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

Multi-LRAUV Swimming Race Example #841

Merged
merged 4 commits into from
Jun 12, 2021
Merged

Conversation

mabelzhang
Copy link
Contributor

@mabelzhang mabelzhang commented May 29, 2021

Signed-off-by: Mabel Zhang [email protected]

🎉 New feature

Summary

An example world and controller for a multi-LRAUV swimming race in an underwater environment. Demonstrates how to control the basic set of plugins using a random controller.

Race results vary in every run. Don't take it personally if your favorite LRAUV doesn't win. (Disclosure: they are all the same! Except for their names -- uh oh, shouldn't have said that.)

Remarks

@arjo129, two things I noticed:

  1. ThrusterPlugin takes a negative value for going forward. Is that the convention?
    I noticed in the LRAUV model.sdf that the propeller_joint is set to negative effort and velocity:

           <effort>-1</effort>
           <velocity>-1</velocity>
    

    Is the actual robot propeller just designed to go forward when rotated in that direction?

  2. The robots are going a lot faster here than in our downstream version. All the parameters are the same, and the command values are in the same bounds (other than the thrust being (-31.4 rad/s, 0) as opposed to (0, +31.4 rad/s). Is something different here (did hydrodynamics get faster)?

Test it

Terminal 1:

cd examples/worlds/
ign gazebo -r multi_lrauv_race.sdf

Terminal 2:

cd examples/standalone/multi_lrauv_race
mkdir build && cd build
cmake ..
make
./multi_lrauv_race

You should see something like this:

2021-05-28-19-15_multiLRAUVSwimRace_upstreamIgnFortress.mp4

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • 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

@mabelzhang mabelzhang added enhancement New feature or request 🏯 fortress Ignition Fortress labels May 29, 2021
@mabelzhang mabelzhang requested review from arjo129 and caguero May 29, 2021 00:15
@mabelzhang mabelzhang self-assigned this May 29, 2021
@mabelzhang mabelzhang requested a review from chapulina as a code owner May 29, 2021 00:15
Signed-off-by: Mabel Zhang <[email protected]>
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.

It works for me. If you're curious: Daphne won 🏆

I've left a comment as to why we seem to be moving so quickly in the review. It has to do with units. Once that is adressed, the environment looks good to me.

As for the thrust taking a negative plugin, this is not due to any convention. To be fair, there are both clockwise and counterclockwise thrusters out there in the wild. As for the effort and velocity being negative, I'm not too sure why they are negative and if this has any impact on the thruster direction at all as the thruster plugin does not read those values.

examples/standalone/multi_lrauv_race/multi_lrauv_race.cc Outdated Show resolved Hide resolved
@mabelzhang
Copy link
Contributor Author

mabelzhang commented Jun 7, 2021

As for the effort and velocity being negative, I'm not too sure why they are negative and if this has any impact on the thruster direction at all as the thruster plugin does not read those values.

I should have checked the specs. -1 is actually the default value, to indicate no max is to be enforced. The tags are for max effort and limit. http://sdformat.org/spec?ver=1.8&elem=joint#limit_effort
So no questions there anymore.

As for the thrust taking a negative plugin, this is not due to any convention. To be fair, there are both clockwise and counterclockwise thrusters out there in the wild.

I wonder if it could be because the current Tethys model has x pointing to the stern, as I just learned last week. Maybe after we flip it to have x pointing to the bow in some weeks, it'll go forward with positive thrust.

I'm mainly coming from the rationale that if the user does the most vanilla thing with their joint axes and follow the convention (x forward), then when they try out the Thruster plugin, it should do the most intuitive thing, which to me is positive going forward. In this case, I think the model we're using is not following conventions, so that's a problem with the model, not the plugin. Let's see in a few weeks if this is confirmed!

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.

This works as described for me. This time both Daphne and Triton were tied 🏆 .

@mabelzhang
Copy link
Contributor Author

mabelzhang commented Jun 10, 2021

Cool! Thanks! Daphne wins more for you too huh, she won the most for me in the beginning but later spread out better, I think. I'm gonna rerun CI because this looks too red to merge even for an example that shouldn't affect the tests...

@mabelzhang
Copy link
Contributor Author

@osrf-jenkins run tests

@mabelzhang
Copy link
Contributor Author

Double-checked that the failed Ubuntu tests are flaky. Actually all OSes' CI have flaky tests and none are required apparently 😅
Merging.

Signed-off-by: Mabel Zhang <[email protected]>
@mabelzhang mabelzhang merged commit a774989 into main Jun 12, 2021
@mabelzhang mabelzhang deleted the mabelzhang/multi_lrauv_race branch June 12, 2021 02:52
WilliamLewww pushed a commit to WilliamLewww/ign-gazebo that referenced this pull request Dec 7, 2021
* Multi-LRAUV swimming race example world and controller

Signed-off-by: Mabel Zhang <[email protected]>

* specifiy units

Signed-off-by: Mabel Zhang <[email protected]>

* change thruster unit to Newtons

Signed-off-by: Mabel Zhang <[email protected]>

* add README

Signed-off-by: Mabel Zhang <[email protected]>
Signed-off-by: William Lew <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants