Not able to see fmu topics with ROS2 Discovery server enabled

Hello,

I am trying to set up Discovery server on my off board computer. The server is running on an AWS EC2 instance.
When I use serial connection from flight controller to my off board computer I am able to see the PX4 fmu/out topics but not able to echo it.

But, when I run PX4 on my laptop (SITL), everything works as expected.

I am running the uxrce agent with

MicroXRCEAgent serial -b 3000000 -D /dev/ttyTHS0 -c /home/eve-vhx/config.yaml

config.yaml

<?xml version="1.0" encoding="UTF-8" ?>
<dds>
    <profiles xmlns="http://www.eprosima.com">
        <participant profile_name="super_client_profile" is_default_profile="true">
            <rtps>
                <builtin>
                    <discovery_config>
                        <discoveryProtocol>SUPER_CLIENT</discoveryProtocol>
                        <discoveryServersList>
                            <RemoteServer prefix="44.53.00.5f.45.50.52.4f.53.49.4d.41">
                                <metatrafficUnicastLocatorList>
                                    <locator>
                                        <udpv4>
                                            <address>my remote IP</address>
                                            <port>11811</port>
                                        </udpv4>
                                    </locator>
                                </metatrafficUnicastLocatorList>
                            </RemoteServer>
                        </discoveryServersList>
                    </discovery_config>
                </builtin>
            </rtps>
        </participant>
    </profiles>
</dds>

I can access other topics like /chatter on my remote machine. Issue is only with PX4 topics. Any help is appreciated! Thanks!

Hi abhikrishnan, I did not use serial for ROS2 Discovery. You mentioned that you could not echo the topics

Feels that it could be a problem with the mismatched messages between the flightcontroller and the offboard ros messages. There is a workaround here:

Hey,
Thanks for the reply.
However, I figured out the issue. It was related to setting UXRCE_DDS_PTCFG parameter on PX4.

I have mentioned what worked for me here,