Installing ROS2 - Fast-RTPS-Gen installation error

Hey,

i am trying to install ROS 2 (dashing) as described here

To do that, (if I get that right) I need to install Fast-RTPS and Fast-RTPS-Gen first. The installation of Fast-RTPS is successfull but when I try to install Fast-RTPS-Gen I get the following error:

~/Fast-RTPS-Gen$ gradle assemble

FAILURE: Build failed with an exception.

* Where:
Build file '/home/falke/Fast-RTPS-Gen/build.gradle' line: 23

* What went wrong:
Could not compile build file '/home/falke/Fast-RTPS-Gen/build.gradle'.
> startup failed:
  build file '/home/falke/Fast-RTPS-Gen/build.gradle': 23: unable to resolve class org.gradle.api.tasks.options.Option
   @ line 23, column 1.
     import org.gradle.api.tasks.options.Option;
     ^
  
  1 error


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

Can someone please help me. I searched on google, but I dont know how to solve the problem.

Best regards

Okay, I guess I get it working. I had still files of an old version of gradle and also some old fastrtps files which might caused the error. After deleting them I was able with sudo env path=$path_to_gradle6.5 gradle install
to install fastrtps gen.

I followed the installation steps for ROS2 here.

  • I have installed ros dashing and melodic.
  • Gradle 6.5
  • Kotlin: 1.3.72
  • Groovy: 2.5.11
  • Ant: Apache Ant™ version 1.10.7 compiled on September 1 2019
  • JVM: 1.8.0_252 (Private Build 25.252-b09)
  • OS: Linux 5.3.0-59-generic amd64

Now I am getting the following error:

[ 76%] Building CXX object CMakeFiles/micrortps_agent.dir/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp.o
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/AdcReport_Publisher.cpp: In member function ‘bool AdcReport_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/AdcReport_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Airspeed_Publisher.cpp: In member function ‘bool Airspeed_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Airspeed_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/BatteryStatus_Publisher.cpp: In member function ‘bool BatteryStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/BatteryStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Cpuload_Publisher.cpp: In member function ‘bool Cpuload_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Cpuload_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/DistanceSensor_Publisher.cpp: In member function ‘bool DistanceSensor_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/DistanceSensor_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/EstimatorStatus_Publisher.cpp: In member function ‘bool EstimatorStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/EstimatorStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
CMakeFiles/micrortps_agent.dir/build.make:1619: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Airspeed_Publisher.cpp.o' failed
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Airspeed_Publisher.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/micrortps_agent.dir/build.make:1606: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/AdcReport_Publisher.cpp.o' failed
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/AdcReport_Publisher.cpp.o] Error 1
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/HomePosition_Publisher.cpp: In member function ‘bool HomePosition_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/HomePosition_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp: In member function ‘bool IridiumsbdStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Cpuload_Publisher.cpp.o] Error 1
CMakeFiles/micrortps_agent.dir/build.make:1645: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Cpuload_Publisher.cpp.o' failed
CMakeFiles/micrortps_agent.dir/build.make:1632: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/BatteryStatus_Publisher.cpp.o' failed
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/BatteryStatus_Publisher.cpp.o] Error 1
CMakeFiles/micrortps_agent.dir/build.make:1671: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/EstimatorStatus_Publisher.cpp.o' failed
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/EstimatorStatus_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/DistanceSensor_Publisher.cpp.o] Error 1
CMakeFiles/micrortps_agent.dir/build.make:1658: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/DistanceSensor_Publisher.cpp.o' failed
CMakeFiles/micrortps_agent.dir/build.make:1684: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/HomePosition_Publisher.cpp.o' failed
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/HomePosition_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp.o] Error 1
CMakeFiles/micrortps_agent.dir/build.make:1697: recipe for target 'CMakeFiles/micrortps_agent.dir/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp.o' failed
make[1]: *** [CMakeFiles/micrortps_agent.dir/all] Error 2
CMakeFiles/Makefile2:158: recipe for target 'CMakeFiles/micrortps_agent.dir/all' failed
make: *** [all] Error 2
Makefile:160: recipe for target 'all' failed
--- stderr: px4_ros_com                                        
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
CMakeFiles/micrortps_agent.dir/build.make:373: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Timesync.cpp'
CMakeFiles/micrortps_agent.dir/build.make:202: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Timesync.cpp'
CMakeFiles/micrortps_agent.dir/build.make:376: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.cpp'
CMakeFiles/micrortps_agent.dir/build.make:205: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.cpp'
CMakeFiles/micrortps_agent.dir/build.make:379: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.h'
CMakeFiles/micrortps_agent.dir/build.make:208: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.h'
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
/sbin/ldconfig.real: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/usr/local/lib' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.27.so is the dynamic linker, ignoring

