Confusion regarding 'arg' heirarchy in launch files
I have a launch file named launch_one.launch
. It looks like this -
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<include file="$(find husky_description)/launch/description.launch" >
<arg name="laser_enabled" default="$(optenv laser_enabled 1)"/>
<arg name="realsense_enabled" default="$(optenv realsense_enabled)"/>
<arg name="urdf_extras" default="$(optenv urdf_extras)"/>
</include>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
</launch>
The description.launch
file look like this -
<launch>
<arg name="robot_namespace" default="/"/>
<arg name="laser_enabled" default="$(optenv HUSKY_LMS1XX_ENABLED false)"/>
<arg name="realsense_enabled" default="$(optenv HUSKY_REALSENSE_ENABLED false)"/>
<arg name="urdf_extras" default="$(optenv HUSKY_URDF_EXTRAS)"/>
<param name="robot_description" command="$(find xacro)/xacro '$(find husky_description)/urdf/husky.urdf.xacro'
robot_namespace:=$(arg robot_namespace)
laser_enabled:=$(arg laser_enabled)
realsense_enabled:=$(arg realsense_enabled)
urdf_extras:=$(arg urdf_extras)
" />
</launch>
Assumption - There are no environment variables named laser_enabled
and HUSKY_LMS1XX_ENABLED
in my system.
I run roslaunch launch_one.launch
in a new terminal window. I have 2 queries -
Which of the two launch files (
launch_one.launch
ordescription.launch
) would dictate the final value of the arglaser_enabled
in the shell environment? Would it be equal to1
(as dictated bylaunch_one.launch
) or would it be equal to0
(as dictated bydescription.launch
) ?How can I check the value of the arg
laser_enabled
through the terminal? I know that I can do that by running the commandprintenv
. However, I can't take that route because the terminal window is already occupied by the currently running roslaunch file. I tried to open a new tab in the same terminal window and ran the commandprintenv
. It didn't return any variable namedlaser_enabled
.