How to set the param into the argument in launch file ?

asked 2019-02-01 17:24:42 -0500

iMatch gravatar image

Can I first set the param in Python and then set the param into the argument in launchfile???

first I set the param in python, rospy.set_param('robot_global_name',robot_global_name)

then I load the param in launchfile, <rosparam ns="robotsss" command="dump" param="robot_global_name" />

the question is how can I send the param into the argument, or how can I use the param as an argument, that i can launch the specific robot?

Another parallel qustion, Can man use the python to send the variable into launchfile as an argument ?

I have used this way,

 sys.argv=['roslaunch', 'launch_files', 'all_in.launch', 'robot_global_name:='+robot_global_name]
import roslaunch
roslaunch.main()

but it also used the roslaunch, but I just want to use the argument 'robot_global_name:='+robot_global_name

edit retag flag offensive close merge delete

Comments

This should be split into two questions. You'll get better results and is the way the site is intended to be used.

jayess gravatar image jayess  ( 2019-02-01 19:10:18 -0500 )edit