Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
48b556f
Added ocean_Current_Plugin at dave_ros_gz_plugins
GauravKumar9920 Jul 9, 2024
9a80242
added the world, model and general plugin for water_current along wit…
GauravKumar9920 Jul 19, 2024
286a21d
updated the ocean current model plugin
GauravKumar9920 Jul 20, 2024
8bf2963
updated and adjusted the head node
GauravKumar9920 Jul 21, 2024
81f4d94
addidng service and msg, updated cmake
GauravKumar9920 Jul 25, 2024
9a2d810
updated include file directory
GauravKumar9920 Jul 25, 2024
425bb68
updated a few things and resolved bugs for dave_interfaces
GauravKumar9920 Jul 25, 2024
e33faf4
updates in code after fixing bugs
GauravKumar9920 Jul 25, 2024
2df7a8a
minor updates to the ocean current world plugin
GauravKumar9920 Jul 28, 2024
1b7a606
added proto files for oc_world
GauravKumar9920 Jul 28, 2024
44bc507
minor fixes
GauravKumar9920 Jul 29, 2024
5f88f0b
minor updates
GauravKumar9920 Aug 1, 2024
e601dc1
added service support on ocean_current plugin
GauravKumar9920 Aug 1, 2024
fd37ffd
updates
GauravKumar9920 Aug 2, 2024
206963f
updated code fixed bugs
GauravKumar9920 Aug 3, 2024
596458b
ocean_current CSV Update/support added
GauravKumar9920 Aug 5, 2024
11eb6b6
fixes
GauravKumar9920 Aug 10, 2024
a241227
minor code fixes
GauravKumar9920 Aug 12, 2024
ea74a89
minor changes
GauravKumar9920 Aug 12, 2024
2e48a9c
Changes to CMakeLists.txt
rakeshv24 Aug 14, 2024
6085c31
minor change
rakeshv24 Aug 14, 2024
42927b6
minor changes
rakeshv24 Aug 14, 2024
11e08e0
sucessfully building model and world plugins :)
GauravKumar9920 Aug 15, 2024
20dae53
Building Sucessfully git status
GauravKumar9920 Aug 16, 2024
a209450
pre final code
GauravKumar9920 Aug 17, 2024
dea4ff9
gazebo source install script
woensug-choi Aug 7, 2024
ce11003
specify gz-phyics version
woensug-choi Aug 7, 2024
9ee8fe1
Update README.md
woensug-choi Aug 8, 2024
35b2f05
source install test
woensug-choi Aug 7, 2024
b8423a4
amd
woensug-choi Aug 7, 2024
fe611e1
clean up
woensug-choi Aug 7, 2024
b3640cf
add entry and pythonpath
woensug-choi Aug 7, 2024
5273020
minor fix
woensug-choi Aug 7, 2024
f16e9d7
finalize
woensug-choi Aug 7, 2024
35eb686
specify gz-physics version
woensug-choi Aug 7, 2024
61266fb
testing self-hosted runner
woensug-choi Aug 7, 2024
5885978
arm build takes longer than 6 hours
woensug-choi Aug 8, 2024
413782c
added sub_sea_pressure_sensor_plugin
GauravKumar9920 Jul 24, 2024
65286f1
added support for proto
GauravKumar9920 Jul 24, 2024
41fbeae
updated cmake for review
GauravKumar9920 Jul 25, 2024
f8da1a6
fix include issue
hmoyen Jul 25, 2024
04fbb43
removed duplicates
GauravKumar9920 Jul 26, 2024
339dae0
Successfully compiling code
GauravKumar9920 Jul 27, 2024
f58fa12
Pre-Final fixes
GauravKumar9920 Aug 4, 2024
e6615d1
fix material issues
hmoyen Jul 25, 2024
8e30757
Final code for Sea_Pressure_sensor_plugin
GauravKumar9920 Aug 6, 2024
922e494
minor Update
GauravKumar9920 Aug 6, 2024
c3e4d33
updated code with reccomended changes
GauravKumar9920 Aug 8, 2024
f49f229
Minor changes
GauravKumar9920 Aug 8, 2024
428b382
Removed Proto
GauravKumar9920 Aug 9, 2024
9b1a7b2
remove empty file
woensug-choi Aug 9, 2024
e731f5c
add lints and build checks for PR too
woensug-choi Aug 9, 2024
408e8a3
minor changes and modification of sdf
GauravKumar9920 Sep 3, 2024
085b4eb
testing
GauravKumar9920 Sep 19, 2024
42f989d
working ocean current model plugin
GauravKumar9920 Oct 6, 2024
cb27f22
major restructuring and refreshed code
GauravKumar9920 Oct 6, 2024
df383b3
fixed issues with OCWP
GauravKumar9920 Oct 9, 2024
c449d63
proto is linked
woensug-choi Oct 23, 2024
c812c51
few fixes
GauravKumar9920 Nov 16, 2024
5143826
few fixes2
GauravKumar9920 Nov 16, 2024
f04faad
update
GauravKumar9920 Nov 27, 2024
a996b01
loacl changes
GauravKumar9920 Dec 23, 2024
31d77f3
fixed pointer memory allocation issue
GauravKumar9920 Dec 28, 2024
1d30cb3
code check
GauravKumar9920 Dec 28, 2024
6ce4529
changed the tidal_oscillation
GauravKumar9920 Jan 13, 2025
a878259
Merge branch 'ros2' into ocean_current
GauravKumar9920 Jan 13, 2025
f131c8b
excluded proto in pre-commit
GauravKumar9920 Jan 13, 2025
5c9ab26
working global current
GauravKumar9920 Jan 15, 2025
eca57b8
Ocp ocean current working : )
GauravKumar9920 Jan 15, 2025
15ea116
corrected incorrect parameter readings
GauravKumar9920 Jan 15, 2025
f5ea2a2
minor changes to sdf param
GauravKumar9920 Jan 18, 2025
50b58fa
code cleanup and fix the msg issue
GauravKumar9920 Jan 22, 2025
8a46c2e
ready to review code - OCP, OCWP
GauravKumar9920 Jan 23, 2025
3935752
minor changes
rakeshv24 Jan 23, 2025
8cfeada
Evything's working ! including model plugin
GauravKumar9920 Jan 24, 2025
5a1f215
code clean-up
GauravKumar9920 Jan 24, 2025
68cc23c
code cleanup
GauravKumar9920 Jan 26, 2025
0f0c5fe
timemachine
GauravKumar9920 Jan 26, 2025
e2c54ed
added the flag to switch between the constant and stratified ocean cu…
GauravKumar9920 Jan 28, 2025
e75dd24
for clean build outpout
woensug-choi Feb 5, 2025
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
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.proto
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ repos:
hooks:
- id: clang-format
args: ["-fallback-style=none", "-i"]
exclude: \.proto$

