How to use controller_manager with ros_canopen
Hi,
I am currently working on controlling two dc motors with integrated controller using ros_canopen, ROS kinetic, ubuntu 16.04.
So far I have done steps 1 through 7 in THIS answer. But I am stuck at the controller_manager part of getting it to work.
Just a tiny recap, I have made an URDF, made driver and controller configs, launched canopen_motor_node and i am able to use init, get/set_object and the other services canopen_motor_node provides.
However, as I am trying to control a diff drive robot I would like to use the diff_drive_controller so I have made the following config file for the controller:
raw19:
mobile_base_controller:
type : "diff_drive_controller/DiffDriveController"
#topic : "test"
left_wheel : 'motor1'
right_wheel : 'motor2'
publish_rate: 50.0 # default: 50
pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
required_drive_mode: 2
# Wheel separation and diameter. These are both optional.
# diff_drive_controller will attempt to read either one or both from the
# URDF if not specified as a parameter
wheel_separation : 0.42
wheel_radius : 0.1313
# Wheel separation and radius multipliers
wheel_separation_multiplier: 1.0 # default: 1.0
wheel_radius_multiplier : 1.0 # default: 1.0
# Velocity commands timeout [s], default 0.5
cmd_vel_timeout: 0.25
# Base frame_id
base_frame_id: base_link #default: base_link
# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear:
x:
has_velocity_limits : true
max_velocity : 1.0 # m/s
min_velocity : -1.0 # m/s
has_acceleration_limits: true
max_acceleration : 0.8 # m/s^2
min_acceleration : -0.8 # m/s^2
has_jerk_limits : true
max_jerk : 5.0 # m/s^3
angular:
z:
has_velocity_limits : true
max_velocity : 0.7 # rad/s
has_acceleration_limits: true
max_acceleration : 0.5 # rad/s^2
has_jerk_limits : true
max_jerk : 2.5 # rad/s^3
I have tried following the edit/answer of THIS question and THIS video/answer but I can't seem to get it to work. But i don't if that is because I am not using Gazebo. I think my main issue is understanding ros_control/controller_manager and how to initiate/spawn the controllers. My preliminary thoughts are that the error is in my launch or urdf file.
Launch file
<?xml version="1.0"?>
<launch>
<arg name="model" default="$(find robot)/urdf/rawcopy.xacro" />
<arg name="rvizconfig" default="$(find robot)/rviz/urdf.rviz" />
<!-- send urdf to param server -->
<param name="/raw19/robot_description"
command="$(find xacro)/xacro $(arg model) --inorder" />
<!-- robot state publisher -->
<node ns="raw19"
pkg="robot_state_publisher"
type="robot_state_publisher"
name="robot_state_publisher"/>
<node ns="raw19"
name="joint_state_publisher"
pkg="joint_state_publisher"
type="joint_state_publisher"
output="screen"/>
<!-- canopen_motor_node -->
<node ns="raw19"
name="driver"
pkg="canopen_motor_node"
type="canopen_motor_node"
output="screen"
clear_params="true"
launch-prefix="">
<rosparam command="load" file="$(find robot)/config/driver_config.yaml" />
</node>
<!-- controllers -->
<rosparam command="load"
file="$(find robot)/config/diff_controller.yaml" />
<!-- load_controllers -->
<node ns="raw19"
name="controller"
pkg="controller_manager"
type="controller_manager"
args="spawn
joint_state_controller
mobile_base_controller"
respawn="false"
output="screen"/>
<!-- Show in Rviz -->
<node ns="raw19"
name="rviz"
pkg="rviz"
type="rviz"
args="-d $(arg rvizconfig)"
required="true" />
</launch>
When i launch and run 'rostopic list' and 'rosservice list ...
What exactly is it that isn't working? What error message if any are you getting?
The wiki page shows no services at all.
What gave you the impression that you should see services?
As stated in Mathias' answer, I misunderstood where the service (that actually was a topic) originated from. I thought it was the controller_manager, but it was the canopen_motor_node once the system was initialized. Either way, I appreciate the help, thank you.