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

Feature/finite difference #61

Merged
merged 7 commits into from
Feb 8, 2024
Merged

Conversation

SylvainBertrand
Copy link
Member

This PR adds simple 1st order finite difference and integration for the different primitives in euclid.
The new stuff is available from EuclidCoreTools.
(I'm thinking about slowly migrating all the tools there so we can reduce the number of tool classes.)

Lemme know whatcha think.

@@ -1403,4 +1421,351 @@ public static int previous(int index, int listSize)
{
return wrap(index - 1, listSize);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

👇 new methods for doing finite difference 👇

finiteDifference(previousTransform.getTranslation(), currentTransform.getTranslation(), dt, linearVelocityToPack);
}

/**
Copy link
Member Author

Choose a reason for hiding this comment

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

👇 new methods for integrating 👇

double angle = nextDouble(random, minMaxAngle);
double radius = EuclidCoreTools.squareRoot(1.0 - height * height);
axisAngleToRandomize.set(radius * EuclidCoreTools.cos(angle), radius * EuclidCoreTools.sin(angle), height, angle);
axisAngleToRandomize.set(EuclidCoreRandomTools.nextVector3D(random), angle);
Copy link
Member Author

Choose a reason for hiding this comment

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

The old implementation was incorrect in the sense that it wouldn't generate random axes that would be uniformly distributed.
Fixing this seems to break other tests. I'll work on fixing them

Copy link
Member

@calvertdw calvertdw left a comment

Choose a reason for hiding this comment

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

Holy moly that's a lot of stuff. Looks great!

@SylvainBertrand SylvainBertrand force-pushed the feature/finite-difference branch from 40f4587 to 5737f56 Compare January 22, 2024 17:12
Copy link
Contributor

@james-p-foster james-p-foster left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just curious about a few constants, but go for merge! 👍🏻

@SylvainBertrand SylvainBertrand merged commit 81809c0 into develop Feb 8, 2024
2 checks passed
@SylvainBertrand SylvainBertrand deleted the feature/finite-difference branch February 8, 2024 03:36
rjgriffin42 pushed a commit that referenced this pull request Oct 23, 2024
…rame to develop

* commit '8ba34f5e5891a2462bfd6974f6f141a137ff19e6':
  Suppressed a line
  Updated the doc
  Completed FixedFrameTuple2DBasics, FixedFrameTuple4DBasics and test
  Complete FramePoint3DTest and FrameVector3DTest
  Addition of FixedFramePoint3DBasics.setMatchingFrame
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.

3 participants