-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SliceByTime for PiecewisePolynomials #22099
SliceByTime for PiecewisePolynomials #22099
Conversation
@jwnimmer-tri or @RussTedrake Do you mind reviewing this or assigning someone? |
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.
+@RussTedrake for feature review.
Reviewed 4 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 3 unresolved discussions, LGTM missing from assignee RussTedrake(platform), needs at least two assigned reviewers, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @sadraddini)
common/trajectories/piecewise_polynomial.h
line 766 at r2 (raw file):
* trajectory's time range. */ PiecewisePolynomial Trim(const T& start_time, const T& end_time) const;
I mildly worry that "trim" sounds like it's changing the current object, whereas this is a const method returning a new object.
we already have "slice" method which does the same thing, except by segment index instead of by time. I actually prefer the name "slice" because it slightly sounds more like it's making the new object? In either case, i'd like this method to be connected to that method.
perhaps "SliceByTime()". I don't love that, but it's clear. Having two overloads for slice, one that takes two ints, and the other that takes two doubles seems too risky.
common/trajectories/test/piecewise_polynomial_test.cc
line 215 at r2 (raw file):
piecewise1.value(t), 1e-8, MatrixCompareType::absolute)); // Pick 10 random samples and check that the sampled values are the same.
btw -- the use of random samples in here is vestigial. it's better to use arbitrary but fixed sample times.
common/trajectories/test/piecewise_polynomial_test.cc
line 221 at r2 (raw file):
piecewise1.value(t_sample), 1e-8, MatrixCompareType::absolute)); }
we don't actually have any guarantee that the impacted segment is being checked in here. we should definitely have that. (it's also good to check the other segments).
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.
Reviewable status: 2 unresolved discussions, LGTM missing from assignee RussTedrake(platform), needs at least two assigned reviewers, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits)
common/trajectories/piecewise_polynomial.h
line 766 at r2 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
I mildly worry that "trim" sounds like it's changing the current object, whereas this is a const method returning a new object.
we already have "slice" method which does the same thing, except by segment index instead of by time. I actually prefer the name "slice" because it slightly sounds more like it's making the new object? In either case, i'd like this method to be connected to that method.
perhaps "SliceByTime()". I don't love that, but it's clear. Having two overloads for slice, one that takes two ints, and the other that takes two doubles seems too risky.
Done changed it to SliceByTime
common/trajectories/test/piecewise_polynomial_test.cc
line 215 at r2 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
btw -- the use of random samples in here is vestigial. it's better to use arbitrary but fixed sample times.
Done See the response to your next comment.
common/trajectories/test/piecewise_polynomial_test.cc
line 221 at r2 (raw file):
Previously, RussTedrake (Russ Tedrake) wrote…
we don't actually have any guarantee that the impacted segment is being checked in here. we should definitely have that. (it's also good to check the other segments).
Done made one sample at every segment.
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.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: needs at least two assigned reviewers, commits need curation (https://drake.mit.edu/reviewable.html#curated-commits) (waiting on @sadraddini)
+@sammy-tri for platform review, per schedule, please! |
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.
Reviewed 2 of 5 files at r1, 3 of 3 files at r3, all commit messages.
Reviewable status:complete! all discussions resolved, LGTM from assignees sammy-tri(platform),RussTedrake(platform)
Part of #22100
This change is