ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
125 stars 52 forks source link

SDO config init how does it work ? #257

Open LudoJ49 opened 5 months ago

LudoJ49 commented 5 months ago

In yml, it says "sdo: # SDO executed during config" (based from the sample)

defaults:
  dcf: "swd_core.eds"
  driver: "ros2_canopen::Cia402Driver"
  package: "canopen_402_driver"
  polling: false
  heartbeat_producer: 1000 # Heartbeat every 1000 ms
  sdo: # SDO executed during config
    - {index: 0x6060, sub_index: 0, value: 2} # Velocity mode

I guess this is where we need to set TX and RX PDOs and stuff the device needs togoin operational state.

yet with the above example, I'm expecting it to write to reg 6060 at boot up.

I can not see those framew with candump. I can see it tries to read device type (reg 1000h)

  can0  604   [8]  80 00 10 00 00 00 04 05
  can0  604   [8]  40 00 10 00 00 00 00 00
  can0  584   [8]  43 00 10 00 92 F1 FF 00

But I can't see anything to so with register 6060 (in my example)

is there a specific action to do to trigger it ?

hellantos commented 2 months ago

@LudoJ49 it seems you are experienceing a timeout issue during startup, as can be seen in the error code. When configuring the underlying CANopen stack will first check if the correct device is present at the correct id. This is what you are seeing here.