ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In short, remove the _2 parameter then you should get what you desire.

In short, remove the _2 parameter then you should get what you desire.

This will call your callback using the received message as the first parameter and cv_pref_ptr as the second. Depending on how you desire to use the pointer you might want to use boost::ref to pass the pointer as reference (if you want to change the pointer, not the pointed object). Also as it is now the cv_pref_ptr is declared locally and thus might go out of scope.

Is there anything that prevents you from making the cv_pref_ptr a member variable of the class?

In short, remove the _2 parameter then you should get what you desire.

This will call your callback using the received message as the first parameter and cv_pref_ptr as the second. Depending on how you desire to use the pointer you might want to use boost::ref to pass the pointer as reference (if you want to change the pointer, not the pointed object). Also as it is now the cv_pref_ptr is declared locally and thus might will go out of scope.

Is there anything that prevents you from making the cv_pref_ptr a member variable of the class?

In short, remove the _2 parameter then you should get what you desire.

desire.

This will call your callback using the received message as the first parameter and cv_pref_ptr as the second. second.

Depending on how you desire to use the pointer you might want to use boost::ref to pass the pointer as reference (if you want to change the pointer, not the pointed object). Also as it is now the cv_pref_ptr is declared locally and thus will go out of scope.

Is there anything that prevents you from making the cv_pref_ptr a member variable of the class?