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

Revision history [back]

click to hide/show revision 1
initial version

If I understand everything correctly:

1) The value of the args in launch_one.launch will be passed to description.launch and replace the default values there. So laser_enabled should be equal to 1 (assuming optenv doesn't find anything)

2) If laser_enabled is really an existing environmental variable (that isn't specifically set in the terminal you launch in) then you should be able to find it using printenv in a new terminal. If it isn't there, then you may want to check if it really exists at all. Also it is good practice (well idk if its good, but it is at least standard) to name environmental variables in all caps. So your line should be:

<arg name="laser_enabled" default="$(optenv LASER_ENABLED 1)"/>

This makes it more clear what is going on. To answer your question "How can I check the value of the arg laser_enabled through the terminal?" -- because you are loading it as a ROS parameter in description.launch, in another terminal run rosparam get laser_enabled it should return you the value.