0
$\begingroup$

Rosanswers logo

Hi, I have two nodelets in separate files(one publishes sensor_msgs::Image and the other subscribes to it) and want to load them in the nodelet manager. ROS does provide a method here but I fail to understand the details of it. Thanks in advance.


Originally posted by surabhi96 on ROS Answers with karma: 41 on 2018-09-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

To load your nodelets you must have loaded a nodelet manager first.

  • Using command lines :

Load the nodelet_manager (you can put the name you want but make sure all your nodelets use the same manager)

rosrun nodelet nodelet manager __name:=nodelet_manager

Then you can load your nodelets (again replace nodelet_manager with the name you chose previously), if you have two nodelets you have to run :

rosrun nodelet nodelet load PACKAGE_OF_YOUR_NODELET/NODELET1 nodelet_manager
rosrun nodelet nodelet load PACKAGE_OF_YOUR_NODELET/NODELET2 nodelet_manager
  • Using launch file :

    < node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager"/>

    < node pkg="nodelet" type="nodelet" name="NODELET1" args="load PACKAGE_OF_YOUR_NODELET/NODELET1 nodelet_manager"> < /node>

    < node pkg="nodelet" type="nodelet" name="NODELET2" args="load PACKAGE_OF_YOUR_NODELET/NODELET2 nodelet_manager"> < /node>

You can also set a parameter or remap some topics as in the tutorial. I personnaly prefer to use launch files.

But always remember that the nodelet manager is mandatory here and if by mistake you load your nodelets in two different nodelet_manager you will lose the specificity of the nodelets and they will have the same behavior as a node.


Originally posted by Delb with karma: 3907 on 2018-09-24

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Delb on 2018-09-25:
I forgot to add this useful command :

rosrun nodelet declared_nodelets

This will list all the available nodelets on your system (from wiki section 2)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.