Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DiffDriveController] use "period" argument in the update method insead of calculating "dt" #271

Open
destogl opened this issue Nov 18, 2021 · 2 comments · May be fixed by #1394
Open

[DiffDriveController] use "period" argument in the update method insead of calculating "dt" #271

destogl opened this issue Nov 18, 2021 · 2 comments · May be fixed by #1394

Comments

@destogl
Copy link
Member

destogl commented Nov 18, 2021

we should have period available in the update method

Originally posted by @destogl in #260 (comment)

josephduchesne added a commit to josephduchesne/ros2_controllers that referenced this issue Nov 27, 2024
use velocity where it claims to, and pass timestep
in to every method that makes use of it.

This was requested in ros-controls#271.

- The result is that the class is very slightly less efficient (but
still quite trivial) due to passing around a extra double.

- The other result is that it is no longer possible for velocity based
odometry updates calculated incorrectly when the timestep fails to keep up.

To prevent position based updates from now suffering the inverse of
the velocity timestep/dt mismatch, the measured delta is used exclusively
for position based updates (retaining the existing behavior), while the
configured timestep is used for open and closed loop velocity updates.

I also added a 1s throttled warning if there is a major mismatch between
measured and configured timestep (+/-20%) since this would cause a slight
accumulation of integration errors on curved paths (I believe), depending
on velocity, curvature and mismatch size.

Similar requested period/measured period mismatches may be a nuisance for
open loop (which is velocity based) and closed loop velocity based updates,
but the impact is likely negligible (in this class).
@christophfroehlich
Copy link
Contributor

Consider also the discussion in
#1481

@christophfroehlich
Copy link
Contributor

@christophfroehlich can you review the odometry implementation in #1535? If it looks good, I can make a PR making similar modifications to the diff_drive_controller.

Originally posted by @Amronos in #1394 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants