Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed QEI biquadFilter
geometry.h
- Committer:
- Jankoekenpan
- Date:
- 2016-11-04
- Revision:
- 29:1c5254b27851
- Parent:
- 17:1aabad4ad986
File content as of revision 29:1c5254b27851:
/* The setup:
- +C---\ r1 = (30 -- 50)
| | ----\
| | ----\
| | ---\
d=30 +D- - - - - - +B
| | ---/
| | ----/
| | ----/
- +A---/ r2 = (30 -- 50)
| |
| |
| |
h=20 |
| |
| |
| |
- O
xB = DB
yB = OD = h + 0.5*d
*/
/*
Constants
*/
const float L_max = 50.0; // Max arm length
const float L_min = 30.0; // Min arm length
const float d = 30.0; // Distance between arm centres of rotation
const float h = 20.0; // Height of lower arm centre of rotation
const float reach = 2*sqrt(pow(L_max,2)-pow(L_min,2))-d; // Total length of wall that can be covered
const float y_max = (2*h + d)/2 + reach/2;
const float y_min = (2*h + d)/2 - reach/2;
const float x_min = L_min;
const float x_max = 0;
/*
Methods
*/
void getArmLengthsForRollerPosition(float x, float y, float &upper, float &lower);
void getRollerPositionForArmLengths(float upper, float lower, float &x, float &y);