Nodelet run via a launch file is slower than a nodelet run via a terminal
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.
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.
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 useroslaunch
and one forrosrun
?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.