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

How to load a cfg file in a launch file for lsd_slam

asked 2016-11-30 10:51:39 -0500

ap gravatar image

updated 2016-12-01 10:30:19 -0500

gvdhoorn gravatar image


I am trying to write a launch file for the lsd_slam command below

rosrun lsd_slam_core live_slam /image:=camera/rgb/image_color _calib:=calib.cfg

The launch file so far is


    <node pkg="lsd_slam_core" type="live_slam" name="live_slam" output="screen" respawn="true">

    <param name="_calib" value="/home/rosbuild_ws/package_dir/lsd_slammaster/lsd_slam_core/calib/calib.cfg"/>

    <remap from="/image" to="camera/rgb/image_color"/>


I am able to launch the file with the output:

started roslaunch server http://laptop1:43952/



 * /live_slam/_calib: /home/adishakti/r...
 * /rosdistro: indigo
 * /rosversion: 1.11.20

    live_slam (lsd_slam_core/live_slam)


core service [/rosout] found
process[live_slam-1]: started with pid [21507]
WAITING for ROS camera calibration!

But when I try to run the bag file nothing happens in the pcl viewer and the depth window does not open.

I guess I am not loading the calibration file correctly. How do I do this ?

Thank you

edit retag flag offensive close merge delete



Please don't use images for what is essentially all plain text. Just copy/paste the text into your question.

If you do, please also use the Pre-formatted Text button (the one with 101010 on it) to format things properly. Select the text, press the button (or use ctrl+k).


gvdhoorn gravatar image gvdhoorn  ( 2016-11-30 11:52:26 -0500 )edit

Ok, sorry about that.

ap gravatar image ap  ( 2016-12-01 02:57:29 -0500 )edit

Could you please edit your question to fix it? Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-01 03:18:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-01 02:04:04 -0500

mgruhler gravatar image

There is a difference between setting a param via rosrun, using _param, to setting the parameter from a launch file or via roslaunch. This is due to namespacing.

calib here is a so called private parameter, i.e. it is loaded in the /live_slam namespace, so the full parameter name actually is /live_slam/calib.

Using rosrun, the underscore in front of the param sets this param to be a private param of the node you run. When you do this with roslaunch, you just load the param, without the underscore, within the node tag to have it in the proper namespace.

So just get rid of the underscore before calib in your launchfile. In your launch file, the namespace for this param is /live_slam/_calib which you can also see at the roslaunch summary.

edit flag offensive delete link more


Awesome, thanks, it worked.

ap gravatar image ap  ( 2016-12-01 02:57:07 -0500 )edit

Question Tools

1 follower


Asked: 2016-11-30 10:51:39 -0500

Seen: 446 times

Last updated: Dec 01 '16