0
$\begingroup$

Rosanswers logo

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


Originally posted by Samper-Esc on ROS Answers with karma: 50 on 2020-02-29

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Weasfas with karma: 1695 on 2020-03-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Samper-Esc on 2020-03-11:
Got it working, thank you very much!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.