ROS2 CAN package build problem

Hi, I want to setup a CAN bus for my odrives. If i want to build the odrive_can package in my ros2/humble directory, it fails.

sudo colcon build --packages-select odrive_can

[10.490s] ERROR:colcon.colcon_cmake.task.cmake.build:Failed to find the following files:
...
/* a lot of ros files */

Failed   <<< odrive_can [0.19s, exited with code 1]

Summary: 0 packages finished [9.34s]
  1 package failed: odrive_can

I can’t find anything in the documentation, and I am not really sure if I have to be in the /ros/humble directory to build it. It is my first ros2 package to build and those endless errors I keep getting from ros are killing me
Setup: RaspberryPi 4, Ubuntu 22.04, ROS2 Humble
thanks for the support

Hi there,

sudo may be causing the issue - why do you need to build with it? If permissions are correctly set up, this should be unnecessary.

You could also try sudo -E, to preserve user environment variables (essentially ignored with sudo).