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

Controller manager - How to correctly launch it

asked 2018-06-05 06:30:57 -0500

jdeleon gravatar image

updated 2018-06-07 01:42:30 -0500

EDIT FOR THE SOLUTION OF THE ERROR

I was trying to configure the controllers for the real robot as a normal gazebo model.

but I was making an error. Ros CANopen only needs the URDF file of the robot, not the controllers. That was why I couldn't load the controller_manager.

If I add to the URDF of the real robot

<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
        <robotNamespace>/hexapodo</robotNamespace>
    </plugin>
</gazebo>

and load the spawn the controllers in the launch file:

<!-- load the controllers -->
<node name="controller"
      pkg="controller_manager"
      type="controller_manager"
      respawn="false"
      output="screen"
      ns="hexapodo"
      args="spawn
            joint_state_controller
            motor_1_to_base_link_joint
            pata2_velocity_controller
            pata3_velocity_controller
            pata4_velocity_controller
            pata5_velocity_controller
            pata6_velocity_controller"/>

They are correctly spawned:

jorge@jorge-ubuntu:~$ rostopic list 
/clicked_point
/clock
/diagnostics
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/hexapodo/joint_states
/hexapodo/motor_1_to_base_link_joint/command
/hexapodo/pata2_velocity_controller/command
/hexapodo/pata3_velocity_controller/command
/hexapodo/pata4_velocity_controller/command
/hexapodo/pata5_velocity_controller/command
/hexapodo/pata6_velocity_controller/command
/imu
/initialpose
/joint_states
/move_base_simple/goal
/robotest/laser/scan
/rosout
/rosout_agg
/tf
/tf_static

- - - - - - - - - END OF THE EDIT

Hi all, I am building the robot described in question #292882 and trying to control the Maxon MCD Epos with ROS Canopen.

I am running ROS Kinectic on a i7 desktop PC.

But now, I have a problem launching the controller_manager.

If I launch it, as is explain in the wiki

 <launch>
   <node name="controller_node" 
         pkg="controller_manager"
         type="spawner"
         args="controller_name1 controller_name2" />
 </launch>

I have the next error:

[INFO] [1528197681.380398]: Controller Spawner: Waiting for service controller_manager/load_controller
[WARN] [1528197711.592166]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[controller_node-3] process has finished cleanly

But, if I change the launch type and args, I have no error:

<node name="controller_node"
            pkg="controller_manager"
            type="controller_manager"
            output="screen"
            respawn="false"
            args="spawn joint_state_controller pata1_velocity_controller" />

But I have no controllers loaded in my ROS. If I list the services, there isn't any for the controller_manager:

jorge@jorge-ubuntu:~$ rosservice list 
/canopen_chain/get_loggers
/canopen_chain/set_logger_level
/driver/get_object
/driver/halt
/driver/init
/driver/recover
/driver/set_object
/driver/shutdown
/joint_state_publisher/get_loggers
/joint_state_publisher/set_logger_level
/robot_state_publisher/get_loggers
/robot_state_publisher/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level
/rviz/get_loggers
/rviz/reload_shaders
/rviz/set_logger_level

Also, if I run:

jorge@jorge-ubuntu:~$ rosrun controller_manager controller_manager spawn pata1_velocity_controller

The terminal doesn't show any message.

If somebody need, I can upload the xacro file of the robot, the yaml for the controllers and the launch file.

Many thanks, Jorge

EDIT: I load all the parameters for the motors with

<rosparam file="$(find hexapodo_control)/config/hexapodo_control.yaml" command="load"/>

This is the yaml file:

hexapodo:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

  # Velocity Controllers ---------------------------------------
  pata1_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: motor_1_to_base_link_joint
    pid: {p: 3.0, i: 0.0, d: 0.0}
    required_drive_mode: 3

  pata2_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: motor_2_to_base_link_joint
    pid: {p: 3.0, i: 0.0, d: 0.0}
    required_drive_mode: 3

  pata3_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: motor_3_to_base_link_joint
    pid: {p: 3.0, i: 0.0, d: 0.0}
    required_drive_mode: 3

  pata4_velocity_controller:
    type: velocity_controllers/JointVelocityController
    joint: motor_4_to_base_link_joint
    pid: {p: 3.0, i: 0.0, d: 0.0}
    required_drive_mode ...
(more)
edit retag flag offensive close merge delete

Comments

Hello. Can you share the github page of the project to check the files? Thnks in advance.

akosodry gravatar image akosodry  ( 2018-06-06 10:57:27 -0500 )edit

Hi @akosodry, thank you for your reply. I have working now correctly the controllers. I was confused about how to configure ros canopen.

Ros CANopen only need the URDF file of the robot, not the controllers that normally you define for the Gazebo simulation.

jdeleon gravatar image jdeleon  ( 2018-06-07 01:35:23 -0500 )edit

If I put on my URDF

<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotnamespace>/hexapodo</robotnamespace> </plugin> </gazebo>

And then launch the controller_manager, it works correctly.

jdeleon gravatar image jdeleon  ( 2018-06-07 01:36:00 -0500 )edit

Okey, very good!

akosodry gravatar image akosodry  ( 2018-06-07 01:58:33 -0500 )edit

Hi jdeleon, I am facing similar problems as you've seem to have solved, I would very much appreciate if you could take a glance on my setup in my question and see if you could lend a helpin hand, thank you

rhas gravatar image rhas  ( 2019-01-25 02:41:52 -0500 )edit

Hello there @jdeleon, have you solved the issue? I am currently facing the same error.

martinlucan gravatar image martinlucan  ( 2021-07-02 08:17:31 -0500 )edit

It will be better if you start a new question. It is not a good idea (according to the ros answers guideline) to use the answer section as comments !

pmuthu2s gravatar image pmuthu2s  ( 2021-07-02 08:44:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-05 06:57:05 -0500

ARB gravatar image

Did you load .yaml file into param server?Something like this

<rosparam file="$(find robot)/config/robot.yaml" command="load"/>

And make sure that namespace arg is correct in your launch file.

<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/robot_name"  args="controller1 controller2  ">
edit flag offensive delete link more

Comments

yes, I load the yaml into the param server,

<rosparam file="$(find hexapodo_control)/config/hexapodo_control.yaml" command="load"/>

And if I use

rosparam list

I can see all the parameters for the motors configuration

jdeleon gravatar image jdeleon  ( 2018-06-05 07:22:01 -0500 )edit

[ https://answers.ros.org/question/2147... ]

Did u check this? especially garebo_ros_control plugin in urdf?

ARB gravatar image ARB  ( 2018-06-05 08:28:39 -0500 )edit

Hi @ARB, as I comment to @akosodry, I was confused about how to configure ROS CANopen.

If I modify my URDF to be launched with Gazebo, I can launch correctly the controllers.

jdeleon gravatar image jdeleon  ( 2018-06-07 01:37:20 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-06-05 06:30:57 -0500

Seen: 6,221 times

Last updated: Jul 02 '21