Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New external transport approach #84

Merged
merged 2 commits into from
Mar 13, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"rmw_microxrcedds":{
"cmake-args":[
"-DRMW_UXRCE_TRANSPORT=custom"
"-DRMW_UXRCE_TRANSPORT=custom_serial"
]
}
}
Expand Down
5 changes: 3 additions & 2 deletions micro_ros_setup/config/freertos/crazyflie21/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_crazyflie21_extensions

echo $CONFIG_NAME > $FW_TARGETDIR/APP

update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER="$EXTENSIONS_DIR"/src/crazyflie_transport.h"
update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC="$EXTENSIONS_DIR"/src/crazyflie_transport.c"
cp -f $EXTENSIONS_DIR/src/crazyflie_transport.c $FW_TARGETDIR/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/profile/transport/serial/serial_transport_external.c
cp -f $EXTENSIONS_DIR/src/crazyflie_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"
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"rmw_microxrcedds": {
"cmake-args": [
"-DRMW_UXRCE_XML_BUFFER_LENGTH=400",
"-DRMW_UXRCE_TRANSPORT=custom",
"-DRMW_UXRCE_TRANSPORT=custom_serial",
"-DRMW_UXRCE_DEFAULT_SERIAL_DEVICE=3"
]
}
Expand Down
22 changes: 19 additions & 3 deletions micro_ros_setup/config/freertos/olimex-stm32-e407/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTENSIONS_DIR=$FW_TARGETDIR/freertos_apps/microros_olimex_e407_extensions

function help {
echo "Configure script need an argument."
echo " --transport -t udp, tcp, serial or serialusb"
echo " --transport -t udp, tcp, serial or serial-usb"
echo " --dev -d agent string descriptor in a serial-like transport"
echo " --ip -i agent IP in a network-like transport"
echo " --port -p agent port in a network-like transport"
Expand All @@ -28,15 +28,31 @@ if [ "$UROS_TRANSPORT" == "udp" ] || [ "$UROS_TRANSPORT" == "tcp" ]; then
elif [ "$UROS_TRANSPORT" == "serial" ]; then
echo "Using serial device USART$UROS_AGENT_DEVICE."

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 "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom"
update_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_SERIAL_DEVICE="$UROS_AGENT_DEVICE
update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER_SERIAL="$EXTENSIONS_DIR"/Inc/olimex_e407_serial_transport.h"
update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC_SERIAL="$EXTENSIONS_DIR"/Src/olimex_e407_serial_transport.c"

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"

elif [ "$UROS_TRANSPORT" == "serial-usb" ]; then
echo "Using serial USB device. EXPERIMENTAL."

cp -f $EXTENSIONS_DIR/Src/olimex_e407_usb_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_usb_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_serial"

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"
else
help
fi
8 changes: 5 additions & 3 deletions micro_ros_setup/config/zephyr/generic/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ elif [ "$UROS_TRANSPORT" == "serial" ]; then
elif [ "$UROS_TRANSPORT" == "serial-usb" ]; then
echo "Using USB serial device."

update_meta "rmw_microxrcedds" "RMW_UXRCE_TRANSPORT=custom"
update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_HEADER="$EXTENSIONS_DIR"/microros_extensions/zephyr_usb_serial_transport.h"
update_meta "microxrcedds_client" "EXTERNAL_TRANSPORT_SRC="$EXTENSIONS_DIR"/microros_extensions/zephyr_usb_serial_transport.c"
cp -f $EXTENSIONS_DIR/microros_extensions/zephyr_usb_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/microros_extensions/zephyr_usb_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_serial"

remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_IP"
remove_meta "rmw_microxrcedds" "RMW_UXRCE_DEFAULT_UDP_PORT"
Expand Down