ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ROS2 DDS communication: How to connect AWS EC2 Instance remotely

asked 2019-07-17 11:49:01 -0500

Iori gravatar image

I am trying to connect from a Client PC (Raspberry Pi) to an AWS EC2 Instance remotely over the internet using by UDP unicast.

I had set up both computers as below.I executed a "ros2 run demo_nodes_py talker" on this Client PC, and executed a "ros2 run demo_nodes_py listener" on this Instance. But this Instance cannot receive topic messageses from this Client PC. Please let me know how to connect AWS EC2 Instance.

Details information is below:

AWS EC2 Instance configuration

  • TYPE: AWS EC2 VPC Instance(t2.micro)
  • OS: Ubuntu 18.04 LTS
  • ROS Version: ROS2 Dashing Diademata
  • Private IP: aaa.aaa.aaa.aaa
  • Public IP: bbb.bbb.bbb.bbb

  • FastRTPS - DEFAULT_FASTRTPS_PROFILES.xml

<?xml version="1.0" encoding="UTF-8" ?>
<profiles>
    <participant profile_name="my_profile_s" is_default_profile="true">
        <rtps>
            <builtin>
                <metatrafficUnicastLocatorList>
                    <locator/>
                </metatrafficUnicastLocatorList>
                <initialPeersList>
                    <locator>
                        <udpv4>
                            <address>ddd.ddd.ddd.ddd</address>
                        </udpv4>
                    </locator>
                </initialPeersList>
            </builtin>
        </rtps>
    </participant>
</profiles>
  • AWS EC2 Security Group Inbound Configuration
type      : port number: src address
-----------------------------------
Custom UDP: port 7412  : 0.0.0.0/0
Custom UDP: port 7413  : 0.0.0.0/0
Custom UDP: port 7414  : 0.0.0.0/0
Custom UDP: port 7415  : 0.0.0.0/0
Custom UDP: port 7416  : 0.0.0.0/0

Client PC configuration

  • TYPE: Raspberry Pi 3+
  • OS: Ubuntu 18.04 LTS
  • ROS Version: ROS 2 Dashing Diademata
  • Private IP: ccc.ccc.ccc.ccc
  • Public IP: ddd.ddd.ddd.ddd

  • FastRTPS - DEFAULT_FASTRTPS_PROFILES.xml

<?xml version="1.0" encoding="UTF-8" ?>
<profiles>
    <participant profile_name="my_profile_c" is_default_profile="true">
        <rtps>
            <builtin>
                <metatrafficUnicastLocatorList>
                    <locator/>
                </metatrafficUnicastLocatorList>
                <initialPeersList>
                    <locator>
                        <udpv4>
                            <address>bbb.bbb.bbb.bbb</address>
                        </udpv4>
                    </locator>
                </initialPeersList>
            </builtin>
        </rtps>
    </participant>
</profiles>

Thank you in advance for reading my question.

Best regards,

Iori

edit retag flag offensive close merge delete

Comments

Fwiw, I have also been unable to get UDP unicast to work. However, I was able to get TCP to work from client to EC2 server. Let me know if that configuration would be helpful.

kaliatech gravatar image kaliatech  ( 2019-07-26 19:22:14 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-05 00:12:22 -0500

Iori gravatar image

Thank you for your advice.

To use UDP unicast communication with ROS2, both client PC and AWS EC2 had to be able to send and receive data using the udp protocol each other. Since this network condition I have asked was client PC communicate AWS EC via NAT, It didn't work UDP unicast communication.

Therefore, I solved this problem by using an OpenVPN network between a Client PC and AWS EC2.

Best regards, Iori

edit flag offensive delete link more

Comments

Can I ask how you set up your configuration? With OpenVPN we are able to echo topics on the client PC published on AWS EC2, but not the other way around.

btidd gravatar image btidd  ( 2023-05-18 01:07:01 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-07-17 11:49:01 -0500

Seen: 845 times

Last updated: Sep 05 '19