diff --git a/micro_ros_setup/README.md b/micro_ros_setup/README.md index 301541b3..be5de08b 100644 --- a/micro_ros_setup/README.md +++ b/micro_ros_setup/README.md @@ -37,7 +37,7 @@ This package targets **ROS 2** installation. ROS 2 supported distributions are: |-|-|-| | Crystal | Supported | `crystal` | | Dashing | Supported | `dashing` | -| Eloquent | *Work in progress* | | +| Foxy | Supported | `foxy` | Some other prerequisites needed for building a firmware using this package are: @@ -116,49 +116,55 @@ For more information please visit the links. uros - freertos - crazyflie21 - crazyflie_position_publisher + freertos + crazyflie21 + crazyflie_position_publisher - crazyflie_uros_sample + olimex-stm32-e407 + add_two_ints_service - olimex-stm32-e407 - add_two_ints + int32_publisher - ping_pong + ping_pong - olimex_uros_sample + zephyr + discovery_l475_iot1 + add_two_ints_service - int32_publisher + int32_publisher - zephyr - discovery_l475_iot1 - ping_pong + int32_wifi_publisher - int32_publisher + ping_pong - sensors_publisher + sensors_publisher - tof_ws2812 + tof_ws2812 - olimex-stm32-e407 - ping_pong + olimex-stm32-e407 + add_two_ints_service + + + int32_publisher + + + openmanipulator_tof - int32_publisher + ping_pong - vl53l1x_tof_sensor + vl53l1x_tof_sensor diff --git a/micro_ros_setup/config/agent_uros_packages.repos b/micro_ros_setup/config/agent_uros_packages.repos index 327f7053..fd0741cf 100644 --- a/micro_ros_setup/config/agent_uros_packages.repos +++ b/micro_ros_setup/config/agent_uros_packages.repos @@ -1,10 +1,10 @@ -# Micro XRCE-DDS agent should be a dashing package repositories: # MicroROS - uros/uROS_agent: + uros/micro-ROS-Agent: type: git url: https://github.com/microROS/micro-ROS-Agent.git version: dashing + # TODO (pablogs9): Integrate Micro XRCE-DDS Agent dependency download in micro-ROS-Agent package eProsima/Micro-XRCE-DDS-Agent: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Agent.git diff --git a/micro_ros_setup/config/client_ros2_packages.txt b/micro_ros_setup/config/client_ros2_packages.txt index 36815201..c00d236d 100644 --- a/micro_ros_setup/config/client_ros2_packages.txt +++ b/micro_ros_setup/config/client_ros2_packages.txt @@ -4,7 +4,6 @@ keep: ros2/rosidl_defaults ros2/rosidl ros2/rosidl_dds - ros2/rosidl_typesupport ros2/rmw_implementation ros2/common_interfaces ros2/libyaml_vendor @@ -13,3 +12,4 @@ keep: ros2/rcl_logging ros2/test_interface_files ros2/example_interfaces + ros2/rcpputils diff --git a/micro_ros_setup/config/freertos/crazyflie21/board.repos b/micro_ros_setup/config/freertos/crazyflie21/board.repos index 95419f40..73e50308 100644 --- a/micro_ros_setup/config/freertos/crazyflie21/board.repos +++ b/micro_ros_setup/config/freertos/crazyflie21/board.repos @@ -2,10 +2,10 @@ repositories: crazyflie_firmware: type: git url: https://github.com/bitcraze/crazyflie-firmware - version: a2a26abd53a5f328374877bfbcb7b25ed38d8111 + version: 2020.06 freertos_apps: type: git url: https://github.com/micro-ROS/freertos_apps - version: dashing + version: foxy diff --git a/micro_ros_setup/config/freertos/crazyflie21/build.sh b/micro_ros_setup/config/freertos/crazyflie21/build.sh index 0948758b..93461d4d 100755 --- a/micro_ros_setup/config/freertos/crazyflie21/build.sh +++ b/micro_ros_setup/config/freertos/crazyflie21/build.sh @@ -33,5 +33,5 @@ pushd $EXTENSIONS_DIR >/dev/null fi # build firmware - make PLATFORM=cf2 CLOAD=0 UROS_APP_FOLDER=$UROS_APP_FOLDER + make PLATFORM=cf2 CLOAD=0 UROS_APP_FOLDER=$UROS_APP_FOLDER PYTHON=python3 popd >/dev/null diff --git a/micro_ros_setup/config/freertos/crazyflie21/client-colcon.meta b/micro_ros_setup/config/freertos/crazyflie21/client-colcon.meta index 82315009..e6a7e9a9 100644 --- a/micro_ros_setup/config/freertos/crazyflie21/client-colcon.meta +++ b/micro_ros_setup/config/freertos/crazyflie21/client-colcon.meta @@ -10,7 +10,10 @@ }, "microxrcedds_client":{ "cmake-args":[ - "-DUCLIENT_PIC=OFF" + "-DUCLIENT_PIC=OFF", + "-DUCLIENT_PROFILE_DISCOVERY=OFF", + "-DUCLIENT_PROFILE_UDP=OFF", + "-DUCLIENT_PROFILE_TCP=OFF" ] }, "rmw_microxrcedds":{ diff --git a/micro_ros_setup/config/freertos/crazyflie21/client_uros_packages.repos b/micro_ros_setup/config/freertos/crazyflie21/client_uros_packages.repos index 0ff8c01e..4316798c 100644 --- a/micro_ros_setup/config/freertos/crazyflie21/client_uros_packages.repos +++ b/micro_ros_setup/config/freertos/crazyflie21/client_uros_packages.repos @@ -2,32 +2,44 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: dashing + version: foxy eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: dashing + version: foxy # MicroROS uros/rcl: type: git url: https://github.com/micro-ROS/rcl - version: dashing + version: foxy + uros/rclc: + type: git + url: https://github.com/micro-ROS/rclc + version: master uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils - version: dashing + version: foxy uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: dashing + version: foxy + uros/rosidl_typesupport: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport.git + version: foxy uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: dashing + version: foxy + uros/tracetools: + type: git + url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing + version: feature/foxy_migration -# interim, until crosscompile fix is available in dashing branch +# interim, until crosscompile fix is available in foxy branch ros2/tinydir_vendor: type: git url: https://github.com/ros2/tinydir_vendor.git diff --git a/micro_ros_setup/config/freertos/crazyflie21/create.sh b/micro_ros_setup/config/freertos/crazyflie21/create.sh index c7aa6b71..878c1530 100755 --- a/micro_ros_setup/config/freertos/crazyflie21/create.sh +++ b/micro_ros_setup/config/freertos/crazyflie21/create.sh @@ -15,12 +15,14 @@ pushd $FW_TARGETDIR >/dev/null # ignore broken packages touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE - touch mcu_ws/ros2/rcl/rcl_action/COLCON_IGNORE + touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE touch mcu_ws/ros2/rcl/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE + touch mcu_ws/ros2/rcpputils/COLCON_IGNORE + touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE + touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE - rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" - - # Turn off features MicroXRCEClient - echo -e ",s/PROFILE_DISCOVERY=TRUE/PROFILE_DISCOVERY=FALSE/\n,s/PROFILE_UDP_TRANSPORT=TRUE/PROFILE_UDP_TRANSPORT=FALSE/\n,s/PROFILE_TCP_TRANSPORT=TRUE/PROFILE_TCP_TRANSPORT=FALSE/g\nw" | ed $(find mcu_ws -name client.config) >/dev/null &>/dev/null + rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro foxy --skip-keys="$SKIP" popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/board.repos b/micro_ros_setup/config/freertos/nucleo_f446ze/board.repos new file mode 100644 index 00000000..6349df15 --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/board.repos @@ -0,0 +1,5 @@ +repositories: + freertos_apps: + type: git + url: https://github.com/micro-ros/freertos_apps + version: dashing diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/build.sh b/micro_ros_setup/config/freertos/nucleo_f446ze/build.sh new file mode 100644 index 00000000..d8ae881a --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/build.sh @@ -0,0 +1,31 @@ +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions + +. $PREFIX/config/utils.sh + +pushd $EXTENSIONS_DIR >/dev/null + + export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) + export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" + + if [ -d "$UROS_APP_FOLDER" ]; then + echo "Selected app: $UROS_APP" + else + echo "App not found: $UROS_APP" + print_available_apps + exit 1 + fi + + if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then + # Clean micro-ROS build + rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log + + # Clean build + make clean + + # Build micro-ROS stack + make libmicroros + fi + + # Build firmware + make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER +popd >/dev/null diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/client-colcon.meta b/micro_ros_setup/config/freertos/nucleo_f446ze/client-colcon.meta new file mode 100644 index 00000000..1b90f924 --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/client-colcon.meta @@ -0,0 +1,23 @@ +{ + "names": { + "rcutils": { + "cmake-args": [ + "-DENABLE_TESTING=OFF", + "-DRCUTILS_NO_FILESYSTEM=ON", + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + ] + }, + "microxrcedds_client": { + "cmake-args": [ + "-DUCLIENT_PIC=OFF" + ] + }, + "rmw_microxrcedds": { + "cmake-args": [ + "-DRMW_UXRCE_XML_BUFFER_LENGTH=400", + "-DRMW_UXRCE_TRANSPORT=custom_serial", + "-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=3" + ] + } + } +} diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/client_uros_packages.repos b/micro_ros_setup/config/freertos/nucleo_f446ze/client_uros_packages.repos new file mode 100644 index 00000000..0ff8c01e --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/client_uros_packages.repos @@ -0,0 +1,34 @@ +repositories: + eProsima/Micro-CDR: + type: git + url: https://github.com/eProsima/Micro-CDR.git + version: dashing + eProsima/Micro-XRCE-DDS-Client: + type: git + url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git + version: dashing + +# MicroROS + + uros/rcl: + type: git + url: https://github.com/micro-ROS/rcl + version: dashing + uros/rcutils: + type: git + url: https://github.com/micro-ROS/rcutils + version: dashing + uros/rmw_microxrcedds: + type: git + url: https://github.com/micro-ROS/rmw-microxrcedds.git + version: dashing + uros/rosidl_typesupport_microxrcedds: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git + version: dashing + +# interim, until crosscompile fix is available in dashing branch + ros2/tinydir_vendor: + type: git + url: https://github.com/ros2/tinydir_vendor.git + version: master diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/configure.sh b/micro_ros_setup/config/freertos/nucleo_f446ze/configure.sh new file mode 100755 index 00000000..e590d7d4 --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/configure.sh @@ -0,0 +1,31 @@ + +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions + +. $PREFIX/config/utils.sh + +function help { + echo "Configure script need an argument." + echo " --transport -t serial or serial-usb" + echo " --dev -d agent string descriptor in a serial-like transport" +} + +echo $CONFIG_NAME > $FW_TARGETDIR/APP +# TODO add USB-OTG support +if [ "$UROS_TRANSPORT" == "serial" ]; then + echo "Using serial device USART$UROS_AGENT_DEVICE." + + cp -f $EXTENSIONS_DIR/uros_transport/stm32f446ze_serial_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c + cp -f $EXTENSIONS_DIR/uros_transport/stm32f446ze_serial_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h + update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON" + + update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" + update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE + + remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" + remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" + + echo "Configured $UROS_TRANSPORT mode with agent at USART$UROS_AGENT_DEVICE" + +else + help +fi diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/create.sh b/micro_ros_setup/config/freertos/nucleo_f446ze/create.sh new file mode 100755 index 00000000..77313da8 --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/create.sh @@ -0,0 +1,20 @@ +pushd $FW_TARGETDIR >/dev/null + # Install toolchain + mkdir toolchain + + + # Install toolchain + echo "Downloading ARM compiler, this may take a while" + curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 + tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null + rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 + + # Import repos + vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos >/dev/null + + # ignore broken packages + touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE + touch mcu_ws/ros2/rcl/COLCON_IGNORE + + rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" +popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/flash.sh b/micro_ros_setup/config/freertos/nucleo_f446ze/flash.sh new file mode 100755 index 00000000..3c38601d --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/flash.sh @@ -0,0 +1,28 @@ +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_nucleo_f446ze_extensions + +USE_STFLASH=false + +pushd $EXTENSIONS_DIR > /dev/null + + if [ -f build/micro-ROS.bin ]; then + + echo "Flashing firmware for $RTOS platform $PLATFORM" + if [$USE_STFLASH = true]; then + st-flash --reset write build/micro-ROS.bin 0x8000000 + else + if lsusb -d 0483:374b; then + ST_INTERFACE=interface/stlink-v2-1.cfg + elif lsusb -d 0483:3748; then + ST_INTERFACE=interface/stlink-v2.cfg + else + # TODO: add stlink v3, should it be stlink.cfg ? + echo "Error. Unsuported OpenOCD USB programmer" + exit 1 + fi + openocd -f $ST_INTERFACE -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" + fi + else + echo "build/micro-ROS.bin not found: please compile before flashing." + fi + +popd > /dev/null diff --git a/micro_ros_setup/config/freertos/nucleo_f446ze/package.xml b/micro_ros_setup/config/freertos/nucleo_f446ze/package.xml new file mode 100644 index 00000000..ec27e966 --- /dev/null +++ b/micro_ros_setup/config/freertos/nucleo_f446ze/package.xml @@ -0,0 +1,12 @@ + + + + firmware + 0.0.0 + Micro-ROS dependecies for FreeRTOS and STM32F446ZE + Ali AlSaibie + APL2 + + openocd + + diff --git a/micro_ros_setup/config/freertos/olimex-stm32-e407/board.repos b/micro_ros_setup/config/freertos/olimex-stm32-e407/board.repos index 7fa5f072..5e4c4a03 100644 --- a/micro_ros_setup/config/freertos/olimex-stm32-e407/board.repos +++ b/micro_ros_setup/config/freertos/olimex-stm32-e407/board.repos @@ -2,7 +2,7 @@ repositories: freertos_apps: type: git url: https://github.com/micro-ROS/freertos_apps - version: dashing + version: foxy diff --git a/micro_ros_setup/config/freertos/olimex-stm32-e407/client-colcon.meta b/micro_ros_setup/config/freertos/olimex-stm32-e407/client-colcon.meta index 1b90f924..60b6d7dc 100644 --- a/micro_ros_setup/config/freertos/olimex-stm32-e407/client-colcon.meta +++ b/micro_ros_setup/config/freertos/olimex-stm32-e407/client-colcon.meta @@ -1,5 +1,11 @@ { "names": { + "tracetools": { + "cmake-args": [ + "-DTRACETOOLS_DISABLED=ON", + "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" + ] + }, "rcutils": { "cmake-args": [ "-DENABLE_TESTING=OFF", @@ -9,7 +15,8 @@ }, "microxrcedds_client": { "cmake-args": [ - "-DUCLIENT_PIC=OFF" + "-DUCLIENT_PIC=OFF", + "-DUCLIENT_PROFILE_DISCOVERY=OFF" ] }, "rmw_microxrcedds": { diff --git a/micro_ros_setup/config/freertos/olimex-stm32-e407/client_uros_packages.repos b/micro_ros_setup/config/freertos/olimex-stm32-e407/client_uros_packages.repos index 4e6b4256..5223a965 100644 --- a/micro_ros_setup/config/freertos/olimex-stm32-e407/client_uros_packages.repos +++ b/micro_ros_setup/config/freertos/olimex-stm32-e407/client_uros_packages.repos @@ -2,30 +2,42 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/micro-CDR.git - version: dashing + version: foxy eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: dashing + version: foxy # MicroROS uros/rcl: type: git url: https://github.com/micro-ROS/rcl - version: dashing + version: foxy + uros/rclc: + type: git + url: https://github.com/micro-ROS/rclc + version: master uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils - version: dashing + version: foxy uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: dashing + version: foxy + uros/rosidl_typesupport: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport.git + version: foxy uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: dashing + version: foxy + uros/tracetools: + type: git + url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing + version: feature/foxy_migration # Remove this when it returns to ros2.repos ros2/tinydir_vendor: diff --git a/micro_ros_setup/config/freertos/olimex-stm32-e407/configure.sh b/micro_ros_setup/config/freertos/olimex-stm32-e407/configure.sh index de71a7b6..161cb963 100755 --- a/micro_ros_setup/config/freertos/olimex-stm32-e407/configure.sh +++ b/micro_ros_setup/config/freertos/olimex-stm32-e407/configure.sh @@ -18,8 +18,12 @@ if [ "$UROS_TRANSPORT" == "udp" ] || [ "$UROS_TRANSPORT" == "tcp" ]; then update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT="$UROS_TRANSPORT update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP="$UROS_AGENT_IP update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT="$UROS_AGENT_PORT - + update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=OFF" + update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=ON" + update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" + remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE" + remove_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL" remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER_SERIAL" remove_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC_SERIAL" @@ -31,8 +35,11 @@ elif [ "$UROS_TRANSPORT" == "serial" ]; then cp -f $EXTENSIONS_DIR/Src/olimex_e407_serial_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c cp -f $EXTENSIONS_DIR/Inc/olimex_e407_serial_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON" + update_meta "microxrcedds_client" "UCLIENT_PROFILE_SERIAL=ON" + update_meta "microxrcedds_client" "UCLIENT_PROFILE_UDP=OFF" + update_meta "microxrcedds_client" "UCLIENT_PROFILE_TCP=OFF" - update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" + update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom_serial" update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" diff --git a/micro_ros_setup/config/freertos/olimex-stm32-e407/create.sh b/micro_ros_setup/config/freertos/olimex-stm32-e407/create.sh index 77313da8..16c657fa 100755 --- a/micro_ros_setup/config/freertos/olimex-stm32-e407/create.sh +++ b/micro_ros_setup/config/freertos/olimex-stm32-e407/create.sh @@ -14,7 +14,13 @@ pushd $FW_TARGETDIR >/dev/null # ignore broken packages touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE + touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE touch mcu_ws/ros2/rcl/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE + touch mcu_ws/ros2/rcpputils/COLCON_IGNORE + touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE + touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE - rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" + rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro foxy --skip-keys="$SKIP" popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/board.repos b/micro_ros_setup/config/freertos/stm32f4_disco/board.repos new file mode 100644 index 00000000..6349df15 --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/board.repos @@ -0,0 +1,5 @@ +repositories: + freertos_apps: + type: git + url: https://github.com/micro-ros/freertos_apps + version: dashing diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/build.sh b/micro_ros_setup/config/freertos/stm32f4_disco/build.sh new file mode 100644 index 00000000..38567b4c --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/build.sh @@ -0,0 +1,31 @@ +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_stm32f4_disco_extensions + +. $PREFIX/config/utils.sh + +pushd $EXTENSIONS_DIR >/dev/null + + export UROS_APP=$(head -n1 $FW_TARGETDIR/APP | tail -n1) + export UROS_APP_FOLDER="$FW_TARGETDIR/freertos_apps/apps/$UROS_APP" + + if [ -d "$UROS_APP_FOLDER" ]; then + echo "Selected app: $UROS_APP" + else + echo "App not found: $UROS_APP" + print_available_apps + exit 1 + fi + + if [ "$UROS_FAST_BUILD" = "off" ] || [ ! -d "build" ]; then + # Clean micro-ROS build + rm -rf $FW_TARGETDIR/mcu_ws/build $FW_TARGETDIR/mcu_ws/install $FW_TARGETDIR/mcu_ws/log + + # Clean build + make clean + + # Build micro-ROS stack + make libmicroros + fi + + # Build firmware + make -j$(nproc) UROS_APP_FOLDER=$UROS_APP_FOLDER +popd >/dev/null diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/client-colcon.meta b/micro_ros_setup/config/freertos/stm32f4_disco/client-colcon.meta new file mode 100644 index 00000000..1af45a34 --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/client-colcon.meta @@ -0,0 +1,23 @@ +{ + "names": { + "rcutils": { + "cmake-args": [ + "-DENABLE_TESTING=OFF", + "-DRCUTILS_NO_FILESYSTEM=ON", + "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON" + ] + }, + "microxrcedds_client": { + "cmake-args": [ + "-DUCLIENT_PIC=OFF" + ] + }, + "rmw_microxrcedds": { + "cmake-args": [ + "-DRMW_UXRCE_XML_BUFFER_LENGTH=400", + "-DRMW_UXRCE_TRANSPORT=custom_serial", + "-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=2" + ] + } + } +} diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/client_uros_packages.repos b/micro_ros_setup/config/freertos/stm32f4_disco/client_uros_packages.repos new file mode 100644 index 00000000..0ff8c01e --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/client_uros_packages.repos @@ -0,0 +1,34 @@ +repositories: + eProsima/Micro-CDR: + type: git + url: https://github.com/eProsima/Micro-CDR.git + version: dashing + eProsima/Micro-XRCE-DDS-Client: + type: git + url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git + version: dashing + +# MicroROS + + uros/rcl: + type: git + url: https://github.com/micro-ROS/rcl + version: dashing + uros/rcutils: + type: git + url: https://github.com/micro-ROS/rcutils + version: dashing + uros/rmw_microxrcedds: + type: git + url: https://github.com/micro-ROS/rmw-microxrcedds.git + version: dashing + uros/rosidl_typesupport_microxrcedds: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git + version: dashing + +# interim, until crosscompile fix is available in dashing branch + ros2/tinydir_vendor: + type: git + url: https://github.com/ros2/tinydir_vendor.git + version: master diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/configure.sh b/micro_ros_setup/config/freertos/stm32f4_disco/configure.sh new file mode 100755 index 00000000..c5d27f5e --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/configure.sh @@ -0,0 +1,31 @@ + +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_stm32f4_disco_extensions + +. $PREFIX/config/utils.sh + +function help { + echo "Configure script need an argument." + echo " --transport -t serial or serial-usb" + echo " --dev -d agent string descriptor in a serial-like transport" +} + +echo $CONFIG_NAME > $FW_TARGETDIR/APP +# TODO add USB-OTG support +if [ "$UROS_TRANSPORT" == "serial" ]; then + echo "Using serial device USART$UROS_AGENT_DEVICE." + + cp -f $EXTENSIONS_DIR/uros_transport/stm32f4disco_serial_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c + cp -f $EXTENSIONS_DIR/uros_transport/stm32f4disco_serial_transport.h $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/transport/serial/serial_transport_external.h + update_meta "microxrcedds_client" "UCLIENT_EXTERNAL_SERIAL=ON" + + update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom" + update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE + + remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP" + remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT" + + echo "Configured $UROS_TRANSPORT mode with agent at USART$UROS_AGENT_DEVICE" + +else + help +fi diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/create.sh b/micro_ros_setup/config/freertos/stm32f4_disco/create.sh new file mode 100755 index 00000000..77313da8 --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/create.sh @@ -0,0 +1,20 @@ +pushd $FW_TARGETDIR >/dev/null + # Install toolchain + mkdir toolchain + + + # Install toolchain + echo "Downloading ARM compiler, this may take a while" + curl -fsSLO https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 + tar --strip-components=1 -xvjf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 -C toolchain > /dev/null + rm gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2 + + # Import repos + vcs import --input $PREFIX/config/$RTOS/$PLATFORM/board.repos >/dev/null + + # ignore broken packages + touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE + touch mcu_ws/ros2/rcl/COLCON_IGNORE + + rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" +popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/freertos/stm32f4_disco/flash.sh b/micro_ros_setup/config/freertos/stm32f4_disco/flash.sh new file mode 100755 index 00000000..01da267f --- /dev/null +++ b/micro_ros_setup/config/freertos/stm32f4_disco/flash.sh @@ -0,0 +1,28 @@ +EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_stm32f4_disco_extensions + +USE_STFLASH=false + +pushd $EXTENSIONS_DIR > /dev/null + + if [ -f build/micro-ROS.bin ]; then + + echo "Flashing firmware for $RTOS platform $PLATFORM" + if [$USE_STFLASH = true]; then + st-flash --reset write build/micro-ROS.bin 0x8000000 + else + if lsusb -d 0483:374b; then + ST_INTERFACE=interface/stlink-v2-1.cfg + elif lsusb -d 0483:3748; then + ST_INTERFACE=interface/stlink-v2.cfg + else + # TODO: add stlink v3, should it be stlink.cfg ? + echo "Error. Unsuported OpenOCD USB programmer" + exit 1 + fi + openocd -f $ST_INTERFACE -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase build/micro-ROS.bin 0x08000000" -c "reset" -c "exit" + fi + else + echo "build/micro-ROS.bin not found: please compile before flashing." + fi + +popd > /dev/null diff --git a/micro_ros_setup/config/host/generic/client_host_packages.repos b/micro_ros_setup/config/host/generic/client_host_packages.repos index c8aa87ff..6363a8fa 100644 --- a/micro_ros_setup/config/host/generic/client_host_packages.repos +++ b/micro_ros_setup/config/host/generic/client_host_packages.repos @@ -2,27 +2,27 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: dashing + version: foxy eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: dashing + version: foxy # MicroROS uros/rclc: type: git url: https://github.com/micro-ROS/rclc.git - version: dashing + version: master uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: dashing + version: foxy uros/rosidl_typesupport_microxrcedds: type: git url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: dashing + version: foxy uros/micro-ROS-demos: type: git url: https://github.com/micro-ROS/micro-ROS-demos.git - version: dashing + version: foxy diff --git a/micro_ros_setup/config/host/generic/create.sh b/micro_ros_setup/config/host/generic/create.sh index 5c5c3b97..14003e8d 100755 --- a/micro_ros_setup/config/host/generic/create.sh +++ b/micro_ros_setup/config/host/generic/create.sh @@ -6,6 +6,5 @@ cp $PREFIX/config/$RTOS/$PLATFORM/client-host-colcon.meta src/colcon.meta rosdep install -y --from-paths src -i src --skip-keys="$SKIP" -# TODO (pablogs9): Remove when rclc builds correctly -touch src/uros/micro-ROS-demos/rclc/COLCON_IGNORE -touch src/uros/rclc/COLCON_IGNORE \ No newline at end of file +touch src/uros/rclc/rclc_examples/COLCON_IGNORE +touch src/uros/rclc/rclc_lifecycle/COLCON_IGNORE \ No newline at end of file diff --git a/micro_ros_setup/config/nuttx/generic/client-colcon.meta b/micro_ros_setup/config/nuttx/generic/client-colcon.meta index ccc376c5..42efe3e1 100644 --- a/micro_ros_setup/config/nuttx/generic/client-colcon.meta +++ b/micro_ros_setup/config/nuttx/generic/client-colcon.meta @@ -1,23 +1,37 @@ { "names": { + "tracetools": { + "cmake-args": [ + "-DTRACETOOLS_DISABLED=ON", + "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF" + ] + }, "rcutils": { "cmake-args": [ - "-DENABLE_TESTING=OFF" + "-DENABLE_TESTING=OFF", + "-DRCUTILS_NO_THREAD_SUPPORT=ON" ] }, + "rcl": { + "cmake-args": [ + "-DRCL_LOGGING_ENABLED=OFF" + ] + }, "microxrcedds_client":{ - "cmake-args":[ - "-DUCLIENT_PIC=OFF" + "cmake-args": [ + "-DUCLIENT_PIC=OFF", + "-DUCLIENT_PROFILE_DISCOVERY=OFF", + "-DUCLIENT_PROFILE_TCP=OFF" ] }, "rmw_microxrcedds":{ - "cmake-args":[ + "cmake-args": [ "-DRMW_UXRCE_MAX_NODES=1", - "-DRMW_UXRCE_MAX_PUBLISHERS_X_NODE=2", - "-DRMW_UXRCE_MAX_SUBSCRIPTIONS_X_NODE=1", - "-DRMW_UXRCE_MAX_SERVICES_X_NODE=1", - "-DRMW_UXRCE_MAX_CLIENTS_X_NODE=1", - "-DRMW_UXRCE_MAX_HISTORY=1", + "-DRMW_UXRCE_MAX_PUBLISHERS=1", + "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", + "-DRMW_UXRCE_MAX_SERVICES=1", + "-DRMW_UXRCE_MAX_CLIENTS=1", + "-DRMW_UXRCE_MAX_HISTORY=4", "-DRMW_UXRCE_XML_BUFFER_LENGTH=400" ] } diff --git a/micro_ros_setup/config/nuttx/generic/client_uros_packages.repos b/micro_ros_setup/config/nuttx/generic/client_uros_packages.repos index 8f81a899..eb7f296b 100644 --- a/micro_ros_setup/config/nuttx/generic/client_uros_packages.repos +++ b/micro_ros_setup/config/nuttx/generic/client_uros_packages.repos @@ -2,36 +2,48 @@ repositories: eProsima/Micro-CDR: type: git url: https://github.com/eProsima/Micro-CDR.git - version: dashing + version: foxy eProsima/Micro-XRCE-DDS-Client: type: git url: https://github.com/eProsima/Micro-XRCE-DDS-Client.git - version: dashing + version: foxy # MicroROS + uros/rcl: + type: git + url: https://github.com/micro-ROS/rcl.git + version: foxy uros/rclc: type: git url: https://github.com/micro-ROS/rclc.git - version: dashing + version: master uros/rmw_microxrcedds: type: git url: https://github.com/micro-ROS/rmw-microxrcedds.git - version: dashing - uros/rosidl_typesupport_microxrcedds: - type: git - url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git - version: dashing + version: foxy uros/rcutils: type: git url: https://github.com/micro-ROS/rcutils.git - version: dashing + version: foxy drive_base: type: git url: https://github.com/micro-ROS/drive_base.git version: master + uros/tracetools: + type: git + url: https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing + version: feature/foxy_migration + uros/rosidl_typesupport: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport.git + version: foxy + uros/rosidl_typesupport_microxrcedds: + type: git + url: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git + version: foxy -# interim, until crosscompile fix is available in dashing branch +# interim, until crosscompile fix is available in foxy branch ros2/tinydir_vendor: type: git url: https://github.com/ros2/tinydir_vendor.git diff --git a/micro_ros_setup/config/nuttx/generic/configure.sh b/micro_ros_setup/config/nuttx/generic/configure.sh index 94e14601..1fc557af 100755 --- a/micro_ros_setup/config/nuttx/generic/configure.sh +++ b/micro_ros_setup/config/nuttx/generic/configure.sh @@ -37,5 +37,3 @@ make distclean tools/configure.sh $CONFIG popd >/dev/null -find $MCU_WS_DIR -name rmw_microxrcedds.config -exec \ - sed -i "s/CONFIG_MICRO_XRCEDDS_TRANSPORT=udp/CONFIG_MICRO_XRCEDDS_TRANSPORT=serial/g" {} \; diff --git a/micro_ros_setup/config/nuttx/generic/create.sh b/micro_ros_setup/config/nuttx/generic/create.sh index 97c37e52..7d741bfc 100755 --- a/micro_ros_setup/config/nuttx/generic/create.sh +++ b/micro_ros_setup/config/nuttx/generic/create.sh @@ -20,14 +20,19 @@ pushd $FW_TARGETDIR >/dev/null # ignore broken packages touch mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE + touch mcu_ws/ros2/rcl_logging/rcl_logging_spdlog/COLCON_IGNORE touch mcu_ws/ros2/rcl/rcl_action/COLCON_IGNORE - rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" + touch mcu_ws/ros2/rcl/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_c/COLCON_IGNORE + touch mcu_ws/ros2/rosidl/rosidl_typesupport_introspection_cpp/COLCON_IGNORE + touch mcu_ws/ros2/rcpputils/COLCON_IGNORE + touch mcu_ws/uros/rcl/rcl_yaml_param_parser/COLCON_IGNORE + touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE - # turn off features which don't compile on NuttX currently - echo -e ",s/PROFILE_DISCOVERY=TRUE/PROFILE_DISCOVERY=FALSE/\n,s/PROFILE_TCP_TRANSPORT=TRUE/PROFILE_TCP_TRANSPORT=FALSE/g\nw" | ed $(find mcu_ws -name client.config) >/dev/null + rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro foxy --skip-keys="$SKIP" popd >/dev/null cp $PREFIX/config/$RTOS/generic/package.xml $FW_TARGETDIR/apps/package.xml -rosdep install -y --from-paths $FW_TARGETDIR/apps -i $FW_TARGETDIR/apps --rosdistro dashing +rosdep install -y --from-paths $FW_TARGETDIR/apps -i $FW_TARGETDIR/apps --rosdistro foxy diff --git a/micro_ros_setup/config/nuttx/generic/flash.sh b/micro_ros_setup/config/nuttx/generic/flash.sh index 4ad3b072..2fd06daa 100755 --- a/micro_ros_setup/config/nuttx/generic/flash.sh +++ b/micro_ros_setup/config/nuttx/generic/flash.sh @@ -7,6 +7,28 @@ set -o pipefail pushd $FW_TARGETDIR/NuttX > /dev/null -./scripts/flash.sh olimex-stm32-e407 +if [ "$PLATFORM" = "olimex-stm32-e407" ]; then + if [ -f nuttx.bin ]; then + echo "Flashing firmware for $RTOS platform $PLATFORM" + + if lsusb -d 15BA:002a; then + PROGRAMMER=interface/ftdi/olimex-arm-usb-tiny-h.cfg + elif lsusb -d 15BA:0003;then + PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd.cfg + elif lsusb -d 15BA:002b;then + PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd-h.cfg + else + echo "Error. Unsuported OpenOCD USB programmer" + exit 1 + fi + + openocd -f $PROGRAMMER -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000" -c "reset" -c "exit" + else + echo "Nuttx/nuttx.bin not found: please compile before flashing." + fi +else + echo "Unrecognized board: $PLATFORM" + exit 1 +fi popd > /dev/null diff --git a/micro_ros_setup/config/nuttx/generic/uros_packages.repos b/micro_ros_setup/config/nuttx/generic/uros_packages.repos index 1a222d26..2baecab6 100644 --- a/micro_ros_setup/config/nuttx/generic/uros_packages.repos +++ b/micro_ros_setup/config/nuttx/generic/uros_packages.repos @@ -6,7 +6,7 @@ repositories: apps: type: git url: https://github.com/micro-ROS/apps.git - version: dashing + version: foxy uclibc: type: git url: https://github.com/micro-ROS/uclibc.git diff --git a/micro_ros_setup/config/raspbian/generic/configure.sh b/micro_ros_setup/config/raspbian/generic/configure.sh index cc4bd6f4..b730d604 100755 --- a/micro_ros_setup/config/raspbian/generic/configure.sh +++ b/micro_ros_setup/config/raspbian/generic/configure.sh @@ -3,7 +3,7 @@ pushd $FW_TARGETDIR >/dev/null rm -rf mcu_ws/* cp raspbian_apps/toolchain.cmake mcu_ws/ - curl -s https://raw.githubusercontent.com/ros2/ros2/dashing/ros2.repos |\ + curl -s https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos |\ ros2 run micro_ros_setup yaml_filter.py raspbian_apps/$CONFIG_NAME/ros2_repos.filter > ros2.repos vcs import --input ros2.repos mcu_ws/ && rm ros2.repos if [ -d mcu_ws/ros2/rcl_logging/rcl_logging_log4cxx ]; then @@ -23,4 +23,4 @@ pushd $FW_TARGETDIR >/dev/null if [ -d raspbian_apps/$CONFIG_NAME/bin ]; then cp -r raspbian_apps/$CONFIG_NAME/bin mcu_ws/ fi -popd >/dev/null \ No newline at end of file +popd >/dev/null diff --git a/micro_ros_setup/config/raspbian/generic/create.sh b/micro_ros_setup/config/raspbian/generic/create.sh index 846d1dc3..bfd5d87f 100755 --- a/micro_ros_setup/config/raspbian/generic/create.sh +++ b/micro_ros_setup/config/raspbian/generic/create.sh @@ -18,5 +18,5 @@ pushd $FW_TARGETDIR/$DEV_WS_DIR >/dev/null popd >/dev/null pushd $FW_TARGETDIR >/dev/null - git clone https://github.com/micro-ROS/raspbian_apps.git + git clone -b foxy https://github.com/micro-ROS/raspbian_apps.git popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/raspbian/generic/supported_platforms b/micro_ros_setup/config/raspbian/generic/supported_platforms new file mode 100644 index 00000000..7c62ce96 --- /dev/null +++ b/micro_ros_setup/config/raspbian/generic/supported_platforms @@ -0,0 +1,3 @@ +stretch_v8 +buster_v7 +buster_v8 \ No newline at end of file diff --git a/micro_ros_setup/config/zephyr/generic/build.sh b/micro_ros_setup/config/zephyr/generic/build.sh index 003b826d..a927c8f2 100755 --- a/micro_ros_setup/config/zephyr/generic/build.sh +++ b/micro_ros_setup/config/zephyr/generic/build.sh @@ -37,6 +37,8 @@ pushd $FW_TARGETDIR >/dev/null export BOARD="olimex_stm32_e407" elif [ "$PLATFORM" = "nucleo_f401re" ]; then export BOARD="nucleo_f401re" + elif [ "$PLATFORM" = "stm32f4_disco" ]; then + export BOARD="stm32f4_disco" elif [ "$PLATFORM" = "host" ]; then export BOARD="native_posix" else diff --git a/micro_ros_setup/config/zephyr/generic/client-colcon.meta b/micro_ros_setup/config/zephyr/generic/client-colcon.meta index 168f2c8a..2d879c39 100644 --- a/micro_ros_setup/config/zephyr/generic/client-colcon.meta +++ b/micro_ros_setup/config/zephyr/generic/client-colcon.meta @@ -26,6 +26,9 @@ "-DRMW_UXRCE_MAX_SERVICES=1", "-DRMW_UXRCE_MAX_CLIENTS=1", "-DRMW_UXRCE_MAX_HISTORY=4" + "-DRMW_UXRCE_XML_BUFFER_LENGTH=400", + "-DRMW_UXRCE_TRANSPORT=custom_serial", + "-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=2" ] } } diff --git a/micro_ros_setup/config/zephyr/generic/create.sh b/micro_ros_setup/config/zephyr/generic/create.sh index 858e1143..6764e13e 100755 --- a/micro_ros_setup/config/zephyr/generic/create.sh +++ b/micro_ros_setup/config/zephyr/generic/create.sh @@ -1,17 +1,14 @@ # Reminder: Zephyr recommended dependecies are: git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib software-properties-common -y -CMAKE_VERSION_NUMBER=$(cmake --version | grep "[0-9]*\.[0-9]*\.[0-9]*" | cut -d ' ' -f 3) -CMAKE_VERSION_MAJOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 1) -CMAKE_VERSION_MINOR_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 2) -CMAKE_VERSION_PATCH_NUMBER=$(echo $CMAKE_VERSION_NUMBER | cut -d '.' -f 3) - -if ! (( $CMAKE_VERSION_MAJOR_NUMBER > 3 || \ - $CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER > 13 || \ - $CMAKE_VERSION_MAJOR_NUMBER == 3 && $CMAKE_VERSION_MINOR_NUMBER == 13 && $CMAKE_VERSION_PATCH_NUMBER >= 1 )); then - echo "Error: installed CMake version must be equal or greater than 3.13.1." - echo "Your current version is $CMAKE_VERSION_NUMBER." +# We need a version newer than the repo +wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - +if sudo echo "deb https://apt.kitware.com/ubuntu/ bionic main" > /etc/apt/sources.list.d/kitware.list; then + sudo apt update + sudo apt install cmake -y +else + echo "Error while installing CMake version >= 3.13.1. Check with cmake --version" echo "Please if not installed follow the instructions: https://docs.zephyrproject.org/latest/getting_started/index.html" - exit 1 + sleep 2 fi export PATH=~/.local/bin:"$PATH" @@ -56,4 +53,4 @@ pushd $FW_TARGETDIR >/dev/null touch mcu_ws/ros2/rcl/COLCON_IGNORE rosdep install -y --from-paths mcu_ws -i mcu_ws --rosdistro dashing --skip-keys="$SKIP" -popd >/dev/null +popd >/dev/null \ No newline at end of file diff --git a/micro_ros_setup/config/zephyr/generic/flash.sh b/micro_ros_setup/config/zephyr/generic/flash.sh index eef47511..5f0a19b3 100755 --- a/micro_ros_setup/config/zephyr/generic/flash.sh +++ b/micro_ros_setup/config/zephyr/generic/flash.sh @@ -1,6 +1,6 @@ pushd $FW_TARGETDIR > /dev/null -if [ "$PLATFORM" = "discovery_l475_iot1" ] || [ "$PLATFORM" = "nucleo_f401re" ]; then +if [ "$PLATFORM" = "discovery_l475_iot1" ] || [ "$PLATFORM" = "nucleo_f401re" ]|| [ "$PLATFORM" = "stm32f4_disco" ]; then export ZEPHYR_TOOLCHAIN_VARIANT=zephyr export ZEPHYR_SDK_INSTALL_DIR=$FW_TARGETDIR/zephyr-sdk diff --git a/micro_ros_setup/config/zephyr/generic/supported_platforms b/micro_ros_setup/config/zephyr/generic/supported_platforms index 6b5f2198..34cd6251 100644 --- a/micro_ros_setup/config/zephyr/generic/supported_platforms +++ b/micro_ros_setup/config/zephyr/generic/supported_platforms @@ -1,3 +1,4 @@ discovery_l475_iot1 olimex-stm32-e407 -nucleo_f401re \ No newline at end of file +nucleo_f401re +stm32f4_disco diff --git a/micro_ros_setup/scripts/build_firmware.sh b/micro_ros_setup/scripts/build_firmware.sh index a39cff0b..26b3d440 100755 --- a/micro_ros_setup/scripts/build_firmware.sh +++ b/micro_ros_setup/scripts/build_firmware.sh @@ -22,6 +22,9 @@ export UROS_FAST_BUILD if [ -d $FW_TARGETDIR ]; then RTOS=$(head -n1 $FW_TARGETDIR/PLATFORM) PLATFORM=$(head -n2 firmware/PLATFORM | tail -n1) + if [ -f $FW_TARGETDIR/TRANSPORT ]; then + TRANSPORT=$(head -n1 firmware/TRANSPORT) + fi else echo "Firmware folder not found. Please use ros2 run micro_ros_setup create_firmware_ws.sh to create a new project." exit 1 diff --git a/micro_ros_setup/scripts/create_firmware_ws.sh b/micro_ros_setup/scripts/create_firmware_ws.sh index 33247bf8..282d7f5b 100755 --- a/micro_ros_setup/scripts/create_firmware_ws.sh +++ b/micro_ros_setup/scripts/create_firmware_ws.sh @@ -68,11 +68,11 @@ echo $RTOS > $FW_TARGETDIR/PLATFORM echo $PLATFORM >> $FW_TARGETDIR/PLATFORM # Setting common enviroment -SKIP="microxrcedds_client microcdr rosidl_typesupport_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_opensplice_cpp rosidl_typesupport_opensplice_c rmw_connext_cpp rmw_opensplice_cpp" +SKIP="microxrcedds_agent microxrcedds_client microcdr rosidl_typesupport_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_opensplice_cpp rosidl_typesupport_opensplice_c rmw_connext_cpp rmw_opensplice_cpp ros-foxy-cyclonedds ros-foxy-rmw-cyclonedds-cpp" # Installing common packages rosdep update -rosdep install -y --from-paths src -i src --rosdistro dashing --skip-keys="$SKIP" +rosdep install -y --from-paths src -i src --rosdistro foxy --skip-keys="$SKIP" # Check generic build if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then @@ -88,7 +88,7 @@ pushd $FW_TARGETDIR >/dev/null if [ $RTOS != "host" ]; then ros2 run micro_ros_setup create_ws.sh $DEV_WS_DIR $PREFIX/config/$RTOS/dev_ros2_packages.txt \ $PREFIX/config/$RTOS/dev_uros_packages.repos - rosdep install -y --from-paths $DEV_WS_DIR -i $DEV_WS_DIR --rosdistro dashing --skip-keys="$SKIP" + rosdep install -y --from-paths $DEV_WS_DIR -i $DEV_WS_DIR --rosdistro foxy --skip-keys="$SKIP" # Creating mcu directory mkdir mcu_ws @@ -109,7 +109,7 @@ if [ $RTOS != "host" ]; then fi # Install dependecies for specific platform -rosdep install -y --from-paths $PREFIX/config/$RTOS/$TARGET_FOLDER -i $PREFIX/config/$RTOS/$TARGET_FOLDER --rosdistro dashing --skip-keys="$SKIP" +rosdep install -y --from-paths $PREFIX/config/$RTOS/$TARGET_FOLDER -i $PREFIX/config/$RTOS/$TARGET_FOLDER --rosdistro foxy --skip-keys="$SKIP" # Creating specific firmware folder . $PREFIX/config/$RTOS/$TARGET_FOLDER/create.sh diff --git a/micro_ros_setup/scripts/create_ws.sh b/micro_ros_setup/scripts/create_ws.sh index 022b33b1..654758ab 100755 --- a/micro_ros_setup/scripts/create_ws.sh +++ b/micro_ros_setup/scripts/create_ws.sh @@ -40,7 +40,7 @@ then fi # ROS_DISTRO SPECIFIC -curl -s https://raw.githubusercontent.com/ros2/ros2/dashing/ros2.repos |\ +curl -s https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos |\ ros2 run micro_ros_setup yaml_filter.py ${PACKAGES} > ros2.repos vcs import --input ros2.repos > /dev/null vcs import --input $REPOS > /dev/null diff --git a/micro_ros_setup/scripts/yaml_filter.py b/micro_ros_setup/scripts/yaml_filter.py index 798ee7bc..80d6f291 100755 --- a/micro_ros_setup/scripts/yaml_filter.py +++ b/micro_ros_setup/scripts/yaml_filter.py @@ -7,8 +7,8 @@ import copy if __name__ == '__main__': - repos_info = yaml.load(sys.stdin) - repos_keep = yaml.load(open(sys.argv[1]))['keep'].split() + repos_info = yaml.safe_load(sys.stdin) + repos_keep = yaml.safe_load(open(sys.argv[1]))['keep'].split() target = {'repositories': {}}