Closed kurtist123 closed 2 months ago
Do you have a CANopen device connected to real bus? It won't work without device.
Do you have a CANopen device connected to real bus? It won't work without device.
I have a PEAK USB to CAN adapter (product number IPEH-002021) connected to my computer and the real can bus. There are other devices on the can bus and I can see their output using candump
on my computer. So I'm confident my can bus is up and running and my adapter is working. The other devices are not necessarily talking CANopen though. Most of them are using the J1939 protocol. I don't plan to actually mix CANopen and J1939 on the same bus, I'm just trying to get something working right now.
I also ran the following commands just to be safe:
sudo modprobe -v peak_usb sudo ip link set can0 txqueuelen 1000 sudo ip link set can0 up type can bitrate 250000 sudo ip link set up can0
Yeah, I met the same issue. I use ros2 canopen with ros2 control. The servo driver is Kinco on the real bus. The test shows the can bus works right. However, it is said "Wait for device to boot. " all the time. I don't know what is wrong. Have you solved the problem?
Yeah, I met the same issue. I use ros2 canopen with ros2 control. The servo driver is Kinco on the real bus. The test shows the can bus works right. However, it is said "Wait for device to boot. " all the time. I don't know what is wrong. Have you solved the problem?
Unfortunately I have not solved this yet but I am actively working on it.
Are you launching a fake slave? If I do not launch a fake slave I see "Wait for device to boot." but it never boots (on both virtual CAN and a real CAN bus). If I launch a fake slave it gets further into the boot process. The Trinamic Stepper Motor control example is the only place I have seen it documented that you should not launch a fake slave when using a real CAN bus. My suggestion would be to try launching a fake slave and see if that boots the device.
I didn't use a fake slave since I want to test on the real device and it stuck exactly on the "Wait for device to boot". After I search the log message in the source code, I found the error message comes from lely_core_libraries
. I searched the relevant docs and found problem seems to be realated with lely_core_libraries
, see https://lely_industries.gitlab.io/lely-core/doxygen/nmt__boot_8c.html#details. However, I still don't understand what is wrong. Did you check the can0 dump when launch file is launched?
After doing some digging your comments helped me realize I had a fundamental misunderstanding of how some of these features were supposed to work.
You are correct, since you are using real devices you do not want to start a fake slave. I traced the boot procedure for using fake slaves on the virtual CAN bus back to https://lely_industries.gitlab.io/lely-core/doxygen/nmt_8c.html#a85b77551a12c1c4b9d856b6eff853b77. The process to boot a proxy driver seems to get kicked off when that function is called.
I don't have a good understanding of the underlying CANopen protocol, but is your device supposed to be sending a 700 message when it starts up which when received starts the driver boot up?
I didn't use a fake slave since I want to test on the real device and it stuck exactly on the "Wait for device to boot". After I search the log message in the source code, I found the error message comes from
lely_core_libraries
. I searched the relevant docs and found problem seems to be realated withlely_core_libraries
, see https://lely_industries.gitlab.io/lely-core/doxygen/nmt__boot_8c.html#details. However, I still don't understand what is wrong. Did you check the can0 dump when launch file is launched?
Your device needs to send a heartbeat message with the boot code '00'. For instance, my proxy node has a node ID of 2. So after launching, when you see "Wait for device to boot", if you send a message with ID 0x702 (0x700 + node ID) with a single byte set to zero, ex. cansend can0 702#00
the device will continue booting. I changed my bus.yml to not have the master start the other devices.
I'm running into two other issues now.
I received the 701#00 from my driver, but only once. And it seemes the code is sent by my driver rather than master. However, nothing happened when I dymped these boot codes from all my drivers. It still stucks at "Wait for device to boot", and no messages sent by master. According to your comments, shoud I send boot code manully?
Besides, for PDO, the bus.yaml defines its mapping. For people who uses ros2 canopen robot controller(You can see it in https://ros-industrial.github.io/ros2_canopen/manual/rolling/user-guide/how-to-create-a-robot-system.html). The PDO message is supposed to be sent via command interface of ros2 control. For my Kinco driver, it also defineds a special CAN frame to send PDO message. However, since I'm still "wait for device to boot", I haven't test it.
Besides, I used a MCU to boot the driver and it boots well. I can set the motor via CAN messages. After I boot from MCU, I changed the CAN bus to master, it still said "Wait for device to boot".
Have you solved the problem now? @kurtist123
Describe the bug I've been able to get everything setup and working using the virtual CAN bus vcan0. After transitioning to using real hardware and a real can bus, can0, I'm running into issues getting the drivers to boot properly.
When using vcan0, upon launch I see the following output:
When using can0, I see:
When using can0 I don't see the "Driver booted and ready" and "Starting with event mode." messages. If I try to send a read or write SDO service call I get the following message:
So it appears the driver is not starting successfully when using can0. I can see can0 is set up using
ip link show
and I can usecansend
andcandump
utilities to send and read the can bus.Here is my bus config:
I'm using a ProxyDriver while most examples I've seen use the Cia402Driver. I'm not controlling anything that follows the 402 standard, I just want to have a simple can node that interfaces with the can bus and forwards that info to ROS messages like the ProxyDriver does.
I'm using a fake slave. Looking through this example it says if you are using a real can bus to remove launching the fake slave. I've tried to not launch my fake slave and the ProxyDriver node did not even start.
Setup:
Additional context This issue appears to be slightly related to https://github.com/ros-industrial/ros2_canopen/issues/26 and https://github.com/ros-industrial/ros2_canopen/issues/183.