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

support ROS_LOCALHOST_ONLY variable #69

Merged
merged 1 commit into from
Sep 29, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions micro-ROS-Agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ RUN . /opt/ros/$ROS_DISTRO/setup.sh \
&& rm -rf log/ build/ src/

# Disable shared memory
COPY disable_fastdds_shm.xml /tmp/
ENV FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm.xml
COPY disable_fastdds_shm.xml disable_fastdds_shm_localhost_only.xml /tmp/

# setup entrypoint
COPY ./micro-ros_entrypoint.sh /
Expand Down
23 changes: 23 additions & 0 deletions micro-ROS-Agent/disable_fastdds_shm_localhost_only.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--The only purpose of this file is to disable Fast-DDS SHM transport used by default to use UDPv4-->
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
<transport_descriptors>
<transport_descriptor>
<transport_id>CustomUdpTransport</transport_id>
<type>UDPv4</type>
<interfaceWhiteList>
<address>127.0.0.1</address>
</interfaceWhiteList>
</transport_descriptor>
</transport_descriptors>

<participant profile_name="participant_profile" is_default_profile="true">
<rtps>
<userTransports>
<transport_id>CustomUdpTransport</transport_id>
</userTransports>

<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
</profiles>
7 changes: 7 additions & 0 deletions micro-ROS-Agent/micro-ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
. "/opt/ros/$ROS_DISTRO/setup.sh"
. "/uros_ws/install/local_setup.sh"

if [ "$ROS_LOCALHOST_ONLY" = "1" ] ; then
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm_localhost_only.xml
else
export FASTRTPS_DEFAULT_PROFILES_FILE=/tmp/disable_fastdds_shm.xml
fi

exec ros2 run micro_ros_agent micro_ros_agent "$@"