ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you build something as a nodelet - you should be able to run it in two ways
Once I make a nodelet, reproducing it as a node is redundant.
If instead, you wish the classes in your library to be more widely available to different systems, then jbohren's method is a good way of making that possible. However, I don't think that's strictly necessary. A library in ros can have two api's:
If you expose your interface via ros comms through a nodelet, then you don't need to expose a c++ api simultaneously. And if you're using nodelets, you don't have to worry about this communciation being significantly slower. Mixing in a c++ api doesn't provide any appreciable benefit.
Sometimes however you need to provide only a c++ api to clients (i.e. non ros users). Then you need to get rid of the ros components completely. We do that occasionally - and if we want to use the same library in a ros system, we create a separate nodelet library which wraps the c++ library. Nodelet subscriber callbacks can utilise the c++ api directly, whereas publishers can be triggered by mechanisms like signals (sigslots) coming from the c++ library.
2 | No.2 Revision |
If you build something as a nodelet - you should be able to run it in two ways
Once I make a nodelet, reproducing it as a node is redundant.
An example standalone nodelet launcher:
<launch>
<node pkg="nodelet" type="nodelet" name="navi_base" args="standalone goo/GooNodelet">
<rosparam file="$(find goo)/resources/yaml/navi_base.yaml" command="load" />
</node>
</launch>
If instead, you wish the classes in your library to be more widely available to different systems, then jbohren's method is a good way of making that possible. However, I don't think that's strictly necessary. A library in ros can have two api's:
If you expose your interface via ros comms through a nodelet, then you don't need to expose a c++ api simultaneously. And if you're using nodelets, you don't have to worry about this communciation being significantly slower. Mixing in a c++ api doesn't provide any appreciable benefit.
Sometimes however you need to provide only a c++ api to clients (i.e. non ros users). Then you need to get rid of the ros components completely. We do that occasionally - and if we want to use the same library in a ros system, we create a separate nodelet library which wraps the c++ library. Nodelet subscriber callbacks can utilise the c++ api directly, whereas publishers can be triggered by mechanisms like signals (sigslots) coming from the c++ library.
3 | No.3 Revision |
If you build something as a nodelet - you should be able to run it in two ways
Once I make a nodelet, reproducing it as a node is redundant. Some history: nodelets came after nodes once they realised there was a need. Their implementation (nodelets can detect when communications are intra or inter and behave accordingly) was such that the node actually became superflous. But we still have nodes because people are familiar them. them and they are a little easier to code.
An example standalone nodelet launcher:
<launch>
<node pkg="nodelet" type="nodelet" name="navi_base" args="standalone goo/GooNodelet">
<rosparam file="$(find goo)/resources/yaml/navi_base.yaml" command="load" />
</node>
</launch>
If instead, you wish the classes in your library to be more widely available to different systems, then jbohren's method is a good way of making that possible. However, I don't think that's strictly necessary. A library in ros can have two api's:
If you expose your interface via ros comms through a nodelet, then you don't need to expose a c++ api simultaneously. And if you're using nodelets, you don't have to worry about this communciation being significantly slower. Mixing in a c++ api doesn't provide any appreciable benefit.
Sometimes however you need to provide only a c++ api to clients (i.e. non ros users). Then you need to get rid of the ros components completely. We do that occasionally - and if we want to use the same library in a ros system, we create a separate nodelet library which wraps the c++ library. Nodelet subscriber callbacks can utilise the c++ api directly, whereas publishers can be triggered by mechanisms like signals (sigslots) coming from the c++ library.
4 | No.4 Revision |
If you build something as a nodelet - you should be able to run it in two ways
Once I make a nodelet, reproducing it as a node is redundant. Some history: nodelets came after nodes once they realised there was a need. Their implementation (nodelets can detect when communications are intra or inter and behave accordingly) was such that the node actually became superflous. But we still have nodes because people are familiar with them and they are a little easier to code.
An example standalone nodelet launcher:
<launch>
<node pkg="nodelet" type="nodelet" name="navi_base" args="standalone goo/GooNodelet">
<rosparam file="$(find goo)/resources/yaml/navi_base.yaml" command="load" />
</node>
</launch>
If instead, you wish the classes in your library to be more widely available to different systems, then jbohren's method is a good way of making that possible. However, I don't think that's strictly necessary. A library in ros can have two api's:
If you expose your interface via ros comms through a nodelet, then you don't need to expose a c++ api simultaneously. And if you're using nodelets, you don't have to worry about this communciation being significantly slower. Mixing in a c++ api doesn't provide any appreciable benefit.
Sometimes however you need to provide only a c++ api to clients (i.e. non ros users). Then you need to get rid of the ros components completely. We do that occasionally - and if we want to use the same library in a ros system, we create a separate nodelet library which wraps the c++ library. Nodelet subscriber callbacks can utilise the c++ api directly, whereas publishers can be triggered by mechanisms like signals (sigslots) coming from the c++ library.