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

test topic with gtest

asked 2013-03-21 09:26:23 -0500

inflo gravatar image

hi, i wanna test a topic, what it actually publish, and when changing something, what the topic then publishes. My problem is, that i need to declare a callback function in the subscribe() member function of the nodeHandle.

What is the "best" way to handle that? I mean, in the main TEST() function a loop over a global variable till the callback has changed this global var, then end the main TEST() function?

i know ros.org/wiki/rostest/Nodes but its written in python, and i wanna write it in c++, perhaps someone knows a tutorial?

thanks flo

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-17 17:31:06 -0500

tfoote gravatar image

That's effectively what you need. You shouldn't need to do it in a global variable. You can always use another container class and pass content that way.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-21 09:26:23 -0500

Seen: 345 times

Last updated: Jun 17 '13