Ask Your Question
0

ros_canopen with lwa4d initialization fails

asked 2016-12-23 01:23:39 -0500

CJ.Nilson gravatar image

updated 2017-01-17 11:51:55 -0500

Hi all,

I am quite new to ROS. My intention is to use ROS_CANopen package to connect with my robot (Maxon EPOS2 motor), but I got the failure during initializing the schunk_lwa4d.

Here is my hardware configuration:

  1. A USB-to-CAN compact is used to communicate between my laptop and the robot. The Linux driver called IXXAT socketcan driver.
  2. The robot uses Maxon EPOS2 with CANopen. DCF file is generated from EPOS studio.

When initializing...

rosservice call /arm/driver/init

the failure as follows.

success: False
message: /home/cj/catkin_ws/src/ros_canopen/canopen_master/src/sdo.cpp(429): Throw in function void canopen::SDOClient::transmitAndWait(const canopen::ObjectDict::Entry&, const canopen::String&, canopen::String*)
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<canopen::TimeoutException> >
std::exception::what: SDO
[canopen::tag_objectdict_key*] = 1003sub0

after run roslaunch schunk_lwa4b robot.launch, the log is shown as follows

auto-starting new master
process[master]: started with pid [1962]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to a2e27e66-c8d0-11e6-ba1f-005056c00001
process[rosout-1]: started with pid [1998]
started core service [/rosout]
process[arm/robot_state_publisher-2]: started with pid [2013]
process[joint_state_publisher-3]: started with pid [2015]
process[arm/driver-4]: started with pid [2023]
process[arm/arm_controller_spawner-5]: started with pid [2034]
process[topic_transf-6]: started with pid [2055]
[ INFO] [1482470911.684654700]: Using fixed control period: 0.010000000
[ INFO] [1482470936.775348397]: Initializing XXX
[ INFO] [1482470936.775647194]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1482470936.775941459]: Current state: 2 device error: system:0 internal_error: 0 (OK)
abort1003#0, reason: Invalid value for parameter (download only).
Could not process message
[ INFO] [1482470936.838776231]: Current state: 0 device error: system:0 internal_error: 0 (OK)
[ INFO] [1482470936.838828278]: Current state: 0 device error: system:0 internal_error: 0 (OK)

Note: I already set the txqueuelen 20.

sudo ip link set can0 txqueuelen 20

From error code showed that 1003sub0, is that possible Epos studio was generated incorrect DCF ? Does someone meet this failure before?

[latest update 12/27] I modified some configuration in epos studio and generated a new DCF. the results are different as follows. When initializing rosservice, the failure as follows.

success: False
message: /home/cj/catkin_ws/src/ros_canopen/canopen_master/src/sdo.cpp(429): Throw in function void canopen::SDOClient::transmitAndWait(const canopen::ObjectDict::Entry&, const canopen::String&, canopen::String*)
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<canopen::TimeoutException> >
std::exception::what: SDO
[canopen::tag_objectdict_key*] = 2303sub3

after run roslaunch schunk_lwa4b robot.launch, the log is shown as follows.

setting /run_id to 6adddc60-cc2a-11e6-bacb-005056c00001
process[rosout-1]: started with pid [23228]
started core service [/rosout]
process[arm/robot_state_publisher-2]: started with pid [23247]
process[joint_state_publisher-3]: started with pid [23248]
process[arm/driver-4]: started with pid [23249]
process[arm/arm_controller_spawner-5]: started with pid [23257]
process[topic_transf-6]: started with pid [23262]
[ INFO] [1482839325.074128952]: Using fixed control period: 0.010000000
[ INFO] [1482839327.892443220]: Initializing XXX
[ INFO] [1482839327.892948706]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1482839327.893326862]: Current state: 2 device error: system:0 internal_error: 0 (OK)
abort2303#3, reason: Data cannot be transferred or stored to ...
(more)
edit retag flag offensive close merge delete

Comments

