ROS2/ROS/Fasr RTPS installation

Hello everyone,
Before starting my question, I have to tell you that I am totally new in this field!
Recently I have been trying to install ROS - Gazebo integration and PX4.
At first I installed the ROS Melodic, Gazebo 9 and Pixhawk 1.10.1, but the environment does not support for Python3 and the example codes for drone did not work!
Therefore,I taught to switch to ROS2, I followed this link:
https://dev.px4.io/master/en/middleware/micrortps.html
But I got several errors, and now the final error is follow:
Starting >>> px4_msgs
– Using C++17 compiler
– Found ament_cmake: 0.6.1 (/opt/ros/crystal/share/ament_cmake/cmake)
– Using PYTHON_EXECUTABLE: /usr/bin/python3
– Override CMake install command with custom implementation using symlinks instead of copying resources
– Found builtin_interfaces: 0.6.3 (/opt/ros/crystal/share/builtin_interfaces/cmake)
– Found rosidl_adapter: 0.6.3 (/opt/ros/crystal/share/rosidl_adapter/cmake)
– Found rosidl_default_generators: 0.6.0 (/opt/ros/crystal/share/rosidl_default_generators/cmake)
CMake Error at CMakeLists.txt:27 (find_package):
By not providing “Findrosidl_generator_dds_idl.cmake” in CMAKE_MODULE_PATH
this project has asked CMake to find a package configuration file provided
by “rosidl_generator_dds_idl”, but CMake did not find one.

Could not find a package configuration file provided by
“rosidl_generator_dds_idl” with any of the following names:

rosidl_generator_dds_idlConfig.cmake
rosidl_generator_dds_idl-config.cmake

Add the installation prefix of “rosidl_generator_dds_idl” to
CMAKE_PREFIX_PATH or set “rosidl_generator_dds_idl_DIR” to a directory
containing one of the above files. If “rosidl_generator_dds_idl” provides
a separate development package or SDK, be sure it has been installed.

– Configuring incomplete, errors occurred!
See also “/home/srl/px4_ros_com_ros2/build/px4_msgs/CMakeFiles/CMakeOutput.log”.
— stderr: px4_msgs
CMake Error at CMakeLists.txt:27 (find_package):
By not providing “Findrosidl_generator_dds_idl.cmake” in CMAKE_MODULE_PATH
this project has asked CMake to find a package configuration file provided
by “rosidl_generator_dds_idl”, but CMake did not find one.

Could not find a package configuration file provided by
“rosidl_generator_dds_idl” with any of the following names:

rosidl_generator_dds_idlConfig.cmake
rosidl_generator_dds_idl-config.cmake

Add the installation prefix of “rosidl_generator_dds_idl” to
CMAKE_PREFIX_PATH or set “rosidl_generator_dds_idl_DIR” to a directory
containing one of the above files. If “rosidl_generator_dds_idl” provides
a separate development package or SDK, be sure it has been installed.


Failed <<< px4_msgs [ Exited with code 1 ]

Summary: 0 packages finished [1.39s]
1 package failed: px4_msgs
1 package had stderr output: px4_msgs
1 package not processed

I have used the following command
colcon build --symlink-install --packages-skip ros1_bridge --event-handlers console_direct+

Judging from the error messages from the micrortps build, it looks like you have successfully installed Python 3 so that sorts out your first problem.

The error messages that you are getting when you try to build micrortps indicate that you are missing the ROS2 IDL message generators. I used the following command to install the ROS2 eloquent dependencies:

sudo apt -y --no-install-recommends install \
    python3-argcomplete \
    python3-colcon-common-extensions \
    python3-colcon-mixin \
    python3-pytest \
    python3-rosdep \
    python3-rosdep-modules \
    python3-rospkg \
    python3-rosdistro \
    python3-setuptools \
    python3-vcstool \
    python3-catkin-pkg \
    flake8 \
    ros-$ROS2_DISTRO-desktop \
    ros-$ROS2_DISTRO-launch-testing-ament-cmake \
    ros-$ROS2_DISTRO-rosidl-generator-dds-idl

The key thing is the last package, ros-$ROS2_DISTRO-rosidl-generator-dds-idl that should get you past the IDL related problems.

Hope this helps.

2 Likes

Thanks @AndyBlight for your response. I will try it!