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

921 kinematics pose estimation #1089

Merged
merged 29 commits into from
Feb 16, 2023
Merged

Commits on Feb 14, 2023

  1. Add tachometer, odometer and kinematics part

    - tachometer takes an encoder and returns revolutions
    - odometer coverts revolutions to distance and velocity
    - kinematics converts odometry to pose estimates
    - BicyclePose part implements the pose estimation pipeline for a
      car-like vehicle (fixed back wheels, turnable front wheels)
    - UnicyclePose part implements the pose estimation pipeline
      for differential drive vehicles.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    1ce5b00 View commit details
    Browse the repository at this point in the history
  2. refactor pose estimation into a single part

    - UnicyclePose handles encoder/tachometer/odometer/kinematics
      for differential drive.
    - BicyclePose handles encoder/tachometer/odomter/kinematics
      for car-like vehicle
    - add a mock encoder that is driven by throttle and steering
      input.  This allows use to simulate the vehicle without
      a full-on simulator.
    - Fix the drawing of the path so that it handles the
      fact that Y increases going north.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    deeb6fc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d31b163 View commit details
    Browse the repository at this point in the history
  4. add arduino encoder sketches

    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    9710c16 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6d66d2c View commit details
    Browse the repository at this point in the history
  6. clean up comments a little

    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    ff95fdf View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e2a9a54 View commit details
    Browse the repository at this point in the history
  8. Add interrupt mode to the mono encoder

    - Interrupts mode can handle much higher tick rates, but does
      a poor job of debouncing.  It is appropriate for high resolution
      optical encoders.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    325e89b View commit details
    Browse the repository at this point in the history
  9. Remove spurious unicode beta character

    It was at the end of `#define ENCODER_OPTIMIZE_INTERRUPTS` and so could have been causing the #define to be unrecognized.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    a5c6a44 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ae4ab8f View commit details
    Browse the repository at this point in the history
  11. Fix syntax error if only using one channel in int mode

    - there was a syntax error if only one pin was defined
      and it was being used in interrupt mode; that is fixed.
    - Add more documentation to the mono_encoder.ino sketch
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    8f2f859 View commit details
    Browse the repository at this point in the history
  12. Added a quadrature encoder sketch with no libraries

    - The sketch counts ticks on a quadrature encoder without
      using 3rd party libraries.
    - This is done 1) to make is simpler to compile and download
      the sketch; the user does not need to figure out what
      library to use. 2) the library that was in use only worked
      on AVR hardware and causes compilation errors on other hardware.
    - if USE_ENCODER_INTERRUPTS is defined when the sketch is compiled,
      then the interrupt driven tick counting will be used.  This has
      no debounce logic, so it is not suitable for mechanical encoder,
      but is appropriate for optical or hall effect encoders.
    - if USE_ENCODER_INTERRUPTS is NOT defined, then this used
      polling mode with debouncing, which is suitable for
      mechanical encoders, but may be to slow for high resolution
      optical or hall effect encoders.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    e6eb5cf View commit details
    Browse the repository at this point in the history
  13. Fix bug in mono encoder sketch

    - it had literal 2 for size of encoders array, so when there
      was only one encoder we got memory overwrites.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    162ff35 View commit details
    Browse the repository at this point in the history
  14. Fix bug in quadrature nolib sketch

    - I used the wrong symbol for adding the #2 isr
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    5d05b11 View commit details
    Browse the repository at this point in the history
  15. minor change to quadrature nolib

    - use array rather than pointer in readEncoders() argument.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    a4ede0a View commit details
    Browse the repository at this point in the history
  16. Updated quadrature_encoder.ino to not require library

    - the library we used was only for AVR microcontrollers,
      so the code could not work on RPi Pico for instance.
    - I reimplemented the sketch to have explicit polling
      mode logic that is suitable for noisy mechanical encoders.
    - To that I added an interrupt driven mode that works if
      there is one interrupt capable pin available for each encoder.
      This is suitable for optical or hall effect encoders that
      do not need to be debounced.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    896cc26 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    1cf569d View commit details
    Browse the repository at this point in the history
  18. Fix RPi_GPIO_Servo part so it does not need GPIO in constructor

    - the constructor has a default for pin_scheme based on the GPIO object.  The GPIO object will not be defined on a PC.
    - this change use None as a default and then checks for it and set the GPIO default if it is None.
    - This fixes a bug in the actuator unit test.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    a90421d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    92af322 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    4e6c371 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    6d4f506 View commit details
    Browse the repository at this point in the history
  22. Vehicle loop prints out number of iterations and total time

    - The vehicle loop now counts frames accurately; prior to
      this change the counter would be one more than the actual
      number of executed frames
    - When the vehicle loop terminates the number of executed
      iterations and the total time are printed and returned
      to the caller.
    - This was used for the kinematics tests because we needed
      to know how long the vehicle drive loop executed so
      we could calculate the expected distance that the
      mock vehicle drove.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    9f2ab20 View commit details
    Browse the repository at this point in the history
  23. Rewrite of the kinematics unit tests

    - We dramatically changed how a mock drivetrain handles
      odometry.  Now is uses a velocity based on encoder
      ticks per second scaled by throttle.  This is a more
      realistic mock, but it is harder to test.
    - The tests setup a vehicle with a mock encoder, then
      run the vehicle loop for a set number of iterations.
      The vehicle loop now returns how long the loop ran and
      this is used along with the configuration for ticks_per_second
      from the mock encoder to calculate how far the vehicle travelled.
      Then the kinematics model is applied to see if the resulting
      ending pose matches the expected pose.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    e9cac78 View commit details
    Browse the repository at this point in the history
  24. Adjust bicycle kinematics to use front wheel reference

    - the code now uses the front wheels as the reference
      point for the calculations
    - this fixes the unit test, which were using the front wheels
      while the code used the back wheels.
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    0cda9b0 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    a1d4f78 View commit details
    Browse the repository at this point in the history
  26. updated based on PR feedback

    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    024fc0f View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    0ae8db9 View commit details
    Browse the repository at this point in the history
  28. Update vehicle.py

    - change print statement to a log
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    ee22a1b View commit details
    Browse the repository at this point in the history
  29. Update setup.py version="4.4.dev5"

    version="4.4.dev5"
    Ezward committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    78711a7 View commit details
    Browse the repository at this point in the history