-
Notifications
You must be signed in to change notification settings - Fork 269
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 DopplerVelocityLogSystem plugin #1804
Conversation
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
First iteration. Once we've agreed on gazebosim/gz-sensors#290 and connected PRs, I'll add integration tests here. |
Check whitespaces. |
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@iche033 @caguero I'm getting:
in tests. Isn't the rendering engine cleaned up on test fixture destruction? |
@osrf-jenkins run tests please |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Made a few changes in bdfe547 which should fix compilation. There are a couple other issues left:
|
Codecov Report
@@ Coverage Diff @@
## main #1804 +/- ##
==========================================
+ Coverage 64.26% 64.47% +0.20%
==========================================
Files 340 341 +1
Lines 26962 27139 +177
==========================================
+ Hits 17328 17498 +170
- Misses 9634 9641 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
As of 0cb2e4d:
/home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:85: Failure
The difference between linearVelocityEstimate.X() and -waterCurrentVelocity.X() is 2.0003976831499872, which exceeds kVelocityTolerance, where
linearVelocityEstimate.X() evaluates to -1.0003976831499872,
-waterCurrentVelocity.X() evaluates to 1, and
kVelocityTolerance evaluates to 0.10000000000000001.
/home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:87: Failure
The difference between linearVelocityEstimate.Y() and -waterCurrentVelocity.Y() is 0.99920384168009524, which exceeds kVelocityTolerance, where
linearVelocityEstimate.Y() evaluates to 0.49920384168009518,
-waterCurrentVelocity.Y() evaluates to -0.5, and
kVelocityTolerance evaluates to 0.10000000000000001.
/home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:133: Failure
The difference between expectedLinearVelocityEstimate.X() and linearVelocityEstimate.X() is 0.50119416839480213, which exceeds kVelocityTolerance, where
expectedLinearVelocityEstimate.X() evaluates to -0.49920351475518465,
linearVelocityEstimate.X() evaluates to -1.0003976831499868, and
kVelocityTolerance evaluates to 0.10000000000000001.
/home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:135: Failure
The difference between expectedLinearVelocityEstimate.Y() and linearVelocityEstimate.Y() is 1.4996016879686576, which exceeds kVelocityTolerance, where
expectedLinearVelocityEstimate.Y() evaluates to -1.0003978462872014,
linearVelocityEstimate.Y() evaluates to 0.49920384168145615, and
kVelocityTolerance evaluates to 0.10000000000000001. |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
removed dependency on gz-sensors in core edf0959. One todo suggestion is to create the generic EnvironmentalData structure in sdformat and make gz-sensors and gz-sim use that data structure. |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Made more fixes in fbd8783 and 2070591
The tests are passing now with the caveat mentioned in the last bullet point. |
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
ok I'm at the point that I think I could use a hand from people who are familiar with the DVL sensor implementation. If I enable setting angular velocity on the AUV in the water mass tracking test by uncommenting this line, the test fails: /home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:182: Failure
The difference between expectedLinearVelocityEstimate.X() and linearVelocityEstimate.X() is 0.31949900784986629, which exceeds kVelocityTolerance, where
expectedLinearVelocityEstimate.X() evaluates to -1.7163285450741428,
linearVelocityEstimate.X() evaluates to -1.3968295372242765, and
kVelocityTolerance evaluates to 0.10000000000000001.
/home/ian/code/gz_h_ws/src/gz-sim/test/integration/dvl_system_water_mass_tracking.cc:184: Failure
The difference between expectedLinearVelocityEstimate.Y() and linearVelocityEstimate.Y() is 1.023310004056881, which exceeds kVelocityTolerance, where
expectedLinearVelocityEstimate.Y() evaluates to -0.78063882907783577,
linearVelocityEstimate.Y() evaluates to -1.8039488331347169, and
kVelocityTolerance evaluates to 0.10000000000000001. Maybe @arjo129 or @hidmic can shed some light on where or what the problem could be? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iche033 thank you for picking this up
velocity->Data() = this->angularVelocityRequest.value(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iche033 why are requests not reset once applied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if reset, the velocities are only applied in that one iteration and moves the AUV only a little bit. I noticed that in the test comment, it is intended to make the AUV go in a circle so I removed the reset logic here in order to continuously apply the same velocities to the AUV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. So the command component themselves are reset on every iteration? That's good to know.
{ | ||
sim::World world(sim::worldEntity(_ecm)); | ||
sim::Model model(world.ModelByName(_ecm, this->modelName)); | ||
using LinearVelocityCmd = sim::components::LinearVelocityCmd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iche033 I see the component was changed. For posterity, mind to clarify which are the reference and observation frames here? I understood (and I may be wrong) that a WorldLinearVelocityCmd
sets a model's linear velocity w.r.t. to the world frame as observed in the world frame, whereas LinearVelocityCmd
does so w.r.t. to the world frame as observed in the model frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through the physics system and noticed that WorldLinearVelocityCmd
is not being used at all. The LinearVelocityCmd
applies the velocity in model frame, which I think it's what's intended after looking at the comment in the test. In order to move the AUV in circle, it needs to continuously apply x linear vel and z angular vel in the model frame
data->units = _units; | ||
data->staticTime = _ignoreTimeStep; | ||
return data; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iche033 hmm, so we are duplicating EnvironmentalData
definition, in gz-sensors
and here, to avoid the dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this introduces gz-sensors dependency in the core component of gz-sim. So far, only the gz systems (plugins) have dependency on gz-sensors, which are are loaded at run time
The general approach we've been taking is to add the common data structure in sdformat in use them in other gz libraries. It's possible to add this extra dependency but I think it needs some discussion. I made the change to try and get the PR in first.
angularVelocityRefFrame.Cross(sensorPositionInSFMFrame); | ||
// calculate the final linear velocity estimate in reference frame | ||
math::Vector3d expectedLinearVelocityEstimate = | ||
linearVelocityRefFrame + tangentialVelocityRefFrame; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iche033 this seems about right (thanks for the fix BTW, frames for angular velocity contributions were off). If the velocity commands are correct (see the request for clarification above), maybe sensor linear velocities w.r.t. the world frame as observed in the world frame back in the DVL are incorrect? This code would be wrong if the reported velocity were not accounting for the transform between body and sensor frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the pointers! I'll take a look at the dvl code on the gz-sensors side and see I can figure out what's wrong
…led before render to guarantee correct timestamp Signed-off-by: Ian Chen <ichen@osrfoundation.org>
ok tests are now passing after changes in a91ff9e! The maths are correct on the gz-sensors side. The problems were:
This PR is ready. |
CIs may fail because infra is being updated to use the latest harmonic deps: fuel-tools9, msgs10, and transport13. Depends on: #1892 |
CI is now working after mernging with |
🎉 New feature
Summary
This patch adds a system plugin to pick DVL sensors. Needs gazebosim/gz-sensors#290.
Test it
TBD
Checklist
codecheck
passed (See contributing)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.