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 link offset to simulation #83

Merged
merged 21 commits into from
Jul 20, 2020

Conversation

claireyywang
Copy link
Contributor

@claireyywang claireyywang commented Jul 15, 2020

Closes #57

Link offset is added to the simulation after some update in tpeplugin. The following shows distinct offsetted pose of wheels and caster.

Screenshot of demo with velocity_control.sdf
successful link offset

claireyywang and others added 16 commits July 8, 2020 16:34
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: Ian Chen <[email protected]>

Co-authored-by: Ian Chen <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
@claireyywang claireyywang requested a review from mxgrey as a code owner July 15, 2020 23:35
@claireyywang claireyywang self-assigned this Jul 15, 2020
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Jul 15, 2020
@claireyywang claireyywang linked an issue Jul 15, 2020 that may be closed by this pull request
@claireyywang claireyywang requested review from chapulina and iche033 and removed request for mxgrey July 15, 2020 23:36
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #83 into ign-physics2 will decrease coverage by 0.27%.
The diff coverage is 54.76%.

Impacted file tree graph

@@               Coverage Diff                @@
##           ign-physics2      #83      +/-   ##
================================================
- Coverage         82.82%   82.54%   -0.28%     
================================================
  Files               106      106              
  Lines              3663     3679      +16     
================================================
+ Hits               3034     3037       +3     
- Misses              629      642      +13     
Impacted Files Coverage Δ
tpe/plugin/src/SDFFeatures.cc 80.00% <50.00%> (-6.21%) ⬇️
tpe/plugin/src/FreeGroupFeatures.cc 68.88% <52.94%> (-10.06%) ⬇️
tpe/plugin/src/KinematicsFeatures.cc 52.63% <62.50%> (-3.90%) ⬇️
tpe/lib/src/Entity.cc 85.83% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1207fe0...03f78ee. Read the comment docs.

@claireyywang claireyywang marked this pull request as draft July 15, 2020 23:37
@claireyywang claireyywang requested a review from scpeters July 16, 2020 01:20
@claireyywang claireyywang marked this pull request as ready for review July 16, 2020 22:09
Signed-off-by: claireyywang <[email protected]>
Signed-off-by: claireyywang <[email protected]>
@claireyywang claireyywang added the TPE Trivial Physics Engine label Jul 16, 2020
@claireyywang
Copy link
Contributor Author

@iche033 Fortunately, I was able to figure out a fix for the problem. I think this is ready for a first pass of review 😃

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

nice, the links offset look correct now. There are just some minor code check errors.

EXPECT_EQ(ignition::math::Vector3d(0.5, 0, 0.1),
ignition::math::eigen3::convert(frameData.linearVelocity));
EXPECT_EQ(ignition::math::Vector3d(0.1, 0.2, 0),
ignition::math::eigen3::convert(frameData.angularVelocity));
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to do something to fix the linear and angular vel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that linear and angular velocity are tied to model instead of link, and this test case started checking the velocity of link after I corrected the implementation of framedata, which is why I removed it. Before it worked because when calling link->FrameDataRelativeToWorld(), it was getting the velocity of the link's parent model.

If we do want to add velocity for links, then that would be a different feature which allows links to move by itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh I see, that makes sense. Just checking, if we assume the link does not move within a model, should it inherit the parent model's velocities in world frame?

In any case, I'm not sure if there's a use case for querying a link's world velocities. We can address this when the need comes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the link doesn't move within model, its WorldPose is then updated as model's WorldPose gets updated (since its offset will remain the same), so we probably don't have to keep track of link velocities in world frame.

However, if we want the link to move within model, then we'll have to compute the link velocities with the offset. And yes, I agree that we can add this if the need comes.

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

apart from the minor code check errors, the latest changes look good to me

Signed-off-by: claireyywang <[email protected]>
@claireyywang claireyywang merged commit 9b033c4 into ign-physics2 Jul 20, 2020
@claireyywang claireyywang deleted the claire/add-pose-offset-tpeplugin branch July 20, 2020 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel TPE Trivial Physics Engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add link offset to tpeplugin::KinematicsFeatures
2 participants