Skip to content

Conversation

@ppakr
Copy link

@ppakr ppakr commented Nov 12, 2025

Goal: correctly implement and validate the existing quaternion-based DP controller

Completed work

  • The core control mathematics have been reimplemented and validated. The implementation sucessfully passes all unit tests.

Known issue

  • Axis/Gain Mapping Swap: The control efforts/gains appear to be swapped for the planar axes (X and Y), and potentially for the rotational axes (Roll and Pitch). This needs investigation into the input vector mapping.
  • RQT Gain Bug: When updating a single gain via the rqt_reconfigure tool, the system receives the correct value, but all other gains are immediately reset to 0 in the controller's internal state

TODO

  1. Resolve the XY axis mapping issue
  2. Fix the RQT gain update to allow persistent configuration
  3. Clean code
  4. Documentation

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 40.90909% with 286 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.91%. Comparing base (1adb624) to head (1ed1d42).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ntrol/pid_controller_dp/src/pid_controller_ros.cpp 0.00% 147 Missing ⚠️
...ol/pid_controller_dp/test/pid_controller_tests.cpp 58.75% 0 Missing and 113 partials ⚠️
control/pid_controller_dp/src/pid_controller.cpp 59.01% 25 Missing ⚠️
...trol/pid_controller_dp/src/pid_controller_node.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #643      +/-   ##
==========================================
+ Coverage   18.77%   26.91%   +8.14%     
==========================================
  Files          38       38              
  Lines        2376     2478     +102     
  Branches      426      680     +254     
==========================================
+ Hits          446      667     +221     
+ Misses       1815     1626     -189     
- Partials      115      185      +70     
Flag Coverage Δ
unittests 26.91% <40.90%> (+8.14%) ⬆️

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

Files with missing lines Coverage Δ
...rol/pid_controller_dp/src/pid_controller_utils.cpp 100.00% <100.00%> (+100.00%) ⬆️
...trol/pid_controller_dp/src/pid_controller_node.cpp 0.00% <0.00%> (ø)
control/pid_controller_dp/src/pid_controller.cpp 65.82% <59.01%> (+65.82%) ⬆️
...ol/pid_controller_dp/test/pid_controller_tests.cpp 58.75% <58.75%> (ø)
...ntrol/pid_controller_dp/src/pid_controller_ros.cpp 0.00% <0.00%> (ø)

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@Andeshog Andeshog left a comment

Choose a reason for hiding this comment

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

Since this is still a draft I wont comment on the debugs and prints and so on. But I do encourage utilizing Eta and Nu from vortex-utils, along with the relevant functions 👍 Also, when time comes it would be cool to see a version of the integration test utilizing this controller for a continuous proof of the quality 💯

Copy link
Contributor

Choose a reason for hiding this comment

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

Everything in this file exist in vortex-utils, and most is embedded in the Eta struct as well 😄

Comment on lines +59 to +63
// TODO: parameter callback for dynamic reconfigure of PID gains
//@brief Callback function for parameter updates
// @param parameters: vector of parameters to be set
rcl_interfaces::msg::SetParametersResult parametersCallback(
const std::vector<rclcpp::Parameter>& parameters);
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a yaml-based approach like Anbit did. Mixing this approach with a service call (Trigger) allows for the same dynamic reconfiguration, but without relying so much on ROS.

Comment on lines -3 to +23
Kp: [70.0, 70.0, 70.0, 12.0, 12.0, 12.0]
Ki: [2.0, 2.0, 2.0, 0.12, 0.12, 0.12]
Kd: [10.0, 10.0, 10.0, 4.0, 5.0, 4.0]
# Kp: [70.0, 70.0, 70.0, 12.0, 12.0, 12.0]
# Ki: [2.0, 2.0, 2.0, 0.12, 0.12, 0.12]
# Kd: [10.0, 10.0, 10.0, 4.0, 5.0, 4.0]
Kp_x: 10.0
Kp_y: 0.0
Kp_z: 0.0
Kp_roll: 0.0
Kp_pitch: 0.0
Kp_yaw: 0.0
Ki_x: 0.0
Ki_y: 0.0
Ki_z: 0.0
Ki_roll: 0.0
Ki_pitch: 0.0
Ki_yaw: 0.0
Kd_x: 0.0
Kd_y: 0.0
Kd_z: 0.0
Kd_roll: 0.0
Kd_pitch: 0.0
Kd_yaw: 0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it not more tidy to have the parameters in vectors here?

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.

3 participants