Ask Your Question

Canopen_motor_node, Error document empty

asked 2018-03-07 07:08:45 -0600

simchanu gravatar image

updated 2018-03-09 06:55:46 -0600


I'm trying to use the motion controller FAULHABER MCBL 3006 S AES with ros_canopen . It seems there is no tutorial on how to use ros_canopen, the closest i've found is :

I use a raspberry pi 3 with a PICAN hat. The hat works fine : with candump and cansend I can communicate, send PDO request or commands.

I've followed the instructions of the answer above, so here are my configuration files :


<robot name="test_robot">
  <link name="link1" />
  <link name="link2" />

  <joint name="node1" type="continuous">
    <parent link="link1"/>
    <child link="link2"/>
    <origin xyz="1 0 0" rpy="0 0 0" />
    <axis xyz="1 0 0" />
    <limit effort="30" velocity="1.0" lower="-2.2" upper="2.7" />

The urdf file is fine when checked with check_urdf.

yaml config

  device: can0 # socketcan network
  # loopback: false # socket should loop back messages
  # driver_plugin: can::SocketCANInterface
  # master_allocator: canopen::SimpleMaster::Allocator
  interval_ms: 10 # set to 0 to disable sync
  # update_ms: <interval_ms> #update interval of control loop, must be set explecitly if sync is disabled
  overflow: 0 # overflow sync counter at value or do not set it (0, default)
heartbeat: # simple heartbeat producer, optional!
  rate: 20 # heartbeat rate
  msg: "77f#05" # message to send, cansend format: heartbeat of node 127 with status 5=Started

# struct syntax
    id: 1
    eds_pkg: can_test # optionals package name for relative path
    eds_file: "config/605.3150.70-A-EK-2-60.eds" # path to EDS/DCF file

defaults: # optional, all defaults can be overwritten per node
  # canopen_chain_node settings ..
  motor_allocator: canopen::Motor402::Allocator # select allocator for motor layer
  motor_layer: # settings passed to motor layer (plugin-specific)
    switching_state: 5 # (Operation_Enable), state for mode switching
  pos_to_device: "rint(rad2deg(pos)*1000)" # rad -> mdeg
  pos_from_device: "deg2rad(obj6064)/1000" # actual position [mdeg] -> rad
  vel_to_device: "rint(rad2deg(vel)*1000)" # rad/s -> mdeg/s
  vel_from_device: "deg2rad(obj606C)/1000" # actual velocity [mdeg/s] -> rad/s
  eff_to_device: "rint(eff)" # just round to integer
  eff_from_device: "0" # unset


<?xml version="1.0" encoding="UTF-8"?>

  <param name="robot_description" value="$(find can_test)/config/robot_description.urdf"/>

  <node name="motor" pkg="canopen_motor_node" type="canopen_motor_node">
    <rosparam command="load" file="$(find can_test)/config/can_config.yaml" />

There is no controller for now. I'm not sure this isn't required to use canopen_motor_node, I would appreciate if someone could clarify that.

But when I run roslaunch can_test test.launch I get :


 * /motor/bus/device: can0
 * /motor/defaults/eff_from_device: 0
 * /motor/defaults/eff_to_device: rint(eff)
 * /motor/defaults/motor_allocator: canopen::Motor402...
 * /motor/defaults/motor_layer/switching_state: 5
 * /motor/defaults/pos_from_device: deg2rad(obj6064)/...
 * /motor/defaults/pos_to_device: rint(rad2deg(pos)...
 * /motor/defaults/vel_from_device: deg2rad(obj606C)/...
 * /motor/defaults/vel_to_device: rint(rad2deg(vel)...
 * /motor/heartbeat/msg: 77f#05
 * /motor/heartbeat/rate: 20
 * /motor/nodes/node1/eds_file: config/605.3150.7...
 * /motor/nodes/node1/eds_pkg: can_test
 * /motor/nodes/node1/id: 1
 * /motor/sync/interval_ms: 10
 * /motor/sync/overflow: 0
 * /robot_description: /home/body/Worksp...
 * /rosdistro: kinetic
 * /rosversion: 1.12.12

    motor (canopen_motor_node/canopen_motor_node)

auto-starting new master
process[master]: started with pid [2259 ...
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-03-07 07:59:03 -0600

Mathias Lüdtke gravatar image

updated 2018-03-07 07:59:45 -0600

[ERROR] [1520018791.076780633]: Error document empty.

The line is not related to ros_canopen, but issued by the URDF parser..

<param name="robot_description" value="$(find can_test)/config/robot_description.urdf"/>

sets robot_description to the path of the URDF file.

However, you have to set it to the content of the URDF file (see roslaunch wiki):

<param name="robot_description" textfile="$(find can_test)/config/robot_description.urdf"/>
edit flag offensive delete link more


Thank you for your help,

I managed to get to the service call /driver/init. However, the call fails with the message : could not prepare homing; Homing failed. I updated the question with theses informations and new tests.

Should I open a new question or we can continue on this one ?

simchanu gravatar imagesimchanu ( 2018-03-07 11:05:26 -0600 )edit

I would say this qualifies for a new question. canopen_motor_mode will try to home the drive if the homing method (object 0x6098) is not zero (= no homing).

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2018-03-07 11:59:43 -0600 )edit

Ok, I close the question. I will open another if necessary.

simchanu gravatar imagesimchanu ( 2018-03-09 06:51:43 -0600 )edit

A new question has been opened that follows this one :

simchanu gravatar imagesimchanu ( 2018-03-19 04:01:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-03-07 07:08:45 -0600

Seen: 464 times

Last updated: Mar 09 '18