How to build-compile FOXY ROS2 packages and nodes for RB5
-
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.125hw 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!
-
@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.
-
-
-
-
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,
-
@tahawaru said in How to build-compile FOXY ROS2 packages and nodes for RB5:
_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 -
@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,
-
@tahawaru said in How to build-compile FOXY ROS2 packages and nodes for RB5:
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. -
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
-
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.