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

chassis: Use pinv instead of solving least squares #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

auscompgeek
Copy link
Member

@auscompgeek auscompgeek commented Jul 22, 2019

Given:

v_wheels = [v_1x v_1y v_2x v_2y v_3x v_3y v_4x v_4y].T
v_robot = [v_x v_y w].T
    [1 0 -r_1y]
    [0 1  r_1x]
    [1 0 -r_2y]
A = [0 1  r_2x]
    [1 0 -r_3y]
    [0 1  r_3x]
    [1 0 -r_4y]
    [0 1  r_4x]

v_wheels = A v_robot

where:

  • v_n denotes the Cartesian velocity of module n, and
  • r_n denotes the Cartesian centre of rotation of module n,

we can left-multiply the pseudo-inverse of A to solve for v_robot.

I presume this should be significantly faster than solving least squares on the fly.

This is currently on top of #75 (otherwise the tests will fail).

I just updated the wpilib-controller package with changes from the
upstream PR.  We should update our code to use this at some point.
@codecov-io
Copy link

Codecov Report

Merging #76 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
- Coverage   83.68%   83.66%   -0.03%     
==========================================
  Files          21       21              
  Lines        1606     1604       -2     
  Branches      160      160              
==========================================
- Hits         1344     1342       -2     
  Misses        220      220              
  Partials       42       42
Impacted Files Coverage Δ
pyswervedrive/chassis.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dda4b60...32b6a36. Read the comment docs.

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

Successfully merging this pull request may close these issues.

2 participants