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 imagekaliatech ( 2019-07-26 19:22:14 -0500 )edit