Code Monkey home page Code Monkey logo

ros2_canopen's Introduction

ROS2 CANopen

Status

Build Process Status
Industrial CI Build CI Build Status
Documentation Build CI Documentation Status
Buildfarm Build (rolling) Buildfarm Status

The stack is currently under development and not yet ready for production use.

Rolling Distribution (Noble & RHEL9)

Package Noble (Ubuntu) RHEL9
canopen_interfaces Build Status Build Status
lely_core_libraries Build Status Build Status
canopen_core Build Status Build Status
canopen_master_driver Build Status Build Status
canopen_base_driver Build Status Build Status
canopen_proxy_driver Build Status Build Status
canopen_402_driver Build Status Build Status
canopen_ros2_control Build Status Build Status
canopen_ros2_controllers Build Status Build Status
canopen_tests Build Status Build Status
canopen_utils Build Status Build Status

Documentation

The documentation consists of two parts: a manual and an api reference. The documentation is built for rolling (master), iron and humble and hosted on github pages. Older ROS 2 releases are EOL and are not supported anymore.

Rolling

Iron

Humble

Features

These are some of the features this stack implements. For further information please refer to the documentation.

  • YAML-Bus configuration This canopen stack enables you to configure the bus using a YAML file. In this file you define the nodes that are connected to the bus by specifying their node id, the corresponding EDS file and the driver to run for the node. You can also specify further parameters that overwrite EDS parameters or are inputs to the driver.
  • Service based operation The stack can be operated using standard ROS2 nodes. In this case the device container will load the drivers for master and slave nodes. Each driver will be visible as a node and expose a ROS 2 interface. All drivers are brought up when the device manager is launched.
  • Managed service based operation The stack can be opeprated using managed ROS2 nodes. In this case the device container will load the drivers for master and slave nodes based on the bus configuration. Each driver will be a lifecycle node and expose a ROS 2 interface. The lifecycle manager can be used to bring all device up and down in the correct sequence.
  • ROS2 control based operation Currently, multiple ros2_control interfaces are available. These can be used for controlling CANopen devices. The interfaces are:
    • canopen_ros2_control/CANopenSystem
    • canopen_ros2_control/CIA402System
    • canopen_ros2_control/RobotSystem
  • CANopen drivers Currently, the following drivers are available:
    • ProxyDriver
    • Cia402Driver

Post testing

To test stack after it was built from source you should first setup a virtual can network.

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set vcan0 txqueuelen 1000
sudo ip link set up vcan0

Then you can launch a managed example

ros2 launch canopen_tests cia402_lifecycle_setup.launch.py
ros2 lifecycle set /lifecycle_manager configure
ros2 lifecycle set /lifecycle_manager activate

Or you can launch a standard example

ros2 launch canopen_tests cia402_setup.launch.py

Or you can launch a ros2_control example

ros2 launch canopen_tests robot_control_setup.launch.py

Contributing

This repository uses pre-commit for code formatting. This program has to be setup locally and installed inside the repository. For this execute in the repository folder following commands:

sudo apt install -y pre-commit
pre-commit install

The checks are automatically executed before each commit. This helps you to always commit well formatted code. To run all the checks manually use pre-commit run -a command. For the other options check pre-commit --help.

In a case of an "emergency" you can avoid execution of pre-commit hooks by adding -n flag to git commit command - this is NOT recommended to do if you don't know what are you doing!

ros2_canopen's People

Contributors

bjsowa avatar borongyuan avatar clalancette avatar cschindlbeck avatar destogl avatar gavanderhoorn avatar hellantos avatar hsd-dev avatar ipa-alb avatar ipa-vsp avatar james-ward avatar kurtist123 avatar lewec avatar livanov93 avatar yos627 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros2_canopen's Issues

Add lifecycle to DeviceManager

Feature request
The DeviceManager should expose a Lifecycle in order enable dynamic reconfiguration and easier error handling.
The initial idea for the lifecycle is this:

image

Additional Requirement:
In active state, the user can still load new devices at runtime, that are marked as enable_lazy_load in the bus.yml. When a failure occurs, these devices should be automatically loaded when configuring after ErrorProcessing.

Launch File error

Hi there,
i followed the Launch configuration creation guidelines (https://ros-industrial.github.io/ros2_canopen/configuration-package.html) but I am not able to run the master (bring_up.launch.py)

ros2 launch everest bring_up.launch.py 
[INFO] [launch]: All log files can be found below /root/.ros/log/2022-08-08-16-52-54-408665-dti-12659-81500
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [device_manager_node-1]: process started with pid [81502]
[device_manager_node-1] [INFO] [1659970374.481639696] [device_manager_node]: Found 2 devices
[device_manager_node-1] [INFO] [1659970374.481656996] [device_manager_node]: Found Master.
[device_manager_node-1] [INFO] [1659970374.481755746] [device_manager_node]: Load Library: /home/drfly/dev_ws/install/canopen_core/lib/libmaster_node.so
[device_manager_node-1] [INFO] [1659970374.482189102] [device_manager_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterNode>
[device_manager_node-1] [INFO] [1659970374.482203307] [device_manager_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterNode>
[device_manager_node-1] [INFO] [1659970374.483814747] [device_manager_node]: Added node of type ros2_canopen::MasterNode with name "master" for node_id 1 to executor.
[device_manager_node-1] [INFO] [1659970374.483850305] [device_manager_node]: Adding master with node id 1
[device_manager_node-1] NMT: entering reset application state
[device_manager_node-1] NMT: entering reset communication state
[device_manager_node-1] NMT: running as master
[device_manager_node-1] NMT: entering pre-operational state
[device_manager_node-1] NMT: entering operational state
[device_manager_node-1] [INFO] [1659970374.498616977] [device_manager_node]: Found Driver ros2_canopen::MotionControllerDriver with lazy_load false
[device_manager_node-1] [INFO] [1659970374.498690897] [device_manager_node]: Load Library: /home/drfly/dev_ws/install/canopen_402_driver/lib/libcanopen_402_driver.so
[device_manager_node-1] [INFO] [1659970374.501282969] [device_manager_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MotionControllerDriver>
[device_manager_node-1] [INFO] [1659970374.501302142] [device_manager_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MotionControllerDriver>
[device_manager_node-1] [INFO] [1659970374.503049949] [device_manager_node]: Added node of type ros2_canopen::MotionControllerDriver with name "canopen_402_driver" for node_id 2 to executor.
[device_manager_node-1] [INFO] [1659970374.503084201] [device_manager_node]: Adding ros2_canopen::MotionControllerDriver for node id 2 to master loop.
[device_manager_node-1] [INFO] [1659970374.508052168] [device_manager_node]: List of active components:
[device_manager_node-1] [INFO] [1659970374.508075242] [device_manager_node]: 1 : /master
[device_manager_node-1] [INFO] [1659970374.508103012] [device_manager_node]: 2 : /canopen_402_driver
[device_manager_node-1] [INFO] [1659970374.508112513] [device_manager_node]: Initialisation successful.
[device_manager_node-1] error: SDO abort code 05040000 received on upload request of object 1000 (Device type) to node 02: SDO protocol timed out
[device_manager_node-1] error: SDO abort code 05040000 received on upload request of object 1000 (Device type) to node 02: SDO protocol timed out
[device_manager_node-1] [INFO] [1659970376.508307248] [canopen_402_driver]: Intitialising Device and Objects
[device_manager_node-1] Initialised object : 6041  0 RPDO: yes TPDO: no 
[device_manager_node-1] terminate called after throwing an instance of 'lely::canopen::SdoError'
[device_manager_node-1]   what():  SubmitRead:02:6040:00: Resource not available: SDO connection (060A0023): Resource not available: SDO connection
[ERROR] [device_manager_node-1]: process has died [pid 81502, exit code -6, cmd '/home/drfly/dev_ws/install/canopen_core/lib/canopen_core/device_manager_node --ros-args -r __node:=device_manager_node -r __ns:=/ --params-file /tmp/launch_params_6k6m3zc1'].

Before running the script I have also bring up the can interface reported at https://ros-industrial.github.io/ros2_canopen/

sudo modprobe peak_pci
sudo modprobe peak_pciefd
sudo ip link set up can0 type can bitrate 125000
sudo ip link set can0 txqueuelen 1000
sudo ip link set up can0

I have also tried to connect the drive but nothing has changed. Moreover, I have tried to monitor the can0 throung candump but i did not see any can frame message.

Attached the ros package that i am trying to build
everest.zip

Could be a problem of the can peak m2 card (https://www.peak-system.com/PCAN-M-2.473.0.html?&L=1)?

Many thanks for your support.

Best Regards

Alessio

Add test for proxy driver rpdo/tpdo behaviour

Is your feature request related to a problem? Please describe.
There is a bug report #46 about the rpdo/tpdo topic behaviour.

Describe the solution you'd like
There should be a launch test in canopen_tests to test the behaviour, similarly to what is done in the sdo tests.

Confusion with master driver

I am trying to set up the maxon epos4 50/15 CAN controller with a Jetson AGX Orin running Foxy. (Humble won't be available until October with JetPack 6.)

Reading through the documentation, source code on the foxy branch and doxygen I am a little confused what driver I should use for the master.

according to read the docs:
ros2_canopen::MasterDriver or ros2_canopen::LifecycleMasterDriver
according to doxygen:
ros2_canopen::CanopenMaster or ros2_canopen::LifecycleCanopenMaster
according to foxy source:
ros2_canopen::MasterNode or ros2_canopen::LifecycleMasterNode

Remove compiler warnings

Hi there, when I am running colcon build i get the following result:

Starting >>> canopen_interfaces
Starting >>> lely_core_libraries
Starting >>> canopen_utils
Finished <<< canopen_interfaces [0.51s]                                                                                                
Finished <<< canopen_utils [0.83s]                                                              
--- stderr: lely_core_libraries                                 
libtool: warning: relinking 'liblely-tap.la'
libtool: warning: relinking 'liblely-util.la'
libtool: warning: relinking 'liblely-can.la'
libtool: warning: relinking 'liblely-co.la'
libtool: warning: relinking 'liblely-io.la'
libtool: warning: relinking 'liblely-ev.la'
libtool: warning: relinking 'liblely-io2.la'
libtool: warning: relinking 'liblely-coapp.la'
---
Finished <<< lely_core_libraries [14.3s]
Starting >>> canopen_core
--- stderr: canopen_core                                
/home/drfly/dev_ws/src/ros2_canopen/canopen_core/src/lely_master_bridge.cpp: In member function ‘std::future<bool> ros2_canopen::LelyMasterBridge::async_write_nmt(uint8_t, uint8_t)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_core/src/lely_master_bridge.cpp:224:5: warning: no return statement in function returning non-void [-Wreturn-type]
  224 |     }
      |     ^
/home/drfly/dev_ws/src/ros2_canopen/canopen_core/src/lely_master_bridge.cpp: In member function ‘std::future<bool> ros2_canopen::LelyMasterBridge::async_write_nmt(uint8_t, uint8_t)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_core/src/lely_master_bridge.cpp:224:5: warning: no return statement in function returning non-void [-Wreturn-type]
  224 |     }
      |     ^
---
Finished <<< canopen_core [3.36s]
Starting >>> canopen_base_driver
--- stderr: canopen_base_driver                                
/home/drfly/dev_ws/src/ros2_canopen/canopen_base_driver/src/canopen_base_driver.cpp: In member function ‘virtual void ros2_canopen::BaseDriver::remove(lely::ev::Executor&, lely::canopen::AsyncMaster&, uint8_t)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_base_driver/src/canopen_base_driver.cpp:61:18: warning: unused parameter ‘exec’ [-Wunused-parameter]
   61 |   ev::Executor & exec,
      |   ~~~~~~~~~~~~~~~^~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_base_driver/src/canopen_base_driver.cpp:62:26: warning: unused parameter ‘master’ [-Wunused-parameter]
   62 |   canopen::AsyncMaster & master,
      |   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_base_driver/src/canopen_base_driver.cpp:63:11: warning: unused parameter ‘node_id’ [-Wunused-parameter]
   63 |   uint8_t node_id) noexcept
      |   ~~~~~~~~^~~~~~~
---
Finished <<< canopen_base_driver [2.47s]
Starting >>> canopen_proxy_driver
Finished <<< canopen_proxy_driver [6.74s]                       
Starting >>> canopen_402_driver
--- stderr: canopen_402_driver                                
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:9,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:15,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/base.hpp: In constructor ‘canopen_402::MotorBase::MotorBase(const string&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/base.hpp:17:34: warning: unused parameter ‘name’ [-Wunused-parameter]
   17 |     MotorBase(const std::string &name) {}
      |               ~~~~~~~~~~~~~~~~~~~^~~~
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:15,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp: In member function ‘void ros2_canopen::MCDeviceDriver::validate_objs()’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:189:28: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  189 |                     switch (obj->type)
      |                            ^
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:210:28: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  210 |                     switch (obj->type)
      |                            ^
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:229:24: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  229 |                 switch (obj->type)
      |                        ^
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In member function ‘virtual bool canopen_402::Mode::setTarget(const double&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:157:46: warning: unused parameter ‘val’ [-Wunused-parameter]
  157 |         virtual bool setTarget(const double &val) { return false; }
      |                                ~~~~~~~~~~~~~~^~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In member function ‘bool canopen_402::DefaultHomingMode::error(const string&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:357:39: warning: unused parameter ‘msg’ [-Wunused-parameter]
  357 |         bool error(const std::string &msg)
      |                    ~~~~~~~~~~~~~~~~~~~^~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp: In member function ‘virtual uint16_t canopen_402::Motor402::getMode()’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:296:31: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
  296 |         return selected_mode_ ? selected_mode_->mode_id_ : MotorBase::No_Mode;
      |                ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘canopen_402::WordAccessor<MASK>& canopen_402::WordAccessor<MASK>::operator=(const uint16_t&) [with short unsigned int MASK = 624; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/motor.cpp:204:14:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:142:22: warning: unused variable ‘was’ [-Wunused-variable]
  142 |             uint16_t was = word_;
      |                      ^~~
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:9,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:15,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp:10,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/base.hpp: In constructor ‘canopen_402::MotorBase::MotorBase(const string&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/base.hpp:17:34: warning: unused parameter ‘name’ [-Wunused-parameter]
   17 |     MotorBase(const std::string &name) {}
      |               ~~~~~~~~~~~~~~~~~~~^~~~
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:15,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp:10,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp: In member function ‘void ros2_canopen::MCDeviceDriver::validate_objs()’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:189:28: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  189 |                     switch (obj->type)
      |                            ^
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:210:28: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  210 |                     switch (obj->type)
      |                            ^
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/mc_device_driver.hpp:229:24: warning: enumeration value ‘CODataUnkown’ not handled in switch [-Wswitch]
  229 |                 switch (obj->type)
      |                        ^
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp:10,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In member function ‘virtual bool canopen_402::Mode::setTarget(const double&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:157:46: warning: unused parameter ‘val’ [-Wunused-parameter]
  157 |         virtual bool setTarget(const double &val) { return false; }
      |                                ~~~~~~~~~~~~~~^~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In member function ‘bool canopen_402::DefaultHomingMode::error(const string&)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:357:39: warning: unused parameter ‘msg’ [-Wunused-parameter]
  357 |         bool error(const std::string &msg)
      |                    ~~~~~~~~~~~~~~~~~~~^~~
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp: In member function ‘virtual void ros2_canopen::MotionControllerDriver::on_rpdo(ros2_canopen::COData)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp:77:37: warning: unused parameter ‘data’ [-Wunused-parameter]
   77 |         virtual void on_rpdo(COData data) override
      |                              ~~~~~~~^~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_init(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:7:54: warning: unused parameter ‘request’ [-Wunused-parameter]
    7 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_recover(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:19:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   19 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_halt(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:30:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   30 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:31:49: warning: unused parameter ‘response’ [-Wunused-parameter]
   31 |     std_srvs::srv::Trigger::Response::SharedPtr response)
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_set_mode_position(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:40:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   40 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_set_mode_velocity(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:56:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   56 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_set_mode_cyclic_position(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:71:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   71 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_set_mode_cyclic_velocity(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:86:54: warning: unused parameter ‘request’ [-Wunused-parameter]
   86 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp: In member function ‘void ros2_canopen::MotionControllerDriver::handle_set_mode_torque(std_srvs::srv::Trigger_Request_<std::allocator<void> >::SharedPtr, std_srvs::srv::Trigger_Response_<std::allocator<void> >::SharedPtr)’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:101:54: warning: unused parameter ‘request’ [-Wunused-parameter]
  101 |     const std_srvs::srv::Trigger::Request::SharedPtr request,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 10; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24689; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
  226 |         virtual bool read(const uint16_t &sw) { return true; }
      |                           ~~~~~~~~~~~~~~~~^~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 9; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24831; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 8; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24698; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 7; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24769; unsigned char SUB = 1; short unsigned int CW_MASK = 16; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 4; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24689; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 3; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24831; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 2; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24642; unsigned char SUB = 0; short unsigned int CW_MASK = 112; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
In file included from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/canopen_402_driver.hpp:10,
                 from /home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/src/canopen_402_driver.cpp:1:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 10; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24689; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
  226 |         virtual bool read(const uint16_t &sw) { return true; }
      |                           ~~~~~~~~~~~~~~~~^~
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 9; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24831; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 8; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24698; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 7; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24769; unsigned char SUB = 1; short unsigned int CW_MASK = 16; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 4; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24689; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 3; TYPE = int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData32; short unsigned int OBJ = 24831; unsigned char SUB = 0; short unsigned int CW_MASK = 0; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::read(const uint16_t&) [with short unsigned int ID = 2; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24642; unsigned char SUB = 0; short unsigned int CW_MASK = 112; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:226:43: warning: unused parameter ‘sw’ [-Wunused-parameter]
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp: In instantiation of ‘canopen_402::WordAccessor<MASK>& canopen_402::WordAccessor<MASK>::operator=(const uint16_t&) [with short unsigned int MASK = 624; uint16_t = short unsigned int]’:
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:231:20:   required from ‘bool canopen_402::ModeForwardHelper<ID, TYPE, TPY, OBJ, SUB, CW_MASK>::write(canopen_402::Mode::OpModeAccesser&) [with short unsigned int ID = 10; TYPE = short int; ros2_canopen::CODataTypes TPY = ros2_canopen::COData16; short unsigned int OBJ = 24689; unsigned char SUB = 0; short unsigned int CW_MASK = 0; canopen_402::Mode::OpModeAccesser = canopen_402::WordAccessor<624>]’
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:227:22:   required from here
/home/drfly/dev_ws/src/ros2_canopen/canopen_402_driver/include/canopen_402_driver/motor.hpp:142:22: warning: unused variable ‘was’ [-Wunused-variable]
  142 |             uint16_t was = word_;
      |                      ^~~
---
Finished <<< canopen_402_driver [8.66s]
Starting >>> canopen
Finished <<< canopen [0.10s]                  
Starting >>> everest
Starting >>> trinamic_pd42_can
Finished <<< everest [0.11s]                                                               
Finished <<< trinamic_pd42_can [0.11s]

Summary: 10 packages finished [35.9s]
  4 packages had stderr output: canopen_402_driver canopen_base_driver canopen_core lely_core_libraries

Do you know how to fix it ?

Best regards

Alessio

Add EMCY logging

Emergency messages should be logged, the functionality should be added to canopen_driver_base and lely_bridge.

Functioning with custom device driver.

Hello Team,

I am a newbie to CANopen and ROS2, I have gone through this https://ros-industrial.github.io/ros2_canopen/ as well, but not able to understand how can I add a device driver and not able to understand how this new repository is functioning. Do you have some more documentation where I can understanding how its working.
I have also gone through this documentation and implementation of master slave part https://opensource.lely.com/canopen/docs/installation/
I need more information how to add a device driver into this CANopen stack.

I would be grateful for your help.
Regards

Problem With canopen 402 driver

I am trying to set up the maxon epos2 50/5 CAN controller with a Jetson AGX Orin running Humble. (Through Docker Image.)

The CANopen 402 driver is reporting a failed error while trying to build the package, this is when cloned from the Master branch.
While the Humble branch reportedly didn't report any error but not sure of using which driver as a Master.

Need help with this issue.

Thank you

Getting Could not find requested resource in ament index, when launching the package

Describe the bug
After launching the package with the ros2 launch command. It fails and dies with the message:
[device_container_node-1] what(): Could not find requested resource in ament index
I don't know what resource it couldn't find, so I'm kind of lost. Maybe someone has a hint here.

Logs

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [launch.user]: /home/noah/ros2_ws/install/roboter_drive_controll/share/roboter_drive_controll/config/main_bus/bus.yml
[INFO] [launch.user]: /home/noah/ros2_ws/install/roboter_drive_controll/share/roboter_drive_controll/config/main_bus/master.dcf
[INFO] [launch.user]: /home/noah/ros2_ws/install/roboter_drive_controll/share/roboter_drive_controll/config/main_bus/master.bin
[INFO] [launch.user]: can0
[INFO] [device_container_node-1]: process started with pid [15974]
[device_container_node-1] [INFO] [1683721653.440090002] [device_container_node]: Starting Device Container with:
[device_container_node-1] [INFO] [1683721653.440153933] [device_container_node]: 	 master_config /home/noah/ros2_ws/install/roboter_drive_controll/share/roboter_drive_controll/config/main_bus/master.dcf
[device_container_node-1] [INFO] [1683721653.440160098] [device_container_node]: 	 bus_config /home/noah/ros2_ws/install/roboter_drive_controll/share/roboter_drive_controll/config/main_bus/bus.yml
[device_container_node-1] [INFO] [1683721653.440164503] [device_container_node]: 	 can_interface_name can0
[device_container_node-1] [INFO] [1683721653.440822825] [device_container_node]: Loading Master Configuration.
[device_container_node-1] terminate called after throwing an instance of 'rclcpp_components::ComponentManagerException'
[device_container_node-1]   what():  Could not find requested resource in ament index
[ERROR] [device_container_node-1]: process has died [pid 15974, exit code -6, cmd '/home/noah/ros2_ws/install/canopen_core/lib/canopen_core/device_container_node --ros-args -r __node:=device_container_node -r __ns:=/ --params-file /tmp/launch_params_r4u96630 --params-file /tmp/launch_params_dsyeh5b7 --params-file /tmp/launch_params_qb9wwsy9 --params-file /tmp/launch_params_lf8gt0ml'].

Setup:

  • Device: Intel Nuc with nanotech-n5-2-2 motor controller
  • OS: Ubuntu 22.04.2 LTS
  • ROS-Distro: Humble Hawksbill
  • Branch/Commit: Master

Expose device configuration errors

Is your feature request related to a problem? Please describe.
Errors during configuration of a device by master are not exposed.

Describe the solution you'd like
Throw an error with message when configuraiton fails.

Only TPDO1 and RPDO1 are Automatically Set

Hi,
I'm testing canopen_402_driver on our motor. I use the same PDO config as in https://github.com/ipa-cmh/trinamic_pd42_can/blob/master/config/bus.yml
I listened to CAN communication using candump. For the device initialization phase, the logs look as expected.

[device_manager_node-1] [INFO] [1660612596.827323496] [wheel_left]: Intitialising Device and Objects
[device_manager_node-1] Initialised object : 6041  1616 RPDO: yes TPDO: no 
[device_manager_node-1] Initialised object : 6040  4 RPDO: no TPDO: yes 
[device_manager_node-1] Initialised object : 6061  1 RPDO: yes TPDO: no 
[device_manager_node-1] Initialised object : 6060  1 RPDO: no TPDO: yes 
[device_manager_node-1] Initialised object : 6502  109 RPDO: no TPDO: no 

But I only see TPDO1 and RPDO1 configured in CAN communication. I don't understand why TPDO2 and RPDO2 are skipped. When I call the init service, it works fine, but it shows that these objects do not have PDO mapping configured.

[device_manager_node-1] [INFO] [1660612706.510199404] [canopen_402_driver]: Init: Read State
[device_manager_node-1] [INFO] [1660612706.510269088] [canopen_402_driver]: Init: Enable
[device_manager_node-1] [INFO] [1660612706.517852496] [canopen_402_driver]: Fault reset
[device_manager_node-1] [INFO] [1660612706.597935800] [canopen_402_driver]: Init: Switch to homing
[device_manager_node-1] [INFO] [1660612706.617899756] [canopen_402_driver]: Init: Execute homing
[device_manager_node-1] [INFO] [1660612706.657942432] [canopen_402_driver]: Init: Switch no mode
[device_manager_node-1] Initialised object : 6041  38455 RPDO: yes TPDO: no 
[device_manager_node-1] Initialised object : 6040  31 RPDO: no TPDO: yes 
[device_manager_node-1] Initialised object : 6061  6 RPDO: yes TPDO: no 
[device_manager_node-1] Initialised object : 6060  6 RPDO: no TPDO: yes 
[device_manager_node-1] Initialised object : 6502  109 RPDO: no TPDO: no 
[device_manager_node-1] Initialised object : 60c1  0 RPDO: no TPDO: no 
[device_manager_node-1] Initialised object : 6098  1 RPDO: no TPDO: no 
[device_manager_node-1] Initialised object : 6071  0 RPDO: no TPDO: no 
[device_manager_node-1] Initialised object : 60ff  0 RPDO: no TPDO: no 
[device_manager_node-1] Initialised object : 607a  0 RPDO: no TPDO: no 

Any suggestions?
Thanks

WARNING:colcon.colcon_core.package_selection:ignoring unknown package 'ros_canopen' in --packages-select

Hello, @ipa-nhg @mathias-luedtke @JeremyZoss @gavanderhoorn @Briancbn

Describe the bug
A clear and concise description of what the bug is.
root@manager-desktop:~/ros2_canopen_ws# colcon build --packages-select ros_canopen
[2.291s] WARNING:colcon.colcon_core.package_selection:ignoring unknown package 'ros_canopen' in --packages-select

Summary: 0 packages finished [0.90s]

Logs
Add build or execution log for context.

Setup:

  • Device: Nvidia jetson nano(jetpack 4.6)
  • OS: arm64 ubuntu18.04
  • ROS-Distro: foxy-ros-base-l4t-r32.6.1 docker image
  • Branch/Commit:

Additional context
Add any other context about the problem here.

How can I install ros2_canopen?

Hello, Everyone

How can I install ros2_canopen?

Describe the bug
A clear and concise description of what the bug is.
root@manager-desktop:~/ros2_canopen_ws# colcon build --packages-select ros_canopen
[2.291s] WARNING:colcon.colcon_core.package_selection:ignoring unknown package 'ros_canopen' in --packages-select

Summary: 0 packages finished [0.90s]

Logs
Add build or execution log for context.

Setup:

Device: Nvidia jetson nano(jetpack 4.6)
OS: arm64 ubuntu18.04
ROS-Distro: foxy-ros-base-l4t-r32.6.1 docker image
Branch/Commit:

It requires a password for downloading ros2_canopen repository.
https://ros-industrial.github.io/ros2_canopen/installation.html#

Thank you.

Iron support

Hi @destogl,

We have problems running our tests on ROS iron.
Test log indicates the following:

build/canopen_ros2_controllers/Testing/20230606-0634/Test.xml: 2 tests, 0 errors, 1 failure, 0 skipped
- test_load_canopen_proxy_controller
  <<< failure message
    -- run_test.py: invoking following command in '/root/target_ws/build/canopen_ros2_controllers':
     - /root/target_ws/build/canopen_ros2_controllers/test_load_canopen_proxy_controller --gtest_output=xml:/root/target_ws/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml
    Running main() from gmock_main.cc
    [==========] Running 1 test from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 1 test from TestLoadCanopenProxyController
    [ RUN      ] TestLoadCanopenProxyController.load_controller
    [INFO] [1686033261.383490100] [resource_manager]: Loading hardware 'TestActuatorHardware' 
    unknown file: Failure
    C++ exception with description "According to the loaded plugin descriptions the class test_actuator with base class type hardware_interface::ActuatorInterface does not exist. Declared types are " thrown in the test body.
    [  FAILED  ] TestLoadCanopenProxyController.load_controller (10 ms)
    [----------] 1 test from TestLoadCanopenProxyController (10 ms total)
    
    [----------] Global test environment tear-down
    [==========] 1 test from 1 test suite ran. (10 ms total)
    [  PASSED  ] 0 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] TestLoadCanopenProxyController.load_controller
    
     1 FAILED TEST

It seems that something goes wrong with loading the TestActuator plugin?

Add ros2_control SystemInterface

Feature request
The CANopen stack should expose a ros2_control hardware interface, in order to make control of motion devices easier. Specifically, a SystemInterface could be interesting for enabling control of CANopen-based modular robot arms in ROS2.

The SystemInterface should be integrated into the URDF for example like this:

<ros2_control name=“CanopenSystemInterface" type="system">
  <hardware>
   <plugin>canopen_control/CanopenSystemInterface</plugin>
   <param name="bus_configuration">[bus.yml]</param>
   <param name="can_interface">can0</param>
   <param name="master_configuration">[master.dcf]</param>
   <param name="master_bin">[master.bin]</param>
  </hardware>
  <joint name="joint1">
   <command_interface name="position">
   </command_interface>
   <state_interface name="position"/>
  </joint>
  <joint name="joint2">
​    <command_interface name="position">
​    </command_interface>
    <state_interface name="position"/>
  </joint>
 </ros2_control>

Conventions:

  • joint names need to correspond to the name of a device indicated in bus.yml

Interpolated position mode

This is more of a question if the package supports it.
One of our applications has multiple CANopen motion drives connected over the CANBus.

  1. Would we be able to run the drives in Interpolated position mode? Basically send PVT messages at set frequency.
    The table below from the documentation does not seem to list this mode.
    image

  2. Can one of the drives be programmed as the SYNC generator.
    This would be an eds or a config via an SDO.

  3. Does the service interface allow us to send data at a (high) frequency. We are looking at around 100Hz PVT data for 5-6 drives.

Thank you

Install Lely CANopen using PPA

Hi,
It looks like some of the compilation warnings are caused by Lely CANopen (see #35). Is it necessary for us to compile and install Lely CANopen from source? Unlike other compilation warnings, Lely CANopen warnings are treated as Errors. This increases the execution time of ’colcon build’ each time. Since Lely CANopen provides Ubuntu PPA, how about installing from PPA?

Crashing of the CAN stack when starting

Describe the bug
Crash when starting CAN Stack with message *** stack smashing detected ***: terminated coming from Lely library.

To Reproduce
Compile the library and try executing tests:

ros2 launch canopen_tests proxy_setup.launch.py

The device_container_node crashes.

Expected behavior
Test is running.

Logs

Log output when `device_container_node` is started

[device_container_node-3] [INFO] [1673872790.262295921] [device_container_node]: Starting Device Container with:
[device_container_node-3] [INFO] [1673872790.262362542] [device_container_node]:         master_config~/install/canopen_tests/share/canopen_tests/config/simple/master.dcf
[device_container_node-3] [INFO] [1673872790.262371437] [device_container_node]:         bus_config ~/install/canopen_tests/share/canopen_tests/config/simple/bus.yml
[device_container_node-3] [INFO] [1673872790.262376459] [device_container_node]:         can_interface_name vcan0
[device_container_node-3] [INFO] [1673872790.262662980] [device_container_node]: Loading Master Configuration.
[device_container_node-3] [INFO] [1673872790.263034842] [device_container_node]: Load Library: ~/install/canopen_master_driver/lib/libmaster_driver.so
[device_container_node-3] [INFO] [1673872790.264850072] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterDriver>
[device_container_node-3] [INFO] [1673872790.264871301] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterDriver>
[device_container_node-3] [INFO] [1673872790.266947625] [master]: NodeCanopenBasicMaster
[device_container_node-3] [INFO] [1673872790.266965010] [device_container_node]: Load master component.
[device_container_node-3] [INFO] [1673872790.266976077] [device_container_node]: Added /master to executor
[device_container_node-3] NMT: entering reset application state
[device_container_node-3] NMT: entering reset communication state
[device_container_node-3] NMT: running as master
[device_container_node-3] NMT: entering pre-operational state
[device_container_node-3] NMT: entering operational state
[device_container_node-3] [INFO] [1673872790.282344573] [device_container_node]: Loading Driver Configuration.
[device_container_node-3] [INFO] [1673872790.282440818] [device_container_node]: Found device proxy_device_1 with driver ros2_canopen::ProxyDriver
[device_container_node-3] [INFO] [1673872790.282656855] [device_container_node]: Load Library: ~/install/canopen_proxy_driver/lib/libproxy_driver.so
[device_container_node-3] [INFO] [1673872790.284837326] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::ProxyDriver>
[device_container_node-3] [INFO] [1673872790.285255220] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::ProxyDriver>
[device_container_node-3] [INFO] [1673872790.287974143] [device_container_node]: Load driver component.
[device_container_node-3] [INFO] [1673872790.287999879] [device_container_node]: Added /proxy_device_1 to executor
[device_container_node-3] [WARN] [1673872790.290844524] [proxy_device_1]: Wait for device to boot.
[basic_slave_node-1] [INFO] [1673872790.492583917] [slave_node_1]: Reaching inactive state.
[basic_slave_node-2] [INFO] [1673872790.492810823] [slave_node_2]: Reaching inactive state.
[INFO] [launch.user]: node 'basic_slave_node' reached the 'inactive' state, 'activating'.
[INFO] [launch.user]: node 'basic_slave_node' reached the 'inactive' state, 'activating'.
[basic_slave_node-1] [INFO] [1673872790.497149244] [slave_node_1]: Reaching active state.
[basic_slave_node-2] [INFO] [1673872790.497246012] [slave_node_2]: Reaching active state.
[basic_slave_node-2] NMT: entering reset application state
[basic_slave_node-2] NMT: entering reset communication state
[basic_slave_node-1] NMT: entering reset application state
[basic_slave_node-1] NMT: entering reset communication state
[basic_slave_node-1] NMT: running as slave
[basic_slave_node-1] NMT: entering pre-operational state
[basic_slave_node-2] NMT: running as slave
[basic_slave_node-2] NMT: entering pre-operational state
[basic_slave_node-2] NMT: entering operational state
[basic_slave_node-1] NMT: entering operational state
[basic_slave_node-1] [INFO] [1673872790.500482212] [slave_node_1]: Created slave for node_id 2.
[basic_slave_node-2] [INFO] [1673872790.500412674] [slave_node_2]: Created slave for node_id 3.
[device_container_node-3] *** stack smashing detected ***: terminated
[ERROR] [device_container_node-3]: process has died [pid 14646, exit code -6, cmd '~/install/canopen_core/lib/canopen_core/device_container_node --ros-args -r __node:=device_container_node -r __ns:=/ --params-file /tmp/launch_params_q4h1hwd1 --params-file /tmp/launch_params_mq6kqa1y --params-file /tmp/launch_params_c8iopeq3 --params-file /tmp/launch_params_e_t4nl1g'].

Setup:

  • Simualted slave
  • System: Docker with Ubuntu 22.04
  • ROS: Rolling (latest sync)
  • Branch/commit: master (e00939b)

Segmentation fault (Address not mapped to object [0x398])

Describe the bug
I uninstalled all the unnecessary components on the control launch, but it still gave me this error and I couldn't get rid of it.

Logs
[ros2_control_node-1] [INFO] [1683709909.075067756] [Cia402System]: Number of registered drivers: '1'
[ros2_control_node-1] [INFO] [1683709909.075209664] [Cia402System]:
[ros2_control_node-1] Registered driver:
[ros2_control_node-1] name: 'kinco_node_1'
[ros2_control_node-1] node_id: '10'
[ros2_control_node-1] [INFO] [1683709909.075234619] [device_container]: Initialisation successful.
[ros2_control_node-1] [INFO] [1683709909.075468356] [resource_manager]: Successful 'configure' of hardware 'canopen_test_system'
[ros2_control_node-1] [INFO] [1683709909.075514248] [resource_manager]: 'activate' hardware 'canopen_test_system'
[ros2_control_node-1] [INFO] [1683709909.075530046] [resource_manager]: Successful 'activate' of hardware 'canopen_test_system'
[ros2_control_node-1] [INFO] [1683709909.078441846] [kinco_node_1]: Starting EMCY Listener
[ros2_control_node-1] [INFO] [1683709909.086642043] [controller_manager]: update rate is 10 Hz
[ros2_control_node-1] [WARN] [1683709909.086912809] [controller_manager]: Could not enable FIFO RT scheduling policy
[ros2_control_node-1] [ERROR] [1683709909.087055454] [kinco_node_1]: ---------------------------------打印代码执行----------------------------------
[ros2_control_node-1] Stack trace (most recent call last) in thread 41744:
[ros2_control_node-1] [INFO] [1683709909.088014763] [kinco_node_1]: Starting RPDO Listener
[ros2_control_node-1] #11 Object "", at 0xffffffffffffffff, in
[ros2_control_node-1] #10 Source "../sysdeps/unix/sysv/linux/x86_64/clone3.S", line 81, in __clone3 [0x7f02eb3749ff]
[ros2_control_node-1] #9 Source "./nptl/pthread_create.c", line 442, in start_thread [0x7f02eb2e2b42]
[ros2_control_node-1] #8 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7f02eb5742b2, in
[ros2_control_node-1] #7 Source "./src/ros2_control_node.cpp", line 80, in operator() [0x561a1b681810]
[ros2_control_node-1] #6 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7f02eb17a401, in hardware_interface::ResourceManager::read(rclcpp::Time const&, rclcpp::Duration const&)
[ros2_control_node-1] #5 Object "/opt/ros/humble/lib/libhardware_interface.so", at 0x7f02eb1a17c4, in hardware_interface::System::read(rclcpp::Time const&, rclcpp::Duration const&)
[ros2_control_node-1] #4 Object "/home/test/Desktop/controller/demo5/install/canopen_ros2_control/lib/libcanopen_ros2_control.so", at 0x7f02e42e2efe, in canopen_ros2_control::Cia402System::read(rclcpp::Time const&, rclcpp::Duration const&)
[ros2_control_node-1] #3 Object "/home/test/Desktop/controller/demo5/install/canopen_ros2_control/lib/libcanopen_ros2_control.so", at 0x7f02e42e4965, in ros2_canopen::Cia402Driver::get_position()
[ros2_control_node-1] #2 Object "/home/test/Desktop/controller/demo5/install/canopen_ros2_control/lib/libcanopen_ros2_control.so", at 0x7f02e42e4ca7, in std::__shared_ptr_access<ros2_canopen::node_interfaces::NodeCanopen402Driverrclcpp::Node, (__gnu_cxx::_Lock_policy)2, false, false>::operator->() const
[ros2_control_node-1] #1 Object "/home/test/Desktop/controller/demo5/install/canopen_ros2_control/lib/libcanopen_ros2_control.so", at 0x7f02e42e5453, in std::__shared_ptr_access<ros2_canopen::node_interfaces::NodeCanopen402Driverrclcpp::Node, (__gnu_cxx::_Lock_policy)2, false, false>::_M_get() const
[ros2_control_node-1] #0 Object "/home/test/Desktop/controller/demo5/install/canopen_ros2_control/lib/libcanopen_ros2_control.so", at 0x7f02e42e5d80, in std::__shared_ptr<ros2_canopen::node_interfaces::NodeCanopen402Driverrclcpp::Node, (__gnu_cxx::_Lock_policy)2>::get() const
[ros2_control_node-1] Segmentation fault (Address not mapped to object [0x398])
[ERROR] [ros2_control_node-1]: process has died [pid 41684, exit code -11, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_rh1l5w25 --params-file /home/test/Desktop/controller/demo5/install/canopen_ros2_control/share/canopen_ros2_control/config/cia402_ros2_control.yaml'].
[spawner-3] [INFO] [1683709911.295526322] [spawner_cia402_device_1_controller]: Waiting for '/controller_manager' node to exist
[spawner-3] [INFO] [1683709913.315490602] [spawner_cia402_device_1_controller]: Waiting for '/controller_manager' node to exist

Setup:

  • Device: can0
  • OS: ubuntu22.04
  • ROS-Distro: master
  • Branch/Commit:

Additional context
Add any other context about the problem here.

1 package failed: lely_core_libraries

Describe the bug
A clear and concise description of what the bug is.

Failed to build
-###########################################################################
error: invalid command 'bdist_wheel'
make[6]: *** [python-bdist_wheel] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [upstr_lely_core_libraries-prefix/src/upstr_lely_core_libraries-stamp/upstr_lely_core_libraries-build] Error 2
make[1]: *** [CMakeFiles/upstr_lely_core_libraries.dir/all] Error 2
make: *** [all] Error 2

Failed <<< lely_core_libraries [4min 21s, exited with code 2]
Aborted <<< topic_service_action_rclcpp_example [2min 42s]

Summary: 14 packages finished [4min 35s]
1 package failed: lely_core_libraries
1 package aborted: topic_service_action_rclcpp_example
8 packages had stderr output: canopen_utils lely_core_libraries logging_rclpy_example my_first_ros_rclpy_pkg ros2env tf2_rclpy_example time_rclpy_example topic_service_action_rclpy_example
5 packages not processed
###########################################################################

To Reproduce
Steps to reproduce the behavior

Expected behavior
A clear and concise description of what you expected to happen.

Success to build

Logs

Setup:

  • Device: Nvidia jetson nano
  • OS: Jetson OS(arm64 ubuntu 18.04)
  • Distro: [e.g. stock browser, safari]
  • Branch/Commit:

Additional context
Add any other context about the problem here.

Can you tell me how to resolve this build error?

Thank you.

Industrial CI has errors

---
Finished <<< lely_core_libraries [52.9s]
Starting >>> canopen_core
--- stderr: canopen_core
CMake Error at CMakeLists.txt:27 (find_package):
  By not providing "Findrclcpp_lifecycle.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "rclcpp_lifecycle", but CMake did not find one.

  Could not find a package configuration file provided by "rclcpp_lifecycle"
  with any of the following names:

    rclcpp_lifecycleConfig.cmake
    rclcpp_lifecycle-config.cmake

  Add the installation prefix of "rclcpp_lifecycle" to CMAKE_PREFIX_PATH or
  set "rclcpp_lifecycle_DIR" to a directory containing one of the above
  files.  If "rclcpp_lifecycle" provides a separate development package or
  SDK, be sure it has been installed.


---
Failed   <<< canopen_core [1.87s, exited with code 1]

Summary: 2 packages finished [54.9s]
  1 package failed: canopen_core
  2 packages had stderr output: canopen_core lely_core_libraries
  4 packages not processed
'build_target_workspace' returned with code '1' after 0 min 55 sec

Stack smashing detected

Describe the bug
Similar to #86 - the master crashes when trying to bring up a slave node with the error:
[device_container_node-1] *** stack smashing detected ***: terminated

To Reproduce

  • Add heartbeat_producer: 500 to either of the nodes in canopen_tests/config/simple/bus.yml
  • Compile
  • ros2 launch canopen_tests proxy_setup.launch.py

Expected behavior
All nodes brought up and producing heartbeats.

Logs

[INFO] [launch]: All log files can be found below /root/.ros/log/2023-04-26-10-41-28-417737-feather-14143
[INFO] [launch]: Default logging verbosity is set to INFO
/opt/underlay_ws/install/canopen_tests/share/canopen_tests/config/proxy_write_sdo/master.dcf
[INFO] [launch.user]: /opt/underlay_ws/install/canopen_tests/share/canopen_tests/config/simple/bus.yml
[INFO] [launch.user]: /opt/underlay_ws/install/canopen_tests/share/canopen_tests/config/simple/master.dcf
[INFO] [launch.user]: 
[INFO] [launch.user]: vcan0
[INFO] [basic_slave_node-1]: process started with pid [14160]
[INFO] [basic_slave_node-2]: process started with pid [14162]
[INFO] [device_container_node-3]: process started with pid [14164]
[device_container_node-3] [INFO] [1682505689.137535473] [device_container_node]: Starting Device Container with:
[device_container_node-3] [INFO] [1682505689.137878680] [device_container_node]: 	 master_config /opt/underlay_ws/install/canopen_tests/share/canopen_tests/config/simple/master.dcf
[device_container_node-3] [INFO] [1682505689.137910592] [device_container_node]: 	 bus_config /opt/underlay_ws/install/canopen_tests/share/canopen_tests/config/simple/bus.yml
[device_container_node-3] [INFO] [1682505689.137920857] [device_container_node]: 	 can_interface_name vcan0
[device_container_node-3] [INFO] [1682505689.138356329] [device_container_node]: Loading Master Configuration.
[device_container_node-3] [INFO] [1682505689.138907891] [device_container_node]: Load Library: /opt/underlay_ws/install/canopen_master_driver/lib/libmaster_driver.so
[device_container_node-3] [INFO] [1682505689.142654231] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterDriver>
[device_container_node-3] [INFO] [1682505689.142698212] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterDriver>
[device_container_node-3] [INFO] [1682505689.150617656] [master]: NodeCanopenBasicMaster
[device_container_node-3] [INFO] [1682505689.150663132] [device_container_node]: Load master component.
[device_container_node-3] [INFO] [1682505689.150692411] [device_container_node]: Added /master to executor
[device_container_node-3] NMT: entering reset application state
[device_container_node-3] NMT: entering reset communication state
[device_container_node-3] NMT: running as master
[device_container_node-3] NMT: entering pre-operational state
[device_container_node-3] NMT: entering operational state
[device_container_node-3] [INFO] [1682505689.188611419] [device_container_node]: Loading Driver Configuration.
[device_container_node-3] [INFO] [1682505689.188690707] [device_container_node]: Found device proxy_device_1 with driver ros2_canopen::ProxyDriver
[device_container_node-3] [INFO] [1682505689.189064212] [device_container_node]: Load Library: /opt/underlay_ws/install/canopen_proxy_driver/lib/libproxy_driver.so
[device_container_node-3] [INFO] [1682505689.195532526] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::ProxyDriver>
[device_container_node-3] [INFO] [1682505689.195581692] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::ProxyDriver>
[device_container_node-3] [INFO] [1682505689.205458349] [device_container_node]: Load driver component.
[device_container_node-3] [INFO] [1682505689.205518158] [device_container_node]: Added /proxy_device_1 to executor
[device_container_node-3] [WARN] [1682505689.214935944] [proxy_device_1]: Wait for device to boot.
[basic_slave_node-1] [INFO] [1682505689.299788677] [slave_node_1]: Reaching inactive state.
[INFO] [launch.user]: node 'basic_slave_node' reached the 'inactive' state, 'activating'.
[INFO] [launch.user]: node 'basic_slave_node' reached the 'inactive' state, 'activating'.
[basic_slave_node-2] [INFO] [1682505689.301485169] [slave_node_2]: Reaching inactive state.
[basic_slave_node-1] [INFO] [1682505689.311529428] [slave_node_1]: Reaching active state.
[basic_slave_node-2] [INFO] [1682505689.311751743] [slave_node_2]: Reaching active state.
[basic_slave_node-1] NMT: entering reset application state
[basic_slave_node-1] NMT: entering reset communication state
[basic_slave_node-2] NMT: entering reset application state
[basic_slave_node-2] NMT: entering reset communication state
[basic_slave_node-1] NMT: running as slave
[basic_slave_node-1] NMT: entering pre-operational state
[basic_slave_node-1] NMT: entering operational state
[basic_slave_node-1] [INFO] [1682505689.330502406] [slave_node_1]: Created slave for node_id 2.
[basic_slave_node-2] NMT: running as slave
[basic_slave_node-2] NMT: entering pre-operational state
[basic_slave_node-2] NMT: entering operational state
[basic_slave_node-2] [INFO] [1682505689.330392091] [slave_node_2]: Created slave for node_id 3.
[device_container_node-3] *** stack smashing detected ***: terminated
[ERROR] [device_container_node-3]: process has died [pid 14164, exit code -6, cmd '/opt/underlay_ws/install/canopen_core/lib/canopen_core/device_container_node --ros-args -r __node:=device_container_node -r __ns:=/ --params-file /tmp/launch_params_yzyx9hqq --params-file /tmp/launch_params_9w2ul1ja --params-file /tmp/launch_params_5gzf2tkq --params-file /tmp/launch_params_cr_9hrus'].

Setup:

  • Device:
  • OS: Ubuntu 22.04
  • ROS-Distro: rolling
  • Branch/Commit: master

Additional context
N/A

There are a few lines executed in the `update`-loop that are rather part of the activation procedure

Resetting and starting of nodes is rather a part of the activation process, so it shouldn't be done/checked all the time in the update loop. Changing this would lead to clearer code and behavior, but it has some strong drawbacks:

  1. Needs error management inside HW interface. ros2_control supports that (see this PR), but then also all the controllers get deactivated – and they have to manually activated again.
  2. The first point clearly disturbs the prototyping and makes it much harder is someone doesn't understand all the internal mechanisms from ros2_control.
  3. There is currently not possibility to automatically re-activate hardware and controllers which probably is desired scenario is many applications to handle bus errors better, e.g., bus errors caused by use of non-realtime kernel.

// reset node nmt
if (it->second.nmt_state.reset_command())
{
it->second.nmt_state.reset_fbk = static_cast<double>(proxy_driver->reset_node_nmt_command());
}
// start nmt
if (it->second.nmt_state.start_command())
{
it->second.nmt_state.start_fbk = static_cast<double>(proxy_driver->start_node_nmt_command());
}

P.S. I will also extend this in the future with possible solutions when different options are tested in real-world scenarios.

Master branch not building in ROS2 Humble

Describe the bug
I cloned the master branch of this repo. Executed rodep install and tried to colcon build and get the following error.

I thought this branch builds fine in Humble. Is this not correct? Am I missing something?

See below for the log

Logs

jerome@jjustin:~/test_ws$ colcon build
Starting >>> canopen_interfaces
Starting >>> lely_core_libraries
Finished <<< canopen_interfaces [7.96s]                                      
Starting >>> canopen_utils
--- stderr: canopen_utils                                                    
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< canopen_utils [0.90s]
--- stderr: lely_core_libraries                                
Cloning into 'upstr_lely_core_libraries'...
HEAD is now at ac31cd5c release v2.3.1
configure.ac:17: warning: The macro `AC_PROG_CC_STDC' is obsolete.
configure.ac:17: You should run autoupdate.
./lib/autoconf/c.m4:1666: AC_PROG_CC_STDC is expanded from...
configure.ac:17: the top level
configure.ac:81: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_pthread.m4:88: AX_PTHREAD is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:81: the top level
configure.ac:434: warning: AC_CHECK_HEADERS($ixxat_header): you should use literals
./lib/autoconf/headers.m4:217: AC_CHECK_HEADERS is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
configure.ac:434: the top level
configure.ac:17: installing './compile'
configure.ac:6: installing './config.guess'
configure.ac:6: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
configure.ac:606: installing './tap-driver.sh'
src/can/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
libtool: warning: relinking 'liblely-tap.la'
libtool: warning: relinking 'liblely-util.la'
libtool: warning: relinking 'liblely-can.la'
libtool: warning: relinking 'liblely-co.la'
libtool: warning: relinking 'liblely-io.la'
libtool: warning: relinking 'liblely-ev.la'
libtool: warning: relinking 'liblely-io2.la'
libtool: warning: relinking 'liblely-coapp.la'
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< lely_core_libraries [26.2s]
Starting >>> canopen_core
Starting >>> canopen_fake_slaves
--- stderr: canopen_fake_slaves                                        
In file included from /home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/basic_slave.hpp:14,
                 from /home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/src/basic_slave.cpp:2:
/home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/base_slave.hpp: In member function ‘virtual rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn ros2_canopen::BaseSlave::on_shutdown(const rclcpp_lifecycle::State&)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/base_slave.hpp:83:9: warning: no return statement in function returning non-void [-Wreturn-type]
   83 |         }
      |         ^
In file included from /home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/cia402_slave.hpp:17,
                 from /home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/src/cia402_slave.cpp:2:
/home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/base_slave.hpp: In member function ‘virtual rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn ros2_canopen::BaseSlave::on_shutdown(const rclcpp_lifecycle::State&)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_fake_slaves/include/canopen_fake_slaves/base_slave.hpp:83:9: warning: no return statement in function returning non-void [-Wreturn-type]
   83 |         }
      |         ^
---
Finished <<< canopen_fake_slaves [5.64s]
--- stderr: canopen_core                                 
In file included from /home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container.cpp:16:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp: In member function ‘std::vector<short unsigned int> ros2_canopen::DeviceContainer::get_ids_of_drivers_with_type(std::string)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp:231:22: warning: unused variable ‘count’ [-Wunused-variable]
  231 |             uint32_t count = this->config_->get_all_devices(devices);
      |                      ^~~~~
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp: In member function ‘std::string ros2_canopen::DeviceContainer::get_driver_type(uint16_t)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp:260:22: warning: unused variable ‘count’ [-Wunused-variable]
  260 |             uint32_t count = this->config_->get_all_devices(devices);
      |                      ^~~~~
/home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container.cpp: In member function ‘virtual bool ros2_canopen::DeviceContainer::load_master()’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container.cpp:199:14: warning: unused variable ‘count’ [-Wunused-variable]
  199 |     uint32_t count = this->config_->get_all_devices(devices);
      |              ^~~~~
/home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container.cpp: In member function ‘virtual bool ros2_canopen::DeviceContainer::load_drivers()’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container.cpp:251:14: warning: unused variable ‘count’ [-Wunused-variable]
  251 |     uint32_t count = this->config_->get_all_devices(devices);
      |              ^~~~~
In file included from /home/jerome/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:16:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp: In member function ‘std::vector<short unsigned int> ros2_canopen::DeviceContainer::get_ids_of_drivers_with_type(std::string)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp:231:22: warning: unused variable ‘count’ [-Wunused-variable]
  231 |             uint32_t count = this->config_->get_all_devices(devices);
      |                      ^~~~~
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp: In member function ‘std::string ros2_canopen::DeviceContainer::get_driver_type(uint16_t)’:
/home/jerome/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container.hpp:260:22: warning: unused variable ‘count’ [-Wunused-variable]
  260 |             uint32_t count = this->config_->get_all_devices(devices);
      |                      ^~~~~
---
Finished <<< canopen_core [20.8s]
Starting >>> canopen_base_driver
Starting >>> canopen_master_driver
--- stderr: canopen_base_driver                                                
In file included from /home/jerome/test_ws/src/ros2_canopen/canopen_base_driver/include/canopen_base_driver/node_interfaces/node_canopen_base_driver.hpp:5,
                 from /home/jerome/test_ws/src/ros2_canopen/canopen_base_driver/src/node_interfaces/node_canopen_base_driver.cpp:1:
/home/jerome/test_ws/src/ros2_canopen/canopen_base_driver/include/canopen_base_driver/lely_driver_bridge.hpp: In member function ‘bool ros2_canopen::LelyDriverBridge::wait_for_boot()’:
/home/jerome/test_ws/src/ros2_canopen/canopen_base_driver/include/canopen_base_driver/lely_driver_bridge.hpp:316:5: warning: control reaches end of non-void function [-Wreturn-type]
  316 |     }
      |     ^
---
Finished <<< canopen_base_driver [15.2s]
Starting >>> canopen_proxy_driver
--- stderr: canopen_master_driver          
/home/jerome/test_ws/src/ros2_canopen/canopen_master_driver/test/test_node_canopen_basic_master.cpp: In destructor ‘RclCppFixture::~RclCppFixture()’:
/home/jerome/test_ws/src/ros2_canopen/canopen_master_driver/test/test_node_canopen_basic_master.cpp:17:5: warning: deleting object of polymorphic class type ‘ros2_canopen::node_interfaces::NodeCanopenBasicMaster<rclcpp::Node>’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
   17 |     delete(interface);
      |     ^~~~~~~~~~~~~~~~~
---
Finished <<< canopen_master_driver [18.3s]
Finished <<< canopen_proxy_driver [19.3s]                             
Starting >>> canopen_402_driver
Finished <<< canopen_402_driver [20.3s]                             
Starting >>> canopen_tests
Starting >>> canopen
Starting >>> canopen_ros2_controllers
Finished <<< canopen [0.56s]                                             
Finished <<< canopen_tests [2.27s]                                          
Starting >>> canopen_ros2_control
Finished <<< canopen_ros2_control [10.7s]    
Finished <<< canopen_ros2_controllers [24.8s]                             

Summary: 13 packages finished [2min 7s]
  6 packages had stderr output: canopen_base_driver canopen_core canopen_fake_slaves canopen_master_driver canopen_utils lely_core_libraries

Setup:

  • OS: Ubuntu 22.04
  • ROS-Distro: Humble
  • Branch/Commit: Master

canopen_core: demand_set_master exceptions are not caught

Describe the bug
The demand_set_master function is called by drivers to have the master object set during start-up of the node.
This function uses a ros service to ask the container to set the master object. This seems to fail sometimes probably due to
rmw issues. In case of failure, the driver will exit.

Expected behavior
This failure should not directly lead to exit. There should be a bunch of retries before throwing and exiting.

yaml-cpp/yaml.h not found

Problem:
When yaml-cpp/yaml.h is included in a header file it is not found by the compiler on specific machines.
This problem does not occur in CI builds.

what(): CanController: Operation not permitted

HI there,
I am trying to use the ros2_canopen package in order to make the my configuration package on my PC (ubuntu 20.04 with ros galactic).
However, after each point in the guide (https://ros-industrial.github.io/ros2_canopen/) when I run the launch script, i get the following error:

[INFO] [launch]: All log files can be found below /home/drfly/.ros/log/2022-06-13-15-32-43-174646-dti-12659-717498
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [device_manager_node-1]: process started with pid [717500]
[device_manager_node-1] [INFO] [1655127163.274893720] [device_manager_node]: Found 1 devices
[device_manager_node-1] [INFO] [1655127163.275023470] [device_manager_node]: Found Master.
[device_manager_node-1] [INFO] [1655127163.275188521] [device_manager_node]: Load Library: /home/drfly/dev_ws/install/canopen_core/lib/libmaster_node.so
[device_manager_node-1] [INFO] [1655127163.275655526] [device_manager_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterNode>
[device_manager_node-1] [INFO] [1655127163.275683741] [device_manager_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::MasterNode>
[device_manager_node-1] [INFO] [1655127163.277072980] [device_manager_node]: Added node of type ros2_canopen::MasterNode with name "master" for node_id 1 to executor.
[device_manager_node-1] [INFO] [1655127163.277106006] [device_manager_node]: Adding master with node id 1
[device_manager_node-1] terminate called after throwing an instance of 'std::system_error'
[device_manager_node-1]   what():  CanController: Operation not permitted
[ERROR] [device_manager_node-1]: process has died [pid 717500, exit code -6, cmd '/home/drfly/dev_ws/install/canopen_core/lib/canopen_core/device_manager_node --ros-args -r __node:=device_manager_node -r __ns:=/ --params-file /tmp/launch_params_e5ilwpr5'].

attached my configuration package

everest.zip

Device Container Tests often fail in CI

Describe the bug
The device container tests often fail when running in CI.

Expected behavior
Tests should not fail due to environment which they are run in.

Implement CiA 301 Multiple Device Profiles

Is your feature request related to a problem? Please describe.

The ROS2 CANopen Stack supports only a single CiA 301 device profile for each node, with CiA 402 being the current reference implementation, allowing for motion control of a single axle.

Many CiA 402 compliant motor controller drivers though, allow for control of more than a single axle, by using the CiA 301's Multiple Device Modules. The ability to control multiple axles from a single driver is of particular interest to the mobile robotics community, as it allows lower costs through hardware consolidation and reduces synchronization issues between independent drivers.

Implicitly, the existing ROS2 CANopen stack implements all functionality in the zeroth device profile segment, indices 6000h-67FFh.
However, there are up to 8 segments available (0-7), with the object indices of these subsequent device profile segments offset each by 800h. Listed below is an excerpt from the CiA 301 standard.

Screenshot 2022-10-25 at 16-10-11 301_v04000204 - 301_canopen pdf

Listed below here is an excerpt from the CiA 402 standard, showing how both CiA 402 motor control profiles and CiA 401 I/O profiles can both be implemented and addressed on a single node.

Screenshot 2022-10-25 at 15-44-12 Inbox - ilter savas@akara ai - Akara Robotics Ltd Mail

Both these specifications can be downloaded in full at https://www.can-cia.org/groups/specations/

The ROS2 CANopen Stack currently hardcodes the object indices for addressing the CiA 402 profile, as shown below.

const uint16_t status_word_entry_index = 0x6041;
const uint16_t control_word_entry_index = 0x6040;
const uint16_t op_mode_display_index = 0x6061;
const uint16_t op_mode_index = 0x6060;
const uint16_t supported_drive_modes_index = 0x6502;

typedef ModeForwardHelper<MotorBase::Profiled_Velocity, int32_t, CODataTypes::COData32, 0x60FF, 0, 0> ProfiledVelocityMode;
typedef ModeForwardHelper<MotorBase::Profiled_Torque, int16_t, CODataTypes::COData16, 0x6071, 0, 0> ProfiledTorqueMode;
typedef ModeForwardHelper<MotorBase::Cyclic_Synchronous_Position, int32_t, CODataTypes::COData32, 0x607A, 0, 0> CyclicSynchronousPositionMode;
typedef ModeForwardHelper<MotorBase::Cyclic_Synchronous_Velocity, int32_t, CODataTypes::COData32, 0x60FF, 0, 0> CyclicSynchronousVelocityMode;
typedef ModeForwardHelper<MotorBase::Cyclic_Synchronous_Torque, int16_t, CODataTypes::COData16, 0x6071, 0, 0> CyclicSynchronousTorqueMode;
typedef ModeForwardHelper<MotorBase::Velocity, int16_t, CODataTypes::COData16, 0x6042, 0, (1 << Command402::CW_Operation_mode_specific0) | (1 << Command402::CW_Operation_mode_specific1) | (1 << Command402::CW_Operation_mode_specific2)> VelocityMode;
typedef ModeForwardHelper<MotorBase::Interpolated_Position, int32_t, CODataTypes::COData32, 0x60C1, 0x01, (1 << Command402::CW_Operation_mode_specific0)> InterpolatedPositionMode;

This makes it impossible to address device profiles in different segments.

Describe the solution you'd like
Instead of hardcoding the object indices, the base indices can be mapped to any device profile segment by Index + (800h * X), where X is the device profile segment number (0-7).

RPDOs assume 32 bit data

Describe the bug
RPDOs referring to 32 bit objects work properly (i.e. this is what is is the test suite).
RPDOs referring to 16 bit objects will cause the device container node to crash.

To Reproduce
Change the RPDO in the example to use 16 bit objects:

  1. Edit canopen_tests/config/simple/simple.eds
    a. Change line 260 to refer to 16 bits: 1=40010010
    b. Change line 270 to make object 4001 a uint16: DataType=0x0006
  2. Compile, and run the example: ros2 launch canopen_tests proxy_setup.launch.py
  3. Send a CAN message to the PDO in question: cansend vcan0 182#0000
  4. Crash. Log below.

Expected behavior
16 bit object should be updated and ROS message sent to the appropriate topic.

Logs

[device_container_node-3] [INFO] [1683419857.881505138] [proxy_device_2]: Driver booted and ready.
[device_container_node-3] [INFO] [1683419857.883477874] [proxy_device_2]: Starting EMCY Listener
[device_container_node-3] [INFO] [1683419857.884723793] [proxy_device_2]: Starting RPDO Listener
[device_container_node-3] terminate called after throwing an instance of 'lely::canopen::SdoError'
[device_container_node-3]   what():  RpdoRead:02:4001:00: General error (08000000): General error
[ERROR] [device_container_node-3]: process has died [pid 243640, exit code -6, cmd '/home/james/zio/install/canopen_core/lib/canopen_core/device_container_node --ros-args -r __node:=device_container_node -r __ns:=/ --params-file /tmp/launch_params_4gbhgr61 --params-file /tmp/launch_params_7kh1ndm4 --params-file /tmp/launch_params_ozlm3wi9 --params-file /tmp/launch_params_zm6zw54t'].

Setup:

  • Device: x86
  • OS: Ubuntu 22.04
  • ROS-Distro: rolling
  • Branch/Commit: master

Segmentation Fault after driver activated

Describe the bug
Hi,

I have a custom driver that I have written inheriting the proxy driver. When I launch the my canopen configuration everything seems to work fine. Then when I configure and then activate it, it say that the driver booted. However, after that the software crashes. See below log.

I am not sure if I am missing something or if this is a bug. Any help would be appreciated!

Logs

jerome@jjustin:~/gh_ws$ ros2 launch groundhog_canopen hetronic_lifecycle_setup.launch.py 
[INFO] [launch]: All log files can be found below /home/jerome/.ros/log/2023-05-04-16-18-52-337749-jjustin-141855
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [launch.user]: /home/jerome/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/bus.yml
[INFO] [launch.user]: /home/jerome/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/master.dcf
[INFO] [launch.user]: /home/jerome/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/master.bin
[INFO] [launch.user]: can0
[INFO] [device_container_node-1]: process started with pid [141867]
[device_container_node-1] [INFO] [1683181132.461812327] [device_container_node]: Starting Device Container with:
[device_container_node-1] [INFO] [1683181132.461968434] [device_container_node]:         master_config /home/jerome/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/master.dcf
[device_container_node-1] [INFO] [1683181132.461980390] [device_container_node]:         bus_config /home/jerome/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/bus.yml
[device_container_node-1] [INFO] [1683181132.461988993] [device_container_node]:         can_interface_name can0
[device_container_node-1] [INFO] [1683181132.462514468] [device_container_node]: Loading Master Configuration.
[device_container_node-1] [INFO] [1683181132.463186408] [device_container_node]: Load Library: /home/jerome/gh_ws/install/canopen_master_driver/lib/liblifecycle_master_driver.so
[device_container_node-1] [INFO] [1683181132.465420160] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleMasterDriver>
[device_container_node-1] [INFO] [1683181132.465477073] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleMasterDriver>
[device_container_node-1] [INFO] [1683181132.470055615] [master]: NodeCanopenBasicMaster
[device_container_node-1] [INFO] [1683181132.470286658] [device_container_node]: Load master component.
[device_container_node-1] [INFO] [1683181132.470374402] [device_container_node]: Added /master to executor
[device_container_node-1] [INFO] [1683181132.472936289] [device_container_node]: Loading Driver Configuration.
[device_container_node-1] [INFO] [1683181132.473021459] [device_container_node]: Found device hetronic_rc with driver ros2_hetronic::LifecycleHetronicDriver
[device_container_node-1] [INFO] [1683181132.473220670] [device_container_node]: Load Library: /home/jerome/gh_ws/install/ros2_hetronic_driver/lib/liblifecycle_hetronic_driver.so
[device_container_node-1] [INFO] [1683181132.477058718] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_hetronic::LifecycleHetronicDriver>
[device_container_node-1] [INFO] [1683181132.477105099] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_hetronic::LifecycleHetronicDriver>
[device_container_node-1] [INFO] [1683181132.480066419] [device_container_node]: Load driver component.
[device_container_node-1] [INFO] [1683181132.480157456] [device_container_node]: Added /hetronic_rc to executor
[device_container_node-1] [INFO] [1683181132.481234850] [device_container_node]: Loading Manager Configuration.
[device_container_node-1] [INFO] [1683181132.484891380] [device_container_node]: Added /lifecycle_manager to executor
[device_container_node-1] [INFO] [1683181136.179801169] [lifecycle_manager]: Configuring for 2 devices.
[device_container_node-1] [INFO] [1683181136.180001900] [lifecycle_manager]: Found hetronic_rc (node_id=100)
[device_container_node-1] [INFO] [1683181136.182523906] [lifecycle_manager]: Found master (node_id=1)
[device_container_node-1] NMT: entering reset application state
[device_container_node-1] NMT: entering reset communication state
[device_container_node-1] NMT: running as master
[device_container_node-1] NMT: entering pre-operational state
[device_container_node-1] NMT: entering operational state
[device_container_node-1] [INFO] [1683181151.074156495] [hetronic_rc]: Driver booted and ready.
[device_container_node-1] [INFO] [1683181151.074540619] [hetronic_rc]: Starting RPDO Listener
[ERROR] [device_container_node-1]: process has died [pid 141867, exit code -11, cmd '/home/jerome/gh_ws/install/canopen_core/lib/canopen_core/device_container_node --ros-args -r __node:=device_container_node -r __ns:=/ --params-file /tmp/launch_params_2tvu7_i7 --params-file /tmp/launch_params_vn7o9r5y --params-file /tmp/launch_params_ptlggfjs --params-file /tmp/launch_params_bp0tt4bq'].
Exception ignored in: <function Executor.__del__ at 0x7ffaf09d1e10>
Traceback (most recent call last):
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 229, in __del__
    self._sigint_gc.destroy()
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/signals.py", line 65, in destroy
    with self.handle:
rclpy._rclpy_pybind11.InvalidHandle: cannot use Destroyable because destruction was requested

Setup:

  • OS: Ubuntu 22.04
  • ROS-Distro: Humble
  • Branch/Commit: master

compilation error

Hi there,
I downloaded he last version available on the mastar branch and when I run colcon build I got the following compilation error:

Starting >>> canopen_interfaces
Starting >>> lely_core_libraries
Finished <<< canopen_interfaces [5.99s]                                                                         
Starting >>> canopen_utils
Finished <<< canopen_utils [0.87s]                                                              
--- stderr: lely_core_libraries                                 
Cloning into 'upstr_lely_core_libraries'...
Note: switching to 'ac31cd5cdf2ded4b2a5ba4a94520f388450614ff'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ac31cd5c release v2.3.1
configure.ac:17: installing './compile'
configure.ac:6: installing './config.guess'
configure.ac:6: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
configure.ac:606: installing './tap-driver.sh'
src/can/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
libtool: warning: relinking 'liblely-tap.la'
libtool: warning: relinking 'liblely-util.la'
libtool: warning: relinking 'liblely-can.la'
libtool: warning: relinking 'liblely-co.la'
libtool: warning: relinking 'liblely-io.la'
libtool: warning: relinking 'liblely-ev.la'
libtool: warning: relinking 'liblely-io2.la'
libtool: warning: relinking 'liblely-coapp.la'
---
Finished <<< lely_core_libraries [17.5s]
Starting >>> canopen_core
Starting >>> canopen_mock_slave
Finished <<< canopen_mock_slave [3.85s]                                                                   
--- stderr: canopen_core                               
In file included from /home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:16:
/home/drfly/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container_node.hpp:68:5: error: ‘virtual void DeviceContainerNode::on_list_nodes(std::shared_ptr<rmw_request_id_t>, std::shared_ptr<composition_interfaces::srv::ListNodes_Request_<std::allocator<void> > >, std::shared_ptr<composition_interfaces::srv::ListNodes_Response_<std::allocator<void> > >)’ marked ‘override’, but does not override
   68 |     on_list_nodes(
      |     ^~~~~~~~~~~~~
/home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp: In member function ‘bool DeviceContainerNode::init()’:
/home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:211:11: error: ‘rclcpp::Service<composition_interfaces::srv::LoadNode>::SharedPtr rclcpp_components::ComponentManager::loadNode_srv_’ is private within this context
  211 |     this->loadNode_srv_.reset();
      |           ^~~~~~~~~~~~~
In file included from /home/drfly/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container_node.hpp:22,
                 from /home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:16:
/opt/ros/galactic/include/rclcpp_components/component_manager.hpp:190:40: note: declared private here
  190 |   rclcpp::Service<LoadNode>::SharedPtr loadNode_srv_;
      |                                        ^~~~~~~~~~~~~
/home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:212:11: error: ‘rclcpp::Service<composition_interfaces::srv::UnloadNode>::SharedPtr rclcpp_components::ComponentManager::unloadNode_srv_’ is private within this context
  212 |     this->unloadNode_srv_.reset();
      |           ^~~~~~~~~~~~~~~
In file included from /home/drfly/test_ws/src/ros2_canopen/canopen_core/include/canopen_core/device_container_node.hpp:22,
                 from /home/drfly/test_ws/src/ros2_canopen/canopen_core/src/device_container_node.cpp:16:
/opt/ros/galactic/include/rclcpp_components/component_manager.hpp:191:42: note: declared private here
  191 |   rclcpp::Service<UnloadNode>::SharedPtr unloadNode_srv_;
      |                                          ^~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/device_container.dir/build.make:63: CMakeFiles/device_container.dir/src/device_container_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:171: CMakeFiles/device_container.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
---
Failed   <<< canopen_core [5.32s, exited with code 2]

Summary: 4 packages finished [23.1s]
  1 package failed: canopen_core
  2 packages had stderr output: canopen_core lely_core_libraries
  6 packages not processed

I have also tried to download the last release version on a new ros2 workspace, but i got the same error.

Best Regards
Alessio

Fake cia402 slave does not exit cleanly

Describe the bug
The fake cia402 slave does not exit cleanly when SIGINT is sent.

Expected behavior
The fake cia402 slave dies cleanly when SIGINT is sent.

Solution approach
This is probably related to duplicated Signal handlers by rclcpp and lely_core. Signals should be handled by either not both.

Add unload driver functionality

Currently, drivers can only be loaded but not unloaded.
The unload functionality should be added to the DeviceManager.

The function stub is already there in device_manager.cpp:

void DeviceManager::on_unload_node(
    const std::shared_ptr<rmw_request_id_t> request_header,
    const std::shared_ptr<UnloadNode::Request> request,
    std::shared_ptr<UnloadNode::Response> response)
{
}

Node needs to be removed from executor and once that is done it needs to be removed from master.

void DeviceManager::remove_node_from_executor
void DeviceManager::remove_node_from_master

Add Diagnostics

Either each driver node or the device container should publish diagnostic_msgs. These should at least indicate the state of each device (nmt, cia402, ...).

CAN frame: Operation canceled

Describe the bug

After the node has been configured basic_slave node is reporting warning: error writing CAN frame: Operation canceled

Do you have any idea what would be causing this issue? I have submitted the log after launching proxy_lifecycle_setup.launch.py and also the bus.yaml file

Logs

groundhog@groundhogPC:~/gh_ws$ ros2 launch groundhog_canopen [proxy_lifecycle_setup.launch.py](http://proxy_lifecycle_setup.launch.py/)
[INFO] [launch]: All log files can be found below /home/groundhog/.ros/log/2023-03-01-15-05-48-779937-groundhogPC-121543
[INFO] [launch]: Default logging verbosity is set to INFO
/home/groundhog/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/proxy_write_sdo/master.dcf
[INFO] [launch.user]: /home/groundhog/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/bus.yml
[INFO] [launch.user]: /home/groundhog/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/master.dcf
[INFO] [launch.user]:
[INFO] [launch.user]: can0
[INFO] [basic_slave_node-1]: process started with pid [121555]
[INFO] [device_container_node-2]: process started with pid [121557]
[device_container_node-2] [INFO] [1677643551.581533659] [device_container_node]: Starting Device Container with:
[device_container_node-2] [INFO] [1677643551.583381255] [device_container_node]:     master_config /home/groundhog/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/master.dcf
[device_container_node-2] [INFO] [1677643551.584828511] [device_container_node]:     bus_config /home/groundhog/gh_ws/install/groundhog_canopen/share/groundhog_canopen/config/bus_two/bus.yml
[device_container_node-2] [INFO] [1677643551.586292279] [device_container_node]:     can_interface_name can0
[device_container_node-2] [INFO] [1677643551.594472759] [device_container_node]: Loading Master Configuration.
[device_container_node-2] [INFO] [1677643551.597940061] [device_container_node]: Load Library: /home/groundhog/gh_ws/install/canopen_master_driver/lib/liblifecycle_master_driver.so
[device_container_node-2] [INFO] [1677643551.631148562] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleMasterDriver>
[device_container_node-2] [INFO] [1677643551.632752080] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleMasterDriver>
[device_container_node-2] [INFO] [1677643551.673329425] [master]: NodeCanopenBasicMaster
[device_container_node-2] [INFO] [1677643551.674027649] [device_container_node]: Load master component.
[device_container_node-2] [INFO] [1677643551.674263459] [device_container_node]: Added /master to executor
[device_container_node-2] [INFO] [1677643551.683782439] [device_container_node]: Loading Driver Configuration.
[device_container_node-2] [INFO] [1677643551.684021177] [device_container_node]: Found device hetronic_rc with driver ros2_canopen::LifecycleProxyDriver
[device_container_node-2] [INFO] [1677643551.685647591] [device_container_node]: Load Library: /home/groundhog/gh_ws/install/canopen_proxy_driver/lib/liblifecycle_proxy_driver.so
[INFO] [launch.user]: node 'basic_slave_node' reached the 'inactive' state, 'activating'.
[basic_slave_node-1] [INFO] [1677643551.692696231] [hetronic_can_node]: Reaching inactive state.
[device_container_node-2] [INFO] [1677643551.698330374] [device_container_node]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleProxyDriver>
[device_container_node-2] [INFO] [1677643551.698468120] [device_container_node]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_canopen::LifecycleProxyDriver>
[basic_slave_node-1] [INFO] [1677643551.714879490] [hetronic_can_node]: Reaching active state.
[device_container_node-2] [INFO] [1677643551.734151497] [device_container_node]: Load driver component.
[device_container_node-2] [INFO] [1677643551.734437094] [device_container_node]: Added /hetronic_rc to executor
[basic_slave_node-1] NMT: entering reset application state
[basic_slave_node-1] NMT: entering reset communication state
[basic_slave_node-1] NMT: running as slave
[basic_slave_node-1] NMT: entering pre-operational state
[basic_slave_node-1] NMT: entering operational state
[basic_slave_node-1] [INFO] [1677643551.755971389] [hetronic_can_node]: Created slave for node_id 100.
[device_container_node-2] [INFO] [1677643551.780409953] [device_container_node]: Loading Manager Configuration.
[device_container_node-2] [INFO] [1677643551.821794468] [device_container_node]: Added /lifecycle_manager to executor
[basic_slave_node-1] warning: error writing CAN frame: Operation canceled

Here is the bus.yaml

master:
  node_id: 1
  driver: ros2_canopen::LifecycleMasterDriver
  package: canopen_master_driver

hetronic_rc:
  node_id: 100
  dcf: "RX_ES-CAN-HL_line0.eds"
  dcf_path: "install/groundhog_canopen/share/groundhog_canopen/config/hetronic_rc"
  driver: "ros2_canopen::LifecycleProxyDriver"
  package: "canopen_proxy_driver"
  tpdo:
    1:
      enabled: true
      cob_id: "auto"
      transmission: 0xF
      event_timer: 50
      mapping:
        - {index: 0x5000, sub_index: 0}
        - {index: 0x5000, sub_index: 1}
        - {index: 0x5000, sub_index: 2}
        - {index: 0x5000, sub_index: 3}
        - {index: 0x5000, sub_index: 4}
        - {index: 0x5000, sub_index: 5}
        - {index: 0x5000, sub_index: 6}
        - {index: 0x5000, sub_index: 7}
    2:
      enabled: true
      cob_id: "auto"
      transmission: 0xF
      event_timer: 50
      mapping:
        - {index: 0x5001, sub_index: 0}
        - {index: 0x5001, sub_index: 1}
        - {index: 0x5001, sub_index: 2}
        - {index: 0x5001, sub_index: 3}
        - {index: 0x5001, sub_index: 4}
        - {index: 0x5001, sub_index: 5}
        - {index: 0x5001, sub_index: 6}
        - {index: 0x5001, sub_index: 7}
    3:
      enabled: false
    4:
      enabled: false

Setup:

  • OS: Ubuntu 22.04
  • ROS-Distro: Humble

402 Driver Licence Issue

The package.xml and license file declares the licence is LGPL-v3, however some of the source code files themselves, such as lifecycle_cia402_driver.cpp and cia402_driver.cpp, have Apache 2.0 licence headers.

Is this a mistake, or are some of the source files meant to be more permissively licensed, while the ROS2 package as a whole is copyleft?

Integrate muparser for conversion functions

Is your feature request related to a problem? Please describe.
In ros_canopen it is possible to specify position, velocity and effort conversions using muparser.
This is interesting for more complex drives.

Describe the solution you'd like
muparsers should be integrated in canopen_402_driver similar to https://github.com/ros-industrial/ros_canopen/blob/eaaf0a17b928db679215ddc9c3da1daaa6aa656c/canopen_motor_node/src/handle_layer.cpp

Example for scaling formulas: https://github.com/ipa320/cob_robots/blob/kinetic_dev/cob_hardware_config/robots/cob4/config/cob4_base_driver.yaml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.