Failed to get parameters after launching .launch file from another .launch file? [closed]
I have .launch (turtlebot3.launch) file in which I am launching a node, that needs parameters. I take parameters as argument in launch file (turtlebot3.launch) such as x
, y
, radius
etc under node /spawn
. I am launching this file multiple times with other launch file (multi_robots.launch).
<group ns="$(arg robot1)">
<include file="$(find path_planning)/launch/turtlebot3.launch">
<arg name="robot" value="$(arg robot1)"/>
<arg name="radius" value="0.08"/>
<arg name="x" value="5."/>
<arg name="y" value="6."/>
<arg name="theta" value="0."/>
<arg name="x_goal" value="6."/>
<arg name="y_goal" value="2."/>
<arg name="theta_goal" value="0."/>
<arg name="robot_color" value="[50,50,50]"/>
<arg name="laser_color" value="[0,255,0]"/>
</include>
</group>
Basically, args passed here above are parameters for another launch file.
Now there are parameters for robot1/spawn such as x
, y
, radius
. But when I try to get parameters
rospy.get_param('/robot1/spawn/radius')
It raises KeyError: '/robot1/spawn/radius'
They are not shown in the rosparam list
either.
I am not sure If something like this is possible or not. If not, is there any suggestions I can try? I need parameters(mainly radius and start) for each robots in one node.
ROS noetic, Python3