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

Commit

Permalink
Add back missing constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Feb 18, 2024
1 parent 1d9cfee commit bc9af85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/trajectory/HolonomicTrajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ HolonomicTrajectory::HolonomicTrajectory(
std::vector<HolonomicTrajectorySample> samples)
: samples(std::move(samples)) {}

HolonomicTrajectory::HolonomicTrajectory(const HolonomicSolution& solution) {
double ts = 0.0;
for (size_t samp = 0; samp < solution.x.size(); samp++) {
if (samp != 0) {
ts += solution.dt[samp - 1];
}
samples.emplace_back(ts, solution.x[samp], solution.y[samp],
solution.theta[samp], solution.vx[samp],
solution.vy[samp], solution.omega[samp]);
}
}

HolonomicTrajectory HolonomicTrajectory::FromSolution(
const HolonomicSolution& solution) {
std::vector<HolonomicTrajectorySample> samples;
Expand Down

0 comments on commit bc9af85

Please sign in to comment.