From 03a20da4fc7a8336147f0ab8d25152efae93f1c9 Mon Sep 17 00:00:00 2001 From: ACFleming Date: Thu, 29 Jun 2023 15:33:40 +1000 Subject: [PATCH 1/4] Fixed missing imports. Fixed error with teleop re gain vector length --- uuv_assistants/src/message_to_tf.cpp | 18 +++++++++--------- .../uuv_gazebo_plugins/src/ThrusterPlugin.cpp | 2 +- .../uuv_gazebo_ros_plugins/CMakeLists.txt | 2 ++ .../launch/auv_underwater_world.launch | 1 - .../launch/empty_underwater_world.launch | 1 - .../launch/herkules_ship_wreck.launch | 1 - uuv_gazebo_worlds/launch/lake.launch | 1 - uuv_gazebo_worlds/launch/mangalia.launch | 1 - .../launch/mangalia_manipulation.launch | 1 - uuv_gazebo_worlds/launch/munkholmen.launch | 1 - uuv_gazebo_worlds/launch/ocean_waves.launch | 13 ++++++++++--- .../launch/subsea_bop_panel.launch | 1 - .../ROSBaseModelPlugin.h | 1 + uuv_teleop/scripts/finned_uuv_teleop.py | 15 ++++++++++++--- .../uuv_world_ros_plugins/CMakeLists.txt | 2 ++ 15 files changed, 37 insertions(+), 24 deletions(-) mode change 100755 => 100644 uuv_teleop/scripts/finned_uuv_teleop.py diff --git a/uuv_assistants/src/message_to_tf.cpp b/uuv_assistants/src/message_to_tf.cpp index 4dbc52d4..31c99c4b 100644 --- a/uuv_assistants/src/message_to_tf.cpp +++ b/uuv_assistants/src/message_to_tf.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include std::string g_odometry_topic; @@ -72,14 +72,14 @@ void addTransform(std::vector& transforms, transforms.push_back(new_msg); } -namespace tf2 -{ - //Specialization for Point msg - static inline void fromMsg(const geometry_msgs::msg::Point& msgIn, tf2::Vector3& out) - { - out = Vector3(msgIn.x, msgIn.y, msgIn.z); - } -} +// namespace tf2 +// { +// //Specialization for Point msg +// static inline void fromMsg(const geometry_msgs::msg::Point& msgIn, tf2::Vector3& out) +// { +// out = Vector3(msgIn.x, msgIn.y, msgIn.z); +// } +// } std::string stripSlash(const std::string & in) { diff --git a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/ThrusterPlugin.cpp b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/ThrusterPlugin.cpp index 38169b93..62efeefa 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_plugins/src/ThrusterPlugin.cpp +++ b/uuv_gazebo_plugins/uuv_gazebo_plugins/src/ThrusterPlugin.cpp @@ -20,7 +20,7 @@ // limitations under the License. #include -#include +#include #include #include diff --git a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt index c06fcb68..f67ca7f5 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt +++ b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt @@ -21,6 +21,7 @@ find_package(tf2_ros REQUIRED) find_package(uuv_gazebo_plugins REQUIRED) find_package(uuv_gazebo_ros_plugins_msgs REQUIRED) find_package(visualization_msgs REQUIRED) +find_package(gazebo_ros REQUIRED) set(BASE_LIBS ament_cmake @@ -34,6 +35,7 @@ set(BASE_LIBS uuv_gazebo_plugins uuv_gazebo_ros_plugins_msgs visualization_msgs + gazebo_ros ) include_directories(include) diff --git a/uuv_gazebo_worlds/launch/auv_underwater_world.launch b/uuv_gazebo_worlds/launch/auv_underwater_world.launch index de544252..55e7b6f5 100644 --- a/uuv_gazebo_worlds/launch/auv_underwater_world.launch +++ b/uuv_gazebo_worlds/launch/auv_underwater_world.launch @@ -26,7 +26,6 @@ Underwater environment with the ODE physics engine configured for vehicles using - diff --git a/uuv_gazebo_worlds/launch/empty_underwater_world.launch b/uuv_gazebo_worlds/launch/empty_underwater_world.launch index 3b3663d9..afb36cb9 100644 --- a/uuv_gazebo_worlds/launch/empty_underwater_world.launch +++ b/uuv_gazebo_worlds/launch/empty_underwater_world.launch @@ -25,7 +25,6 @@ clearly show it is not the case--> - diff --git a/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch b/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch index 5bd407b1..66122bcc 100644 --- a/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch +++ b/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch @@ -19,7 +19,6 @@ - diff --git a/uuv_gazebo_worlds/launch/lake.launch b/uuv_gazebo_worlds/launch/lake.launch index 2bb539af..b5a6cdc8 100644 --- a/uuv_gazebo_worlds/launch/lake.launch +++ b/uuv_gazebo_worlds/launch/lake.launch @@ -22,7 +22,6 @@ - diff --git a/uuv_gazebo_worlds/launch/mangalia.launch b/uuv_gazebo_worlds/launch/mangalia.launch index eaeafa57..7747f4ca 100644 --- a/uuv_gazebo_worlds/launch/mangalia.launch +++ b/uuv_gazebo_worlds/launch/mangalia.launch @@ -19,7 +19,6 @@ - diff --git a/uuv_gazebo_worlds/launch/mangalia_manipulation.launch b/uuv_gazebo_worlds/launch/mangalia_manipulation.launch index 57f785bd..c4d69511 100644 --- a/uuv_gazebo_worlds/launch/mangalia_manipulation.launch +++ b/uuv_gazebo_worlds/launch/mangalia_manipulation.launch @@ -19,7 +19,6 @@ - diff --git a/uuv_gazebo_worlds/launch/munkholmen.launch b/uuv_gazebo_worlds/launch/munkholmen.launch index efb43b2d..7dc88dd5 100644 --- a/uuv_gazebo_worlds/launch/munkholmen.launch +++ b/uuv_gazebo_worlds/launch/munkholmen.launch @@ -19,7 +19,6 @@ - diff --git a/uuv_gazebo_worlds/launch/ocean_waves.launch b/uuv_gazebo_worlds/launch/ocean_waves.launch index 5b903669..1c270feb 100644 --- a/uuv_gazebo_worlds/launch/ocean_waves.launch +++ b/uuv_gazebo_worlds/launch/ocean_waves.launch @@ -1,7 +1,7 @@ + - @@ -20,11 +20,10 @@ - + - @@ -38,6 +37,14 @@ + + + + + diff --git a/uuv_gazebo_worlds/launch/subsea_bop_panel.launch b/uuv_gazebo_worlds/launch/subsea_bop_panel.launch index 3d3a8ab9..ecddd17b 100644 --- a/uuv_gazebo_worlds/launch/subsea_bop_panel.launch +++ b/uuv_gazebo_worlds/launch/subsea_bop_panel.launch @@ -19,7 +19,6 @@ - diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/include/uuv_sensor_ros_plugins/ROSBaseModelPlugin.h b/uuv_sensor_plugins/uuv_sensor_ros_plugins/include/uuv_sensor_ros_plugins/ROSBaseModelPlugin.h index c4d96c4e..28b27aca 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/include/uuv_sensor_ros_plugins/ROSBaseModelPlugin.h +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/include/uuv_sensor_ros_plugins/ROSBaseModelPlugin.h @@ -36,6 +36,7 @@ #include #include #include +#include #include diff --git a/uuv_teleop/scripts/finned_uuv_teleop.py b/uuv_teleop/scripts/finned_uuv_teleop.py old mode 100755 new mode 100644 index 72109fdd..d2669ab2 --- a/uuv_teleop/scripts/finned_uuv_teleop.py +++ b/uuv_teleop/scripts/finned_uuv_teleop.py @@ -30,6 +30,14 @@ from plankton_utils.param_helper import parse_nested_params_to_dict from plankton_utils.time import is_sim_time +def to_int_list(l: list): + cp = list(l) + if(len(cp) != 0 and type(cp[0]) == str): + if(len(cp) == 1): + cp = ("".join(cp)).split(",") + cp = [int(i) for i in cp] + return cp + class FinnedUUVControllerNode(Node): def __init__(self, **kwargs): @@ -63,9 +71,10 @@ def __init__(self, **kwargs): # Read the vector for contribution of each fin on the change on # orientation - gain_roll = self.get_parameter('gain_roll').value - gain_pitch = self.get_parameter('gain_pitch').value - gain_yaw = self.get_parameter('gain_yaw').value + gain_roll = to_int_list(self.get_parameter('gain_roll').value) + gain_pitch = to_int_list(self.get_parameter('gain_pitch').value) + gain_yaw = to_int_list(self.get_parameter('gain_yaw').value) + print(self._n_fins, gain_pitch, gain_roll, gain_yaw) if len(gain_roll) != self._n_fins or len(gain_pitch) != self._n_fins \ or len(gain_yaw) != self._n_fins: diff --git a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt index c88803c7..146c0ba6 100644 --- a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt +++ b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt @@ -17,6 +17,7 @@ find_package(gazebo_dev REQUIRED) find_package(ament_cmake REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rclcpp REQUIRED) +find_package(gazebo_ros REQUIRED) set(LIBS uuv_world_plugins @@ -26,6 +27,7 @@ set(LIBS ament_cmake geometry_msgs rclcpp + gazebo_ros ) include_directories(include) From b2d05883cb2eafd111b92643a68a0f8e0ab21f1a Mon Sep 17 00:00:00 2001 From: ACFleming Date: Mon, 24 Jul 2023 14:42:49 +1000 Subject: [PATCH 2/4] Added remapping to fix spawning issue for rexrov --- uuv_descriptions/launch/upload_rexrov_default.launch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uuv_descriptions/launch/upload_rexrov_default.launch.py b/uuv_descriptions/launch/upload_rexrov_default.launch.py index ca68ade1..3dc25a7b 100644 --- a/uuv_descriptions/launch/upload_rexrov_default.launch.py +++ b/uuv_descriptions/launch/upload_rexrov_default.launch.py @@ -127,7 +127,10 @@ def launch_setup(context, *args, **kwargs): executable='spawn_entity.py', output='screen', parameters=[{'use_sim_time': res}], - arguments=args + arguments=args, + remappings=[ + ('/gazebo/spawn_entity', '/spawn_entity') + ] ) # A joint state publisher plugin already is started with the model, no need to use the default joint state publisher From b795f8f3e8b897e1aa1c51714096a301b4d6df3b Mon Sep 17 00:00:00 2001 From: ACFleming Date: Thu, 3 Aug 2023 16:15:57 +1000 Subject: [PATCH 3/4] Addressing changes with debug flag and removing comments --- uuv_assistants/src/message_to_tf.cpp | 9 --------- uuv_gazebo_worlds/launch/auv_underwater_world.launch | 1 - uuv_gazebo_worlds/launch/empty_underwater_world.launch | 1 - uuv_gazebo_worlds/launch/herkules_ship_wreck.launch | 1 - uuv_gazebo_worlds/launch/lake.launch | 1 - uuv_gazebo_worlds/launch/mangalia.launch | 1 - uuv_gazebo_worlds/launch/mangalia_manipulation.launch | 1 - uuv_gazebo_worlds/launch/munkholmen.launch | 1 - uuv_gazebo_worlds/launch/ocean_waves.launch | 5 ++--- uuv_gazebo_worlds/launch/subsea_bop_panel.launch | 1 - 10 files changed, 2 insertions(+), 20 deletions(-) diff --git a/uuv_assistants/src/message_to_tf.cpp b/uuv_assistants/src/message_to_tf.cpp index 31c99c4b..f65a3dd9 100644 --- a/uuv_assistants/src/message_to_tf.cpp +++ b/uuv_assistants/src/message_to_tf.cpp @@ -72,15 +72,6 @@ void addTransform(std::vector& transforms, transforms.push_back(new_msg); } -// namespace tf2 -// { -// //Specialization for Point msg -// static inline void fromMsg(const geometry_msgs::msg::Point& msgIn, tf2::Vector3& out) -// { -// out = Vector3(msgIn.x, msgIn.y, msgIn.z); -// } -// } - std::string stripSlash(const std::string & in) { if (in.size() && in[0] == '/') diff --git a/uuv_gazebo_worlds/launch/auv_underwater_world.launch b/uuv_gazebo_worlds/launch/auv_underwater_world.launch index 55e7b6f5..eaba1603 100644 --- a/uuv_gazebo_worlds/launch/auv_underwater_world.launch +++ b/uuv_gazebo_worlds/launch/auv_underwater_world.launch @@ -25,7 +25,6 @@ Underwater environment with the ODE physics engine configured for vehicles using - diff --git a/uuv_gazebo_worlds/launch/empty_underwater_world.launch b/uuv_gazebo_worlds/launch/empty_underwater_world.launch index afb36cb9..ed4c6eb4 100644 --- a/uuv_gazebo_worlds/launch/empty_underwater_world.launch +++ b/uuv_gazebo_worlds/launch/empty_underwater_world.launch @@ -24,7 +24,6 @@ clearly show it is not the case--> - diff --git a/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch b/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch index 66122bcc..c2218c35 100644 --- a/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch +++ b/uuv_gazebo_worlds/launch/herkules_ship_wreck.launch @@ -18,7 +18,6 @@ - diff --git a/uuv_gazebo_worlds/launch/lake.launch b/uuv_gazebo_worlds/launch/lake.launch index b5a6cdc8..e4c82522 100644 --- a/uuv_gazebo_worlds/launch/lake.launch +++ b/uuv_gazebo_worlds/launch/lake.launch @@ -21,7 +21,6 @@ - diff --git a/uuv_gazebo_worlds/launch/mangalia.launch b/uuv_gazebo_worlds/launch/mangalia.launch index 7747f4ca..740f1b21 100644 --- a/uuv_gazebo_worlds/launch/mangalia.launch +++ b/uuv_gazebo_worlds/launch/mangalia.launch @@ -18,7 +18,6 @@ - diff --git a/uuv_gazebo_worlds/launch/mangalia_manipulation.launch b/uuv_gazebo_worlds/launch/mangalia_manipulation.launch index c4d69511..5acf21d4 100644 --- a/uuv_gazebo_worlds/launch/mangalia_manipulation.launch +++ b/uuv_gazebo_worlds/launch/mangalia_manipulation.launch @@ -18,7 +18,6 @@ - diff --git a/uuv_gazebo_worlds/launch/munkholmen.launch b/uuv_gazebo_worlds/launch/munkholmen.launch index 7dc88dd5..a116478a 100644 --- a/uuv_gazebo_worlds/launch/munkholmen.launch +++ b/uuv_gazebo_worlds/launch/munkholmen.launch @@ -18,7 +18,6 @@ - diff --git a/uuv_gazebo_worlds/launch/ocean_waves.launch b/uuv_gazebo_worlds/launch/ocean_waves.launch index 1c270feb..c70491fe 100644 --- a/uuv_gazebo_worlds/launch/ocean_waves.launch +++ b/uuv_gazebo_worlds/launch/ocean_waves.launch @@ -2,6 +2,7 @@ + @@ -20,10 +21,8 @@ - + - - diff --git a/uuv_gazebo_worlds/launch/subsea_bop_panel.launch b/uuv_gazebo_worlds/launch/subsea_bop_panel.launch index ecddd17b..cf29693b 100644 --- a/uuv_gazebo_worlds/launch/subsea_bop_panel.launch +++ b/uuv_gazebo_worlds/launch/subsea_bop_panel.launch @@ -18,7 +18,6 @@ - From a914ef905ea823e0fb8d351c24197d3a93f9f20a Mon Sep 17 00:00:00 2001 From: ACFleming Date: Thu, 3 Aug 2023 16:53:45 +1000 Subject: [PATCH 4/4] Removing comment and removing remapping --- uuv_descriptions/launch/upload_rexrov_default.launch.py | 5 +---- uuv_gazebo_worlds/launch/ocean_waves.launch | 8 -------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/uuv_descriptions/launch/upload_rexrov_default.launch.py b/uuv_descriptions/launch/upload_rexrov_default.launch.py index 3dc25a7b..ca68ade1 100644 --- a/uuv_descriptions/launch/upload_rexrov_default.launch.py +++ b/uuv_descriptions/launch/upload_rexrov_default.launch.py @@ -127,10 +127,7 @@ def launch_setup(context, *args, **kwargs): executable='spawn_entity.py', output='screen', parameters=[{'use_sim_time': res}], - arguments=args, - remappings=[ - ('/gazebo/spawn_entity', '/spawn_entity') - ] + arguments=args ) # A joint state publisher plugin already is started with the model, no need to use the default joint state publisher diff --git a/uuv_gazebo_worlds/launch/ocean_waves.launch b/uuv_gazebo_worlds/launch/ocean_waves.launch index c70491fe..d023c91d 100644 --- a/uuv_gazebo_worlds/launch/ocean_waves.launch +++ b/uuv_gazebo_worlds/launch/ocean_waves.launch @@ -36,14 +36,6 @@ - - - - -