ros-industrial / ros2_canopen

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

Failed init services when running device_container_node in a two core computer #210

Closed POtaoPereiraRosen closed 10 months ago

POtaoPereiraRosen commented 11 months ago

Describe the bug Failed init services when running device_container_node in a two core computer

To Reproduce When launching device_container_node (canopen_core/launch/canopen.launch.py)

Expected behavior This behaviour does not exist when device_container_node is launched in a virtual machine with 8 processors. But our target platform is a computer with 2 cores, and there the faulty behaviour (described above) occurs. The faulty behaviour also occurs, in a virtual machine setup with 2 processors.

Setup:

hellantos commented 11 months ago

@POtaoPereiraRosen this could be because three threads are necessary for this. Does it work if you initialise sequencially?

POtaoPereiraRosen commented 11 months ago

@ipa-cmh Yes, when starting sequentially, it works (i.e., if I wait for the reply of the init-service of motor 1, and then call the init-service of motor 2, then it works). In your question, you referred to the need of three threads: I am guessing you meant hardware-threads/cores/CPUs/processors. Out of curiosity, why are three cores required?

hellantos commented 10 months ago

One thread runs the canopen loop, an one per driver.