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

Example controller for LRAUV #1822

Merged
merged 14 commits into from
Dec 14, 2022
Merged

Conversation

adityapande-1995
Copy link
Contributor

@adityapande-1995 adityapande-1995 commented Nov 29, 2022

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

🎉 New feature

Summary

This PR adds a simple PID based controller for LRAUVs, specifically a PI controller for speed, and P for yaw and pitch angles.
The target state is the linear speed, yaw and pitch angle of the vehicle.

Test it

The required world file is gz-sim/examples/worlds/lrauv_control_demo.sdf. Run that file in a terminal :

gz sim -r lrauv_control_demo.sdf

and in a separate terminal, source the Gazebo Garden workspace and run :

cd ~/garden_ws/src/gz-sim/examples/standalone/lrauv_control/
mkdir build ; cd build
cmake ..; make
./lrauv_control 0.5 0.78 0.174

This would make the vehicle maintain a speed of 0.5 m/s, yaw angle of 0.78 rad (~ 45 deg) and pitch angle of 0.147 rad (~10 deg).

TODO

  • Make the LRAUV leave a trail of markers when moving.
  • Interpolate between states for large angles.
  • Update README
  • Remove sections from codecov and testing

Screenshot

image
image

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@osrf-triage osrf-triage added this to Inbox in Core development Nov 29, 2022
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Nov 29, 2022
@adityapande-1995 adityapande-1995 assigned arjo129 and unassigned arjo129 Nov 29, 2022
@adityapande-1995 adityapande-1995 marked this pull request as ready for review November 29, 2022 23:24
@adityapande-1995 adityapande-1995 mentioned this pull request Nov 29, 2022
38 tasks
@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #1822 (607e0f0) into gz-sim7 (64c01fd) will decrease coverage by 0.07%.
The diff coverage is n/a.

❗ Current head 607e0f0 differs from pull request most recent head 689139a. Consider uploading reports for the commit 689139a to get more accurate results

@@             Coverage Diff             @@
##           gz-sim7    #1822      +/-   ##
===========================================
- Coverage    64.52%   64.44%   -0.08%     
===========================================
  Files          341      341              
  Lines        27185    28826    +1641     
===========================================
+ Hits         17540    18577    +1037     
- Misses        9645    10249     +604     
Impacted Files Coverage Δ
src/gui/AboutDialogHandler.cc 66.66% <0.00%> (-3.34%) ⬇️
src/systems/altimeter/Altimeter.cc 73.52% <0.00%> (-1.48%) ⬇️
.../plugins/component_inspector/ComponentInspector.cc 5.46% <0.00%> (-0.01%) ⬇️
include/gz/sim/Util.hh 100.00% <0.00%> (ø)
src/components/Environment.cc 100.00% <0.00%> (ø)
src/systems/buoyancy/Buoyancy.hh 100.00% <0.00%> (ø)
include/gz/sim/components/Environment.hh 100.00% <0.00%> (ø)
src/rendering/RenderUtil.cc 39.73% <0.00%> (+0.19%) ⬆️
src/rendering/SceneManager.cc 31.37% <0.00%> (+0.41%) ⬆️
src/SimulationRunner.cc 92.27% <0.00%> (+0.94%) ⬆️
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

The README is empty. Did you forget to commit it?

Core development automation moved this from Inbox to In review Nov 30, 2022
@adityapande-1995
Copy link
Contributor Author

adityapande-1995 commented Nov 30, 2022

The README is empty. Did you forget to commit it?

Sorry about that, still working on the controller. I meant to keep this as a draft.

@adityapande-1995 adityapande-1995 marked this pull request as draft November 30, 2022 02:12
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
@adityapande-1995 adityapande-1995 marked this pull request as ready for review December 6, 2022 22:40
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

@adityapande-1995 this looks great. Left a few comments. Will test next.

examples/standalone/lrauv_control/README.md Outdated Show resolved Hide resolved
examples/standalone/lrauv_control/lrauv_control.cc Outdated Show resolved Hide resolved
examples/standalone/lrauv_control/lrauv_control.cc Outdated Show resolved Hide resolved
examples/standalone/lrauv_control/lrauv_control.cc Outdated Show resolved Hide resolved
examples/standalone/lrauv_control/lrauv_control.cc Outdated Show resolved Hide resolved
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
@hidmic
Copy link
Contributor

hidmic commented Dec 9, 2022

@adityapande-1995 we should check failing CI jobs.

@adityapande-1995
Copy link
Contributor Author

@osrf-jenkins retest this please

@adityapande-1995
Copy link
Contributor Author

The only test failing here is UNIT_SdfGenerator_TEST which I don't think is related to the changes made here. What do you think @hidmic @caguero ?

@hidmic
Copy link
Contributor

hidmic commented Dec 14, 2022

@adityapande-1995 not sure what the policy is, but I see the same as you: it's UNIT_SdfGenerator_TEST failing everywhere.

We should be good to merge this patch.

@adityapande-1995 adityapande-1995 enabled auto-merge (squash) December 14, 2022 19:32
@adityapande-1995 adityapande-1995 merged commit 53835d8 into gz-sim7 Dec 14, 2022
Core development automation moved this from In review to Done Dec 14, 2022
@adityapande-1995 adityapande-1995 deleted the aditya/lrauv_controller branch December 14, 2022 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants