ROS2 Canopen Nanotec - How to setup configuration?

asked 2023-07-18 08:39:29 -0500

cypher20 gravatar image

Describe the bug:

I am trying to attach a nanotec controller (CL3-E-2-0F) to operate a BLDC motor (DB42M03). I created a single-motor package configuration using the Canopen tutorial and the Trinamic Stepper Motor example. However, I get the errors shown below. I would greatly appreciate any help in resolving this issue and getting the motor to operate w/ ROS2.

Setup:

Device: Jetson AGX Orin
OS: Linux
ROS-Distro: Foxy
Repo: ros-industrial/ros2_canopen
Branch/Commit: Foxy

Additional context I have also attached a link to the package repository, for any clarification on the code. https://github.com/r9-pena/drive_motor.git


ERROR BELOW

--- stderr: drive_motor
CMake Error at CMakeLists.txt:25 (find_package): By not providing "Findros2_canopen.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ros2_canopen", but CMake did not find one.

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

ros2_canopenConfig.cmake
ros2_canopen-config.cmake

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


Failed <<< drive_motor [2.13s, exited with code 1]

edit retag flag offensive close merge delete

Comments

So I was able to resolve this error, by modifying the dependency values on the CMake and package.xml.

Before: find_package(ros2_canopen REQUIRED) <depend>ros2_canopen</depend>

After: find_package(canopen REQUIRED) <depend>canopen</depend>


However, now I get an error of a mismatch of the product number, as shown below. I know one of the values being compared is from the .eds file, but I'm not sure which product code it is referring to.

--- stderr: drive_motor
~/rover_ws/install/lely_core_libraries/lib/python3.8/site-packages/dcfgen/cli.py:14: UserWarning: ProductNumber in [DeviceInfo] differs from product code in identity object

super().__init__(cfg, env)

cypher20 gravatar image cypher20  ( 2023-07-18 11:22:57 -0500 )edit