# - repo: local
# hooks:
Expand Down
12 changes: 11 additions & 1 deletion dave_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(gz-cmake3 REQUIRED)
find_package(gz-msgs10 REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/UsblCommand.msg"
Expand All @@ -19,10 +21,18 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"msg/DVL.msg"
"msg/DVLBeam.msg"
"msg/DVLTarget.msg"
"msg/StratifiedCurrentVelocity.msg"
"msg/StratifiedCurrentDatabase.msg"
"srv/SetOriginSphericalCoord.srv"
"srv/GetOriginSphericalCoord.srv"
"srv/TransformToSphericalCoord.srv"
"srv/TransformFromSphericalCoord.srv"
"srv/GetCurrentModel.srv"
"srv/SetCurrentModel.srv"
"srv/SetCurrentDirection.srv"
"srv/SetCurrentVelocity.srv"
"srv/SetStratifiedCurrentVelocity.srv"
"srv/SetStratifiedCurrentDirection.srv"
DEPENDENCIES geometry_msgs
)

Expand All @@ -36,4 +46,4 @@ ament_export_dependencies(rosidl_default_runtime)
# Install CMake package configuration
ament_export_include_directories(include)

ament_package()
ament_package()
42 changes: 42 additions & 0 deletions dave_interfaces/msg/StratifiedCurrentDatabase.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Publishes depths and velocities read from the csv database

# Depths
float32[] depths

# Velocities
geometry_msgs/Vector3[] velocities

# Tide time (GMT)
int16[] time_gmt_year
int16[] time_gmt_month
int16[] time_gmt_day
int16[] time_gmt_hour
int16[] time_gmt_minute

# Tide velocities
float32[] tidevelocities

# Tide constituents
bool tideconstituents
float32 m2_amp
float32 m2_phase
float32 m2_speed
float32 s2_amp
float32 s2_phase
float32 s2_speed
float32 n2_amp
float32 n2_phase
float32 n2_speed

# Tide direction
float32 ebb_direction
float32 flood_direction

# World start time (GMT)
int16 world_start_time_year
int16 world_start_time_month
int16 world_start_time_day
int16 world_start_time_hour
int16 world_start_time_minute

# Everything is written in lowercase according to ROS 2 conventions old(v)
9 changes: 9 additions & 0 deletions dave_interfaces/msg/StratifiedCurrentVelocity.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Publishes depths and velocities based on the database contents

std_msgs/Header header

# Depths
float32[] depths

# Velocities
geometry_msgs/Vector3[] velocities
1 change: 1 addition & 0 deletions dave_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="helenamoyen@usp.br">lena</maintainer>
<maintainer email="gaurav.og.9920@gmail.com">Gaurav Kumar</maintainer>
<license>TODO: License declaration</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
Expand Down
21 changes: 21 additions & 0 deletions dave_interfaces/srv/GetCurrentModel.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
float64 mean
float64 min
float64 max
float64 noise
float64 mu
18 changes: 18 additions & 0 deletions dave_interfaces/srv/SetCurrentDirection.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

float64 angle
---
bool success
22 changes: 22 additions & 0 deletions dave_interfaces/srv/SetCurrentModel.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

float64 mean
float64 min
float64 max
float64 noise
float64 mu
---
bool success
20 changes: 20 additions & 0 deletions dave_interfaces/srv/SetCurrentVelocity.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

float64 velocity
float64 horizontal_angle
float64 vertical_angle
---
bool success
19 changes: 19 additions & 0 deletions dave_interfaces/srv/SetStratifiedCurrentDirection.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

uint16 layer
float64 angle
---
bool success
21 changes: 21 additions & 0 deletions dave_interfaces/srv/SetStratifiedCurrentVelocity.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 The dave Simulator Authors.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

uint16 layer
float64 velocity
float64 horizontal_angle
float64 vertical_angle
---
bool success
65 changes: 65 additions & 0 deletions gazebo/dave_gz_model_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
cmake_minimum_required(VERSION 3.8)
project(dave_gz_model_plugins)

# Find required packages
find_package(ament_cmake REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
find_package(gz-cmake3 REQUIRED)
find_package(gz-plugin2 REQUIRED COMPONENTS register)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(gz-common5 REQUIRED COMPONENTS profiler)
find_package(gz-sim8 REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(dave_interfaces REQUIRED)
find_package(Protobuf REQUIRED)
find_package(gz-msgs10 REQUIRED)
find_package(dave_gz_world_plugins REQUIRED)

# Set version variables
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Harmonic")

add_library(OceanCurrentModelPlugin SHARED src/OceanCurrentModelPlugin.cc)

target_include_directories(OceanCurrentModelPlugin PRIVATE include)

target_link_libraries(OceanCurrentModelPlugin
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
)

# Specify dependencies for ocean_current_plugin using ament_target_dependencies
ament_target_dependencies(OceanCurrentModelPlugin
rclcpp
std_msgs
geometry_msgs
dave_interfaces
dave_gz_world_plugins
)

# Install targets
install(TARGETS OceanCurrentModelPlugin
DESTINATION lib/${PROJECT_NAME}
)

# Install headers
install(DIRECTORY include/
DESTINATION include/
)

# Environment hooks
ament_environment_hooks(
"${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.dsv.in"
)

# Testing setup
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prepend-non-duplicate;GZ_SIM_SYSTEM_PLUGIN_PATH;lib/@PROJECT_NAME@/
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#ifndef DAVE_GZ_MODEL_PLUGINS__OCEANCURRENTMODELPLUGIN_HH_
#define DAVE_GZ_MODEL_PLUGINS__OCEANCURRENTMODELPLUGIN_HH_

#include "dave_gz_world_plugins/gauss_markov_process.hh"
#include "dave_gz_world_plugins/tidal_oscillation.hh"
#include "dave_interfaces/msg/stratified_current_database.hpp"
#include "dave_interfaces/msg/stratified_current_velocity.hpp"

// OceanCurrentModelPlugin

#include <gz/physics/World.hh>
#include <gz/sim/System.hh>

#include <chrono>
#include <map>
#include <memory>
#include <string>

#include <geometry_msgs/msg/twist_stamped.hpp>
#include <geometry_msgs/msg/vector3.hpp>
#include <rclcpp/rclcpp.hpp>

#include <gz/transport/Node.hh>
#include <sdf/sdf.hh>

namespace dave_gz_model_plugins
{
class OceanCurrentModelPlugin : public gz::sim::System,
public gz::sim::ISystemConfigure,
public gz::sim::ISystemUpdate,
public gz::sim::ISystemPostUpdate
{
public:
OceanCurrentModelPlugin();
~OceanCurrentModelPlugin() override;

// ----------------------------------------------

void Configure(
const gz::sim::Entity & _entity, const std::shared_ptr<const sdf::Element> & _sdf,
gz::sim::EntityComponentManager & _ecm, gz::sim::EventManager & _eventMgr);

void LoadCurrentVelocityParams(sdf::ElementPtr _sdf, gz::sim::EntityComponentManager & _ecm);

void UpdateDatabase(
const std::shared_ptr<const dave_interfaces::msg::StratifiedCurrentDatabase> & _msg);

gz::sim::Entity GetModelEntity(
const std::string & modelName, gz::sim::EntityComponentManager & ecm);

gz::math::Pose3d GetModelPose(
const gz::sim::Entity & modelEntity, gz::sim::EntityComponentManager & ecm);

// ----------------------------------------------

void Update(const gz::sim::UpdateInfo & _info, gz::sim::EntityComponentManager & _ecm);

void CalculateOceanCurrent(double vehicleDepth);

// ----------------------------------------------

// Function called after the simulation state updates
void PostUpdate(const gz::sim::UpdateInfo & _info, const gz::sim::EntityComponentManager & _ecm);

void PublishCurrentVelocity(const gz::sim::UpdateInfo & _info);

private:
std::shared_ptr<rclcpp::Node> ros_node_;
struct PrivateData;
std::unique_ptr<PrivateData> dataPtr;
};
} // namespace dave_gz_model_plugins

#endif // DAVE_GZ_MODEL_PLUGINS__OCEANCURRENTMODELPLUGIN_HH_
Loading