Your new DCF specifies a ParameterValue (0x00) for 2303sub3, but your controller does not like it. ros_canopen sends SDOs for all non-default parameters at start-up. Please consult the EPOS manual to find out in which cases 2303sub3 (and 1003) can be written.

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2016-12-29 11:07:33 -0500 )edit

I commented some objectdict in my DCF file and run rosservice init. I still observed one error, 60c1sub1, which is not listed in EPOS manual. and I also consulted Drive operation modes, it's shown Interpolated Position. but EPOS manual doesn't mention 60C1 item. Could you plz advise for this issue?

CJ.Nilson gravatar imageCJ.Nilson ( 2017-01-02 12:38:49 -0500 )edit

log and details listed on above [latest update 1/2] , thanks for your time and the reply

CJ.Nilson gravatar imageCJ.Nilson ( 2017-01-02 12:40:02 -0500 )edit

Maxon uses 0x20C1 instead of 0x60C1, not sure why.. There is not config option for the object to use, so you have to subclass the 402 layer to make it work. Or just use another mode.. (Please ask a new question if you really want to subclass)

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2017-01-03 05:28:28 -0500 )edit

You probably want to use Maxon-specific Postion Mode (-1).

Or http://wiki.ros.org/epos_hardware

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2017-01-03 06:32:52 -0500 )edit

Did you mean I should not comment some objectdict in my DCF file eg. 2303sub3 (analog position setpoint notation index) or each of Drive operation modes should be included and make it work? I will ask a new question, thanks for the reply.

CJ.Nilson gravatar imageCJ.Nilson ( 2017-01-03 07:26:21 -0500 )edit

For my understanding, epos_hardware only supports USB and rs232. My intention is to use CANopen to communicate with my robot. Is ros_canopen package the only one solution for my case? If yes, I will try to let it work on my robot. Thank you for the reply.

CJ.Nilson gravatar imageCJ.Nilson ( 2017-01-03 08:01:59 -0500 )edit

Maxon does not support standard IP mode, it uses setpoint (pos, vel & time) with 0x20C1.

You could implement this mode (difficult) or you could implement mode -1 (looks almost like IP mode).

If you do not need full trajectories, you can uses PP mode. Or you can use a PID controller with Pv mode.

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2017-01-03 12:27:01 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-12-23 06:41:41 -0500

Mathias Lüdtke gravatar image

abort1003#0, reason: Invalid value for parameter (download only).

ros_canopen tries to reset the error counter on initialization. There might be a little glitch because the code just checks if the object is available, but does not check if it's writable. It seems like it is marked writable in your EDS/DCF. Can you upload it somewhere? gist would be best.

sudo ip link set can0 txqueuelen 20

Don't do this if you have a single axis! This is just required (and recommended) if you have more than 4 nodes on one CAN bus.

edit flag offensive delete link more

Comments

Thank you for your reply, should I just upload my DCF, or it's better to upload the entire lwa4d project which I modified some part of configuration?

CJ.Nilson gravatar imageCJ.Nilson ( 2016-12-26 12:40:58 -0500 )edit

Why should I set txqueuelen to 20 if I have more than 4 nodes on one CANbus ? If I don't set one, it will be more possible to lose packages ? thanks for your reply

CJ.Nilson gravatar imageCJ.Nilson ( 2016-12-26 12:45:41 -0500 )edit

I set txqueuelen to 10 as a single axis config, it still failed to initial package.

CJ.Nilson gravatar imageCJ.Nilson ( 2016-12-27 06:05:36 -0500 )edit

ros_canopen sends synchronous PDOs in bursts, so the socketcan queue might overrun and the driver stops working. ( https://github.com/ros-industrial/ros... )

Mathias Lüdtke gravatar imageMathias Lüdtke ( 2016-12-30 09:12:08 -0500 )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

2 followers

Stats

Asked: 2016-12-23 01:23:39 -0500

Seen: 653 times

Last updated: Jan 17 '17