DDS faild to connect ROS2 Jazzy

Setup
Ubuntu: 24.04
PX4: 1.17.0alpha
Got an error while building DDS on Ubuntu 24, so build this way

git clone -b v2.4.3 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git
cd Micro-XRCE-DDS-Agent
mkdir build
cd build
cmake .. -DUAGENT_P2P_PROFILE=OFF
make
sudo make install
sudo ldconfig /usr/local/lib/

compilation successfully.
Simulation launch successfully, but got the following error on the PX4 side when running MicroXRCEAgent udp4 -p 8888

On the DDS terminal, got the following

mubashir@mubashir:~$ MicroXRCEAgent udp4 -p 8888 
[1763846363.945943] info     | UDPv4AgentLinux.cpp | init                     | running...             | port: 8888
[1763846363.946131] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 4
[1763846365.201091] info     | Root.cpp           | create_client            | create                 | client_key: 0x00000001, session_id: 0x81
[1763846365.201135] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x00000001, address: 127.0.0.1:16055
[1763846365.203176] info     | ProxyClient.cpp    | create_participant       | participant created    | client_key: 0x00000001, participant_id: 0x001(1)
[1763846371.217126] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x00000001, topic_id: 0x800(2), participant_id: 0x001(1)
[1763846371.217167] info     | ProxyClient.cpp    | create_subscriber        | subscriber created     | client_key: 0x00000001, subscriber_id: 0x800(4), participant_id: 0x001(1)
terminate called after throwing an instance of 'eprosima::fastcdr::exception::BadParamException'
  what():  This member is not been selected
Aborted (core dumped)

I’m also seeing this on v1.16.1-rc2 and v1.16.0. This did not happen on Ubuntu 22, only when I switched to Ubuntu 24. Hard to know which dependency would be breaking this.

Ah, It’s because your uXRCE is linking against the wrong library after installation. If you set LD_LIBRARY_PATH and manually run the locally built version, it connects correctly:

nbingham@dev-0:\~/workspace/Micro-XRCE-DDS-Agent/build$ pwd
/home/nbingham/workspace/Micro-XRCE-DDS-Agent/build
nbingham@dev-0:\~/workspace/Micro-XRCE-DDS-Agent/build$ export LD_LIBRARY_PATH=$PWD
nbingham@dev-0:\~/workspace/Micro-XRCE-DDS-Agent/build$ ./MicroXRCEAgent udp4 -p 8888 -v 4
\[1764008892.656842\] info     | UDPv4AgentLinux.cpp | init                     | running…             | port: 8888
\[1764008892.657046\] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 4
\[1764008892.765164\] info     | Root.cpp           | create_client            | create                 | client_key: 0x00000001, session_id: 0x81
\[1764008892.765217\] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x00000001, address: 127.0.0.1:23761
\[1764008892.767962\] info     | ProxyClient.cpp    | create_participant       | participant created    | client_key: 0x00000001, participant_id: 0x001(1)
\[1764008898.805119\] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x00000001, topic_id: 0x800(2), participant_id: 0x001(1)
\[1764008898.805235\] info     | ProxyClient.cpp    | create_subscriber        | subscriber created     | client_key: 0x00000001, subscriber_id: 0x800(4), participant_id: 0x001(1)
\[1764008898.806515\] info     | ProxyClient.cpp    | create_datareader        | datareader created     | client_key: 0x00000001, datareader_id: 0x800(6), subscriber_id: 0x800(4)
\[1764008898.806749\] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x00000001, topic_id: 0x801(2), participant_id: 0x001(1)
…

Update:
It’s because you forgot to run the last step of installation:

sudo ldconfig /usr/local/lib/
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.