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

Correct way to change <xacro:arg name> in launch file

asked 2022-05-15 16:08:33 -0500

CroCo gravatar image

updated 2022-05-15 16:09:15 -0500

I'm working with Husky in melodic (i.e. ubuntu 18.04). The laser option is disabled by default as shown below

<xacro:arg name="laser_enabled" default="$(optenv HUSKY_LMS1XX_ENABLED 0)" />

When I start the launch file as follows

roslaunch husky_gazebo husky_empty_world.launch laser_enabled:=true

It doesn't change anything. What is the correct way to change this option? My current solution is to open the file as admin and change 0 to 1. This does slove the problem but it is not an optimal solution. Any suggestions!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-05-15 16:43:10 -0500

ljaniec gravatar image

updated 2022-05-15 16:48:43 -0500

You can use Environment Variables for this:

http://wiki.ros.org/husky_bringup/Tut...

 HUSKY_LMS1XX_ENABLED    false    Enable/disable the SICK LMS1XX LIDAR

====

Maybe connected:

edit flag offensive delete link more

Comments

what is the actual command that I need to type in the terminal to change these environment variables?

CroCo gravatar image CroCo  ( 2022-05-15 17:18:13 -0500 )edit

To set an environment variable the export command is used. You give the variable a name, which is what is used to access it in shell scripts and configurations and then a value to hold whatever data is needed in the variable, e.g. export NAME=VALUE, so there it would be export HUSKY_LMS1XX_ENABLED=true

ljaniec gravatar image ljaniec  ( 2022-05-15 18:40:34 -0500 )edit

I've tried this but it is not working.

CroCo gravatar image CroCo  ( 2022-05-16 09:17:41 -0500 )edit
1

Please add more details in the edit of your questions, maybe something there is incorrect. Do you call other launchers inside this one?

ljaniec gravatar image ljaniec  ( 2022-05-16 09:37:22 -0500 )edit

^never mind, it worked. thank you.

CroCo gravatar image CroCo  ( 2022-05-16 09:38:15 -0500 )edit

Relevant issue with similar problem: https://github.com/husky/husky/issues...

ljaniec gravatar image ljaniec  ( 2022-05-16 09:39:18 -0500 )edit

If it worked, please accept the answer so it will be marked in the questions queue :)

ljaniec gravatar image ljaniec  ( 2022-05-16 09:42:09 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-05-15 16:08:33 -0500

Seen: 238 times

Last updated: May 15 '22