From f3f6a9558594f39d256bf0b0b2b95c036f94f0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=20=D0=96=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D0=BE=D0=B2?= Date: Wed, 13 Nov 2024 14:49:18 +0000 Subject: [PATCH 1/4] Update readme --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index afe9c259..20738101 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,14 @@ sudo apt-get install gazebo11 sudo apt-get install libgazebo11-dev ``` +Or if this didn't work: + +``` +sudo apt install gazebo +sudo apt install libgazebo-dev +``` + + You can write `gazebo` in a terminal to make sure that gazebo runs correctly. Write `gazebo --version` to ensure that the version number is 11.X. >For more information about the installation of Gazebo, refer to the official installation documentation (beware that the default installation command will not install the version 11): @@ -60,8 +68,8 @@ You can write `gazebo` in a terminal to make sure that gazebo runs correctly. Wr ### 3. Install the ros packages for gazebo -Write in a terminal: -`sudo apt install ros-foxy-gazebo-ros-pkgs` +Write in a terminal: +`sudo apt install ros-iron-gazebo-ros-pkgs` >See for more detailed information about gazebo and ROS 2 connection. @@ -77,11 +85,11 @@ Make sure git is installed: `sudo apt install git` Now, clone the Plankton repository: -`git clone https://www.github.com/Liquid-ai/Plankton.git` +`git clone https://sdb.smtu.ru/gitlab/ros-in-underwater-robotics/plankton` At this point, you need to source 2 different files described below to configure ROS 2 and Gazebo environment variables: - For ROS 2 variables -`source /opt/ros/foxy/setup.bash` +`source /opt/ros/iron/setup.bash` - For Gazebo `source /usr/share/gazebo/setup.sh` @@ -95,7 +103,7 @@ rosdep update Browse to the root of your workspace and check for missing dependencies: ``` cd ~/ros2_ws/ -rosdep install -i --from-path src --rosdistro foxy -y +rosdep install -i --from-path src --rosdistro iron -y ``` Install Colcon, the build tool system: @@ -115,7 +123,7 @@ If everything went well, you should be able to run example cases. Note: Every time you open a new terminal, you need to source 3 different files described below to configure ROS 2 and Gazebo environment variables. Write the following each time you start a new terminal to deal with ROS 2 / Gazebo stuff, or prefer to add them at the end of your .bashrc file with `gedit ~/.bashrc`. For the latter, don’t forget to source your .bashrc to enforce the update after saving these changes, or open a fresh terminal. - For ROS 2 variables -`source /opt/ros/foxy/setup.bash` +`source /opt/ros/iron/setup.bash` - For your installation workspace (change the path accordingly) `source $HOME/ros2_ws/install/setup.bash` - For Gazebo -- GitLab From cd8c7ee10daa6abccc29785491d848291e680dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9B?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=D1=88=D0=B5=D0=B2?= Date: Wed, 13 Nov 2024 14:50:48 +0000 Subject: [PATCH 2/4] Fix some compilation problems --- uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt | 2 ++ uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt index c06fcb68..bdeffeea 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt +++ b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt @@ -12,6 +12,7 @@ endif() find_package(ament_cmake REQUIRED) find_package(gazebo_dev REQUIRED) +find_package(gazebo_ros REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(sensor_msgs REQUIRED) @@ -25,6 +26,7 @@ find_package(visualization_msgs REQUIRED) set(BASE_LIBS ament_cmake gazebo_dev + gazebo_ros geometry_msgs rclcpp sensor_msgs diff --git a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt index c88803c7..4a17f98f 100644 --- a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt +++ b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(uuv_world_plugins REQUIRED) find_package(uuv_world_ros_plugins_msgs REQUIRED) find_package(gazebo_msgs REQUIRED) find_package(gazebo_dev REQUIRED) +find_package(gazebo_ros REQUIRED) find_package(ament_cmake REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rclcpp REQUIRED) @@ -23,6 +24,7 @@ set(LIBS uuv_world_ros_plugins_msgs gazebo_msgs gazebo_dev + gazebo_ros ament_cmake geometry_msgs rclcpp -- GitLab From b3293fee93a2a3783f2a0b487af85dfc5daeed64 Mon Sep 17 00:00:00 2001 From: Rjkzavr Date: Fri, 18 Jul 2025 18:42:03 +0300 Subject: [PATCH 3/4] fix namespaces --- .github/workflows/ci.yaml | 86 ---- .vscode/uuv.vscode.code-snippets | 461 ------------------ README.md | 20 +- .../uuv_gazebo_ros_plugins/CMakeLists.txt | 2 - .../urdf/camera_snippets.xacro | 7 +- .../urdf/dvl_snippets.xacro | 1 + uuv_teleop/launch/uuv_teleop.launch | 28 +- .../uuv_world_ros_plugins/CMakeLists.txt | 2 - 8 files changed, 27 insertions(+), 580 deletions(-) delete mode 100644 .github/workflows/ci.yaml delete mode 100644 .vscode/uuv.vscode.code-snippets diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 9ced34ed..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: CI - -on: # NOLINT - pull_request: - push: - schedule: - - cron: '0 0 */2 * *' # Every 2 days at midnight - -jobs: - test_docker: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - gazebo-version: [9, 11] - # Define the Docker image(s) associated with each ROS distribution. - # The include syntax allows additional variables to be defined, like - # docker_image in this case. See documentation: - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build - - # Platforms are defined in REP 3, and REP 2000: - # https://ros.org/reps/rep-0003.html - # https://ros.org/reps/rep-2000.html - include: - # Foxy Fitzroy (May 2020 - May 2023) - - docker_image: ros:foxy - ros_distribution: foxy - - container: ${{ matrix.docker_image }} - - defaults: - run: - shell: bash - - steps: - - uses: actions/checkout@v2 - with: - path: src/plankton - - - name: Install Tools - run: | - sudo apt update - sudo apt install -y build-essential clang cmake git wget libasio-dev libtinyxml2-dev lcov psmisc - rosdep update - sudo apt install -y python3-colcon-coveragepy-result - sudo apt install -y python3-colcon-lcov-result - - - name: Install Gazebo - run: | - echo Installing Gazebo ${{ matrix.gazebo-version }} - sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' - wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - - sudo apt update - sudo apt install -y gazebo${{ matrix.gazebo-version }} - sudo apt install -y libgazebo${{ matrix.gazebo-version }}-dev - sudo apt install -y ros-${{ matrix.ros_distribution }}-gazebo-ros-pkgs - - - name: Install Dependencies - run: | - rosdep update - rosdep install --from-paths src --ignore-src --rosdistro ${{ matrix.ros_distribution }} -y - - - name: Build Packages - run: | - . /opt/ros/${{ matrix.ros_distribution }}/setup.sh - colcon build --packages-up-to plankton --merge-install - - - name: Run Unit Tests - id: action_ros_ci_step - run: | - . /opt/ros/${{ matrix.ros_distribution }}/setup.sh - colcon test --merge-install --packages-up-to plankton --event-handlers console_cohesion+ - - - name: Unit Test Results - run: | - echo Results for Gazebo ${{ matrix.gazebo-version }} - . /opt/ros/${{ matrix.ros_distribution }}/setup.sh - colcon test-result --all --verbose - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-linux - path: log/ - if: always() diff --git a/.vscode/uuv.vscode.code-snippets b/.vscode/uuv.vscode.code-snippets deleted file mode 100644 index 12eb5b68..00000000 --- a/.vscode/uuv.vscode.code-snippets +++ /dev/null @@ -1,461 +0,0 @@ -{ - "py_class_md_docstring": { - "prefix": "uuv.py.doc.class", - "scope": "python", - "description": "Python Class Docstring (Markdown)", - "body": [ - "\"\"\"Class description", - "", - "> *Attributes*", - "", - "* `param` (*type:* `data_type`, *value:* `data`): Parameter description", - "", - "> *Input arguments*", - "", - "* `param` (*type:* `data_type`, *default:* `data`): Parameter description", - "", - "\"\"\"" - ] - }, - - "py_func_md_docstring": { - "prefix": "uuv.py.doc.func", - "scope": "python", - "description": "Python Function Docstring (Markdown)", - "body": [ - "\"\"\"Function description", - "", - "> *Input arguments*", - "", - "* `param` (*type:* `data_type`, *default:* `data`): Parameter description", - "", - "> *Returns*", - "", - "Description of return values", - "\"\"\"" - ] - }, - - "py_module_md_docstring": { - "prefix": "uuv.py.doc.module", - "scope": "python", - "description": "Python Module Docstring (Markdown)", - "body": [ - "\"\"\"Module description", - "\"\"\"" - ] - }, - - "py_param_md_docstring_snippet": { - "prefix": "uuv.py.doc.param", - "scope": "python", - "description": "Python Parameter Docstring Snippet (Markdown)", - "body": [ - "* `param` (*type:* `data_type`, *default:* `data`): Parameter description" - ] - }, - - "py_ros_publisher_md_docstring_snippet": { - "prefix": "uuv.py.doc.publisher", - "scope": "python", - "description": "Python ROS Publisher Docstring Snippet (Markdown)", - "body": [ - "* `topic_name` (*message:* `data_type`): Topic description" - ] - }, - - "py_property_md_docstring": { - "prefix": "uuv.py.doc.property", - "scope": "python", - "description": "Python Property Docstring (Markdown)", - "body": [ - "\"\"\"`data_type`: Property description\"\"\"" - ] - }, - - "py_script_md_docstring": { - "prefix": "uuv.py.doc.script", - "scope": "python", - "description": "Python Script Docstring (Markdown)", - "body": [ - "\"\"\"**Description**", - "", - "Script description, with some formulas", - "", - "$$", - "\t\\dot{v_c}(t) + \\mu_c v_c(t) = w_c", - "$$", - "", - "**Input ROS parameters**", - "", - "* `param` (*type:* `data_type`, *default:* `value`): Parameter description", - "", - "**Input parameters**", - "", - "* `param` (*type:* `data_type`, *default:* `value`): Parameter description", - "", - "**Usage**", - "", - "Examples of usage", - "", - "```bash", - "rosrun pkg_name node_name --param value", - "```", - "", - "**Launch file snippet**", - "", - "```xml", - "", - "\t", - "\t\tparam: value", - "\t", - "", - "```", - "**ROS services**", - "", - "> **`service_name`**", - "", - "*Service description file*", - "", - "[`service.file`](link_to_service_file)", - "", - "*Service call*", - "", - "```bash", - "rosservice call service_name", - "```", - "", - "Description of input parameters and return values", - "", - "\"\"\"" - ] - }, - - "py_uuv_ros_test": { - "scope": "python", - "prefix": "uuv.py.ros.test", - "description": "ROS Unit Test Script (Python)", - "body": [ - "#!/usr/bin/env python", - "# Copyright (c) 2016-$CURRENT_YEAR The UUV 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.", - "import roslib", - "import unittest", - "# Other imports", - "", - "PKG = 'package_name'", - "roslib.load_manifest(PKG)", - "", - "class TestModule(unittest.TestCase):", - "\tpass", - "", - "if __name__ == '__main__':", - "\timport rosunit", - "\trosunit.unitrun(PKG, 'test_module', TestModule)" - ] - }, - - "py_uuv_license_header": { - "scope": "python", - "prefix": "uuv.py.license", - "description": "UUV Simulator License Header (Python)", - "body": [ - "# Copyright (c) 2016-$CURRENT_YEAR The UUV 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." - ] - }, - - "xml_uuv_license_header": { - "scope": "xml", - "prefix": "uuv.xml.license", - "description": "UUV Simulator License Header (XML)", - "body": [ - "" - ] - }, - - "xml_uuv_xacro_file": { - "scope": "xml", - "prefix": "uuv.xml.xacro.file", - "description": "Xacro file (XML)", - "body": [ - "", - "", - "", - "" - ] - }, - - "xml_uuv_xacro_include": { - "scope": "xml", - "prefix": "uuv.xml.xacro.include", - "description": "Xacro include (XML)", - "body": [ - "" - ] - }, - - "xml_uuv_xacro_property": { - "scope": "xml", - "prefix": "uuv.xml.xacro.property", - "description": "Xacro property (XML)", - "body": [ - "" - ] - }, - - "xml_uuv_xacro_macro": { - "scope": "xml", - "prefix": "uuv.xml.xacro.macro", - "description": "Xacro macro (XML)", - "body": [ - "", - "", - "" - ] - }, - - "xml_uuv_xacro_insert_block": { - "scope": "xml", - "prefix": "uuv.xml.xacro.insert_block", - "description": "Xacro insert block (XML)", - "body": [ - "" - ] - }, - - "xml_uuv_xacro_hydrodynamic_model_link": { - "scope": "xml", - "prefix": "uuv.xml.xacro.hydro.link", - "description": "Base for the hydrodynamic model description for one link", - "body": [ - "", - "\t0", - "", - "\t0", - "", - "\t", - "\t\t0", - "\t\t0", - "\t\t0", - "\t", - "", - "0 0 0", - "", - "", - "", - "\t", - "", - "", - "" - ] - }, - - "xml_uuv_xacro_hydrodynamic_model_fossen": { - "scope": "xml", - "prefix": "uuv.xml.xacro.hydro.fossen", - "description": "Inputs for Fossen's hydrodynamic model (XML)", - "body": [ - "", - "\tfossen", - "", - "\t", - "\t\t0 0 0 0 0 0", - "\t\t0 0 0 0 0 0", - "\t\t0 0 0 0 0 0", - "\t\t0 0 0 0 0 0", - "\t\t0 0 0 0 0 0", - "\t\t0 0 0 0 0 0", - "\t", - "", - "\t", - "\t\t0 0 0 0 0 0", - "\t", - "", - "\t", - "\t\t0 0 0 0 0 0", - "\t", - "", - "\t", - "\t\t0 0 0 0 0 0", - "\t", - "" - ] - }, - - "xml_uuv_xacro_hydrodynamic_model_sphere": { - "scope": "xml", - "prefix": "uuv.xml.xacro.hydro.sphere", - "description": "Inputs for an approximated Fossen's hydrodynamic model for a sphere (XML)", - "body": [ - "", - "\tsphere", - "\t0", - "" - ] - }, - - "xml_uuv_xacro_underwater_object_plugin_sphere": { - "scope": "xml", - "prefix": "uuv.xml.xacro.hydro.sphere.underwater_object_plugin", - "description": "Snippet for the uuv_underwater_object plugin using Fossen's model for a sphere (XML)", - "body": [ - "", - "\t", - "\t\t1025.0", - "\t\thydrodynamics/current_velocity", - "\t\t0", - "", - "\t\t", - "\t\t\t0", - "", - "\t\t\t0", - "", - "\t\t\t", - "\t\t\t\t0", - "\t\t\t\t0", - "\t\t\t\t0", - "\t\t\t", - "", - "\t\t0 0 0", - "", - "\t\t", - "\t\t\tsphere", - "\t\t\t0", - "\t\t", - "", - "\t", - "" - ] - }, - - "xml_uuv_xacro_default_joint_state_publisher": { - "scope": "xml", - "prefix": "uuv.xml.xacro.joint_state_publisher", - "description": "Xacro snippet for the joint state publisher (XML)", - "body": [ - "", - "\t", - "\t\t", - "\t\t\t${namespace}", - "\t\t\t${update_rate}", - "\t\t", - "\t", - "" - ] - }, - - "xml_uuv_xacro_underwater_object_plugin_fossen": { - "scope": "xml", - "prefix": "uuv.xml.xacro.hydro.fossen.underwater_object_plugin", - "description": "Snippet for the uuv_underwater_object plugin using Fossen's model (XML)", - "body": [ - "", - "\t", - "\t\t1025.0", - "\t\thydrodynamics/current_velocity", - "\t\t0", - "", - "\t\t", - "\t\t\t0", - "", - "\t\t\t0", - "", - "\t\t\t", - "\t\t\t\t0", - "\t\t\t\t0", - "\t\t\t\t0", - "\t\t\t", - "", - "\t\t0 0 0", - "", - "\t\t", - "\t\t\tfossen", - "", - "\t\t\t", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t", - "", - "\t\t\t", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t", - "", - "\t\t\t", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t", - "", - "\t\t\t", - "\t\t\t\t0 0 0 0 0 0", - "\t\t\t", - "\t\t", - "", - "\t", - "" - ] - }, - - "cpp_uuv_license_header": { - "scope": "cpp", - "prefix": "uuv.cpp.license", - "description": "UUV Simulator License Header (C++)", - "body": [ - "// Copyright (c) 2016-$CURRENT_YEAR The UUV 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." - ] - } -} \ No newline at end of file diff --git a/README.md b/README.md index 20738101..afe9c259 100644 --- a/README.md +++ b/README.md @@ -53,14 +53,6 @@ sudo apt-get install gazebo11 sudo apt-get install libgazebo11-dev ``` -Or if this didn't work: - -``` -sudo apt install gazebo -sudo apt install libgazebo-dev -``` - - You can write `gazebo` in a terminal to make sure that gazebo runs correctly. Write `gazebo --version` to ensure that the version number is 11.X. >For more information about the installation of Gazebo, refer to the official installation documentation (beware that the default installation command will not install the version 11): @@ -68,8 +60,8 @@ You can write `gazebo` in a terminal to make sure that gazebo runs correctly. Wr ### 3. Install the ros packages for gazebo -Write in a terminal: -`sudo apt install ros-iron-gazebo-ros-pkgs` +Write in a terminal: +`sudo apt install ros-foxy-gazebo-ros-pkgs` >See for more detailed information about gazebo and ROS 2 connection. @@ -85,11 +77,11 @@ Make sure git is installed: `sudo apt install git` Now, clone the Plankton repository: -`git clone https://sdb.smtu.ru/gitlab/ros-in-underwater-robotics/plankton` +`git clone https://www.github.com/Liquid-ai/Plankton.git` At this point, you need to source 2 different files described below to configure ROS 2 and Gazebo environment variables: - For ROS 2 variables -`source /opt/ros/iron/setup.bash` +`source /opt/ros/foxy/setup.bash` - For Gazebo `source /usr/share/gazebo/setup.sh` @@ -103,7 +95,7 @@ rosdep update Browse to the root of your workspace and check for missing dependencies: ``` cd ~/ros2_ws/ -rosdep install -i --from-path src --rosdistro iron -y +rosdep install -i --from-path src --rosdistro foxy -y ``` Install Colcon, the build tool system: @@ -123,7 +115,7 @@ If everything went well, you should be able to run example cases. Note: Every time you open a new terminal, you need to source 3 different files described below to configure ROS 2 and Gazebo environment variables. Write the following each time you start a new terminal to deal with ROS 2 / Gazebo stuff, or prefer to add them at the end of your .bashrc file with `gedit ~/.bashrc`. For the latter, don’t forget to source your .bashrc to enforce the update after saving these changes, or open a fresh terminal. - For ROS 2 variables -`source /opt/ros/iron/setup.bash` +`source /opt/ros/foxy/setup.bash` - For your installation workspace (change the path accordingly) `source $HOME/ros2_ws/install/setup.bash` - For Gazebo diff --git a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt index bdeffeea..c06fcb68 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt +++ b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/CMakeLists.txt @@ -12,7 +12,6 @@ endif() find_package(ament_cmake REQUIRED) find_package(gazebo_dev REQUIRED) -find_package(gazebo_ros REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(sensor_msgs REQUIRED) @@ -26,7 +25,6 @@ find_package(visualization_msgs REQUIRED) set(BASE_LIBS ament_cmake gazebo_dev - gazebo_ros geometry_msgs rclcpp sensor_msgs diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/camera_snippets.xacro b/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/camera_snippets.xacro index 54058e98..a02b9967 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/camera_snippets.xacro +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/camera_snippets.xacro @@ -139,7 +139,7 @@ - ${namespace}/camera${suffix} + camera${suffix} camera${suffix}_link_optical @@ -153,6 +153,7 @@ 0 + ${namespace} image_raw:=${topic}_image @@ -243,6 +244,10 @@ + + ${namespace} + + ${update_rate} ${namespace}/camera${suffix} ${namespace}/camera${suffix}_link diff --git a/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/dvl_snippets.xacro b/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/dvl_snippets.xacro index 8a4c8e74..b880b712 100644 --- a/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/dvl_snippets.xacro +++ b/uuv_sensor_plugins/uuv_sensor_ros_plugins/urdf/dvl_snippets.xacro @@ -133,6 +133,7 @@ + ${namespace} ~/out:=${topic}_sonar${index} diff --git a/uuv_teleop/launch/uuv_teleop.launch b/uuv_teleop/launch/uuv_teleop.launch index 48288b0e..19528676 100644 --- a/uuv_teleop/launch/uuv_teleop.launch +++ b/uuv_teleop/launch/uuv_teleop.launch @@ -4,20 +4,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt index 4a17f98f..c88803c7 100644 --- a/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt +++ b/uuv_world_plugins/uuv_world_ros_plugins/CMakeLists.txt @@ -14,7 +14,6 @@ find_package(uuv_world_plugins REQUIRED) find_package(uuv_world_ros_plugins_msgs REQUIRED) find_package(gazebo_msgs REQUIRED) find_package(gazebo_dev REQUIRED) -find_package(gazebo_ros REQUIRED) find_package(ament_cmake REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rclcpp REQUIRED) @@ -24,7 +23,6 @@ set(LIBS uuv_world_ros_plugins_msgs gazebo_msgs gazebo_dev - gazebo_ros ament_cmake geometry_msgs rclcpp -- GitLab From 9cf72f478a378afe4d2c9b7a7fecfeed6faab027 Mon Sep 17 00:00:00 2001 From: Rjkzavr Date: Tue, 22 Jul 2025 21:28:49 +0300 Subject: [PATCH 4/4] add set rpm --- .../uuv_gazebo_ros_plugins/ThrusterROSPlugin.h | 3 +++ .../src/ThrusterROSPlugin.cpp | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/include/uuv_gazebo_ros_plugins/ThrusterROSPlugin.h b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/include/uuv_gazebo_ros_plugins/ThrusterROSPlugin.h index 8aa1ba41..f97c9b1c 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/include/uuv_gazebo_ros_plugins/ThrusterROSPlugin.h +++ b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/include/uuv_gazebo_ros_plugins/ThrusterROSPlugin.h @@ -63,6 +63,8 @@ namespace uuv_simulator_ros /// \brief Set new set point (desired thrust [N]) for thruster. public: void SetThrustReference( const uuv_gazebo_ros_plugins_msgs::msg::FloatStamped::SharedPtr _msg); + public: void SetThrustReferenceFloat64( + const std_msgs::msg::Float64::SharedPtr _msg); /// \brief Return the ROS publish period. public: gazebo::common::Time GetRosPublishPeriod(); @@ -127,6 +129,7 @@ namespace uuv_simulator_ros /// \brief Subscriber reacting to new reference thrust set points. private: rclcpp::Subscription::SharedPtr mySubThrustReference; + private: rclcpp::Subscription::SharedPtr mySubThrustReferenceFloat64; /// \brief Publisher for current actual thrust. private: rclcpp::Publisher::SharedPtr myPubThrust; diff --git a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/src/ThrusterROSPlugin.cpp b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/src/ThrusterROSPlugin.cpp index 271b0559..6141d31f 100644 --- a/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/src/ThrusterROSPlugin.cpp +++ b/uuv_gazebo_plugins/uuv_gazebo_ros_plugins/src/ThrusterROSPlugin.cpp @@ -66,6 +66,18 @@ void ThrusterROSPlugin::SetThrustReference( this->inputCommand = _msg->data; } +void ThrusterROSPlugin::SetThrustReferenceFloat64( + const std_msgs::msg::Float64::SharedPtr _msg) +{ + if (std::isnan(_msg->data)) + { + RCLCPP_WARN(myRosNode->get_logger(), "ThrusterROSPlugin: Ignoring nan command"); + return; + } + + this->inputCommand = _msg->data; +} + //============================================================================= /////////////////////////////////////////////////////////////////////////////// gazebo::common::Time ThrusterROSPlugin::GetRosPublishPeriod() @@ -183,7 +195,11 @@ void ThrusterROSPlugin::Load(gazebo::physics::ModelPtr _parent, uuv_gazebo_ros_plugins_msgs::msg::FloatStamped >(this->commandSubscriber->GetTopic(), 10, std::bind(&ThrusterROSPlugin::SetThrustReference, this, _1)); - + + mySubThrustReferenceFloat64 = myRosNode->create_subscription< + std_msgs::msg::Float64 + >(this->commandSubscriber->GetTopic() + "/rpm", 10, + std::bind(&ThrusterROSPlugin::SetThrustReferenceFloat64, this, _1)); myPubThrust = myRosNode->create_publisher< uuv_gazebo_ros_plugins_msgs::msg::FloatStamped -- GitLab