ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

canopen motor node exit with error code -6

asked 2021-08-05 18:05:44 -0600

Shaevita gravatar image

When trying to initialize a canopen_motor_node to control a CiA402 compliant stepper motor controller (Nanotec C5-E-1-09) I am met an error code -6. When running my launch file:

<?xml version="1.0"?>
<launch>
  <!-- send urdf to param server -->
  <param name="robot_description" command="cat '$(find nanotec_ros)/urdf/urdf.xml'" />

  <node ns="nanotec_stepper" name="driver" pkg="canopen_motor_node" type="canopen_motor_node" output="screen" clear_params="true" launch-prefix="">
    <rosparam command="load" file="$(find nanotec_ros)/config/nanotec_node.yaml" />
  </node>

</launch>

With the following .yaml file:

bus:
  device: can0 #socketcan network  
  master_allocator: canopen::SimpleMaster::Allocator

sync:
  interval_ms: 10  
  overlfow: 0

nodes:
  nanotec_stepper:
    id: 1
    eds_file: "$find(nanotec_ros)/config/C5-E-1-09.eds"


defaults:
  ### 402
  motor_allocator: canopen::Motor402::Allocator
  pos_to_device: "rint(rad2deg(pos)/0.18)"
  pos_from_device: "deg2rad(obj6064)*0.18"
  vel_to_device: "rint(rad2deg(vel)/0.18)"
  vel_from_device: "deg2rad(obj606C)*0.18"
  eff_to_device: "rint(eff)"
  eff_from_device: "0"

I receive the following output:

roslaunch --screen main.launch
... logging to /home/usr/.ros/log/e129dd76-f63a-11eb-964a-c8b29bf77957/roslaunch-usr-ThinkPad-X1-Extreme-2nd-9881.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://usr-ThinkPad-X1-Extreme-2nd:38641/

SUMMARY
========

CLEAR PARAMETERS
 * /nanotec_stepper/driver/

PARAMETERS
 * /nanotec_stepper/driver/bus/device: can0
 * /nanotec_stepper/driver/bus/master_allocator: canopen::SimpleMa...
 * /nanotec_stepper/driver/defaults/eff_from_device: 0
 * /nanotec_stepper/driver/defaults/eff_to_device: rint(eff)
 * /nanotec_stepper/driver/defaults/motor_allocator: canopen::Motor402...
 * /nanotec_stepper/driver/defaults/pos_from_device: deg2rad(obj6064)*...
 * /nanotec_stepper/driver/defaults/pos_to_device: rint(rad2deg(pos)...
 * /nanotec_stepper/driver/defaults/vel_from_device: deg2rad(obj606C)*...
 * /nanotec_stepper/driver/defaults/vel_to_device: rint(rad2deg(vel)...
 * /nanotec_stepper/driver/nodes/nanotec_stepper/eds_file: $find(nanotec_ros...
 * /nanotec_stepper/driver/nodes/nanotec_stepper/id: 1
 * /nanotec_stepper/driver/sync/interval_ms: 10
 * /nanotec_stepper/driver/sync/overlfow: 0
 * /robot_description: <?xml version="1....
 * /rosdistro: melodic
 * /rosversion: 1.14.11

NODES
  /nanotec_stepper/
    driver (canopen_motor_node/canopen_motor_node)

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

setting /run_id to e129dd76-f63a-11eb-964a-c8b29bf77957
process[rosout-1]: started with pid [9904]
started core service [/rosout]
process[nanotec_stepper/driver-2]: started with pid [9912]
[ WARN] [1628201831.729440941]: Sync overflow was not specified, so overflow is disabled per default
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::property_tree::ini_parser::ini_parser_error> >'
  what():  $find(nanotec_ros)/config/C5-E-1-09.eds: cannot open file
[nanotec_stepper/driver-2] process has died [pid 9912, exit code -6, cmd /opt/ros/melodic/lib/canopen_motor_node/canopen_motor_node __name:=driver __log:=/home/usr/.ros/log/e129dd76-f63a-11eb-964a-c8b29bf77957/nanotec_stepper-driver-2.log].
log file: /home/usr/.ros/log/e129dd76-f63a-11eb-964a-c8b29bf77957/nanotec_stepper-driver-2*.log

I have tried multiple .eds files and none of them work. I checked my .eds file with the eds file checker tool and there didn't seem to be any issues.

I have a similar error to another topic however I wasn't able to solve my error looking at the solution.

My .eds file is on github

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-08-07 06:22:02 -0600

Mathias Lüdtke gravatar image

what(): $find(nanotec_ros)/config/C5-E-1-09.eds: cannot open file

This is a very specific error message.

It looks like your roslaunch syntax is wrong. At this stage (in the driver) the path should already be expanded. I think it should be $(find nanotec_ros)/config/C5-E-1-09.eds

edit flag offensive delete link more

Comments

The <rosparam command="load" also doesn't have subst_value set to true, so the find will never be evaluated.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-07 07:39:11 -0600 )edit

Good point!

Or even simpler: don't specify the full path, but the package as well

eds_pkg: "nanotec_ros"
eds_file: "config/C5-E-1-09.eds"
Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2021-08-07 08:00:23 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-08-05 18:05:44 -0600

Seen: 220 times

Last updated: Aug 07 '21