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

Fixed missing imports. #2

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions uuv_assistants/src/message_to_tf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include <tf2/LinearMath/Transform.h>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>


std::string g_odometry_topic;
Expand Down Expand Up @@ -72,14 +72,14 @@ void addTransform(std::vector<geometry_msgs::msg::TransformStamped>& 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if this section is needed or if it can be removed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fromMsg function causes a compilation error. Ros humble defines the same function in /opt/ros/humble/include/tf2_geometry_msgs/tf2_geometry_msgs/tf2_geometry_msgs.hpp.
From this, I believe it is correct to remove it, as the functionality is not lost, and keeping it in fact causes errors. I shall delete that function

// {
// //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)
{
Expand Down
5 changes: 4 additions & 1 deletion uuv_descriptions/launch/upload_rexrov_default.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// limitations under the License.

#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/shared_ptr.hpp>

#include <limits>
Expand Down
2 changes: 2 additions & 0 deletions uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,6 +35,7 @@ set(BASE_LIBS
uuv_gazebo_plugins
uuv_gazebo_ros_plugins_msgs
visualization_msgs
gazebo_ros
)

include_directories(include)
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/auv_underwater_world.launch
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Underwater environment with the ODE physics engine configured for vehicles using
<arg name="debug" value="false"/>
<arg name="verbose" value="true"/>
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove the corresponding comment from the other launch files as well

<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/empty_underwater_world.launch
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ clearly show it is not the case-->
<arg name="debug" value="false"/>
<arg name="verbose" value="true"/>
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/herkules_ship_wreck.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true" />
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/lake.launch
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true"/>
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/mangalia.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true" />
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/mangalia_manipulation.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true" />
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/munkholmen.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true" />
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
13 changes: 10 additions & 3 deletions uuv_gazebo_worlds/launch/ocean_waves.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<launch>
<arg name="gui" default="true"/>
<arg name="paused" default="false"/>
<arg name="debug" default="false"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check how this could be reinstated

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reinstated

<arg name="set_timeout" default="false"/>
<arg name="timeout" default="0.0"/>
<arg name="use_sim_time" default="true"/>
Expand All @@ -20,11 +20,10 @@
<arg name="use_sim_time" value="$(var use_sim_time)"/>
<arg name="gui" value="$(var gui)"/>
<arg name="headless" value="false"/>
<arg name="debug" value="$(var debug)"/>
<arg name="debug" value="false"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert this change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

<arg name="verbose" value="true"/>
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<!-- Also investigate why /gazebo ns has a strong bad perf impact-->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand All @@ -38,6 +37,14 @@
<param from="$(find-pkg-share uuv_gazebo_worlds)/config/ocean_waves.yaml"/>
</node>

<!-- <plugin name="gazebo_factory" filename="libgazebo_ros_factory.so"> -->
<!-- NB: omitting <ros> element, the namespace is still correctly read,
but is it an intended behaviour ?-->
<!-- <ros>
<namespace>/vehicle</namespace>
</ros> -->
<!-- </plugin> -->

<group if="$(var set_timeout)">
<include file="$(find-pkg-share uuv_assistants)/launch/set_simulation_timer.launch">
<arg name="timeout" value="$(var timeout)"/>
Expand Down
1 change: 0 additions & 1 deletion uuv_gazebo_worlds/launch/subsea_bop_panel.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<arg name="debug" value="false"/>
<arg name="verbose" value="true" />
<!-- TODO Remove force_system in foxy, as it will be loaded by default -->
<arg name="extra_gazebo_args" value="-s libgazebo_ros_force_system.so --ros-args -r gazebo:__ns:=/gazebo"/>
</include>

<include file="$(find-pkg-share uuv_assistants)/launch/publish_world_ned_frame.launch">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <tf2_msgs/msg/tf_message.hpp>
#include <tf2_ros/transform_listener.h>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2_ros/buffer.h>

#include <geometry_msgs/msg/transform_stamped.hpp>

Expand Down
15 changes: 12 additions & 3 deletions uuv_teleop/scripts/finned_uuv_teleop.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,6 +27,7 @@ set(LIBS
ament_cmake
geometry_msgs
rclcpp
gazebo_ros
)

include_directories(include)
Expand Down