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

Make path times public. #197

Merged
merged 7 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [cpp] Minor PR to make the cpp part compiles on windows64 (msvc). Thanks @ahoarau.
- [cpp] Fixed out of bounds issue in parametrizer::ConstAccel.
- [cpp] Fixed incorrect variable bug in seidel solver.
- [cpp] [#187] Expose waypoint times in parametizers.
- [python] Fix linting error that causes CI failure
- [ci] Do integration testing in gh action instead of circle CI
- [ci] Remove Circle CI and use Github Action for all testings
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/toppra/parametrizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class Parametrizer : public GeometricPath {

virtual ~Parametrizer() {}

/** \brief Return the waypoint times.
*/
virtual const Vector& getTimes() const = 0;
jmirabel marked this conversation as resolved.
Show resolved Hide resolved

protected:
// Input geometric path
GeometricPathPtr m_path;
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/toppra/parametrizer/const_accel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class ConstAccel : public Parametrizer {
public:
ConstAccel(GeometricPathPtr path, const Vector &gridpoints, const Vector &vsquared);

const Vector& getTimes() const override { return m_ts; }

private:
/** Return joint derivatives at specified times. */
Vectors eval_impl(const Vector &times, int order = 0) const override;
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/toppra/parametrizer/spline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class Spline: public Parametrizer {
* @param vsquared the path velocity squared with shape (N+1,).
*/
Spline(GeometricPathPtr path, const Vector &gridpoints, const Vector &vsquared);

const Vector& getTimes() const override { return m_ts; }

private:
/** Return joint derivatives at specified times. */
Vectors eval_impl(const Vector &times, int order = 0) const override;
Expand Down