wuhanstudio / micro_ros

MicroROS on RT-Thread (ROS2).
https://micro.ros.org
Apache License 2.0
17 stars 17 forks source link

setup.bash is missed during creating customer MicroROS static library #10

Open weblxj opened 1 year ago

weblxj commented 1 year ago

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

wuhanstudio commented 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
weblxj commented 1 year ago

I will try it will docker later.

weblxj commented 1 year ago

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: image

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 " not supported" │ set +o nounset 10 | #error " not supported" │ # source dev workspace | ^~~~~ │ . install/setup.bash In file included from /home/super/microros_ws/firmware/mcu_ws/ros2/rcpputils/src/asserts.cpp:15: │ popd > /dev/null /home/super/microros_ws/firmware/mcu_ws/ros2/rcpputils/include/rcpputils/asserts.hpp: In function 'void rcpputils::require_true(bool, const string&)': │fi /home/super/microros_ws/firmware/mcu_ws/ros2/rcpputils/include/rcpputils/asserts.hpp:98:36: error: exception handling disabled, use '-fexceptions' to e│ nable │# Install dependecies for specific platform 98 | throw std::invalid_argument{msg}; │ 107,7 95% | ^ ├─────────────────────────────────────────────────── make[2]: [CMakeFiles/rcpputils.dir/build.make:66: CMakeFiles/rcpputils.dir/src/asserts.cpp.obj] Error 1 │ make[2]: Waiting for unfinished jobs.... │if [ ! -f ${REPOS} ] In file included from /home/super/microros_ws/firmware/mcu_ws/ros2/rcpputils/src/filesystem_helper.cpp:58: │then /usr/include/newlib/dirent.h:48:12: error: 'DIR' was not declared in this scope │ echo "Error: Repo file $REPOS (expanded from $3 48 | int dirfd(DIR ); │) does not exist" | ^~~ │ exit 255 /usr/include/newlib/dirent.h:48:17: error: expected primary-expression before ')' token │fi 48 | int dirfd(DIR ); │ | ^ │ /usr/include/newlib/dirent.h:51:17: error: 'DIR' was not declared in this scope │pushd $1 >/dev/null 51 | int fdclosedir(DIR ); │if [ -f ros2.repos ] | ^~~ │then /usr/include/newlib/dirent.h:51:22: error: expected primary-expression before ')' token │ echo "Repo-file ros2.repos already present, ove 51 | int fdclosedir(DIR ); │rwriting!" | ^ │fi /usr/include/newlib/dirent.h:53:1: error: 'DIR' does not name a type │ 53 | DIR opendir(const char ); │# ROS_DISTRO SPECIFIC | ^~~ │@@@
/usr/include/newlib/dirent.h:54:1: error: 'DIR' does not name a type │ 36,1 77% [0] 0:[tmux]*