Hello,
i am trying to communicate with a single motor through CANopen. I had posted earlier about it in this question: #q294210
EDIT (21/06): This question was answered by Mathias Lüdtke. The error was in the EDS file, Mathias noticed that the [6502] object had a wrong DataType value, the right DataType value is 0x0007. After i changed the value the controller was spawned correctly.
**However a new ERROR occurred after the spawning. ** This problem is discussed in #q294869
ORIGINAL question starts here: Since no answer was arrived, i was trying to find reference CANopen based projects. Two popular projects/packages were recommended by Mathias Lüdtke: 1) canopen_test_utils and 2) schunk_robots.
The canopen_test_utils seemed perfect to me, since it provides a CANopen based control solution for only 1 joint, e.g. one motor. Therefore i only needed to replace the Elmo.dcf file to my EDS file in canopen_rig1.yaml file. I changed nothing else in the package.
So i did the following:
- sudo ip link set can0 up type can bitrate 500000
- roslaunch canopen_test_utils hw_rig1.launch
- rosservice call /rig1/driver/init
And of course the call crashed with the following message:
success: False
message: "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\nDynamic exception\
\ type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error>\
\ >\nstd::exception::what: boost: mutex lock failed in pthread_mutex_lock: Invalid\
\ argument\n; Could not set transition"
OK.. (so i thought...) Since only the DCF/EDS file differs, and this project has been tested, therefore i checked and compared the Elmo.dcf and my EDS file line by line in a bruteforce way. I modified my original EDS file based on this Elmo.dcf, so it has the same T/R PDO mappings, transmission types, etc, more or less everything.
I repeated the aforementioned 3 steps using the new updated EDS file to test the package.
And of course it crashes again. I try to give here every information that i got in the terminals:
After step 2, i have the following output in the terminal (2 suspicious warnings: Controller Spawner couldn't find the expected controller_manager ROS interface.):
xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
deprecated: xacro tags should be prepended with 'xacro' xml namespace.
Use the following script to fix incorrect usage:
find . -iname "*.xacro" | xargs sed -i 's#<\([/]\?\)\(if\|unless\|include\|arg\|property\|macro\|insert_block\)#<\1xacro:\2#g'
when processing file: /home/akosodry/catkin_ws/src/canopen_test_utils/urdf/rig1.urdf.xacro
xacro.py is deprecated; please use xacro instead
started roslaunch server http://akosodry-8700K-linux:33007/
SUMMARY
========
CLEAR PARAMETERS
* /rig1/driver/
PARAMETERS
* /rig1/driver/bus/device: can0
* /rig1/driver/bus/master_allocator: canopen::SimpleMa...
* /rig1/driver/defaults/dcf_overlay/1016sub1: 0x7F0064
* /rig1/driver/defaults/dcf_overlay/1017: 100
* /rig1/driver/defaults/dcf_overlay/6098: 35
* /rig1/driver/defaults/eds_file: config/ASDA_A2_10...
* /rig1/driver/defaults/eds_pkg: canopen_test_utils
* /rig1/driver/heartbeat/msg: 77f#05
* /rig1/driver/heartbeat/rate: 20
* /rig1/driver/nodes/rig1_plate_joint/id: 1
* /rig1/driver/sync/interval_ms: 10
* /rig1/driver/sync/overflow: 0
* /rig1/joint_state_controller/joints: ['rig1_plate_joint']
* /rig1/joint_state_controller/publish_rate: 50
* /rig1/joint_state_controller/type: joint_state_contr...
* /rig1/joint_trajectory_controller/action_monitor_rate: 10
* /rig1/joint_trajectory_controller/constraints/goal_time: 0.6
* /rig1/joint_trajectory_controller/constraints/rig1_plate_joint/goal: 0.1
* /rig1/joint_trajectory_controller/constraints/rig1_plate_joint/trajectory: 0.1
* /rig1/joint_trajectory_controller/constraints/stopped_velocity_tolerance: 0.5
* /rig1/joint_trajectory_controller/joints: ['rig1_plate_joint']
* /rig1/joint_trajectory_controller/required_drive_mode: 7
* /rig1/joint_trajectory_controller/state_publish_rate: 25
* /rig1/joint_trajectory_controller/stop_trajectory_duration: 0.5
* /rig1/joint_trajectory_controller/topic: test
* /rig1/joint_trajectory_controller/type: position_controll...
* /rig1/joint_trajectory_pid_controller/action_monitor_rate: 10
* /rig1/joint_trajectory_pid_controller/constraints/goal_time: 0.6
* /rig1/joint_trajectory_pid_controller/constraints/rig1_plate_joint/goal: 0.1
* /rig1/joint_trajectory_pid_controller/constraints/rig1_plate_joint/trajectory: 0.1
* /rig1/joint_trajectory_pid_controller/constraints/stopped_velocity_tolerance: 0.5
* /rig1/joint_trajectory_pid_controller/gains/rig1_plate_joint/d: 0.0
* /rig1/joint_trajectory_pid_controller/gains/rig1_plate_joint/i: 0.0
* /rig1/joint_trajectory_pid_controller/gains/rig1_plate_joint/i_clamp: 0.0
* /rig1/joint_trajectory_pid_controller/gains/rig1_plate_joint/p: 0.5
* /rig1/joint_trajectory_pid_controller/joints: ['rig1_plate_joint']
* /rig1/joint_trajectory_pid_controller/required_drive_mode: 3
* /rig1/joint_trajectory_pid_controller/state_publish_rate: 25
* /rig1/joint_trajectory_pid_controller/stop_trajectory_duration: 0.5
* /rig1/joint_trajectory_pid_controller/topic: test
* /rig1/joint_trajectory_pid_controller/type: position_controll...
* /rig1/rig1_plate_joint_position_controller/joint: rig1_plate_joint
* /rig1/rig1_plate_joint_position_controller/required_drive_mode: 1
* /rig1/rig1_plate_joint_position_controller/type: position_controll...
* /rig1/rig1_plate_joint_velocity_controller/joint: rig1_plate_joint
* /rig1/rig1_plate_joint_velocity_controller/required_drive_mode: 3
* /rig1/rig1_plate_joint_velocity_controller/type: velocity_controll...
* /robot_description: <?xml version="1....
* /robot_state_publisher/publish_frequency: 50.0
* /robot_state_publisher/tf_prefix:
* /rosdistro: kinetic
* /rosversion: 1.12.13
* /script_server/rig1/action_name: /rig1/joint_traje...
* /script_server/rig1/default_vel: 0.3
* /script_server/rig1/down: [[3.14]]
* /script_server/rig1/home: [[0.0]]
* /script_server/rig1/joint_names: ['rig1_plate_joint']
* /script_server/rig1/left: [[1.5708]]
* /script_server/rig1/right: [[-1.5708]]
* /script_server/rig1/roundtrip: ['down', 'left', ...
* /script_server/rig1/service_ns: /rig1/driver
* /script_server/rig1/ticktack: ['left', 'right',...
* /script_server/rig1/up: [[0.0]]
NODES
/rig1/
driver (canopen_motor_node/canopen_motor_node)
rig1_controller_spawner (controller_manager/spawner)
rig1_joint_state_controller_spawner (controller_manager/spawner)
/
robot_state_publisher (robot_state_publisher/robot_state_publisher)
auto-starting new master
process[master]: started with pid [9070]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 157337bc-73ee-11e8-931c-78321b043645
process[rosout-1]: started with pid [9083]
started core service [/rosout]
process[robot_state_publisher-2]: started with pid [9101]
process[rig1/driver-3]: started with pid [9102]
process[rig1/rig1_joint_state_controller_spawner-4]: started with pid [9103]
process[rig1/rig1_controller_spawner-5]: started with pid [9115]
[ INFO] [1529432704.218127226]: Using fixed control period: 0.010000000
[WARN] [1529432734.635528]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[WARN] [1529432734.636938]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[rig1/rig1_joint_state_controller_spawner-4] process has finished cleanly
log file: /home/akosodry/.ros/log/157337bc-73ee-11e8-931c-78321b043645/rig1-rig1_joint_state_controller_spawner- 4*.log
[rig1/rig1_controller_spawner-5] process has finished cleanly
log file: /home/akosodry/.ros/log/157337bc-73ee-11e8-931c-78321b043645/rig1-rig1_controller_spawner-5*.log
If i do rosservice list there is no controller_manager:
/rig1/driver/get_loggers
/rig1/driver/get_object
/rig1/driver/halt
/rig1/driver/init
/rig1/driver/recover
/rig1/driver/set_logger_level
/rig1/driver/set_object
/rig1/driver/shutdown
/robot_state_publisher/get_loggers
/robot_state_publisher/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level
And also, if i call the /rig1/driver/init, it returns with success: True, i can hear that my servo is turned on. I got the following message in the other terminal:
[ INFO] [1529433440.546777357]: Initializing XXX
[ INFO] [1529433440.547440823]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1529433440.547911808]: Current state: 2 device error: system:0 internal_error: 0 (OK)
EMCY: 81#0000000000000000
I assume that these messages are OK. But the problem is that i have no topics related to the controllers:
/diagnostics
/joint_states
/rosout
/rosout_agg
/tf
/tf_static
If i do rosservice list i have now the controller manager:
/rig1/controller_manager/list_controller_types
/rig1/controller_manager/list_controllers
/rig1/controller_manager/load_controller
/rig1/controller_manager/reload_controller_libraries
/rig1/controller_manager/switch_controller
/rig1/controller_manager/unload_controller
/rig1/driver/get_loggers
/rig1/driver/get_object
/rig1/driver/halt
/rig1/driver/init
/rig1/driver/recover
/rig1/driver/set_logger_level
/rig1/driver/set_object
/rig1/driver/shutdown
/robot_state_publisher/get_loggers
/robot_state_publisher/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level
However, if i call for example:
rosservice call /rig1/controller_manager/load_controller "name: 'rig1_plate_joint_position_controller'"
It returns with false and message:
[ERROR] [1529433712.087792833]: Exception thrown while initializing controller rig1_plate_joint_position_controller.
Could not find resource 'rig1_plate_joint' in 'hardware_interface::PositionJointInterface'.
[ERROR] [1529433712.087895663]: Initializing controller 'rig1_plate_joint_position_controller' failed
Also after the rosservice call i get the following:
[ WARN] [1529433780.238559532]: RPDO timeout
Did not receive a response message
abort1001#0, reason: Client/server command specifier not valid or unknown.
Could not process message
discarded message
[ WARN] [1529433790.288558376]: RPDO timeout
[ WARN] [1529433800.298543451]: RPDO timeout
[ WARN] [1529433810.298551968]: RPDO timeout
EMCY: 81#3081108001000000
EMCY: 81#3081108001000000
[ERROR] [1529433816.158555573]: RPDO timeout; Node has emergency error
[ERROR] [1529433826.168516048]: not operational; not operational
[ERROR] [1529433836.178398516]: not operational; not operational
[ERROR] [1529433846.178455135]: not operational; not operational
[ERROR] [1529433856.188484882]: not operational; not operational
At this point i am stuck. I really tried to give all the information i have regarding the testing of this package.
I would like to ask some help from the forum members. Especially, the help of @Mathias Lüdtke would be appreciated, (if im not mistaken) the owner/author of the canopen_test_utils package.
Thank you in advance. Best regards, Akos
Originally posted by akosodry on ROS Answers with karma: 121 on 2018-06-19
Post score: 0
Original comments
Comment by Mathias Lüdtke on 2018-06-20:\
Also after the rosservice call i get the following:
Which service call? The errors do not look good. The error register (1001) cannot be read/reset and your drive has a heartbeat failure. In addition "RPDO timeout" might occur once in a while (given heavy CPU or bus load), but not always.
Comment by akosodry on 2018-06-20:
After i call:
rosservice call /rig1/controller_manager/load_controller "name: 'rig1_plate_joint_position_controller'"