Closed granzscientific closed 2 years ago
Try to use CMake 3.22.1 (the version installed by default in Ubuntu 22.04). We are having some issues with newer versions.
Related https://github.com/micro-ROS/micro_ros_mbed/actions/runs/2844490547
I am having issues as well. I am not sure what is causing it.
Dockerfile: here
Build and run:
docker build -t robodrome/zephyr-build:humble .
docker run -ti --rm robodrome/zephyr-build:humble
Inside container:
cd ~
git clone -b humble https://github.com/micro-ROS/micro_ros_zephyr_module.git
west build -b disco_l475_iot1 micro_ros_zephyr_module
No critical errors.
CMake Warning at /home/zephyr/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
Package 'rcutils' exports library 'dl' which couldn't be found
CMake Error at /opt/ros/humble/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_c-extras.cmake:5 (find_package):
Could not find a configuration file for package "fastcdr" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
/opt/ros/humble/lib/cmake/fastcdr/fastcdr-config.cmake, version: 1.0.24 (64bit)
Call Stack (most recent call first):
/opt/ros/humble/share/rosidl_typesupport_fastrtps_c/cmake/rosidl_typesupport_fastrtps_cConfig.cmake:41 (include)
/home/zephyr/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_c-extras.cmake:13 (find_package)
/home/zephyr/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rosidl_typesupport_c/cmake/rosidl_typesupport_cConfig.cmake:41 (include)
/home/zephyr/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rosidl_default_generators/cmake/rosidl_default_generators-extras.cmake:21 (find_package)
/home/zephyr/micro_ros_zephyr_module/modules/libmicroros/micro_ros_src/install/share/rosidl_default_generators/cmake/rosidl_default_generatorsConfig.cmake:41 (include)
CMakeLists.txt:14 (find_package)
Warnings can be ignored.
The error is related to have ROS 2 sourced when building micro-ROS. Make sure that the environment where you build micro-ROS do not have a ROS 2 distro sourced. Probably this is done automatically by ros:humble
image, just check the .bashrc
Warnings can be ignored.
The error is related to have ROS 2 sourced when building micro-ROS. Make sure that the environment where you build micro-ROS do not have a ROS 2 distro sourced. Probably this is done automatically by
ros:humble
image, just check the .bashrc
I will alter the Dockerfile and share the results. Is there a manual where I could have read that? I am missing some crucial information it seems. Thanks!
@granzscientific @pablogs9
Thanks Pablo, it works now. I will share my dockerfile and instructions. Hope it helps others.
NOTE: ROS2 Humble on Ubuntu 22.04 Jammy
Get Dockerfile
docker build -t zephyr-build:jammy .
docker run \
-it \
--privileged \
-v /dev/bus/usb:/dev/bus/usb \
--hostname zephyr-build \
--name zephyr-build \
--rm \
zephyr-build:jammy
git clone -b humble https://github.com/micro-ROS/micro_ros_zephyr_module.git
west build -o=-j`nproc` -b disco_l475_iot1 micro_ros_zephyr_module
Outcome:
(...)
Memory region Used Size Region Size %age Used
FLASH: 130299 B 1 MB 12.43%
SRAM: 57536 B 96 KB 58.53%
IDT_LIST: 0 GB 2 KB 0.00%
Flash it:
west flash --build-dir build/microros
Hello, @robodrome what are the next steps to flash micro-ros to the board?
Thanks
@acastro4
That would be:
west flash --build-dir build/microros
NOTE: i can't test this because I don't have this board. I own the Nucleo STM32F446 board.
See edit in my previous post.
And you need to mount usb devices dir from host:
docker run \
-it \
--privileged \
-v /dev/bus/usb:/dev/bus/usb \
--hostname zephyr-build \
--name zephyr-build \
--rm \
zephyr-build:jammy
@robodrome, After runinng:
west flash --build-dir build/microros
Output:
FATAL ERROR: no CMake cache found (expected one at build/microros/CMakeCache.txt)
EDIT: It works with a few changes
Install openocd:
sudo apt install openocd
Then run:
west flash
@robodrome, After runinng:
west flash --build-dir build/microros
Output:FATAL ERROR: no CMake cache found (expected one at build/microros/CMakeCache.txt)
EDIT: It works with a few changes
Install openocd:
sudo apt install openocd
Then run:
west flash
I now see the Dockerfile I now use is different from the one I posted. Well caught! And good to here it works now. I will post my Dockerfile here.
Hi, I'm having a build issue with the rcutils package after doing a clean zephyr workspace setup and then cloning the repo:
I'm on Ubuntu 20.04, with zephyr-sdk 0.14.2 West and cmake versions are shown at the bottom...
Any guidance would be highly appreciated. I've been able to successfully build Zephyr+MicroROS using the micro_ros_setup ROS2 package, but I'd prefer to use the zephyr module since I have a lot of existing zephyr-based applications already.