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

How to start a ros node

asked 2014-11-25 13:24:47 -0600

Giza gravatar image

How do I start a ros node from the terminal? For example I'm looking to start the node /camera/camera_nodelet_manager but I have no idea how? Do I use rosrun?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-11-25 14:24:14 -0600

updated 2014-11-26 12:23:08 -0600

You can either use rosrun or manually execute the binary/script. In the first case, run:

rosrun <package_name> <executable_name>

In the second case look up the executable name (if you're using catking, it's usually in

<catkin_workspace>/devel/lib/<executable_name>

EDIT

I see what you want to do now! If you want the nodelet manager (that's the node you're looking for), then you should look at manager.launch.xml in rgbd_launch. In particular the lines that you're interested in are:

<!-- Nodelet manager -->
  <node pkg="nodelet" type="nodelet" name="$(arg name)" args="manager"
        output="screen" launch-prefix="$(arg launch_prefix)">
     <param name="num_worker_threads" value="$(arg num_worker_threads)" />
  </node>

where the name is set in the calling launch file (openni.launch, https://github.com/ros-drivers/openni... ).

Just remember that all roslaunch does is to call processes, so if roslaunch can do it then you can do it as well at the command line! For example if you want to run the nodelet above, just type:

>> rosrun nodelet nodelet manager _num_worker_threads:=4
edit flag offensive delete link more

Comments

seems like the only way I can run /camera/camera_nodelet_manager is to launch openni.launch

Giza gravatar image Giza  ( 2014-11-26 11:40:38 -0600 )edit

To run openni for my Kinect, I have been using openni_launch:

$ roslaunch openni_launch openni.launch
$ rosrun rviz rviz  #In new terminal window
sealguy77 gravatar image sealguy77  ( 2014-11-27 17:59:51 -0600 )edit
2

answered 2014-11-25 14:07:39 -0600

I am new with ROS, so I feel your pain. From what I understand, you must have roscore running.

$ roscore

In a new terminal window, use rosrun to start your node:

$ rosrun [package_name] [node_name]

I hope this helps...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-11-25 13:24:47 -0600

Seen: 17,312 times

Last updated: Nov 26 '14