Open weblxj opened 1 year ago
Here's the documentation for static library generation:
https://github.com/micro-ROS/micro_ros_arduino#how-to-build-the-precompiled-library
The following command generates static libraries (ROS2 humble) for all platforms:
$ docker pull microros/micro_ros_static_library_builder:humble
$ git clone https://github.com/wuhanstudio/micro_ros && cd micro_ros
$ docker run -it --rm -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:humble
I will try it will docker later.
Currently, I have followed the instructions here https://micro.ros.org/docs/tutorials/advanced/create_custom_static_library/ to do the building.
In the last step,: ros2 run micro_ros_setup build_firmware.sh $(pwd)/my_custom_toolchain.cmake $(pwd)/my_custom_colcon.meta
I ran into some issues like below:
Appreciate it if someone can tell me what's the root cause of this issue and how to resolve it.
More details like below:
-- stderr: rcpputils [125/1505]│2/rcl_logging/
CMake Warning at /home/super/ros2_galactic/ros2-linux/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message): │CODEOWNERS .github/ rcl_l
Package 'rcutils' exports library 'dl' which couldn't be found │ogging_noop/
Call Stack (most recent call first): │CONTRIBUTING.md LICENSE rcl_l
/home/super/ros2_galactic/ros2-linux/share/rcutils/cmake/rcutilsConfig.cmake:41 (include) │ogging_spdlog/
CMakeLists.txt:7 (find_package) │.git/ rcl_logging_interface/ READM
│E.md
│super@u20base:~/microros_ws/firmware/mcu_ws$ ls ros
CMake Warning (dev) at /home/super/ros2_galactic/ros2-linux/share/rcutils/cmake/rcutilsExport.cmake:54 (add_library): │2/rcl_logging/rcllogging
ADD_LIBRARY called with SHARED option but the target platform does not │rcl_logging_interface/ rcl_logging_noop/ rcl_l
support dynamic linking. Building a STATIC library instead. This may lead │ogging_spdlog/
to problems. │super@u20base:~/microros_ws/firmware/mcu_ws$ ls ros
Call Stack (most recent call first): │super@u20base:~/microros_ws/firmware/mcu_ws$ ls ros
/home/super/ros2_galactic/ros2-linux/share/rcutils/cmake/ament_cmake_export_targets-extras.cmake:9 (include) │2/rcl_logging/rcl_logging_r
/home/super/ros2_galactic/ros2-linux/share/rcutils/cmake/rcutilsConfig.cmake:41 (include) ├───────────────────────────────────────────────────
CMakeLists.txt:7 (find_package) │# build the dev_ws
This warning is for project developers. Use -Wno-dev to suppress it. │. $(dirname $0)/clean_env.sh
│if [ $RTOS != "host" ]; then
In file included from /usr/include/newlib/dirent.h:39, │ pushd $FW_TARGETDIR/$DEV_WS_DIR >/dev/null
from /home/super/microros_ws/firmware/mcu_ws/ros2/rcpputils/src/filesystem_helper.cpp:58: │ colcon build
/usr/include/newlib/sys/dirent.h:10:2: error: #error "
/usr/include/newlib/dirent.h:54:1: error: 'DIR' does not name a type │ 36,1 77%
[0] 0:[tmux]*
Dear man,
I have tried to run below command according to the official document to "create custom MicroROS static library". Unfortunately there is below exception. Just want to know what's the possible reason for this issue?
super@u20base:~/microros_ws$ ros2 run micro_ros_setup build_firmware.sh $(pwd)/my_custom_toolchain.cmake $(pwd)/my_custom_colcon.meta Crosscompiled environment: cleaning path /home/super/microros_ws/install/micro_ros_setup/lib/micro_ros_setup/build_firmware.sh: line 65: /home/super/microros_ws/firmware/dev_ws/install/setup.bash: No such file or directory super@u20base:~/microros_ws$
Thanks a lot! Rongcai