Schunk_canopen_driver launch file crash
Hi,
I am using Schunk LWA4P robot arm, and I recently downloaded schunkcanopendriver package. After catkinmakeisolated, I launch standaloneinterpolated.launch or some other launch file, and it crashes after trying to do "Commutation search for node 3". I was using arm previously with ipacanopen and it worked good. Besides that, my controllermanager/spawner is waiting for service, and never spawns a controller. (roscontrol and ros_controllers are installed).
I'll give you my output of my cmd.
Update: I found that it crashes when SchunkPowerBallNode::CommutationCalibrated calls msdo.upload(false, 0x2050, 0, commutationstatus);. Then in SDO.cpp in SDO::upload on argument if( mdatabuffer[0] == SDOSEGABORT_TRANSFER ). That is true and sends break exception.
Update2: In SchunkPowerBallNode.cpp in void SchunkPowerBallNode::commutationSearch(), when I comment the line bool calibok = CommutationCalibrated(); and set bool calibok = true;, in other words, when I don't go to CommutationCalibrated(), everything works, and all nodes initialize. BUT, I don't know why is that, and I don't want to do it that way. I have a feeling that the id 0x2050 in bool SchunkPowerBallNode::CommutationCalibrated() doesn't pass. Any opinions?
Thanks in advance, Matko
SUMMARY
========
PARAMETERS
* /hardware_control_loop/loop_hz: 125
* /hardware_interface/joints: ['arm_1_joint', '...
* /joint_limits/arm_1_joint/has_acceleration_limits: True
* /joint_limits/arm_1_joint/has_velocity_limits: True
* /joint_limits/arm_1_joint/max_acceleration: 6.0
* /joint_limits/arm_1_joint/max_velocity: 1.25
* /joint_limits/arm_2_joint/has_acceleration_limits: True
* /joint_limits/arm_2_joint/has_velocity_limits: True
* /joint_limits/arm_2_joint/max_acceleration: 6.0
* /joint_limits/arm_2_joint/max_velocity: 1.25
* /joint_limits/arm_3_joint/has_acceleration_limits: True
* /joint_limits/arm_3_joint/has_velocity_limits: True
* /joint_limits/arm_3_joint/max_acceleration: 6.0
* /joint_limits/arm_3_joint/max_velocity: 1.25
* /joint_limits/arm_4_joint/has_acceleration_limits: True
* /joint_limits/arm_4_joint/has_velocity_limits: True
* /joint_limits/arm_4_joint/max_acceleration: 6.0
* /joint_limits/arm_4_joint/max_velocity: 1.25
* /joint_limits/arm_5_joint/has_acceleration_limits: True
* /joint_limits/arm_5_joint/has_velocity_limits: True
* /joint_limits/arm_5_joint/max_acceleration: 6.0
* /joint_limits/arm_5_joint/max_velocity: 1.25
* /joint_limits/arm_6_joint/has_acceleration_limits: True
* /joint_limits/arm_6_joint/has_velocity_limits: True
* /joint_limits/arm_6_joint/max_acceleration: 6.0
* /joint_limits/arm_6_joint/max_velocity: 1.25
* /joint_state_controller/publish_rate: 50
* /joint_state_controller/type: joint_state_contr...
* /pos_based_pos_traj_controller_arm/joints: ['arm_1_joint', '...
* /pos_based_pos_traj_controller_arm/publish_rate: 50
* /pos_based_pos_traj_controller_arm/type: position_controll...
* /robot_description: <?xml version="1....
* /rosdistro: kinetic
* /rosversion: 1.12.7
* /schunk_canopen_node/autostart: True
* /schunk_canopen_node/can_device_name: auto
* /schunk_canopen_node/chain_arm: [3, 4, 5, 6, 7, 8]
* /schunk_canopen_node/chain_names: ['arm']
* /schunk_canopen_node/frequency: 30
* /schunk_canopen_node/node_mapping_3: arm_1_joint
* /schunk_canopen_node/node_mapping_4: arm_2_joint
* /schunk_canopen_node/node_mapping_5: arm_3_joint
* /schunk_canopen_node/node_mapping_6: arm_4_joint
* /schunk_canopen_node/node_mapping_7: arm_5_joint
* /schunk_canopen_node/node_mapping_8: arm_6_joint
* /schunk_canopen_node/ppm_profile_acceleration: 0.3
* /schunk_canopen_node/ppm_profile_velocity: 0.3
* /schunk_canopen_node/ppm_use_relative_targets: False
* /schunk_canopen_node/traj_controller_name: pos_based_pos_tra...
* /schunk_canopen_node/use_ros_control: True
NODES
/
robot_state_publisher (robot_state_publisher/robot_state_publisher)
ros_control_controller_spawner (controller_manager/spawner)
schunk_canopen_node (schunk_canopen_driver/schunk_canopen_driver_node)
auto-starting new master
process[master]: started with pid [11738]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to fce92254-366f-11e7-8af9-fc4dd456d934
process[rosout-1]: started with pid [11751]
started core service [/rosout]
process[schunk_canopen_node-2]: started with pid [11769]
process[ros_control_controller_spawner-3]: started with pid [11770]
process[robot_state_publisher-4]: started with pid [11771]
flags:2050
<2017-05-11 19:33:48.039> CanOpen(Info)::init: CAN Device was set to auto.
<2017-05-11 19:33:48.039> CanOpen(Info)::init: Trying CAN device: /dev/pcanusb0...
[INFO] [1494524028.524145]: Controller Spawner: Waiting for service controller_manager/load_controller
Invalid CanDescriptor!
flags:2050
<2017-05-11 19:33:49.039> CAN(Error) tCanDevice(PEAK-CAN)::tCanDeviceT: Error open CAN-device '/dev/pcanusb0' (errno=Bad file descriptor)
<2017-05-11 19:33:49.039> CanOpen(Info)::init: Trying CAN device: /dev/pcanusb1...
Can Init successful!
<2017-05-11 19:33:50.221> CAN(Info) tCanDevice(PEAK-CAN)::tCanDeviceT: Opened device /dev/pcanusb1 -> 40754656
[ INFO] [1494524030.221688500]: Can device identifier: auto
[ INFO] [1494524030.221742568]: Found 1 chains
[ INFO] [1494524030.223536994]: Found chain with name arm of type PowerBall containing 6 nodes.
<2017-05-11 19:33:50.223> CanOpen(Info)::addNode: Adding new DS402Node with id 3
<2017-05-11 19:33:50.224> CanOpen(Info)::addNode: Adding new DS402Node with id 4
<2017-05-11 19:33:50.224> CanOpen(Info)::addNode: Adding new DS402Node with id 5
<2017-05-11 19:33:50.225> CanOpen(Info)::addNode: Adding new DS402Node with id 6
<2017-05-11 19:33:50.225> CanOpen(Info)::addNode: Adding new DS402Node with id 7
<2017-05-11 19:33:50.226> CanOpen(Info)::addNode: Adding new DS402Node with id 8
<2017-05-11 19:33:50.288> CanOpen(Info)::setModeOfOperation: Initialized mode MOO_PROFILE_POSITION_MODE for node 3
<2017-05-11 19:33:50.288> CanOpen(Info)::commutationSearch: Commutation search for node 3
[ERROR] [1494524030.290619146]: Caught ProtocolException while initializing devices: 0?m
[ INFO] [1494524030.290661881]: Going to shut down now
[schunk_canopen_node-2] process has died [pid 11769, exit code 255, cmd /home/matkok/catkin_ws/devel/lib/schunk_canopen_driver/schunk_canopen_driver_node __name:=schunk_canopen_node __log:=/home/matkok/.ros/log/fce92254-366f-11e7-8af9-fc4dd456d934/schunk_canopen_node-2.log].
log file: /home/matkok/.ros/log/fce92254-366f-11e7-8af9-fc4dd456d934/schunk_canopen_node-2*.log
[WARN] [1494524058.673410]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[ros_control_controller_spawner-3] process has finished cleanly
Asked by matkok on 2017-05-11 09:24:28 UTC
Answers
Hi matkok,
we looked into the problem, thanks for your detailed writeup which helped tremendously.
The error is not as assumed an SDO error which would produce a much more verbose output but (at least that is the theory) a PDO timing error which is resulting from the way we had implemented the commutation search.
The following lines in SchunkPowerballNode.cpp (135 following) are responsible for this:
size_t counter = 50;
// Try commutation search for counter times
while (!calib_ok && counter--)
{
usleep(100000); // sleep for 100 ms
downloadPDOs();
sendSync(m_can_dev);
uploadPDOs();
calib_ok = CommutationCalibrated();
}
The routine waits for the commutation calibration by doing a fixed time wait. This is not the best way to do it as no SYNC signals are sent anymore during this time. If the sync signal is missed for a predefined number of steps a PDO exeception (resulting in a ProtocollException) is thrown and the nodes will enter the fault state.
Please try the following patch:
size_t counter = 500;
// Try commutation search for counter times
while (!calib_ok && counter--)
{
sendSync(m_can_dev);
downloadPDOs();
uploadPDOs();
calib_ok = CommutationCalibrated();
}
The explicit sleep is actually not relevant as the sendSync will already take care of the wait without skipping the SYNC signal.
Please let me know if this works or you encounter further problems.
Asked by heppner on 2017-05-24 09:18:40 UTC
Comments
Hi, I am sorry to inform you that is not the answer. I get exactly the same error, and output on my cmd. If you have any other idea, please let me know.
Asked by matkok on 2017-05-25 11:11:45 UTC
Comments
And if someone can tell my how to put my Terminal output so it is easyer to read. Thanks :)
Asked by matkok on 2017-05-11 11:57:52 UTC
Edit your question, select the terminal output, press the Preformatted Text button (the one with
101010
on it). Save.Asked by gvdhoorn on 2017-05-11 12:09:56 UTC
Does anyone know how to start tests, like test_sdo.cpp, that are in the package?
Asked by matkok on 2017-05-12 07:01:36 UTC