Robotics StackExchange | Archived questions

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

Hi

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

<launch>

    <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"/>

    </node>
</launch>

I am able to launch the file with the output:

started roslaunch server http://laptop1:43952/

SUMMARY

========

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

NODES
  /
    live_slam (lsd_slam_core/live_slam)

ROS_MASTER_URI=http://localhost:11311

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

Asked by ap on 2016-11-30 11:51:39 UTC

Comments

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).

Thanks.

Asked by gvdhoorn on 2016-11-30 12:52:26 UTC

Ok, sorry about that.

Asked by ap on 2016-12-01 03:57:29 UTC

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

Asked by gvdhoorn on 2016-12-01 04:18:35 UTC

Answers

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.

Asked by mgruhler on 2016-12-01 03:04:04 UTC

Comments

Awesome, thanks, it worked.

Asked by ap on 2016-12-01 03:57:07 UTC