0
$\begingroup$

I installed all packages I need and write my controll.xacro file and my_controller.yaml file and write launch file correctly and in my source file I clone serial package.

However, when I clone diffdrive_arduino package but with foxy branch so I cannot colcon build it.

If i colcon build

In file included from /home/omar/project_ws/src/ros2_control_diff_drive/diffdrive/src/diffdrive_arduino.cpp:1:
/home/omar/project_ws/src/ros2_control_diff_drive/diffdrive/include/diffdrive_arduino/diffdrive_arduino.h:7:10: fatal error: hardware_interface/base_interface.hpp: No such file or directory
    7 | #include "hardware_interface/base_interface.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/diffdrive_arduino.dir/build.make:76: CMakeFiles/diffdrive_arduino.dir/src/diffdrive_arduino.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/diffdrive_arduino.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

This error appears.

If I do not build it, I launch my launch file the next error will appear

[ERROR] [ros2_control_node-2]: process has died [pid 10267, exit code -2, cmd '/opt/ros/humble/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_o5gavlx1 --params-file /home/omar/project_ws/install/diff_bot/share/diff_bot/config/diff_drive_controller.yaml'].
[INFO] [robot_state_publisher-1]: process has finished cleanly [pid 10255]
$\endgroup$

2 Answers 2

0
$\begingroup$

Welcome at RSE. It is not possible to know what could be the problem if you don't add your code (package.xml, CMakeLists.txt, etc). Could you provide a public repository?

I'd suggest that you start with the official demos to learn how to setup ros2_control.

$\endgroup$
0
$\begingroup$

maybe you are missing a Package try this:

sudo apt install ros-humble-hardware-interface
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.