Fix bug with acceleration
This commit is contained in:
parent
e6b32616da
commit
af98e92fe8
|
@ -45,13 +45,14 @@ class TrajectoryTracker {
|
||||||
return {linear_velocity, 0.0, angular_velocity, 0.0};
|
return {linear_velocity, 0.0, angular_velocity, 0.0};
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto previous_velocity = *previous_velocity_;
|
TrajectoryTrackerOutput output{
|
||||||
|
linear_velocity, (linear_velocity - previous_velocity_->linear_velocity) / dt, angular_velocity,
|
||||||
|
(angular_velocity - previous_velocity_->angular_velocity) / dt};
|
||||||
|
|
||||||
previous_velocity_->linear_velocity = linear_velocity;
|
previous_velocity_->linear_velocity = linear_velocity;
|
||||||
previous_velocity_->angular_velocity = angular_velocity;
|
previous_velocity_->angular_velocity = angular_velocity;
|
||||||
|
|
||||||
return {linear_velocity, (linear_velocity - previous_velocity.linear_velocity) / dt, angular_velocity,
|
return output;
|
||||||
(angular_velocity - previous_velocity.angular_velocity) / dt};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual TrajectoryTrackerVelocityOutput CalculateState(const TimedIterator<Pose2dWithCurvature>& iterator,
|
virtual TrajectoryTrackerVelocityOutput CalculateState(const TimedIterator<Pose2dWithCurvature>& iterator,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user