Cannot find Fast RTPS files

Hi everyone,

I am working on a project where I would like to port the control part on a cloud and exchanging data via 4G.
Right now I’m trying to setup the network and RTPS seems to be the way to go. I will use a Raspberry pi to connect on the 4G network using a dongle.

I think RTPS is installed correctly, the path is ok but after building there is no client file in the build.

I installed Px4 3 weeks ago. Anyone knows about this issue ?

edit1:
Information about my path:

$ echo $PATH /home/florian/.sdkman/candidates/gradle/current/bin:/opt/ros/kinetic/bin:/home/florian/gcc-arm-none-eabi-7-2017-q4-major/bin:/home/florian/bin:/home/florian/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ which fastrtpsgen
/usr/local/bin/fastrtpsgen

edit2:

Trying to run the manual generation also doesnt work since the python files missing in the src/Tools directory but are only in the srs/msg/tools/ directory.

Moreover, I can’t find the set(GENERATE_RTPS_BRIDGE on) in my cmake/config/posix_sitl_default.cmake so i just added set(GENERATE_RTPS_BRIDGE off), not sure if it is correct ?

Greetings,
Florian

Problem solved.
The tutorial conserning RTPS is not up to date with the latest version of PX4.

I had to move files inside the folder srs/msg/tools/ to src/Tools and run manually the python client/agent generator. It looks like the auto generator is not working anymore.

edit: it is not a good idea, read next posts

Hi,
I am having the same problem here…
I moved the files to src/Tools and then I ran the “generate_microRTPS_bridge.py” script.
After that, I moved to “~/src/Firmware/src/modules/micrortps_bridge/micrortps_agent/build” and ran the “cmake …” and “make” commands, but I got an error.
It returns:
error: ‘get_header_length’ was not declared in this scope
uint16_t header_length = get_header_length();
^~~~~~~~~~~~~~~~~

Do you know what’s missing?

Thank you so much,
elBarto

edit :slight_smile:
I fixed it! There’s an error in the code…
In order to build the agent, you have to change:

uint16_t header_length = get_header_length();

to

uint16_t header_length = transport_node->get_header_length();

in microRTPS_agent.cpp:174:38

Hi elBarto,

Excellent I had the same issue with the agent. Did you manage to run the client as well ?

Greetings,
Lyris

Hi,
I found out that the rtps module can be included in the build process using the makefiles whose names end with “_rtps”.
If you make the px4fmu-v3_rtps, the module is correctly built and included in the elf target file ([ 95%] Built target modules__micrortps_bridge__micrortps_client).
Unfortunately, I have a first generation pixhawk (one of those with the flash size issue) and I can’t upload the v3 firmware on it. The v2 firmware instead doesn’t have a makefile that includes the rtps module, probably because it wouldn’t fit in the flash.
Finally, I tried to build the “posix_sitl_rtps” makefile, but I got this error:
/home/emanuele/Firmware_clone/Firmware/src/modules/micrortps_bridge/micrortps_client/microRTPS_transport.h:41:7: error: redefinition of ‘class Transport_node’

I am still trying to make it work… let’s keep in touch

Hi,

Yes idealy I would like to test everything in simulation. Right now I can run the agent and listener but not the client. I believe they changed quite a bit the Transport_node class. I’ll dig into the code tomorrow and let you know if I can get any results.

lyris

Hi,

It finally worked for me. Did you try on a fresh Px4 firmware ?

Using posix_sitl_rtps links correctly the client and generate automatically the agent in the build as described here https://dev.px4.io/en/middleware/micrortps.html

I believe you got some errors because you manually generated the client and agent, maybe it does not overwrite correctly when you start building.

lyris

1 Like

Hi,
thank you so much for guiding me through it.
I did a fresh start, deleted the old folder, made a new one, pulled the repository… and it finally worked.
I have been able to build client, agent and listener. But when I run the client from the jMavsim console, it fails because it can’t open the /dev/ttyUSB0 port (how can I blame it since a physical tty port doesn’t exist).
So I think I will wait for a real pixhawk to test it. I have already ordered a new mRo Pixhawk.
Have you been able to make it work within the SITL simulator? It would be great to test it before flying :slight_smile:

Thank you again,
E.

Change the settings, you can run UDP instead of UART.

try:
micrortps_client start -t UDP
then for the agent:
./micrortps_agent -t UDP

then just run the listener and have fun

lyris

1 Like

Awesome! It works :+1:
Thank you so much! :relaxed:

1 Like