Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make px4_sitl_rtps error #20424

Open
mengchaoheng opened this issue Oct 17, 2022 · 6 comments
Open

make px4_sitl_rtps error #20424

mengchaoheng opened this issue Oct 17, 2022 · 6 comments

Comments

@mengchaoheng
Copy link

Describe the bug

mch@ubuntu:~/PX4-Autopilot$ git submodule update --init --recursive 
mch@ubuntu:~/PX4-Autopilot$ make px4_sitl_rtps
[0/2] Re-checking globbed directories...
[1/2] Re-running CMake...
-- PX4 version: v1.13.0-beta1-987-g458e5a6b0e
-- PX4 config file: /home/mch/PX4-Autopilot/boards/px4/sitl/rtps.px4board
-- PLATFORM posix
-- ROMFSROOT px4fmu_common
-- TESTING y
-- ETHERNET y
-- PX4 config: px4_sitl_rtps
-- PX4 platform: posix
-- PX4 lockstep: enabled
-- cmake build type: RelWithDebInfo
-- Building for code coverage
-- fastrtpsgen version 1.0.4
-- microRTPS bridge:
--   Publish to the bridge from: collision_constraints, sensor_combined, timesync, timesync_status, trajectory_waypoint, vehicle_control_mode, vehicle_odometry, vehicle_status, vehicle_trajectory_waypoint_desired
--   Subscribe from the bridge to: debug_array, debug_key_value, debug_value, debug_vect, offboard_control_mode, onboard_computer_status, position_setpoint, position_setpoint_triplet, sensor_optical_flow, telemetry_status, timesync, trajectory_bezier, trajectory_setpoint, vehicle_attitude_setpoint, vehicle_command, vehicle_local_position_setpoint, vehicle_rates_setpoint, vehicle_trajectory_bezier, vehicle_trajectory_waypoint, vehicle_mocap_odometry, vehicle_visual_odometry
-- Looking for ignition-transport8 -- found version 8.3.0
-- Searching for dependencies of ignition-transport8
-- Config-file not installed for ZeroMQ -- checking for pkg-config
-- Checking for module 'libzmq >= 4'
--   Found libzmq , version 4.3.2
-- Checking for module 'uuid'
--   Found uuid, version 2.34.0
-- Looking for ignition-msgs5 -- found version 5.11.0
-- Searching for dependencies of ignition-msgs5
-- Looking for ignition-math6 -- found version 6.13.0
-- Searching for dependencies of ignition-math6
-- Checking for module 'tinyxml2'
--   Found tinyxml2, version 6.2.0
-- ROMFS: ROMFS/px4fmu_common
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mch/PX4-Autopilot/build/px4_sitl_rtps
[0/2] Re-checking globbed directories...
[2/282] Generating RTPS topic bridge
openjdk version "13.0.7" 2021-04-20
OpenJDK Runtime Environment (build 13.0.7+5-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 13.0.7+5-Ubuntu-0ubuntu120.04, mixed mode, sharing)
Traceback (most recent call last):
  File "/home/mch/PX4-Autopilot/msg/tools/generate_microRTPS_bridge.py", line 206, in <module>
    fastrtps_version = subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'ldconfig -v 2>/dev/null | grep libfastrtps' returned non-zero exit status 1.
[3/277] Building CXX object src/modules/micrortps_bridge...bridge__micrortps_client.dir/microRTPS_client_main.cpp.o
FAILED: src/modules/micrortps_bridge/micrortps_client/CMakeFiles/modules__micrortps_bridge__micrortps_client.dir/microRTPS_client_main.cpp.o 
/usr/bin/c++  -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"micrortps_client\" -DPX4_MAIN=micrortps_client_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -I../../src/modules/micrortps_bridge/micrortps_client -Isrc/modules/micrortps_bridge/micrortps_client -I../../src/modules/micrortps_bridge/micro-CDR/include -Isrc/modules/micrortps_bridge/micro-CDR/include -Isrc/modules/micrortps_bridge/micro-CDR/include/microcdr -O2 -g -DNDEBUG -fPIC   -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -std=gnu++14 -MD -MT src/modules/micrortps_bridge/micrortps_client/CMakeFiles/modules__micrortps_bridge__micrortps_client.dir/microRTPS_client_main.cpp.o -MF src/modules/micrortps_bridge/micrortps_client/CMakeFiles/modules__micrortps_bridge__micrortps_client.dir/microRTPS_client_main.cpp.o.d -o src/modules/micrortps_bridge/micrortps_client/CMakeFiles/modules__micrortps_bridge__micrortps_client.dir/microRTPS_client_main.cpp.o -c ../../src/modules/micrortps_bridge/micrortps_client/microRTPS_client_main.cpp
../../src/modules/micrortps_bridge/micrortps_client/microRTPS_client_main.cpp:34:10: fatal error: microRTPS_transport.h: No such file or directory
   34 | #include <microRTPS_transport.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[5/277] Building CXX object src/modules/navigator/CMakeFiles/modules__navigator.dir/rtl.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl_rtps] Error 1
