Controller manager - How to correctly launch it
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 ...
Hello. Can you share the github page of the project to check the files? Thnks in advance.
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.
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.
Okey, very good!
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
Hello there @jdeleon, have you solved the issue? I am currently facing the same error.
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 !