Skip to content

Commit

Permalink
Check dt in updateFromVelocity (#1481)
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Najjar <[email protected]>
  • Loading branch information
tonynajjar authored Jan 10, 2025
1 parent 67096bd commit 0736e6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diff_drive_controller/src/odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ bool Odometry::update(double left_pos, double right_pos, const rclcpp::Time & ti
bool Odometry::updateFromVelocity(double left_vel, double right_vel, const rclcpp::Time & time)
{
const double dt = time.seconds() - timestamp_.seconds();

if (dt < 0.0001)
{
return false; // Interval too small to integrate with
}
// Compute linear and angular diff:
const double linear = (left_vel + right_vel) * 0.5;
// Now there is a bug about scout angular velocity
Expand Down

0 comments on commit 0736e6c

Please sign in to comment.