Robotics StackExchange | Archived questions

ros_canopen: Node 'eff_from_device' has no id

I am trying to control (Delta Asda-A2) servo motor using the ros_canopen pkg (0.8.5). Using: ros melodic Jetson nano mcp2515 module.

Node.yaml

nodes:
  node1:
    id: 2
    name: J0
    eds_pkg: servo_canopen # optionals package  name for relative path
    eds_file: "config/ASDA-A2.eds" # path to EDS/DCF file

# defaults: # optional, all defaults can be overwritten per node
#  eds_pkg: my_config_package # optional package  name for relative path
#  eds_file: "my_config.dcf" # path to EDS/DCF file
#   dcf_overlay: # "ObjectID": "ParameterValue" (both as strings)
#    "6098": "0" # No homing operation required
#    "1016sub1" : "0x7F0064" # heartbeat timeout of 100 ms for master at 127
#    "1017": "100" # heartbeat producer

# canopen_chain_node settings ..
  motor_allocator: canopen::Motor402::Allocator # select allocator for motor layer
#   motor_layer: settings passed to motor layer (plugin-specific)
  switching_state: 2 # (Operation_Enable), state for mode switching. Drive mode of operation from canopen_402 wiki
  pos_to_device: "pos" # inc
  pos_from_device: "obj6064" # inc 
  vel_to_device: "vel" # rpm
  vel_from_device: "obj606C" # rpm
  eff_to_device: "rint(eff)" # just round to integer
  eff_from_device: "0" # unset

can.yaml

bus:
  device: can0 # SocketCAN network interface
  loopback: true # Make the SocketCAN loop back messages
  # driver_plugin: can::SocketCANInterface
  master_allocator: canopen::SimpleMaster::Allocator
sync:
  interval_ms: 10 # 10 ms is recommended for non real-time systems, set to 0 to disable sync
  # update_ms: <interval_ms> # Update interval of control loop, must be set explicitly if sync is disabled
  overflow: 0 # overflow sync counter at value or do not set it (0, default)
heartbeat: # simple heartbeat producer, optional!
  rate: 20 # heartbeat rate
  msg: "77f#05" # message to send, cansend format: heartbeat of node 127 with status 5=Started

controller.yaml

joint_names: [J0]

joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

joint_group_position_controller:
  type: position_controllers/JointGroupPositionController
  joints:
    - J0
  required_drive_mode: 1

J0_position_controller:
  type: position_controllers/JointPositionController
  joint: J0
  required_drive_mode: 1

ros.yaml

defaults: # optional, all defaults can be overwritten per node
  publish: ["1A00"] # list of objects to be published (one topic per node)
nodes:
  node1:
    # ...
    #publish: ["1003sub0!"] # list of objects to be published (one topic per node)
  node2:
# ...

Launch File

<?xml version="1.0"?>
   <launch>
     <group ns="/Delta">
      <arg name="model" default="$(find servo_canopen)/urdf/Motor.urdf"/> 
       <!-- Load the URDF into ROS parameter server -->
       <param name="robot_description" command="cat $(arg model)"/>

       <node name="canopen_motor" pkg="canopen_motor_node" type="canopen_motor_node" output="screen" clear_params="true" >
         <rosparam command="load" file="$(find servo_canopen)/config/can.yaml" />
         <rosparam command="load" file="$(find servo_canopen)/config/controller.yaml" />
         <rosparam command="load" file="$(find servo_canopen)/config/node.yaml" />
       </node>

       <!-- load the controllers -->
       <node name="controller_spawner" pkg="controller_manager" type="controller_manager" respawn="false"
         output="screen" args="spawn 
         /Delta/canopen_motor/joint_state_controller
         /Delta/canopen_motor/J0_position_controller
         /Delta/canopen_motor/joint_group_position_controller"/>
     </group>
   </launch>

When running the launch file, I get this error. I don't know what is producing this error!

console output

... logging to /home/karim/.ros/log/796865f4-37fc-11ed-8da5-00e04c49cd22/roslaunch-karim-desktop-21063.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://karim-desktop:34509/

SUMMARY
========

CLEAR PARAMETERS
 * /Delta/canopen_motor/

PARAMETERS
 * /Delta/canopen_motor/J0_position_controller/joint: J0
 * /Delta/canopen_motor/J0_position_controller/required_drive_mode: 1
 * /Delta/canopen_motor/J0_position_controller/type: position_controll...
 * /Delta/canopen_motor/bus/device: can0
 * /Delta/canopen_motor/bus/loopback: True
 * /Delta/canopen_motor/bus/master_allocator: canopen::SimpleMa...
 * /Delta/canopen_motor/heartbeat/msg: 77f#05
 * /Delta/canopen_motor/heartbeat/rate: 20
 * /Delta/canopen_motor/joint_group_position_controller/joints: ['J0']
 * /Delta/canopen_motor/joint_group_position_controller/required_drive_mode: 1
 * /Delta/canopen_motor/joint_group_position_controller/type: position_controll...
 * /Delta/canopen_motor/joint_names: ['J0']
 * /Delta/canopen_motor/joint_state_controller/publish_rate: 50
 * /Delta/canopen_motor/joint_state_controller/type: joint_state_contr...
 * /Delta/canopen_motor/nodes/eff_from_device: 0
 * /Delta/canopen_motor/nodes/eff_to_device: rint(eff)
 * /Delta/canopen_motor/nodes/motor_allocator: canopen::Motor402...
 * /Delta/canopen_motor/nodes/node1/eds_file: config/ASDA-A2.eds
 * /Delta/canopen_motor/nodes/node1/eds_pkg: servo_canopen
 * /Delta/canopen_motor/nodes/node1/id: 2
 * /Delta/canopen_motor/nodes/node1/name: J0
 * /Delta/canopen_motor/nodes/pos_from_device: obj6064
 * /Delta/canopen_motor/nodes/pos_to_device: pos
 * /Delta/canopen_motor/nodes/switching_state: 2
 * /Delta/canopen_motor/nodes/vel_from_device: obj606C
 * /Delta/canopen_motor/nodes/vel_to_device: vel
 * /Delta/canopen_motor/sync/interval_ms: 10
 * /Delta/canopen_motor/sync/overflow: 0
 * /Delta/robot_description: <?xml version="1....
 * /rosdistro: melodic
 * /rosversion: 1.14.13

NODES
  /Delta/
    canopen_motor (canopen_motor_node/canopen_motor_node)
    controller_spawner (controller_manager/controller_manager)

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

setting /run_id to 796865f4-37fc-11ed-8da5-00e04c49cd22
process[rosout-1]: started with pid [21098]
started core service [/rosout]
process[Delta/canopen_motor-2]: started with pid [21102]
process[Delta/controller_spawner-3]: started with pid [21103]
[ERROR] [1663579308.112021169]: Node 'eff_from_device' has no id
[Delta/canopen_motor-2] process has died [pid 21102, exit code 1, cmd /opt/ros/melodic/lib/canopen_motor_node/canopen_motor_node __name:=canopen_motor __log:=/home/karim/.ros/log/796865f4-37fc-11ed-8da5-00e04c49cd22/Delta-canopen_motor-2.log].
log file: /home/karim/.ros/log/796865f4-37fc-11ed-8da5-00e04c49cd22/Delta-canopen_motor-2*.log

Asked by Karim Mobarak on 2022-09-19 05:53:47 UTC

Comments

Answers

I figured it out ! There was a missing indention in the Node.yaml file

Asked by Karim Mobarak on 2022-09-19 06:01:16 UTC

Comments