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

C++ RAII interface to ROS?

asked 2015-08-07 06:16:00 -0600

drewm1980 gravatar image

Is there a supported RAII interface to ROS? i.e. a class that encapsulates the ros connection, with initialization in the constructor and teardown in the destructor, etc?

The tutorials all seem to start with a call to ros::init, for example, and I don't understand why that can't just be done in the NodeHandle constructor.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-08-08 13:58:42 -0600

NEngelhard gravatar image

So far, there is nothing (afaik). If often happens (at least for me) that you have several NodeHandels in a single Node. I have one for the global namespace and one local ( NodeHandle("~") ) so that it's a bit easier to see where a parameter comes from.

But the concept of a node lifecycle will probably end up in ROS 2:

https://github.com/gbiggs/design/comm...

edit flag offensive delete link more

Comments

Thanks for the confirmation.... I thought that was the case.

drewm1980 gravatar image drewm1980  ( 2015-08-10 08:21:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-07 06:16:00 -0600

Seen: 224 times

Last updated: Aug 08 '15