Robotics StackExchange | Archived questions

Passing different arguments to a yaml configuration file

I have a general question about passing substitution arguments to your .yaml file. One of the things I'm having trouble with is passing different arguments to the yaml file. So the first time I pass the argument $(arg controlname) to the yaml file and it works. The second time lets say I want to pass the argument $(arg controlname_2) to it, it doesn't work.

I tried defining the argument within the rosparam tags but that didn't work either. Kindly an example of how I'm doing this below. Thanks for your help!

<arg name="control_name" value="racecar3" /> <rosparam file="$(find racecar_control)/config/racecar_control_gen.yaml" subst_value="true" command="load">$(arg control_name)</rosparam>

 $(arg controlname):
  # Publish all joint states -----------------------------------
  jointstatecontroller:
    type: jointstatecontroller/JointStateController
    publishrate: 50

# Velocity Controllers --------------------------------------- leftrearwheelvelocitycontroller: type: effortcontrollers/JointVelocityController joint: leftrearwheeljoint pid: {p: 1.0, i: 0.0, d: 0.0, iclamp: 0.0} rightrearwheelvelocitycontroller: type: effortcontrollers/JointVelocityController joint: rightrearwheeljoint pid: {p: 1.0, i: 0.0, d: 0.0, iclamp: 0.0} leftfrontwheelvelocitycontroller: type: effortcontrollers/JointVelocityController joint: leftfrontwheeljoint pid: {p: 0.5, i: 0.0, d: 0.0, iclamp: 0.0} rightfrontwheelvelocitycontroller: type: effortcontrollers/JointVelocityController joint: rightfrontwheeljoint pid: {p: 0.5, i: 0.0, d: 0.0, iclamp: 0.0}

# Position Controllers --------------------------------------- leftsteeringhingepositioncontroller: joint: leftsteeringhingejoint type: effortcontrollers/JointPositionController pid: {p: 10.0, i: 0.0, d: 0.5} rightsteeringhingepositioncontroller: joint: rightsteeringhingejoint type: effortcontrollers/JointPositionController pid: {p: 10.0, i: 0.0, d: 0.5}

Asked by Patrick Musau on 2019-12-10 10:47:06 UTC

Comments

Answers