ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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 image Mathias 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 image CJ.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 image CJ.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 image Mathias 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 image Mathias 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 image CJ.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 image CJ.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 image Mathias Lüdtke  ( 2017-01-03 12:27:01 -0500 )edit

Yes, I don't need full trajectories, just need PP mode, PV mode, and torque mode. Do you know where I could find more information about mode -1 as you mentioned? I'm a little bit confused. Could you advise how to skip IP mode or should I ask a new question?

CJ.Nilson gravatar image CJ.Nilson  ( 2017-01-03 12:54:10 -0500 )edit

mode -1 (position mode) is documented in the manual you linked above If you don't need IP mode, don't map 0x60c1 and better do not use the schunk bringup, as is was designed for trajectories and uses them by default.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2017-01-03 13:27:04 -0500 )edit

Better start from scratch with http://answers.ros.org/question/25017... You can copy parts from schunk_robot, as long as you understand the implications.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2017-01-03 13:28:20 -0500 )edit

Hi all, I am running into the same problem. I have a Maxon EPOS70/10 motor controller and I would like to drive a motor over the CAN bus. I had a look at https://answers.ros.org/question/2501... .

Edgar Carrasco gravatar image Edgar Carrasco  ( 2017-11-06 09:56:43 -0500 )edit

After this I followed the link https://github.com/ipa320/canopen_tes... and adapted the config files for CAN. Once I start the rosservice call /../driver/init I get a time out error when trying to write to index 0x60C1. I tried to configure the drive_mode to 1 that according to canopen_402 is PP

Edgar Carrasco gravatar image Edgar Carrasco  ( 2017-11-06 10:00:57 -0500 )edit

I can start a new question with all the details if required.

Edgar Carrasco gravatar image Edgar Carrasco  ( 2017-11-06 10:01:40 -0500 )edit

Did following in order to avoid the IP mode for the Maxon motor. In the dcf config file for the canopen I wrote for the dictionary entry 0x6502 following value 0x003F0025. This differs from the controller value (0x003F0065) in the bit 7. The value of this bit is set to 0 in the dcf. Hope this helps.

Edgar Carrasco gravatar image Edgar Carrasco  ( 2017-11-22 06:41:24 -0500 )edit

Hi CJ, Mathias and Edgar, I am trying to move 6 Maxon MCD Epos with an IXXAT adapter. I look in my DCF file and have the entry 0x6502, do I have to assign manually the value (0x6502=0x003F0025)? Also, I have that value at the end of the file.

jdeleon gravatar image jdeleon  ( 2018-05-31 07:09:03 -0500 )edit

Also I change the required_drive_mode to -1, but still having the same error:

jdeleon gravatar image jdeleon  ( 2018-05-31 07:14:15 -0500 )edit

Hi, I did change and saved the value of the dictionary entry 0x6502 using the EPOS Studio SW. I exported then the DCF file from there and used it in the ros_canopen package. For my application I had to use the profiled velocity mode and this is why I used the the value 3 in the required_drive_mode.

Edgar Carrasco gravatar image Edgar Carrasco  ( 2018-06-01 03:10:04 -0500 )edit

Hi again @Edgar Carrasco, I'm trying to modify the dictionary entry, but is impossible. I have try with EPOS_UserInterface and EPOS Studio. It says that the object is not ReadWrite, because is a Constant.

Did you have that problem? If yes, how could you solved it?

jdeleon gravatar image jdeleon  ( 2018-06-08 03:05:42 -0500 )edit

Just change it in the EDS/DCF with a text editor.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-06-08 03:34:22 -0500 )edit

Hi @Mathias Lüdtke, I have this in my DCF file:

[6502]
ParameterName=Supported Drive Modes
DataType=0x0007
AccessType=const
PDOMapping=0
ObjFlags=0x1
ParameterValue=0x003F0025

But the error persists.

jdeleon gravatar image jdeleon  ( 2018-06-08 03:52:54 -0500 )edit

I changed also:

66=0x003F0025

and

[003F0025]
ParameterName=Supported Drive Modes
DataType=0x0007
AccessType=const
PDOMapping=0
ObjFlags=0x1
ParameterValue=0x003F0025

But still the error

jdeleon gravatar image jdeleon  ( 2018-06-08 03:53:57 -0500 )edit

This entry is const, you cannot change ParameterValue. Please set DefaultValue instead.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-06-08 03:57:46 -0500 )edit

I add the DefaultValue, but the same error:

[6502]
ParameterName=Supported Drive Modes
DataType=0x0007
AccessType=const
DefaultValue=0x003F0025
PDOMapping=0
ObjFlags=0x1
ParameterValue=0x003F0025

Also, change the PDOMapping to 1, and the same result

jdeleon gravatar image jdeleon  ( 2018-06-08 05:23:19 -0500 )edit

Please open a new question. It is wrong to change PDOMapping and 66=0x003F0025 is not even valid.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-06-08 05:41:41 -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 image CJ.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 image CJ.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 image CJ.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 image Mathias Lüdtke  ( 2016-12-30 09:12:08 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 1,296 times

Last updated: Jan 17 '17