Skip to content

Commit

Permalink
Fix TOTG state time from start numerical issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Dec 20, 2023
1 parent 788feaa commit 707e46b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ bool Trajectory::assignData(TrajectoryContainer& trajectory, const std::vector<s

time = getTime(dist_mapping.at(seg_idx));
if (!(time > prev_time))
time = prev_time + 1e-16;
time = prev_time + 1e-8;

path_data = getPathData(time);
uv = getVelocity(path_data).head(trajectory.dof());
Expand All @@ -967,7 +967,10 @@ bool Trajectory::assignData(TrajectoryContainer& trajectory, const std::vector<s
}

// Set end
path_data = getPathData(prev_time);
if (!(time > prev_time))
time = prev_time + 1e-8;

path_data = getPathData(time);
uv = getVelocity(path_data).head(trajectory.dof());
ua = getAcceleration(path_data).head(trajectory.dof());
trajectory.setData((trajectory.size() - 1), uv, ua, time);
Expand Down

0 comments on commit 707e46b

Please sign in to comment.