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

How to get the arguments or parameters of launch file in node file?

asked 2020-03-15 23:28:43 -0600

kane_choigo gravatar image

updated 2020-03-15 23:38:52 -0600

Hello, I'm using ROS melodic of Ubuntu 18.04.

I'm trying to spawn 4 different robots and get their pose every time in the Gazebo simulation.

I had gotten /odom topic of each, but also noticed /odom topic is the relative from a local frame.

So I additionally need to get each robot's initial pose to convert from the local /odom to global /odom.

However, I practically set the initial pose in launch file, not Python node file.

If I can get those arguments or parameters (actually I'm not still familiar with the launch file so I'm not sure my word is right) in the Python node file, I think I can do many things wrt pose correction.

More specifically, I want to get arguments like

<arg name="init_pose" .......>

in the Python file.

So if anyone who is familiar with the launch file is here, would you please give me some advice?

Thanks in advance :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-03-16 05:22:03 -0600

you could use arg as described on this page to pass values to a node,roslaunch or param to put values on the parameter server and then read them from there in the node

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-03-15 23:28:43 -0600

Seen: 703 times

Last updated: Mar 16 '20