Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Can only create whitelisting with IP, also set to default profile.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed Jun 23, 2024
1 parent 853a3ba commit ef68e4e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN git clone --recursive --depth 1 https://github.com/107-systems/robotem_rovne

WORKDIR /opt/colcon_ws

COPY fastrtps-whitelist-wlan.xml /opt/colcon_ws
COPY fastrtps-whitelist-wlan.sh /opt/colcon_ws
ENV FASTRTPS_DEFAULT_PROFILES_FILE=/opt/colcon_ws/fastrtps-whitelist-wlan.xml
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp

Expand Down
47 changes: 47 additions & 0 deletions docker/fastrtps-whitelist-wlan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

# Fast-DDS https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/whitelist.html
# needs actual ip for this interface
interface=wlan0
ipinet="$(ip a s $interface | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<profiles xmlns=\"http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles\">
<transport_descriptors>
<transport_descriptor>
<transport_id>CustomUDPTransport</transport_id>
<type>UDPv4</type>
<interfaceWhiteList>
<address>${ipinet##inet }</address>
</interfaceWhiteList>
</transport_descriptor>
<transport_descriptor>
<transport_id>CustomTcpTransport</transport_id>
<type>TCPv4</type>
<interfaceWhiteList>
<address>${ipinet##inet }</address>
</interfaceWhiteList>
</transport_descriptor>
</transport_descriptors>
<participant profile_name=\"CustomUDPTransportParticipant\" is_default_profile=\"true\">
<rtps>
<userTransports>
<transport_id>CustomUDPTransport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
<participant profile_name=\"CustomTcpTransportParticipant\" is_default_profile=\"true\">
<rtps>
<userTransports>
<transport_id>CustomTcpTransport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
</profiles>" > fastrtps-whitelist-wlan.xml
43 changes: 0 additions & 43 deletions docker/fastrtps-whitelist-wlan.xml

This file was deleted.

0 comments on commit ef68e4e

Please sign in to comment.