mch@ubuntu:~/PX4-Autopilot$ 

To Reproduce

Steps to reproduce the behavior:

  1. on ubuntu20, px4 main branch, have been installed fast dds2.0.2 and fast rtps gen1.0.4
  2. Run make px4_sitl_rtps
  3. See error
@mengchaoheng
Copy link
Author

mengchaoheng commented Oct 17, 2022

I have fix it by reinstall fastdds from source. but new error is :

mch@ubuntu:~/PX4-Autopilot/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_listener$ bin/x64Linux2.6gcc/sensor_combinedPublisherSubscriber subscriberbin/x64Linux2.6gcc/sensor_combinedPublisherSubscriber: error while loading shared libraries: libfastcdr.so.1: cannot open shared object file: No such file or directory
mch@ubuntu:~/PX4-Autopilot/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_listener$

@mengchaoheng
Copy link
Author

@dagar

@mengchaoheng
Copy link
Author

@beniaminopozzan can you help me?

@mengchaoheng
Copy link
Author

mengchaoheng commented Oct 17, 2022

after I try to install dds from binaries . error again:

mch@ubuntu:~/PX4-Autopilot/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_listener$ ls -la /usr/local/lib/
total 53444
drwxr-xr-x  5 root root      4096 Oct 17 08:15 .
drwxr-xr-x 11 root root      4096 Oct 17 04:55 ..
drwxr-xr-x  3 root root      4096 Oct 17 07:49 cmake
drwxr-xr-x  3 root root      4096 Oct 17 00:14 foonathan_memory
-rw-r--r--  1 root root    159762 Oct 17 08:02 libfastcdr.a
lrwxrwxrwx  1 root root        15 Oct 17 04:55 libfastcdr.so -> libfastcdr.so.1
lrwxrwxrwx  1 root root        20 Oct 17 07:49 libfastcdr.so.1 -> libfastcdr.so.1.0.25
-rw-r--r--  1 root root    117016 Oct 17 04:39 libfastcdr.so.1.0.10
-rw-r--r--  1 root root    108448 Oct 17 07:49 libfastcdr.so.1.0.25
-rw-r--r--  1 root root  31031968 Oct 17 08:15 libfastrtps.a
lrwxrwxrwx  1 root root        18 Oct 17 08:02 libfastrtps.so -> libfastrtps.so.2.8
lrwxrwxrwx  1 root root        20 Oct 17 04:55 libfastrtps.so.2 -> libfastrtps.so.2.0.2
-rw-r--r--  1 root root  10974208 Oct 17 04:55 libfastrtps.so.2.0.2
lrwxrwxrwx  1 root root        20 Oct 17 08:02 libfastrtps.so.2.8 -> libfastrtps.so.2.8.0
-rw-r--r--  1 root root  11101128 Oct 17 08:02 libfastrtps.so.2.8.0
-rw-r--r--  1 root root   1193802 Oct 17 00:14 libfoonathan_memory-0.7.1.a
mch@ubuntu:~/PX4-Autopilot/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_listener$ bin/x64Linux2.6gcc/sensor_combinedPublisherSubscriber subscriber
bin/x64Linux2.6gcc/sensor_combinedPublisherSubscriber: error while loading shared libraries: libfastcdr.so.1: cannot open shared object file: No such file or directory

@mengchaoheng
Copy link
Author

My fault, I forgot to add the environment variable:

echo 'export LD_LIBRARY_PATH=/usr/local/lib/' >> ~/.bashrc

@mengchaoheng
Copy link
Author

The user manual should contain the correct environment variable settings:

When running an instance of an application using eProsima Fast DDS, it must be linked with the library where the packages have been installed, /usr/local/lib/. There are two possibilities:

  • Prepare the environment locally by typing in the console used for running the eProsima Fast DDS instance the command:
export LD_LIBRARY_PATH=/usr/local/lib/
  • Add it permanently to the PATH by executing:
echo 'export LD_LIBRARY_PATH=/usr/local/lib/' >> ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant