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

Multibeam Sonar Migration Template #15

Open
wants to merge 49 commits into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0368e21
template save
woensug-choi Aug 15, 2024
912b984
intermediate save
woensug-choi Aug 15, 2024
7264f6b
rendering not working
woensug-choi Aug 16, 2024
06c3a2b
failing
woensug-choi Aug 16, 2024
bf919e2
dvl_template
woensug-choi Aug 16, 2024
4af0cd1
wrap
woensug-choi Aug 16, 2024
8c64ae5
dvl_template_ready
woensug-choi Aug 16, 2024
9538f40
rename the plugin
woensug-choi Aug 17, 2024
1c90b1e
add description
woensug-choi Aug 17, 2024
4527b4b
add to library path too
woensug-choi Aug 18, 2024
de1d329
ogre not found in target_link_libraries fix
woensug-choi Aug 18, 2024
e7a73a7
somewhat compile success
woensug-choi Aug 18, 2024
9717fe4
launch and upload test
woensug-choi Aug 18, 2024
0a561f3
match variable name for launchs
woensug-choi Aug 19, 2024
e59a9fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 19, 2024
b749c2f
precommit fixes
woensug-choi Aug 19, 2024
0aa82c0
updated contact sensor plugin from ignition
rakeshv24 Aug 18, 2024
3256f6d
add dvl sensor example
hmoyen Jul 25, 2024
5d97839
fix material issues
hmoyen Jul 25, 2024
2b4a43e
fix material issues
hmoyen Jul 25, 2024
ad7003c
Added a custom ros-gz bridge for DVL messages
rakeshv24 Aug 5, 2024
0d31cfa
Moved DVLBridge plugin to model.sdf and added a feature of importing …
rakeshv24 Aug 5, 2024
2ac8255
added dvl plugin to nortek500. TODO: fix water_tracking
rakeshv24 Aug 16, 2024
7f5671a
Added multiple dvl sensors and modified top-level launch files
rakeshv24 Aug 18, 2024
f1b60c6
added mutex lock
rakeshv24 Aug 18, 2024
5b69e8b
1. Fixed reference frame conversion: East-North-Up -> Forward-Starboa…
rakeshv24 Aug 18, 2024
05054b4
precommit changes
rakeshv24 Aug 18, 2024
9d35b10
Update roll, pitch, yaw arguements and DVL types in the code
rakeshv24 Aug 19, 2024
37e9e14
Updated DVL to stay static in the environment
rakeshv24 Aug 19, 2024
102f46e
updated example in README
rakeshv24 Aug 19, 2024
25a70e2
adjust initial camera position
woensug-choi Aug 19, 2024
dbcbd72
rebase to ros2 and add blueview p900 model
woensug-choi Aug 19, 2024
a127723
update test launch command
woensug-choi Aug 19, 2024
e009fa9
sonar orientation fix
woensug-choi Aug 19, 2024
8760b4c
add demo launch with ros_gz_bridge
woensug-choi Aug 19, 2024
0398425
tf2 added (not sure)
woensug-choi Aug 19, 2024
6b46f20
add tf2 memo TODO
woensug-choi Aug 19, 2024
7f5d81a
leave ros_gz_point_cloud memo
woensug-choi Aug 19, 2024
52a2722
fix for precommit
woensug-choi Aug 19, 2024
fabe2e5
Merge branch 'ros2' into sonar_ws_progress
woensug-choi Aug 19, 2024
47f402d
fix for precommit
woensug-choi Aug 19, 2024
21b6993
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 19, 2024
4d7bdfc
reorganize demo
woensug-choi Aug 19, 2024
4c9cd08
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 19, 2024
9cfc7fa
temporary point cloud fix
hmoyen Aug 25, 2024
47d3dd7
correct rays range
hmoyen Oct 19, 2024
9071871
pcl conversion
hmoyen Jan 8, 2025
68759dd
Update pre-commit hooks
hmoyen Jan 9, 2025
b9052d3
Merge branch 'ros2' into sonar_ws_progress
hmoyen Jan 9, 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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=2000"]
Expand All @@ -48,7 +48,7 @@ repos:

# Python hooks
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -62,20 +62,20 @@ repos:
["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"]

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
args: ["--line-length=99", "--exclude=tools/code_check"]

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
args: ["--extend-ignore=E501", "--exclude=tools/code_check"]

# CPP hooks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.7
rev: v19.1.6
hooks:
- id: clang-format
args: ["-fallback-style=none", "-i"]
Expand Down Expand Up @@ -125,7 +125,7 @@ repos:

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
rev: v1.1.2
hooks:
- id: doc8
args: ["--max-line-length=100", "--ignore=D001"]
Expand All @@ -150,7 +150,7 @@ repos:

# Json lint
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
rev: 0.31.0
hooks:
- id: check-github-workflows
args: ["--verbose"]
Expand All @@ -161,7 +161,7 @@ repos:

# XML lint for xacro, urdf, and sdf files
- repo: https://github.com/pamoller/xmlformatter
rev: v0.2.6
rev: v0.2.8
hooks:
- id: xml-formatter
name: Format XML
Expand Down
18 changes: 18 additions & 0 deletions gazebo/dave_gz_multibeam_sonar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dave Gazebo Multibeam Sonar Plugin

- The sensor itself is at `multibeam_sonar`
- The system plugin that will also be defined in `world` file is at `multibeam_sonar_system`
- We need both the sensor and the system plugin to be able to use the sensor in Gazebo

- Launch example with `dave_sensor.launch.py`:

```
ros2 launch dave_demos dave_sensor.launch.py namespace:=blueview_p900 world_name:=dave_multibeam_sonar paused:=false x:=4 z:=0.5 yaw:=3.14
```

- Launch example with `ros_gz_bridge` to translate gazebo msg to ROS msg:
- Not perfect

```
ros2 launch dave_multibeam_sonar_demo multibeam_sonar_demo.launch.py
```
132 changes: 132 additions & 0 deletions gazebo/dave_gz_multibeam_sonar/multibeam_sonar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
cmake_policy(SET CMP0144 NEW)

project(multibeam_sonar)

find_package(ament_cmake REQUIRED)
find_package(gz-cmake3 REQUIRED)
find_package(gz-sim8 REQUIRED)
find_package(gz-sensors8 REQUIRED)
find_package(gz-rendering8 REQUIRED OPTIONAL_COMPONENTS ogre ogre2)
find_package(gz-transport13 REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(PCL REQUIRED)
find_package(pcl_conversions REQUIRED)

find_package(OpenCV REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

# Set version variables
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})
set(GZ_RENDERING_VER ${gz-rendering8_VERSION_MAJOR})
set(GZ_SENSORS_VER ${gz-sensors8_VERSION_MAJOR})
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})

if(TARGET gz-rendering${GZ_RENDERING_VER}::ogre)
set(HAVE_OGRE TRUE)
set(GZ_RENDERING_TARGET gz-rendering${GZ_RENDERING_VER}-ogre)
add_definitions(-DWITH_OGRE)
endif()

if(TARGET gz-rendering${GZ_RENDERING_VER}::ogre2)
set(HAVE_OGRE2 TRUE)
set(GZ_RENDERING_TARGET gz-rendering${GZ_RENDERING_VER}-ogre2)
add_definitions(-DWITH_OGRE2)
endif()

add_library(${PROJECT_NAME}
SHARED
MultibeamSonarSensor.cc
)

target_include_directories(${PROJECT_NAME}
PUBLIC
${gz-sensors${GZ_SENSORS_VER}_INCLUDE_DIRS}
${gz-rendering${GZ_RENDERING_VER}_INCLUDE_DIRS}
${gz-msgs${GZ_MSGS_VER}_INCLUDE_DIRS}
${gz-transport${GZ_TRANSPORT_VER}_INCLUDE_DIRS}
${gz-sim${GZ_SIM_VER}_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES})

install(TARGETS ${PROJECT_NAME}
DESTINATION lib/${PROJECT_NAME}
)

ament_target_dependencies(${PROJECT_NAME}
gz-sensors${GZ_SENSORS_VER}
${GZ_RENDERING_TARGET}
gz-msgs${GZ_MSGS_VER}
gz-transport${GZ_TRANSPORT_VER}
gz-sim${GZ_SIM_VER}
rclcpp
sensor_msgs
rosidl_default_generators
PCL
pcl_conversions
OpenCV
)


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

ament_package()


# find_package(CUDAToolkit QUIET)
# if (CUDAToolkit_FOUND)
# enable_language(CUDA)
# message(STATUS "CUDA found, enabling CUDA support.")
# include_directories(${CUDA_INCLUDE_DIRS})
# set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -arch=sm_60")

# find_package(cv_bridge REQUIRED)
# find_package(OpenCV REQUIRED)
# find_package(rosidl_default_generators REQUIRED)
# find_package(PCL REQUIRED)
# find_package(pcl_ros REQUIRED)
# find_package(marine_acoustic_msgs REQUIRED)
# find_package(gz-sensors${GZ_SIM_VER} REQUIRED)
# set(GZ_SENSORS_VER ${gz-sensors8_VERSION_MAJOR})

# add_library(MultibeamSonarSystem SHARED
# src/MultibeamSonarSystem.cc
# )

# set_target_properties(MultibeamSonarSystem
# PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# target_include_directories(MultibeamSonarSystem PRIVATE include)
# target_link_libraries(MultibeamSonarSystem
# gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
# gz-sensors${GZ_SENSORS_VER}::gz-sensors${GZ_SENSORS_VER}
# gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}
# ${CUDA_LIBRARIES}
# ${PCL_LIBRARIES}
# ${OpenCV_LIBRARIES}
# )

# ament_target_dependencies(MultibeamSonarSystem
# rclcpp
# std_msgs
# sensor_msgs
# geometry_msgs
# PCL
# OpenCV
# marine_acoustic_msgs
# )
# install(TARGETS MultibeamSonarSystem
# DESTINATION lib/${PROJECT_NAME}
# )
# else()
# message(STATUS "CUDA Toolkit not found: Skipping CUDA-specific targets")
# endif()
Loading