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

Nodelet run via a launch file is slower than a nodelet run via a terminal

asked 2019-04-10 04:27:57 -0600

Kluun gravatar image

updated 2019-04-10 05:18:02 -0600

gvdhoorn gravatar image

Hello,

I am trying to run the depth_image_proc nodelet to transform a depth and colour image into a rgb pointcloud. The nodelets are working wen i run the separately on multiple terminals, but the slowdown drastically wen i launch them in a launch file. When launched from a terminal the depth_image_proc/register nodelet has frame rate of 20 fps, but wen i launch the depth_image_proc/register nodelet with a launch file i get around 1 frame every 5 seconds. The launch file i use is as following:

<launch>
  <node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
  <node pkg="nodelet" type="nodelet" name="step_1" args="load depth_image_proc/register standalone_nodelet">
    <remap from="rgb/camera_info" to="/camera/color/camera_info"/>
    <remap from="depth/camera_info" to="/camera/depth/camera_info"/>
    <remap from="depth/image_rect" to="/camera/depth/image_rect_raw"/>
  </node>
</launch>

Does any one have a idea why the nodelet slows down when launch from a launch file and how to pevernt it?

The system i am running is a ubuntu 16.04 LTS and ROS kinetic. Beside the nodelets i am also running the realsense2_camera demo_pointcloud.launch file to get information from the camera.

Edit 1:

I am running the following commands in two different terminal:

$ rosrun nodelet nodelet manager __name:=nodelet_manager

and

rosrun nodelet nodelet load depth_image_proc/register nodelet_manager __name:=step_1 rgb/camera_info:=/camera/color/camera_info depth/camera_info:=/camera/depth/camera_info depth/image_rect:=/camera/depth/image_rect_raw

Edit 2:

I know that the realsense2_camera uses /camera/realsense2_camera_manager nodelet manager.

edit retag flag offensive close merge delete

Comments

Can you detail exactly what you run from the terminals and also your full launch files ? One reason might be that you have different nodelets manager when using your launch files, that would basically be the same as using nodes, inducing your speed loss.

Delb gravatar image Delb  ( 2019-04-10 04:56:14 -0600 )edit

Your edit seems to suggest the launch file and the rosrun line use the exact same arguments.

Can you show an rqt_graph screenshot both when you use roslaunch and one for rosrun?

In any case: you'll want to load your nodelet into the /camera/realsense2_camera_manager, otherwise it doesn't make much sense to use nodelets.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-10 05:38:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-10 04:55:13 -0600

gvdhoorn gravatar image

updated 2019-04-10 04:56:51 -0600

The launch file i use is as following:

<launch>
  <node pkg="nodelet" type="nodelet" name="standalone_nodelet" args="manager" output="screen"/>
  <node pkg="nodelet" type="nodelet" name="step_1" args="load depth_image_proc/register standalone_nodelet">
[..]

this launch file hosts the nodelet step_1 in a manager called standalone_nodelet.

So only within standalone_nodelet will zero-copy data exchange be used.

Any other communication with other participants in your ROS nodegraph (ie: other running nodes) will not benefit from direct zero-copy exchanges.

Beside the nodelets i am also running the realsense2_camera demo_pointcloud.launch file to get information from the camera.

It's likely that realsense2_camera starts a nodelet_manager of its own, into which it loads a nr of nodelets.

The "nodelet run via a terminal" you mention is then likely loaded into the manager started by the driver. In that case you do benefit, as now zero-copy data exchange between your depth_image_proc/register and the realsense driver can take place.


Edit: it would be good if you can show how you load the nodelet "via the terminal". As that should show the difference (specifically: which nodelet manager the nodelet is loaded into).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-04-10 04:27:57 -0600

Seen: 564 times

Last updated: Apr 10 '19