Skip to content

Commit 9d870d1

Browse files
authored
Update Ros2ControlSystem.cpp: correct joint.acceleration (#1023)
* Update Ros2ControlSystem.cpp: correct acceleration * Update webots_ros2_control/CHANGELOG.rst
1 parent be9c9ce commit 9d870d1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

webots_ros2_control/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Changelog for package webots_ros2_control
55
2023.1.3 (2024-08-07)
66
------------------
77
* Added support for the new `ros2_control` API affecting resource_manager and controller_manager.
8+
* Corrected the sign of the joint accelerations.
89

910
2023.1.0 (2023-06-29)
1011
------------------

webots_ros2_control/src/Ros2ControlSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ namespace webots_ros2_control {
153153
const double velocity = std::isnan(joint.position) ? NAN : (position - joint.position) / deltaTime;
154154

155155
if (!std::isnan(joint.velocity))
156-
joint.acceleration = (joint.velocity - velocity) / deltaTime;
156+
joint.acceleration = (velocity - joint.velocity) / deltaTime;
157157
joint.velocity = velocity;
158158
joint.position = position;
159159
}

0 commit comments

Comments
 (0)