Ask Your Question
0

Loading controllers from yaml in namespace

asked 2020-02-29 07:14:04 -0500

Samper-Esc gravatar image

updated 2020-02-29 07:15:24 -0500

Hi,

(*Using ROS Melodic in Ubuntu)

I am loading a yaml with 4 controllers + joint_state_controller in a namespace. Yaml aspect:

ch1_joint_state_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

ch1_controller_ur: 
  type: "effort_controllers/JointEffortController"
  joint: "joint1"

....

Then, I try to spawn them using a controller_manager node. However, the node only finds the rosparam if I explicitly put the namespace, like that:

  <rosparam command="load" file="$(find ch1_simulator)/controllers/wheels_controllers.yaml"
    ns="ch1_controllers"/>
  <node name="ch1_controller_spawner" pkg="controller_manager" type="spawner"
    args= "/ch1_controllers/ch1_joint_state_publisher
    /ch1_controllers/ch1_controller_ur
    /ch1_controllers/ch1_controller_ul
    /ch1_controllers/ch1_controller_br
    /ch1_controllers/ch1_controller_bl"/>

However, the node is not able to find the param by using the --namespace arg:

  <rosparam command="load" file="$(find ch1_simulator)/controllers/wheels_controllers.yaml"
    ns="ch1_controllers"/>
  <node name="ch1_controller_spawner" pkg="controller_manager" type="spawner"
    args= "--namespace=/ch1_controllers 
    ch1_joint_state_publisher
    ch1_controller_ur
    ch1_controller_ul
    ch1_controller_br
   ch1_controller_bl"/>

I would really appreciate any clue about it or what I am missing thereof.

Regards,

J.L Samper

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-02 02:31:59 -0500

Weasfas gravatar image

updated 2020-03-02 02:32:08 -0500

Hi @Samper-Esc,

Try to load the config file and the node in the same namespace with:

<group ns="ch1_controllers">
  <rosparam command="load" file="$(find ch1_simulator)/controllers/wheels_controllers.yaml" />
  <node name="ch1_controller_spawner" pkg="controller_manager" type="spawner"
    args= "ch1_joint_state_publisher ch1_controller_ur ch1_controller_ul ch1_controller_br ch1_controller_bl" />
</group>

Also, remember the ROS control plugin will need to work withing the same namespace.

edit flag offensive delete link more

Comments

Got it working, thank you very much!

Samper-Esc gravatar image Samper-Esc  ( 2020-03-11 06:01:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-02-29 07:14:04 -0500

Seen: 26 times

Last updated: Mar 02