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

What are the proper versions of ROS and Gazebo for a successfull build? #2

Open
pvonmoradi opened this issue Jan 22, 2024 · 0 comments

Comments

@pvonmoradi
Copy link

Hi,
I tried building your project on Ubuntu 18.04 and ROS Melodic (hence Gazebo 9).
I got this error:

mantis_gazebo/include/rotors/gazebo_motor_model.hpp:34:10: fatal error: gazebo/math/Vector3.hh: No such file or directory
 #include "gazebo/math/Vector3.hh"

This is due to the deprecation of Gazebo math in Gazebo 8 and newer. So the Gazebo version should be 7 or older. Am I right?

So I continued on on a VBox running Ubuntu 16.04, ROS Kinetic (hence Gazebo 7).
However, the project has dependencies on qfs_base and qfs_fc. The former builds fine unlike qfc_fc.
I got two errors when building robin. One about an unclosed ifdef compilation guard and the other an unincluded "drivers/posix_common/runtime.h" for posix_reset.

I am not familiar with the codebase but I tried a fix. Here is the diff:

diff --git a/src/drivers/posix_ros/drv_system.cpp b/src/drivers/posix_ros/drv_system.cpp
index fb4f9a4..57a79c6 100644
--- a/src/drivers/posix_ros/drv_system.cpp
+++ b/src/drivers/posix_ros/drv_system.cpp
@@ -16,6 +16,7 @@
 #include <uuid/uuid.h>
 
 #include "drivers/drv_system.h"
+#include "drivers/posix_common/runtime.h"
 
 static uint16_t vid;
 static uint16_t pid;
diff --git a/src/drivers/posix_ros/robin_node.cpp b/src/drivers/posix_ros/robin_node.cpp
index 5ee6fd6..5dc6cfa 100644
--- a/src/drivers/posix_ros/robin_node.cpp
+++ b/src/drivers/posix_ros/robin_node.cpp
@@ -1,6 +1,8 @@
 #include <ros/ros.h>
 
-extern "C" {
+#ifdef __cplusplus
+ extern "C" {
+#endif
 
 #include "run.h"
 #include "drivers/posix_common/drv_cmd_args.h"
@@ -34,3 +36,7 @@ int main(int argc, char **argv) {
 
        return 0;
 }
+
+#ifdef __cplusplus
+}
+#endif

Anyway, the main problem is with robin_gazebo as it's calling an API that is not available on Gazebo 7.

Building CXX object robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/src/robin_gazebo/rg_plugin.cpp.o
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp: In member function ‘void gazebo::RobinGazeboPlugin::callback_odom(const ros::TimerEvent&)’:
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:107:45: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.position.x = model_->WorldPose().Pos().X();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:108:45: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.position.y = model_->WorldPose().Pos().Y();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:109:45: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.position.z = model_->WorldPose().Pos().Z();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:110:48: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.orientation.w = model_->WorldPose().Rot().W();
                                                ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:111:48: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.orientation.x = model_->WorldPose().Rot().X();
                                                ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:112:48: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.orientation.y = model_->WorldPose().Rot().Y();
                                                ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:113:48: error: ‘class gazebo::physics::Model’ has no member named ‘WorldPose’
    msg_odom_.pose.pose.orientation.z = model_->WorldPose().Rot().Z();
                                                ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:115:45: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeLinearVel’
    msg_odom_.twist.twist.linear.x = model_->RelativeLinearVel().X();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:116:45: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeLinearVel’
    msg_odom_.twist.twist.linear.y = model_->RelativeLinearVel().Y();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:117:45: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeLinearVel’
    msg_odom_.twist.twist.linear.z = model_->RelativeLinearVel().Z();
                                             ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:118:46: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeAngularVel’
    msg_odom_.twist.twist.angular.x = model_->RelativeAngularVel().X();
                                              ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:119:46: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeAngularVel’
    msg_odom_.twist.twist.angular.y = model_->RelativeAngularVel().Y();
                                              ^
/home/pooya-xenial/catkin_ws/src/robin_gazebo/src/robin_gazebo/rg_plugin.cpp:120:46: error: ‘class gazebo::physics::Model’ has no member named ‘RelativeAngularVel’
    msg_odom_.twist.twist.angular.z = model_->RelativeAngularVel().Z();
                                              ^
robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/build.make:62: recipe for target 'robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/src/robin_gazebo/rg_plugin.cpp.o' failed
make[2]: *** [robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/src/robin_gazebo/rg_plugin.cpp.o] Error 1
CMakeFiles/Makefile2:13703: recipe for target 'robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/all' failed
make[1]: *** [robin_gazebo/CMakeFiles/robin_gazebo_plugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j1 -l1" failed

So, for only gazebo simulation purposes of the control of an aerial manipulator, what components should be compiled on what version of Ubuntu, ROS and Gazebo?

Thanks

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

No branches or pull requests

1 participant