Ask Your Question
0

How to load two seperate nodelets in the nodelet manager

asked 2018-09-24 02:47:04 -0500

surabhi96 gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-24 04:20:21 -0500

Delb gravatar image

updated 2018-09-24 04:21:17 -0500

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.

edit flag offensive delete link more

Comments

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)

Delb gravatar imageDelb ( 2018-09-25 00:59:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-09-24 02:47:04 -0500

Seen: 287 times

Last updated: Sep 24 '18