/sbin/ldconfig.real: /lib32/ld-2.27.so is the dynamic linker, ignoring

/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
CMakeFiles/micrortps_agent.dir/build.make:373: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Timesync.cpp'
CMakeFiles/micrortps_agent.dir/build.make:202: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Timesync.cpp'
CMakeFiles/micrortps_agent.dir/build.make:376: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.cpp'
CMakeFiles/micrortps_agent.dir/build.make:205: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.cpp'
CMakeFiles/micrortps_agent.dir/build.make:379: warning: overriding recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.h'
CMakeFiles/micrortps_agent.dir/build.make:208: warning: ignoring old recipe for target '/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/TimesyncPubSubTypes.h'
In file included from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:38:0,
             from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.cpp:34:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint64_t TimeSync::setMsgTimestamp(timesync_msg_t*, const uint64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:170:114: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint64_t setMsgTimestamp(timesync_msg_t* msg, const uint64_t& timestamp) { msg->timestamp() = timestamp; }
                                                                                                              ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSysID(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:171:99: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint8_t setMsgSysID(timesync_msg_t* msg, const uint8_t& sys_id) { msg->sys_id() = sys_id; }
                                                                                               ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSeq(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:172:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint8_t setMsgSeq(timesync_msg_t* msg, const uint8_t& seq) { msg->seq() = seq; }
                                                                                    ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTC1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:173:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline int64_t setMsgTC1(timesync_msg_t* msg, const int64_t& tc1) { msg->tc1() = tc1; }
                                                                                    ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTS1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:174:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline int64_t setMsgTS1(timesync_msg_t* msg, const int64_t& ts1) { msg->ts1() = ts1; }
                                                                                    ^
In file included from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.cpp:42:0:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint64_t TimeSync::setMsgTimestamp(timesync_msg_t*, const uint64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:170:114: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint64_t setMsgTimestamp(timesync_msg_t* msg, const uint64_t& timestamp) { msg->timestamp() = timestamp; }
                                                                                                              ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSysID(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:171:99: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint8_t setMsgSysID(timesync_msg_t* msg, const uint8_t& sys_id) { msg->sys_id() = sys_id; }
                                                                                               ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSeq(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:172:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline uint8_t setMsgSeq(timesync_msg_t* msg, const uint8_t& seq) { msg->seq() = seq; }
                                                                                    ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTC1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:173:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline int64_t setMsgTC1(timesync_msg_t* msg, const int64_t& tc1) { msg->tc1() = tc1; }
                                                                                    ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTS1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:174:88: warning: no return statement in function returning non-void [-Wreturn-type]
  inline int64_t setMsgTS1(timesync_msg_t* msg, const int64_t& ts1) { msg->ts1() = ts1; }
                                                                                    ^
In file included from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.cpp:34:0:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint64_t RtpsTopics::setMsgTimestamp(T*, const uint64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:175:104: warning: no return statement in function returning non-void [-Wreturn-type]
 inline uint64_t setMsgTimestamp(T* msg, const uint64_t& timestamp) { msg->timestamp() = timestamp; }
                                                                                                    ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint8_t RtpsTopics::setMsgSysID(T*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:178:89: warning: no return statement in function returning non-void [-Wreturn-type]
 inline uint8_t setMsgSysID(T* msg, const uint8_t& sys_id) { msg->sys_id() = sys_id; }
                                                                                     ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint8_t RtpsTopics::setMsgSeq(T*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:181:78: warning: no return statement in function returning non-void [-Wreturn-type]
 inline uint8_t setMsgSeq(T* msg, const uint8_t& seq) { msg->seq() = seq; }
                                                                          ^
In file included from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_agent.cpp:52:0:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint64_t TimeSync::setMsgTimestamp(timesync_msg_t*, const uint64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:170:114: warning: no return statement in function returning non-void [-Wreturn-type]
 mesync_msg_t* msg, const uint64_t& timestamp) { msg->timestamp() = timestamp; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSysID(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:171:99: warning: no return statement in function returning non-void [-Wreturn-type]
 sgSysID(timesync_msg_t* msg, const uint8_t& sys_id) { msg->sys_id() = sys_id; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘uint8_t TimeSync::setMsgSeq(timesync_msg_t*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:172:88: warning: no return statement in function returning non-void [-Wreturn-type]
 int8_t setMsgSeq(timesync_msg_t* msg, const uint8_t& seq) { msg->seq() = seq; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTC1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:173:88: warning: no return statement in function returning non-void [-Wreturn-type]
 nt64_t setMsgTC1(timesync_msg_t* msg, const int64_t& tc1) { msg->tc1() = tc1; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h: In member function ‘int64_t TimeSync::setMsgTS1(timesync_msg_t*, const int64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_timesync.h:174:88: warning: no return statement in function returning non-void [-Wreturn-type]
 nt64_t setMsgTS1(timesync_msg_t* msg, const int64_t& ts1) { msg->ts1() = ts1; }
                                                                           ^
In file included from /home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/microRTPS_agent.cpp:53:0:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint64_t RtpsTopics::setMsgTimestamp(T*, const uint64_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:175:104: warning: no return statement in function returning non-void [-Wreturn-type]
 gTimestamp(T* msg, const uint64_t& timestamp) { msg->timestamp() = timestamp; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint8_t RtpsTopics::setMsgSysID(T*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:178:89: warning: no return statement in function returning non-void [-Wreturn-type]
  uint8_t setMsgSysID(T* msg, const uint8_t& sys_id) { msg->sys_id() = sys_id; }
                                                                           ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h: In member function ‘uint8_t RtpsTopics::setMsgSeq(T*, const uint8_t&)’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/RtpsTopics.h:181:78: warning: no return statement in function returning non-void [-Wreturn-type]
 inline uint8_t setMsgSeq(T* msg, const uint8_t& seq) { msg->seq() = seq; }
                                                                          ^
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/AdcReport_Publisher.cpp: In member function ‘bool AdcReport_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/AdcReport_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Airspeed_Publisher.cpp: In member function ‘bool Airspeed_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Airspeed_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/BatteryStatus_Publisher.cpp: In member function ‘bool BatteryStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/BatteryStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Cpuload_Publisher.cpp: In member function ‘bool Cpuload_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/Cpuload_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/DistanceSensor_Publisher.cpp: In member function ‘bool DistanceSensor_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/DistanceSensor_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/EstimatorStatus_Publisher.cpp: In member function ‘bool EstimatorStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/EstimatorStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Airspeed_Publisher.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/AdcReport_Publisher.cpp.o] Error 1
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/HomePosition_Publisher.cpp: In member function ‘bool HomePosition_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/HomePosition_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp: In member function ‘bool IridiumsbdStatus_Publisher::init()’:
/home/falke/px4_ros_com_ros2/src/px4_ros_com/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp:67:25: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’
 PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
                     ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/Cpuload_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/BatteryStatus_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/EstimatorStatus_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/DistanceSensor_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/HomePosition_Publisher.cpp.o] Error 1
make[2]: *** [CMakeFiles/micrortps_agent.dir/src/micrortps_agent/IridiumsbdStatus_Publisher.cpp.o] Error 1
make[1]: *** [CMakeFiles/micrortps_agent.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< px4_ros_com	[ Exited with code 2 ]

Summary: 1 package finished [8min 5s]
  1 package failed: px4_ros_com
  2 packages had stderr output: px4_msgs px4_ros_com

There seems to be still an error with the mircortps_agent. What can cause this error? Any suggestions? Help?

Thanks!

Hi! Did you already manage to solve your problem? Currently I am trying to install Fast-RTPs-Gen on:
ROS-Eloquent
where $ dpkg -l | grep fastrtps gives me:

ii ros-eloquent-fastrtps 1.9.3-2bionic.20200605.222043 amd64 Implementation of RTPS standard.
ii ros-eloquent-fastrtps-cmake-module 0.8.0-1bionic.20200605.225737 amd64 Provide CMake module to find eProsima FastRTPS.
ii ros-eloquent-rmw-fastrtps-cpp 0.8.1-1bionic.20200605.235017 amd64 Implement the ROS middleware interface using eProsima FastRTPS static code generation in C++.
ii ros-eloquent-rmw-fastrtps-shared-cpp 0.8.1-1bionic.20200605.231351 amd64 Code shared on static and dynamic type support of rmw_fastrtps_cpp.
ii ros-eloquent-rosidl-typesupport-fastrtps-c 0.8.0-1bionic.20200605.232147 amd64 Generate the C interfaces for eProsima FastRTPS.
ii ros-eloquent-rosidl-typesupport-fastrtps-cpp 0.8.0-1bionic.20200605.231532 amd64 Generate the C++ interfaces for eProsima FastRTPS.

Installing another version of FastRTPS should not need to happen in my eyes since it is already installed in ROS2 as proved in the command and result above. So I skipped that step.

While trying to $ sudo gradle install it raises the same error as you stated at first:

startup failed:
  build file '/home/edwin/Fast-RTPS-Gen/build.gradle': 23: unable to resolve class org.gradle.api.tasks.options.Option
   @ line 23, column 1.
     import org.gradle.api.tasks.options.Option;
     ^
  
  1 error

Best regards,
Edwin

Hey,

No, i didnt solve it yet.