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

How to pass a file path to rosrun?

asked 2015-05-07 01:15:32 -0500

Cerin gravatar image

updated 2015-05-07 01:16:48 -0500

What's the syntax for passing a filepath as a parameter to rosrun?

I'm trying to call lsd_slam_core with a custom calibration file located at lsd_slam_test/config/logitech.cfg with:

rosrun lsd_slam_core live_slam image:=/usb_cam/image_mono camera_info:=/usb_cam/camera_info calib:=lsd_slam_test/config/logitech.cfg

but this returns the error:

terminate called after throwing an instance of 'ros::InvalidNameException'
  what():  Character [.] at element [25] is not valid in Graph Resource Name [lsd_slam_test/config/logitech.cfg].  Valid characters are a-z, A-Z, 0-9, / and _.
Aborted (core dumped)

What am I doing wrong?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2015-05-07 02:24:28 -0500

bvbdort gravatar image

put _ before calib

rosrun lsd_slam_core live_slam image:=/usb_cam/image_mono camera_info:=/usb_cam/camera_info _calib:=lsd_slam_test/config/logitech.cfg
edit flag offensive delete link more
1

answered 2015-05-07 06:09:02 -0500

130s gravatar image

If you want to pass the argument via commandline with rosrun, the way @bvbdort suggests should be the way to go.

In addition, when passing a file path in general I recommend to pass absolute paths compensated by tools like rospack find. Combined, your command would look like the following (not sure if this is exactly what you do):

rosrun lsd_slam_core live_slam image:=/usb_cam/image_mono camera_info:=/usb_cam/camera_info _calib:=`rospack find lsd_slam_test`/config/logitech.cfg
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-07 01:15:32 -0500

Seen: 1,953 times

Last updated: May 07 '15