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

Loading controllers from yaml in namespace

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

Samper-Esc gravatar image

updated 2022-01-22 16:10:23 -0600

Evgeny gravatar image

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
1

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

Weasfas gravatar image

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

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 -0600 )edit

Question Tools

2 followers

Stats

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

Seen: 1,256 times

Last updated: Mar 02 '20