Closed liangfok closed 8 years ago
Best practice is actually to use roslaunch
, as it would start the core automatically, if it doesn't find on. I don't think there is an easy way to do that in a listener.
Thanks for the advice. I will test roslaunch
. I hope I can run and control it from within a Google Test context!
For testing, you should consider running rostest
(http://wiki.ros.org/rostest). It's basically just an extension of roslaunch
that will:
roscore
You might have to play a little with directing and collecting the test results that are produced by rostest and feeding them into your own reporting scheme, but it should be doable.
What is the best practice for a C++ process to start a
roscore
if one does not exist? For example, if I run ros1_external_use/ros1_comms/listener.cpp without first launching aroscore
, I'd like for it to go ahead and start aroscore
rather than get stuck printing the following message:Thanks!