|
8 months ago | |
---|---|---|
.. | ||
blob | 8 months ago | |
flexible | 8 months ago | |
ros2 | 8 months ago | |
blob-msg.h | 8 months ago | |
dds-topic-names.h | 8 months ago | |
device-info-msg.h | 8 months ago | |
flexible-msg.h | 8 months ago | |
image-msg.h | 8 months ago | |
imu-msg.h | 8 months ago | |
readme.md | 8 months ago |
readme.md
Topic List
The various topics are arranged hierarchically:
realsense/
device-info
— device discovery (flexible)<model>_<serial-number>/
— topic root per device in device-info (all in flexible format)notification
— server notifications, responses, etc.control
— client requests to servermetadata
— optional stream information
rt/realsense/
— ROS2-compatible streams
Interface Definition Files
The code for each message type in this directory is generated from IDL files if the message format is defined by RealDDS.
For ROS, the IDLs are not available.
Generation
A utility from FastDDS called FastDDSGen is required to convert the IDL files to the headers that're needed. Unfortunately, this utility requires a java installation and sometimes not even the latest.
Instead, we found it easiest to download a Docker image for FastDDS (last used is version 2.9.1) and generate the files within.
-
Download the Docker image from here (link was valid at time of writing; if no longer, register with eProsima and update it)
docker load -i /mnt/c/work/ubuntu-fastdds_v2.9.1.tar
-
In a
zsh
shell:# from third-party/realdds/ # for topic in flexible do cd include/realdds/topics/${topic} cid=`docker run -itd --privileged ubuntu-fastdds:v2.9.1` docker exec $cid mkdir /idl /idl/out docker cp *.idl $cid:idl/ docker exec -w /idl/out $cid fastddsgen -typeobject /idl/`ls -1 *.idl` docker cp $cid:/idl/out . docker kill $cid cd out for cxx in *.cxx; do mv -- "$cxx" "../../../../../src/topics/${cxx%.cxx}.cpp"; done mv -- *TypeObject.h "../../../../../src/topics/" mv * .. cd .. rmdir out cd ../../../.. done
This automatically renames .cxx to .cpp, places them in the right directory, etc.
-
Once files are generated, they still need some manipulation:
- Certain
#include
statements (mainly in the .cpp files moved into src/) need to be updated (e.g.,#include "flexible.h"
changed to#include <realdds/topics/flexible/flexible.h>
) - Copyright notices in all the files needs updating to LibRealSense's
- Certain
ROS2
All the ROS2 topics are under ros2/
. The IDLs are not part of this repo and the source code was pre-generated then modified appropriately.
The per-distro (including rolling) source message (.msg
) files can be found in:
The .msg
files can be converted to .idl
with rosidl and then fastddsgen
can be used to generate source code, similar to what was detailed above. This was all done offline and is not part of the build.
Because there is an interest in keeping our topics ROS-compatible (i.e., so that ROS applications can pick up on and read them), this requires specific topic naming conventions and formats. We try to use ROS-compatible formats, encodings, and names where possible. Right now this is only done one-way: ROS2 can read certain topics, but cannot otherwise control the camera.