Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Initial Guess Point to Pose2d. Constraint members const public
Browse files Browse the repository at this point in the history
  • Loading branch information
bruingineer committed Jun 25, 2024
1 parent c5bdff7 commit 2cdb72a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class TRAJOPT_DLLEXPORT AngularVelocityMaxMagnitudeConstraint {
}
}

private:
double m_maxMagnitude;
const double m_maxMagnitude;
};

} // namespace trajopt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ class TRAJOPT_DLLEXPORT LinearVelocityMaxMagnitudeConstraint {
}
}

private:
double m_maxMagnitude;
const double m_maxMagnitude;
};

} // namespace trajopt
7 changes: 3 additions & 4 deletions src/spline/SplineUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace trajopt {

std::vector<CubicHermitePoseSplineHolonomic>
CubicPoseControlVectorsFromWaypoints(
const std::vector<std::vector<InitialGuessPoint>> initialGuessPoints) {
const std::vector<std::vector<Pose2d>> initialGuessPoints) {
size_t totalGuessPoints = 0;
for (const auto& points : initialGuessPoints) {
totalGuessPoints += points.size();
Expand All @@ -27,9 +27,8 @@ CubicPoseControlVectorsFromWaypoints(
// populate translation and heading vectors
for (const auto& guessPoints : initialGuessPoints) {
for (const auto& guessPoint : guessPoints) {
flatTranslationPoints.emplace_back(units::meter_t(guessPoint.x),
units::meter_t(guessPoint.y));
flatHeadings.emplace_back(units::radian_t(guessPoint.heading));
flatTranslationPoints.emplace_back(guessPoint.Translation());
flatHeadings.emplace_back(guessPoint.Rotation());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/spline/SplineUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include <vector>

#include "spline/CubicHermitePoseSplineHolonomic.hpp"
#include "trajopt/path/InitialGuessPoint.hpp"
#include "trajopt/geometry/Pose2.hpp"

namespace trajopt {

std::vector<CubicHermitePoseSplineHolonomic>
CubicPoseControlVectorsFromWaypoints(
const std::vector<std::vector<InitialGuessPoint>> initialGuessPoints);
const std::vector<std::vector<Pose2d>> initialGuessPoints);

} // namespace trajopt

0 comments on commit 2cdb72a

Please sign in to comment.