Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions micro_ros_setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -116,49 +116,55 @@ For more information please visit the links.
<td>uros</td>
</tr>
<tr>
<td rowspan=6>freertos</td>
<td rowspan=2>crazyflie21</td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/crazyflie_position_publisher/app.c">crazyflie_position_publisher</a></td>
<td rowspan=4>freertos</td>
<td rowspan=1>crazyflie21</td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/crazyflie_position_publisher/app.c">crazyflie_position_publisher</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/crazyflie_uros_sample/app.c">crazyflie_uros_sample</a></td>
<td rowspan=3>olimex-stm32-e407</td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/add_two_ints_service/app.c">add_two_ints_service</a></td>
</tr>
<tr>
<td rowspan=4>olimex-stm32-e407</td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/add_two_ints/app.c">add_two_ints</a></td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/int32_publisher/app.c">int32_publisher</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/ping_pong/app.c">ping_pong</a></td>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/foxy/apps/ping_pong/app.c">ping_pong</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/olimex_uros_sample/app.c">olimex_uros_sample</a></td>
<td rowspan=11>zephyr</td>
<td rowspan=6>discovery_l475_iot1</td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/add_two_ints_service/src/main.c">add_two_ints_service</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/freertos_apps/blob/dashing/apps/int32_publisher/app.c">int32_publisher</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/int32_publisher/src/main.c">int32_publisher</a></td>
</tr>
<tr>
<td rowspan=7>zephyr</td>
<td rowspan=4>discovery_l475_iot1</td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/src/main.c">ping_pong</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/int32_wifi_publisher/src/main.c">int32_wifi_publisher</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/int32_publisher/src/main.c">int32_publisher</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/src/main.c">ping_pong</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/sensors_publisher/src/main.c">sensors_publisher</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/sensors_publisher/src/main.c">sensors_publisher</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/tof_ws2812/src/main.c">tof_ws2812</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/tof_ws2812/src/main.c">tof_ws2812</a></td>
</tr>
<tr>
<td rowspan=3>olimex-stm32-e407</td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/ping_pong/src/main.c">ping_pong</a></td>
<td rowspan=5>olimex-stm32-e407</td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/add_two_ints_service/src/main.c">add_two_ints_service</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/int32_publisher/src/main.c">int32_publisher</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/openmanipulator_tof/src/main.c">openmanipulator_tof</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/int32_publisher/src/main.c">int32_publisher</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/ping_pong/src/main.c">ping_pong</a></td>
</tr>
<tr>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/dashing/apps/vl53l1x_tof_sensor/src/main.c">vl53l1x_tof_sensor</a></td>
<td><a href="https://github.com/micro-ROS/zephyr_apps/blob/foxy/apps/vl53l1x_tof_sensor/src/main.c">vl53l1x_tof_sensor</a></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions micro_ros_setup/config/agent_uros_packages.repos
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion micro_ros_setup/config/client_ros2_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,3 +12,4 @@ keep:
ros2/rcl_logging
ros2/test_interface_files
ros2/example_interfaces
ros2/rcpputils
4 changes: 2 additions & 2 deletions micro_ros_setup/config/freertos/crazyflie21/board.repos
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion micro_ros_setup/config/freertos/crazyflie21/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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":{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions micro_ros_setup/config/freertos/crazyflie21/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions micro_ros_setup/config/freertos/nucleo_f446ze/board.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
freertos_apps:
type: git
url: https://github.com/micro-ros/freertos_apps
version: dashing
31 changes: 31 additions & 0 deletions micro_ros_setup/config/freertos/nucleo_f446ze/build.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions micro_ros_setup/config/freertos/nucleo_f446ze/configure.sh
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions micro_ros_setup/config/freertos/nucleo_f446ze/create.sh
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions micro_ros_setup/config/freertos/nucleo_f446ze/flash.sh
Original file line number Diff line number Diff line change
@@ -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
Loading