# How to build-compile FOXY ROS2 packages and nodes for RB5

Source: https://forum.modalai.com/topic/4248/how-to-build-compile-foxy-ros2-packages-and-nodes-for-rb5
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: ros
Posted: 2025-03-10 13:57:42 UTC by tahawaru
Replies: 10 · Views: 6089

## tahawaru · 2025-03-10 13:57:42 UTC

Hi,

I have the following Rb5:
system-image: 1.7.1-M0052-14.1a-perf-nightly-20231025
kernel:       #1 SMP PREEMPT Thu Oct 26 05:24:02 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0052
--------------------------------------------------------------------------------
voxl-suite:   1.1.2
--------------------------------------------------------------------------------
current IP: wlan0: 192.168.1.32

How to build-compile FOXY ROS2 packages and nodes for this RB5 ?
What kind of environment can be used to run colcon build to get  ROS2 packages and nodes for the Rb5?

Thanks!

## Reply by teddy.zaremba · 2025-03-10 19:31:46 UTC

@tahawaru Not sure if your use case allows this but we typically build off the arm64v8/ros:foxy docker image when writing ROS nodes on the voxl.

## Reply by tahawaru · 2025-03-11 10:20:22 UTC (in reply to teddy.zaremba)

@teddy-zaremba 

Where can I get this docker image?
Do you have a link?

Thanks,

## Reply by teddy.zaremba · 2025-03-11 14:57:16 UTC (in reply to tahawaru)

Sure! Here's the [link](https://hub.docker.com/layers/library/ros/foxy/images/sha256-52db769cb45c988bebba81e933842212cf4e581ba716c1253d9389e387590c37) @tahawaru

## Reply by tahawaru · 2025-03-11 15:42:41 UTC (in reply to teddy.zaremba)

@teddy-zaremba 

Thank you.
Let me have a look.

Best wishes,

## Reply by tahawaru · 2025-04-22 16:46:17 UTC (in reply to tahawaru)

@teddy-zaremba 

Hi 
Thank for your support.
I have used a docker environment in VsCode(ROS2-foxy + PX4).
I have colcon built a package, and I have pushed the build into the Rb5.
When running the ros2 run xx_pkg_py py_node
the code starts executing, then through an error regarding ros_idl.

Any help on this?
Is this to do with the pushing of the packages into the Rb5?

Here is the error:

----------------------------------
rb5:/opt/ros/foxy/Fig8_pkg_py$ ros2 run figure8_py py_node 
[INFO] [1745326367.028604419] [offboard_figure8_node]: (Qualcomm RB5):Offboard Figure 8 Node Alive!
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 46, in import_type_support
    return importlib.import_module(module_name, package=pkg_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'px4_msgs.px4_msgs_s__rosidl_typesupport_c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/foxy/Fig8_pkg_py/install/figure8_py/lib/figure8_py/py_node", line 11, in <module>
    load_entry_point('figure8-py==0.0.0', 'console_scripts', 'py_node')()
  File "/opt/ros/foxy/Fig8_pkg_py/install/figure8_py/lib/python3.8/site-packages/figure8_py/figure8_massa.py", line 201, in main
    offboard_figure8_node = OffboardFigure8Node()
  File "/opt/ros/foxy/Fig8_pkg_py/install/figure8_py/lib/python3.8/site-packages/figure8_py/figure8_massa.py", line 28, in __init__
    OffboardControlMode, '/fmu/in/offboard_control_mode', qos_profile)
  File "/opt/ros/foxy/lib/python3.6/site-packages/rclpy/node.py", line 1144, in create_publisher
    check_for_type_support(msg_type)
  File "/opt/ros/foxy/lib/python3.6/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
    msg_type.__class__.__import_type_support__()
  File "/opt/ros/foxy/Fig8_pkg_py/install/px4_msgs/lib/python3.8/site-packages/px4_msgs/msg/_offboard_control_mode.py", line 27, in __import_type_support__
    module = import_type_support('px4_msgs')
  File "/opt/ros/foxy/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 48, in import_type_support
    raise UnsupportedTypeSupport(pkg_name)
rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'px4_msgs'
----------------------------------
Best wishes,

## Reply by Zachary Lowell 0 · 2025-04-22 20:06:27 UTC

@tahawaru said in [How to build\-compile FOXY ROS2 packages and nodes for RB5](/post/21974):
> _find_and_load_unlocked

to confirm @tahawaru you are pushing your docker instance to the voxl2, then deploying the docker container, and running ros2 run command inside the docker container correct? Prior to running the ros2 command in the docker instance you are sourcing the right packages? Usually the rosidl typesupport error occurs because you have not build the right package and if you have you never sourced the right directory - so in your case its necessary to run source /opt/ros/foxy/setup.bash (if you installed px4 msgs via apt-get) if you build them directly from the colcon env then you need to source the directory you built those messages in!

LMK if this helps.
Zach

## Reply by tahawaru · 2025-04-28 10:15:25 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 
I just pushed the src folder in the rb5 after the colcon in VSCode.
How do you do the following?
"
 pushing your docker instance to the voxl2, then deploying the docker container, and running ros2 run command inside the docker container correct? 
"

Best wishes,

## Reply by Zachary Lowell 0 · 2025-04-28 15:30:17 UTC

@tahawaru said in [How to build\-compile FOXY ROS2 packages and nodes for RB5](/post/22064):
> pushing your docker instance to the voxl2, then deploying the docker container, and running ros2 run command inside the docker container correct?
> 

I build my docker container on the voxl2 and then run everything inside. I am unsure I am following what you are doing. If its easiest, just install docker on your voxl2, then build your container on there and call it a day.

The other option is to run on disk outside of a docker instance. The voxl2 supports ros2 foxy natively on disk. To install this you can just do `apt-get install voxl-ros2-foxy` - lmk if that helps.

## Reply by tahawaru · 2025-04-29 11:10:28 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 

I have already install the foxy.
I'm building ROS2 nodes now on a container on Vscode on my computer.
I want to push the build in the RB5 and run it their, just like building figure 8 out of the Rb5 and then push the build in the Rb5 to run it.

Do I have to push the whole container instance or just the src folder.

I pushed already the src folder via adb push, and it generated the error above.

Thanks

## Reply by Zachary Lowell 0 · 2025-04-29 13:13:51 UTC

You need to push the install folder as thats where the executables live in ros2 once you run colcon build. src folder is just the code you wrote with zero executables after colcon build is run.
