From fdcd7aa8c67ea57f44bbf2f8fba90a28d7f04b5d Mon Sep 17 00:00:00 2001 From: Mateus Menezes Date: Mon, 8 Apr 2024 05:22:06 -0300 Subject: [PATCH 1/2] Fix incorrect force-torque sensor vec population (#296) --- gazebo_ros2_control/src/gazebo_system.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gazebo_ros2_control/src/gazebo_system.cpp b/gazebo_ros2_control/src/gazebo_system.cpp index c688541c..8647b711 100644 --- a/gazebo_ros2_control/src/gazebo_system.cpp +++ b/gazebo_ros2_control/src/gazebo_system.cpp @@ -589,13 +589,13 @@ hardware_interface::return_type GazeboSystem::read( for (unsigned int j = 0; j < this->dataPtr->sim_ft_sensors_.size(); j++) { auto sim_ft_sensor = this->dataPtr->sim_ft_sensors_[j]; - this->dataPtr->imu_sensor_data_[j][0] = sim_ft_sensor->Force().X(); - this->dataPtr->imu_sensor_data_[j][1] = sim_ft_sensor->Force().Y(); - this->dataPtr->imu_sensor_data_[j][2] = sim_ft_sensor->Force().Z(); + this->dataPtr->ft_sensor_data_[j][0] = sim_ft_sensor->Force().X(); + this->dataPtr->ft_sensor_data_[j][1] = sim_ft_sensor->Force().Y(); + this->dataPtr->ft_sensor_data_[j][2] = sim_ft_sensor->Force().Z(); - this->dataPtr->imu_sensor_data_[j][3] = sim_ft_sensor->Torque().X(); - this->dataPtr->imu_sensor_data_[j][4] = sim_ft_sensor->Torque().Y(); - this->dataPtr->imu_sensor_data_[j][5] = sim_ft_sensor->Torque().Z(); + this->dataPtr->ft_sensor_data_[j][3] = sim_ft_sensor->Torque().X(); + this->dataPtr->ft_sensor_data_[j][4] = sim_ft_sensor->Torque().Y(); + this->dataPtr->ft_sensor_data_[j][5] = sim_ft_sensor->Torque().Z(); } return hardware_interface::return_type::OK; } From 105c0ba5b786a43e1e9266399ab027a12011c643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Mon, 8 Apr 2024 10:25:49 +0200 Subject: [PATCH 2/2] Update precommit config (#298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Hernández Cordero --- .github/workflows/update-pre-commit.yml | 12 ++++++++++++ .pre-commit-config.yaml | 22 ++++++++++++++++------ gazebo_ros2_control/src/gazebo_system.cpp | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/update-pre-commit.yml diff --git a/.github/workflows/update-pre-commit.yml b/.github/workflows/update-pre-commit.yml new file mode 100644 index 00000000..6bedaa0c --- /dev/null +++ b/.github/workflows/update-pre-commit.yml @@ -0,0 +1,12 @@ +name: Auto Update pre-commit +# Update pre-commit config and create PR if changes are detected +# author: Christoph Fröhlich + +on: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' # Runs at 00:00, on day 1 of the month + +jobs: + auto_update_and_create_pr: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-update-pre-commit.yml@master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f03ed362..6b59c0e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-ast @@ -35,7 +35,7 @@ repos: # Python hooks - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py36-plus] @@ -51,7 +51,7 @@ repos: args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"] - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 7.0.0 hooks: - id: flake8 args: ["--extend-ignore=E501"] @@ -112,14 +112,14 @@ repos: # Docs - RestructuredText hooks - repo: https://github.com/PyCQA/doc8 - rev: 0.10.1 + rev: v1.1.1 hooks: - id: doc8 args: ['--max-line-length=100', '--ignore=D001'] exclude: CHANGELOG\.rst$ - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-backticks exclude: CHANGELOG\.rst$ @@ -129,8 +129,18 @@ repos: # Spellcheck in comments and docs # skipping of *.svg files is not working... - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.6 hooks: - id: codespell args: ['--write-changes'] exclude: CHANGELOG\.rst|\.(svg|pyc)$ + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.1 + hooks: + - id: check-github-workflows + args: ["--verbose"] + - id: check-github-actions + args: ["--verbose"] + - id: check-dependabot + args: ["--verbose"] diff --git a/gazebo_ros2_control/src/gazebo_system.cpp b/gazebo_ros2_control/src/gazebo_system.cpp index 8647b711..243bd3a8 100644 --- a/gazebo_ros2_control/src/gazebo_system.cpp +++ b/gazebo_ros2_control/src/gazebo_system.cpp @@ -226,7 +226,7 @@ void GazeboSystem::registerJoints( RCLCPP_INFO_STREAM( this->nh_->get_logger(), "Joint '" << joint_name << "'is mimicking joint '" << mimicked_joint << - "' with mutiplier: " << mimic_joint.multiplier); + "' with multiplier: " << mimic_joint.multiplier); this->dataPtr->mimic_joints_.push_back(mimic_joint); suffix = "_mimic"; }