FastRTPS source is required when statically compiling CyberRT without docker.
@baowanyu Hi, I found that FastRTPS 1.4.0 from apollo-platform cannot work for CyberRT.
The compiler complains as follows: cyber/service_discovery/topology_manager.cc:152:10: error: 'DROPPED_RTPSPARTICIPANT' is not a member of 'eprosima::fastrtps::rtps::DISCOVERY_STATUS'.
I am wondering which version and patch are used for CyberRT. Thanks.
@KitFung Hi, I also tried FastRTPS 1.5.0 and Fast-CDR-1.0.7. The compilation is OK. But the generated executable cannot work well. The example talker outputs the following warning: manager.cc:192] [talker] !message::ParseFromString(msg_str, &msg) is not met. And the talker cannot talk to the listener. Could you share a patch about your modification?
Thanks.
1、Download Fast-RTPS 1.5.0 source code $ cd ~ $ wget http://www.eprosima.com/index.php/component/ars/repository/eprosima-fast-rtps/eprosima-fast-rtps-1-5-0/eprosima_fastrtps-1-5-0-linux-tar-gz -O eprosima_fastrtps-1-5-0-linux.tar.gz $ tar -xzf eprosima_fastrtps-1-5-0-linux.tar.gz eProsima_FastRTPS-1.5.0-Linux/ $ tar -xzf eprosima_fastrtps-1-5-0-linux.tar.gz requiredcomponents $ tar -xzf requiredcomponents/eProsima_FastCDR-1.0.7-Linux.tar.gz 2、Apply the patch ‘FastRTPS_1.4.0.patch’ manually, or else cyber rt's nodes cann't communicate with each other 3、Start to compile Fast-RTPS and Fast-CDR $ cd eProsima_FastCDR-1.0.7-Linux && ./configure --prefix=/home/nvidia/eProsima_FastCDR-1.0.7-Linux/install && make –j4 && make install $ cd ../ $ cd eProsima_FastRTPS-1.5.0-Linux && ./configure --prefix=/home/nvidia/eProsima_FastRTPS-1.5.0-Linux/install && make –j4 && make install $ cd ../ 4、Copy the header files and library files to /usr/local/fast-rtps $ sudo mkdir –p /usr/local/fast-rtps/ $ sudo cp –rf eProsima_FastRTPS-1.5.0-Linux/install/* /usr/local/fast-rtps/ $ sudo cp –rf eProsima_FastCDR-1.0.7-Linux/install/* /usr/local/fast-rtps/ Finally, these steps are tested on ARM64, but I think x86_64 would be OK also.
@Eclipsehelio Thanks, I will try.
Before receiving your response, I also want to manually patch 1.5 with the patch for 1.4. But, I am worried that Baidu does some other modifications.
@sjtugjy I think Fast-RTPS as an implementation of RTPS protocol is a mature product, Baidu would not put much energy to renovation it; the patch for 1.4 is primarily an adaptation to apollo. Regardless of these doubts, just do it. By the way, remember to export CYBER_IP environment variable.
I upload the patch in case needed by others. The original source is downloaded from the official website of eprosima as Eclipsehelio suggested.
@sjtugjy Hi, does @Eclipsehelio 's answer solve your problem?
Yes. I forgot to close this issue.
@sjtugjy Hi, I choose Fast-RTPS 1.5.0, the compilation is OK. But when compile Cyber RT, the compiler complains as follows:
Executing task: bazel build --compilation_mode dbg --sandbox_debug //cyber/examples/... <
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/home/yzd90/yzd90/Apollo/cyber_ws/tools/bazel.rc
INFO: Invocation ID: 5733e29f-0d0d-4001-afa7-5b97514bd817
INFO: Analysed 8 targets (0 packages loaded, 0 targets configured).
INFO: Found 8 targets...
ERROR: /home/yzd90/yzd90/Apollo/cyber_ws/cyber/examples/BUILD:41:1: Linking of rule '//cyber/examples:record' failed (Exit 1) linux-sandbox failed: error executing command
(cd /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/execroot/cyber_ws &&
exec env -
LD_LIBRARY_PATH=/opt/ros/indigo/lib:/usr/local/lib:/usr/local/fast-rtps/lib
PATH=/opt/ros/indigo/bin:/home/yzd90/.local/share/umake/bin:/home/yzd90/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=/proc/self/cwd
TMPDIR=/tmp
/home/yzd90/.cache/bazel/_bazel_yzd90/install/35f799b1c96ee2522d30a28ff4ef485a/_embedded_binaries/linux-sandbox -t 15 -w /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/sandbox/linux-sandbox/1/execroot/cyber_ws -w /tmp -w /run/shm -D -- /usr/bin/gcc -o bazel-out/k8-dbg/bin/cyber/examples/record '-Wl,-rpath,$ORIGIN/../../_solib_k8/_U_S_Sthird_Uparty_Stf2_Ctf2___Uthird_Uparty_Stf2_Slib' '-Wl,-rpath,$ORIGIN/../../_solib_k8/_U@fastrtps_S_S_Cfastrtps___Uexternal_Sfastrtps_Slib' -Lbazel-out/k8-dbg/bin/_solib_k8/_U_S_Sthird_Uparty_Stf2_Ctf2___Uthird_Uparty_Stf2_Slib -Lbazel-out/k8-dbg/bin/_solib_k8/_U@fastrtps_S_S_Cfastrtps___Uexternal_Sfastrtps_Slib -L/usr/local/lib '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,@bazel-out/k8-dbg/bin/cyber/examples/record-2.params)
src/main/tools/linux-sandbox.cc:154: linux-sandbox-pid1 has PID 12059
src/main/tools/linux-sandbox-pid1.cc:175: working dir: /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/sandbox/linux-sandbox/1/execroot/cyber_ws
src/main/tools/linux-sandbox-pid1.cc:194: writable: /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/sandbox/linux-sandbox/1/execroot/cyber_ws
src/main/tools/linux-sandbox-pid1.cc:194: writable: /tmp
src/main/tools/linux-sandbox-pid1.cc:194: writable: /run/shm
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /dev
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /dev/pts
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /run
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /run/lock
src/main/tools/linux-sandbox-pid1.cc:265: remount rw: /run/shm
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /run/user
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /run/user/1000/gvfs
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/systemd
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/cpuset
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/cpu
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/cpuacct
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/blkio
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/memory
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/devices
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/freezer
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/net_cls
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/perf_event
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/net_prio
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/hugetlb
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/cgroup/pids
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/fuse/connections
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/kernel/debug
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/kernel/security
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/firmware/efi/efivars
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /sys/fs/pstore
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /proc
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /proc/sys/fs/binfmt_misc
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /boot
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /boot/efi
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /home
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /home
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /root
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /esntmp
src/main/tools/linux-sandbox-pid1.cc:265: remount ro: /var/lib/docker
src/main/tools/linux-sandbox-pid1.cc:265: remount rw: /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/sandbox/linux-sandbox/1/execroot/cyber_ws
src/main/tools/linux-sandbox-pid1.cc:265: remount rw: /home/yzd90/.cache/bazel/_bazel_yzd90/8bd79af12b762a489c536733bddfbd60/sandbox/linux-sandbox/1/execroot/cyber_ws
src/main/tools/linux-sandbox-pid1.cc:265: remount rw: /tmp
src/main/tools/linux-sandbox-pid1.cc:265: remount rw: /run/shm
src/main/tools/process-tools.cc:118: sigaction(32, &sa, nullptr) failed
src/main/tools/process-tools.cc:118: sigaction(33, &sa, nullptr) failed
cyber/transport/rtps/sub_listener.cc:37: error: undefined reference to 'eprosima::fastrtps::Subscriber::getAttributes() const'
collect2: error: ld returned 1 exit status
src/main/tools/linux-sandbox-pid1.cc:437: waitpid returned 2
src/main/tools/linux-sandbox-pid1.cc:457: child exited with code 1
src/main/tools/linux-sandbox.cc:204: child exited normally with exitcode 1
INFO: Elapsed time: 2.611s, Critical Path: 0.95s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
The terminal process terminated with exit code: 1
Could you tell me how to solve the problem?
Thanks.
error message is :
cyber/transport/rtps/sub_listener.cc:37: error: undefined reference to 'eprosima::fastrtps::Subscriber::getAttributes() const'
collect2: error: ld returned 1 exit status
you can link fastrtps after build it.