Skip to content

Conversation

@christophfroehlich
Copy link
Contributor

This PR addresses an optional configuration if the position error used as input for the PID controller should be normalized between -pi/pi or not (the latter is the default).
This normalization is useful if endless rotary joints are controlled, where always the shortest relative distance is of interest. But if linear joints or limited rotary joints are used, it might be very dangerous.

I'm open for suggestions to a better naming of the parameter, and if it should be situated below the gain-structure or in a separate one.

EXPECT_NEAR(points[0][1], state_msg->desired.positions[1], allowed_delta);
EXPECT_NEAR(points[0][2], state_msg->desired.positions[2], 3 * allowed_delta);

// no normalization of position error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this here be normalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments were misleading, maybe it's clearer now

@mergify
Copy link
Contributor

mergify bot commented Jan 10, 2023

This pull request is in conflict. Could you fix it @christophfroehlich?

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@codecov-commenter
Copy link

Codecov Report

Merging #491 (694b018) into master (e7f9962) will decrease coverage by 3.31%.
The diff coverage is 26.60%.

@@            Coverage Diff             @@
##           master     #491      +/-   ##
==========================================
- Coverage   35.78%   32.48%   -3.31%     
==========================================
  Files         189        7     -182     
  Lines       17570      665   -16905     
  Branches    11592      357   -11235     
==========================================
- Hits         6287      216    -6071     
+ Misses        994      157     -837     
+ Partials    10289      292    -9997     
Flag Coverage Δ
unittests 32.48% <26.60%> (-3.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ontroller/test/test_load_diff_drive_controller.cpp 12.50% <0.00%> (ø)
diff_drive_controller/src/odometry.cpp 42.16% <11.11%> (ø)
diff_drive_controller/src/speed_limiter.cpp 46.55% <11.11%> (ø)
...ive_controller/test/test_diff_drive_controller.cpp 17.62% <12.08%> (ø)
...troller/include/diff_drive_controller/odometry.hpp 20.00% <20.00%> (ø)
...iff_drive_controller/src/diff_drive_controller.cpp 39.22% <35.50%> (ø)
...de/diff_drive_controller/diff_drive_controller.hpp 100.00% <100.00%> (ø)
...ectory_controller/test/test_trajectory_actions.cpp
..._state_broadcaster/src/joint_state_broadcaster.cpp
...test/test_load_joint_group_velocity_controller.cpp
... and 191 more

@bmagyar bmagyar disabled auto-merge January 20, 2023 09:55
@bmagyar bmagyar merged commit 67e5d4d into ros-controls:master Jan 20, 2023
@christophfroehlich christophfroehlich deleted the jtc_configurable_joint_normalization branch March 28, 2023 10:08
@christophfroehlich
Copy link
Contributor Author

@Mergifyio backport humble

@mergify
Copy link
Contributor

mergify bot commented Apr 23, 2023

backport humble

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission>=write

@bmagyar
Copy link
Member

bmagyar commented Apr 23, 2023

@Mergifyio backport humble

@mergify
Copy link
Contributor

mergify bot commented Apr 23, 2023

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 23, 2023
* Use the same variables for state feedback and PID loop

* Make joint_error normalization configurable

* Activate test for only velocity controller

* Allow ff_velocity_scale=0 without deprecated warning

* Add test for setpoint due to normalized position error

* Update comments in test

Co-authored-by: Bence Magyar <[email protected]>
(cherry picked from commit 67e5d4d)
bmagyar pushed a commit that referenced this pull request Apr 23, 2023
…579)

* Use the same variables for state feedback and PID loop

* Make joint_error normalization configurable

* Activate test for only velocity controller

* Allow ff_velocity_scale=0 without deprecated warning

* Add test for setpoint due to normalized position error

* Update comments in test

Co-authored-by: Bence Magyar <[email protected]>
(cherry picked from commit 67e5d4d)

Co-authored-by: Christoph Fröhlich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants