Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add position control mode #98

Merged
merged 11 commits into from
Mar 1, 2024
Merged

Conversation

xela-95
Copy link
Member

@xela-95 xela-95 commented Feb 27, 2024

This PR adds to the control board plugin the implementation of IPositionControl

This control mode uses a trajectory generator to interpolate between subsequent position references, with multiple possible options (at the moment they are trapezoidal velocity profile, minimum jerk trajectory, constant velocity).

Closes #83

@xela-95 xela-95 linked an issue Feb 27, 2024 that may be closed by this pull request
2 tasks
@xela-95 xela-95 self-assigned this Feb 27, 2024
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 32.74596% with 458 lines in your changes are missing coverage. Please review.

Project coverage is 54.65%. Comparing base (13aa198) to head (bb2e705).

Files Patch % Lines
...lugins/controlboard/src/ControlBoardTrajectory.cpp 29.66% 211 Missing ⚠️
plugins/controlboard/src/ControlBoardDriver.cpp 5.10% 186 Missing ⚠️
plugins/controlboard/src/ControlBoard.cpp 60.00% 54 Missing ⚠️
...ins/controlboard/include/ControlBoardTrajectory.hh 36.36% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   62.00%   54.65%   -7.36%     
==========================================
  Files          23       26       +3     
  Lines        2011     2684     +673     
==========================================
+ Hits         1247     1467     +220     
- Misses        764     1217     +453     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This class is mainly copied from the `ControlBoardDriverTrajectory` class from gazebo-yarp-plugins, adapted to work with the new gazebo APIs
- Remove dependency from not used model pointer
- Add traj. generator factory class
- JointProperties updated to contain fields related to trajectory generation
-  Add a field to store control update period in ControlBoardData (now with a constant value, soon it will be read from configuration)
Also update the `initTrajectory` method to accept the control update period
Note: the correct behavior is to decouple the controller update rate from the simulation one; this will be addressed in a future issue
The deadlock was caused to the call to `getLimits` that tried to acquire the lock already acquired by the calling method.
@xela-95 xela-95 force-pushed the feature/pos-control-with-interpolation branch from 5528c12 to 2b72cd7 Compare March 1, 2024 11:36
@xela-95 xela-95 marked this pull request as ready for review March 1, 2024 11:36
@xela-95 xela-95 requested a review from traversaro March 1, 2024 11:36
Copy link
Member

@traversaro traversaro left a comment

Choose a reason for hiding this comment

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

Minor comments, I think this is ready to go!

fyi @randaz81

@xela-95 xela-95 force-pushed the feature/pos-control-with-interpolation branch from a4e49b1 to bb2e705 Compare March 1, 2024 12:09
@xela-95
Copy link
Member Author

xela-95 commented Mar 1, 2024

I have squashed minor commits maintaining only the main ones. Merging.

@xela-95 xela-95 merged commit 98f78ae into main Mar 1, 2024
5 of 7 checks passed
@xela-95 xela-95 deleted the feature/pos-control-with-interpolation branch March 1, 2024 13:15
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.

Add position control (with interpolation) to control board plugin
2 participants