From d34c9d7286e173f504bbcfd9f0aa14a7fe4496b7 Mon Sep 17 00:00:00 2001 From: Daria Date: Fri, 9 Jul 2021 15:44:01 +0200 Subject: [PATCH 1/3] noetic adapted, may not be adapted for earlier version anymore --- .../scripts/trajectory_marker_publisher.py | 2 +- .../models/thruster_proportional.py | 2 +- .../scripts/rov_mb_fl_controller.py | 2 +- .../uuv_gazebo_plugins/CMakeLists.txt | 24 +++++++++++++++---- .../uuv_gazebo_plugins/BuoyantObject.hh | 8 +++++++ .../uuv_gazebo_plugins/src/BuoyantObject.cc | 10 +++++++- .../src/HydrodynamicModel.cc | 8 ++++++- .../src/gazebo_ros_image_sonar.cpp | 1 + uuv_simulator/CMakeLists.txt | 2 +- 9 files changed, 48 insertions(+), 11 deletions(-) diff --git a/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py b/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py index a8128c6df..3aadd7b84 100755 --- a/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py +++ b/uuv_control/uuv_control_utils/scripts/trajectory_marker_publisher.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (c) 2016 The UUV Simulator Authors. # All rights reserved. # diff --git a/uuv_control/uuv_thruster_manager/src/uuv_thrusters/models/thruster_proportional.py b/uuv_control/uuv_thruster_manager/src/uuv_thrusters/models/thruster_proportional.py index 27cf4e673..483c274d6 100644 --- a/uuv_control/uuv_thruster_manager/src/uuv_thrusters/models/thruster_proportional.py +++ b/uuv_control/uuv_thruster_manager/src/uuv_thrusters/models/thruster_proportional.py @@ -14,7 +14,7 @@ # limitations under the License. import rospy import numpy -from thruster import Thruster +from .thruster import Thruster class ThrusterProportional(Thruster): diff --git a/uuv_control/uuv_trajectory_control/scripts/rov_mb_fl_controller.py b/uuv_control/uuv_trajectory_control/scripts/rov_mb_fl_controller.py index 3d2e54d9e..6e5fa2e20 100755 --- a/uuv_control/uuv_trajectory_control/scripts/rov_mb_fl_controller.py +++ b/uuv_control/uuv_trajectory_control/scripts/rov_mb_fl_controller.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (c) 2016-2019 The UUV Simulator Authors. # All rights reserved. # diff --git a/uuv_gazebo_plugins/uuv_gazebo_plugins/CMakeLists.txt b/uuv_gazebo_plugins/uuv_gazebo_plugins/CMakeLists.txt index 16efc7ae3..9b1d1a60d 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_plugins/CMakeLists.txt +++ b/uuv_gazebo_plugins/uuv_gazebo_plugins/CMakeLists.txt @@ -1,8 +1,13 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0.2) project(uuv_gazebo_plugins) # Specify C++11 standard -add_definitions(-std=c++11) +if(NOT "${CMAKE_VERSION}" VERSION_LESS "3.16") + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +else() + set(LOCAL_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif() find_package(catkin REQUIRED COMPONENTS gazebo_dev) @@ -72,7 +77,11 @@ add_library(uuv_dynamics src/Dynamics.cc ) list(APPEND UUV_GAZEBO_PLUGINS_LIST uuv_dynamics) - +set_target_properties(uuv_dynamics + PROPERTIES + COMPILE_FLAGS + "${LOCAL_CXX_FLAGS}" +) add_library(uuv_fin_plugin src/LiftDragModel.cc src/FinPlugin.cc @@ -97,6 +106,11 @@ target_link_libraries(uuv_underwater_object_plugin ${EIGEN3_LIBRARIES} ) list(APPEND UUV_GAZEBO_PLUGINS_LIST uuv_underwater_object_plugin) +set_target_properties(uuv_underwater_object_plugin + PROPERTIES + COMPILE_FLAGS + "${LOCAL_CXX_FLAGS}" +) add_library(uuv_thruster_plugin src/ThrusterConversionFcn.cc @@ -136,8 +150,8 @@ install(DIRECTORY include/${PROJECT_NAME}/ ) install(DIRECTORY include/ - DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION} - FILES_MATCHING PATTERN ".hh" + DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN ".hh" ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ diff --git a/uuv_gazebo_plugins/uuv_gazebo_plugins/include/uuv_gazebo_plugins/BuoyantObject.hh b/uuv_gazebo_plugins/uuv_gazebo_plugins/include/uuv_gazebo_plugins/BuoyantObject.hh index 5802903e9..2b7a8366f 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_plugins/include/uuv_gazebo_plugins/BuoyantObject.hh +++ b/uuv_gazebo_plugins/uuv_gazebo_plugins/include/uuv_gazebo_plugins/BuoyantObject.hh @@ -74,7 +74,11 @@ class BuoyantObject public: double GetGravity(); /// \brief Sets bounding box + #if GAZEBO_MAJOR_VERSION >= 11 + public: void SetBoundingBox(const ignition::math::AxisAlignedBox &_bBox); + #else public: void SetBoundingBox(const ignition::math::Box &_bBox); + #endif /// \brief Adds a field in the hydroWrench map public: void SetStoreVector(std::string _tag); @@ -120,7 +124,11 @@ class BuoyantObject /// \brief TEMP for calculation of the buoyancy /// force close to the surface + #if GAZEBO_MAJOR_VERSION >= 11 + protected: ignition::math::AxisAlignedBox boundingBox; + #else protected: ignition::math::Box boundingBox; + #endif /// \brief Storage for hydrodynamic and hydrostatic forces and torques /// for debugging purposes diff --git a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/BuoyantObject.cc b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/BuoyantObject.cc index a206aeafc..8fa228794 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/BuoyantObject.cc +++ b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/BuoyantObject.cc @@ -205,10 +205,18 @@ void BuoyantObject::ApplyBuoyancyForce() } ///////////////////////////////////////////////// +#if GAZEBO_MAJOR_VERSION >= 11 +void BuoyantObject::SetBoundingBox(const ignition::math::AxisAlignedBox &_bBox) +#else void BuoyantObject::SetBoundingBox(const ignition::math::Box &_bBox) +#endif { + #if GAZEBO_MAJOR_VERSION >= 11 + this->boundingBox = ignition::math::AxisAlignedBox(_bBox); + #else this->boundingBox = ignition::math::Box(_bBox); - + #endif + gzmsg << "New bounding box for " << this->link->GetName() << "::" << this->boundingBox << std::endl; } diff --git a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/HydrodynamicModel.cc b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/HydrodynamicModel.cc index a4b49ad37..2e524d291 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/HydrodynamicModel.cc +++ b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/HydrodynamicModel.cc @@ -75,9 +75,15 @@ HydrodynamicModel::HydrodynamicModel(sdf::ElementPtr _sdf, double width = sdfModel->Get("width"); double length = sdfModel->Get("length"); double height = sdfModel->Get("height"); - ignition::math::Box boundingBox = ignition::math::Box( + #if GAZEBO_MAJOR_VERSION >= 11 + ignition::math::AxisAlignedBox boundingBox = ignition::math::AxisAlignedBox( ignition::math::Vector3d(-width / 2, -length / 2, -height / 2), ignition::math::Vector3d(width / 2, length / 2, height / 2)); + #else + ignition::math::Box boundingBox = ignition::math::Box( + ignition::math::Vector3d(-width / 2, -length / 2, -height / 2), + ignition::math::Vector3d(width / 2, length / 2, height / 2)); + #endif // Setting the the bounding box from the given dimensions this->SetBoundingBox(boundingBox); } diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp index 6c3b7af9b..9183fb17b 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/gazebo_ros_image_sonar.cpp @@ -49,6 +49,7 @@ #include #include #include +#include namespace gazebo { diff --git a/uuv_simulator/CMakeLists.txt b/uuv_simulator/CMakeLists.txt index 9898bcdd7..7d92136ac 100644 --- a/uuv_simulator/CMakeLists.txt +++ b/uuv_simulator/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0.2) project(uuv_simulator) find_package(catkin REQUIRED) catkin_metapackage() From b3b549f0883f1c51cd18857ef7c58f37fa341d08 Mon Sep 17 00:00:00 2001 From: Daria Date: Fri, 9 Jul 2021 15:47:40 +0200 Subject: [PATCH 2/3] noetic adapted, may not be adapted for earlier version anymore --- uuv_simulator/CHANGELOG.rst | 117 ----------------------------------- uuv_simulator/CMakeLists.txt | 4 -- uuv_simulator/package.xml | 44 ------------- 3 files changed, 165 deletions(-) delete mode 100644 uuv_simulator/CHANGELOG.rst delete mode 100644 uuv_simulator/CMakeLists.txt delete mode 100644 uuv_simulator/package.xml diff --git a/uuv_simulator/CHANGELOG.rst b/uuv_simulator/CHANGELOG.rst deleted file mode 100644 index 9bc348192..000000000 --- a/uuv_simulator/CHANGELOG.rst +++ /dev/null @@ -1,117 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package uuv_simulator -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.6.13 (2019-08-12) -------------------- - -0.6.12 (2019-05-23) -------------------- - -0.6.11 (2019-03-21) -------------------- - -0.6.10 (2019-02-28) -------------------- - -0.6.9 (2019-02-26) ------------------- - -0.6.8 (2019-02-14) ------------------- - -0.6.7 (2019-02-13) ------------------- - -0.6.6 (2019-02-12) ------------------- - -0.6.5 (2019-02-07) ------------------- -* RM Dependency to uuv_tutorials -* Contributors: Musa Morena Marcusso Manhães - -0.6.4 (2019-02-03) ------------------- -* Add uuv_gazebo_worlds to metapackage - Signed-off-by: Musa Morena Marcusso Manhães -* Contributors: Musa Morena Marcusso Manhães - -0.6.3 (2018-12-13) ------------------- -* CHANGE Use lowercase strings for e-mail - Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Musa Morena Marcusso Manhães - -0.6.2 (2018-12-03) ------------------- -* FIX Sensor ROS plugins package name - Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Musa Morena Marcusso Manhães - -0.6.1 (2018-08-03) ------------------- -* FIX List of dependencies with the new transfer - Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Musa Morena Marcusso Manhaes - -0.6.0 (2018-07-31) ------------------- - -0.5.13 (2018-07-24) -------------------- - -0.5.12 (2018-07-23) -------------------- - -0.5.11 (2018-07-21) -------------------- - -0.5.10 (2018-07-10) -------------------- - -0.5.9 (2018-07-09) ------------------- - -0.5.8 (2018-07-07) ------------------- - -0.5.7 (2018-07-06) ------------------- - -0.5.6 (2018-07-06) ------------------- - -0.5.5 (2018-07-05) ------------------- -* RM Merge messages from the change log -Signed-off-by: Musa Morena Marcusso Manhaes -* UPDATE CHANGELOG files -Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Musa Morena Marcusso Manhaes - -0.5.4 (2018-07-04) ------------------- - -0.5.3 (2018-07-04) ------------------- -* ADD CHANGELOG files - Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Musa Morena Marcusso Manhaes - -0.5.1 (2018-07-03) ------------------- -* CHANGE Bump version to 0.5.2 - Signed-off-by: Musa Morena Marcusso Manhaes -* ADD execution dependencies to metapackages - Signed-off-by: Gabriel Arjones -* ADD format 2 to metapackage's manifests - Signed-off-by: Gabriel Arjones -* ADD metapackage to package's manifest - Signed-off-by: Gabriel Arjones -* CHANGE Version -* CHANGE Package versions - Signed-off-by: Musa Morena Marcusso Manhaes -* ADD Meta-package - Signed-off-by: Musa Morena Marcusso Manhaes -* Contributors: Gabriel Arjones, Musa Morena Marcusso Manhaes diff --git a/uuv_simulator/CMakeLists.txt b/uuv_simulator/CMakeLists.txt deleted file mode 100644 index 7d92136ac..000000000 --- a/uuv_simulator/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2) -project(uuv_simulator) -find_package(catkin REQUIRED) -catkin_metapackage() diff --git a/uuv_simulator/package.xml b/uuv_simulator/package.xml deleted file mode 100644 index de6cecac2..000000000 --- a/uuv_simulator/package.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - uuv_simulator - 0.6.13 - uuv_simulator contains Gazebo plugins and ROS packages for modeling and simulating unmanned underwater vehicles - - Luiz Ricardo Douat - Musa Morena Marcusso Manhaes - Sebastian Scherer - - Luiz Ricardo Douat - Musa Morena Marcusso Manhaes - Sebastian Scherer - - Apache-2.0 - - https://uuvsimulator.github.io/ - - catkin - - uuv_assistants - uuv_auv_control_allocator - uuv_control_cascaded_pid - uuv_control_msgs - uuv_control_utils - uuv_thruster_manager - uuv_trajectory_control - uuv_descriptions - uuv_gazebo - uuv_gazebo_plugins - uuv_gazebo_ros_plugins - uuv_gazebo_ros_plugins_msgs - uuv_gazebo_worlds - uuv_sensor_ros_plugins_msgs - uuv_sensor_ros_plugins - uuv_teleop - uuv_world_plugins - uuv_world_ros_plugins - uuv_world_ros_plugins_msgs - - - - - From ec7c1d4624b1b750f63cceebec2e1c65d82b4658 Mon Sep 17 00:00:00 2001 From: XY Date: Sat, 23 Oct 2021 13:20:15 +0800 Subject: [PATCH 3/3] Changed python dependencies to python3 Add missing return statements --- uuv_control/uuv_control_utils/package.xml | 5 +++-- uuv_control/uuv_thruster_manager/package.xml | 8 +++++--- uuv_control/uuv_trajectory_control/package.xml | 11 +++++++---- .../src/MagnetometerROSPlugin.cc | 1 + .../uuv_sensor_ros_plugins/src/ROSBasePlugin.cc | 1 + .../scripts/tutorial_dp_controller.py | 4 ++-- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/uuv_control/uuv_control_utils/package.xml b/uuv_control/uuv_control_utils/package.xml index 18eeebd94..f6bd138ae 100644 --- a/uuv_control/uuv_control_utils/package.xml +++ b/uuv_control/uuv_control_utils/package.xml @@ -1,5 +1,5 @@ - + uuv_control_utils 0.6.13 The uuv_control_utils package @@ -24,7 +24,8 @@ python-numpy uuv_control_msgs std_msgs - python-yaml + python-yaml + python3-yaml visualization_msgs nav_msgs uuv_trajectory_control diff --git a/uuv_control/uuv_thruster_manager/package.xml b/uuv_control/uuv_thruster_manager/package.xml index e8c8e947c..d62970e56 100644 --- a/uuv_control/uuv_thruster_manager/package.xml +++ b/uuv_control/uuv_thruster_manager/package.xml @@ -1,5 +1,5 @@ - + uuv_thruster_manager 0.6.13 The thruster manager package @@ -22,7 +22,10 @@ message_runtime tf rospy - python-yaml + python-empy + python3-empy + python-yaml + python3-yaml uuv_gazebo_ros_plugins_msgs geometry_msgs uuv_assistants @@ -37,4 +40,3 @@ xacro - diff --git a/uuv_control/uuv_trajectory_control/package.xml b/uuv_control/uuv_trajectory_control/package.xml index a8eaf6127..8c68a39a0 100644 --- a/uuv_control/uuv_trajectory_control/package.xml +++ b/uuv_control/uuv_trajectory_control/package.xml @@ -1,5 +1,5 @@ - + uuv_trajectory_control 0.6.13 The uuv_trajectory_control package @@ -15,9 +15,12 @@ rospy roslib python-numpy - python-matplotlib - python-yaml - python-scipy + python-matplotlib + python3-matplotlib + python-yaml + python3-yaml + python-scipy + python3-scipy geometry_msgs uuv_control_msgs tf diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/MagnetometerROSPlugin.cc b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/MagnetometerROSPlugin.cc index f08b51d85..9990d597d 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/MagnetometerROSPlugin.cc +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/MagnetometerROSPlugin.cc @@ -149,6 +149,7 @@ bool MagnetometerROSPlugin::OnUpdate(const common::UpdateInfo& _info) this->rosMsg.magnetic_field.z = this->measMagneticField.Z(); this->rosSensorOutputPub.publish(this->rosMsg); + return true; } ///////////////////////////////////////////////// diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/ROSBasePlugin.cc b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/ROSBasePlugin.cc index 3482aa454..df6846d5d 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/ROSBasePlugin.cc +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/src/ROSBasePlugin.cc @@ -141,6 +141,7 @@ bool ROSBasePlugin::InitBasePlugin(sdf::ElementPtr _sdf) // Add a default Gaussian noise model this->AddNoiseModel("default", this->noiseSigma); + return true; } ///////////////////////////////////////////////// diff --git a/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py b/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py index d3f6a3d90..6e071d017 100755 --- a/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py +++ b/uuv_tutorials/uuv_tutorial_dp_controller/scripts/tutorial_dp_controller.py @@ -90,7 +90,7 @@ def __init__(self): diag = rospy.get_param('~Kd') if len(diag) == 6: self._Kd = np.diag(diag) - print 'Kd=\n', self._Kd + print('Kd=\n', self._Kd) else: # If the vector provided has the wrong dimension, raise an exception raise rospy.ROSException('For the Kd diagonal matrix, 6 coefficients are needed') @@ -99,7 +99,7 @@ def __init__(self): diag = rospy.get_param('~Ki') if len(diag) == 6: self._Ki = np.diag(diag) - print 'Ki=\n', self._Ki + print('Ki=\n', self._Ki) else: # If the vector provided has the wrong dimension, raise an exception raise rospy.ROSException('For the Ki diagonal matrix, 6 coefficients are needed')