Skip to content

Conversation

blooop
Copy link
Contributor

@blooop blooop commented Jul 22, 2025

if you run pixi r go2_example it will work the first time but will fail if you try to run it again.

This is because the first time the example is run, the pixi environment has numpy 1.X installed when the go2_ros_sdk is run, but when the:

[tasks.rerun_viewer]
cmd = "pip install rerun-sdk==0.23.4"

task is run, numpy 2.x gets installed. This means that if you run the go2_example task again the version of numpy now 2.x and so the compliation fails.

Pixi task (go2_ros2_sdk): (test -d src/go2_ros2_sdk || git clone --recurse-submodules https://github.com/abizovnuralem/go2_ros2_sdk.git src/go2_ros2_sdk)
&& colcon build --packages-select unitree_go go2_interfaces go2_robot_sdk --cmake-args -DCMAKE_BUILD_TYPE=Release
Starting >>> go2_interfaces
Starting >>> unitree_go
--- stderr: go2_interfaces
/home/ags/projects/cpp-example-ros2-bridge/humble_ws/build/go2_interfaces/rosidl_generator_py/go2_interfaces/msg/_go2_state_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
   11 | #include "numpy/ndarrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/go2_interfaces__rosidl_generator_py.dir/build.make:90: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/rosidl_generator_py/go2_interfaces/msg/_go2_state_s.c.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/ags/projects/cpp-example-ros2-bridge/humble_ws/build/go2_interfaces/rosidl_generator_py/go2_interfaces/msg/_go2_rpy_cmd_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
   11 | #include "numpy/ndarrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
/home/ags/projects/cpp-example-ros2-bridge/humble_ws/build/go2_interfaces/rosidl_generator_py/go2_interfaces/msg/_go2_cmd_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
   11 | #include "numpy/ndarrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/go2_interfaces__rosidl_generator_py.dir/build.make:118: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/rosidl_generator_py/go2_interfaces/msg/_go2_rpy_cmd_s.c.o] Error 1
gmake[2]: *** [CMakeFiles/go2_interfaces__rosidl_generator_py.dir/build.make:76: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/rosidl_generator_py/go2_interfaces/msg/_go2_cmd_s.c.o] Error 1
/home/ags/projects/cpp-example-ros2-bridge/humble_ws/build/go2_interfaces/rosidl_generator_py/go2_interfaces/msg/_imu_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
   11 | #include "numpy/ndarrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/go2_interfaces__rosidl_generator_py.dir/build.make:132: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/rosidl_generator_py/go2_interfaces/msg/_imu_s.c.o] Error 1
/home/ags/projects/cpp-example-ros2-bridge/humble_ws/build/go2_interfaces/rosidl_generator_py/go2_interfaces/msg/_go2_move_s.c:11:10: fatal error: numpy/ndarrayobject.h: No such file or directory
   11 | #include "numpy/ndarrayobject.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/go2_interfaces__rosidl_generator_py.dir/build.make:104: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/rosidl_generator_py/go2_interfaces/msg/_go2_move_s.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:475: CMakeFiles/go2_interfaces__rosidl_generator_py.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< go2_interfaces [0.39s, exited with code 2]
Aborted  <<< unitree_go [0.77s]

Summary: 0 packages finished [0.84s]
  1 package failed: go2_interfaces
  1 package aborted: unitree_go
  2 packages had stderr output: go2_interfaces unitree_go
  1 package not processed

I have added a workaround which stops the mcap_vendor and go2_interfaces packages recompiling after the first build, but its not really an ideal solution, as using rerun with other ros2 packages runs into issues like this fairly frequently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant