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

accessing value of variable of one callback in other callback

asked 2013-07-23 06:41:47 -0500

fairy gravatar image

I have 2 callbacks in my program subcribing on depth and rgb image.I have detected circle and calculated its centre point from rgb data now I am trying to access the depth value of that centre point by passing the point to the second callback but when I run the code it generate "segmentation fault". Is there any solution for this??? kindly help

edit retag flag offensive close merge delete



you should post your code.

thebyohazard gravatar image thebyohazard  ( 2013-07-23 08:51:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-23 10:26:57 -0500

allenh1 gravatar image

I'd suggest you thread your system. I cannot tell if you have, for you did not paste your code.

Threading would enable you to keep the variables that you from both callbacks to be in a common class. That would get rid of your segmentation fault.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-07-23 06:41:47 -0500

Seen: 113 times

Last updated: Jul 23 '13