Library to calculate angles from positions and vice versa (also used for shooting angles)
Dependents: includeair includeair calcul_Ueff2 Mesure_energie
angleandposition.h@3:067c75c62882, 2015-10-27 (annotated)
- Committer:
- Gerth
- Date:
- Tue Oct 27 16:13:26 2015 +0000
- Revision:
- 3:067c75c62882
- Parent:
- 1:6cace9fdb088
- Child:
- 4:9492c1c361b9
Added angle to position and documentation;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Gerth | 0:b8295c4b5793 | 1 | #ifndef _ANGLEANDPOSITION_H_ |
Gerth | 0:b8295c4b5793 | 2 | #define _ANGLEANDPOSITION_H_ |
Gerth | 0:b8295c4b5793 | 3 | |
Gerth | 0:b8295c4b5793 | 4 | #include "mbed.h" |
Gerth | 0:b8295c4b5793 | 5 | #include "math.h" |
Gerth | 0:b8295c4b5793 | 6 | |
Gerth | 0:b8295c4b5793 | 7 | class angleandposition |
Gerth | 0:b8295c4b5793 | 8 | { |
Gerth | 0:b8295c4b5793 | 9 | public: |
Gerth | 3:067c75c62882 | 10 | /** |
Gerth | 3:067c75c62882 | 11 | *Constructor |
Gerth | 3:067c75c62882 | 12 | */ |
Gerth | 0:b8295c4b5793 | 13 | angleandposition(void); |
Gerth | 0:b8295c4b5793 | 14 | |
Gerth | 3:067c75c62882 | 15 | /** |
Gerth | 3:067c75c62882 | 16 | *Calculates required angle for rigth arm from desired position. |
Gerth | 3:067c75c62882 | 17 | *@param x_position : float Desired x position in mm |
Gerth | 3:067c75c62882 | 18 | *@param y_position : float Desired y position in mm |
Gerth | 3:067c75c62882 | 19 | *@return Required angle for rigth arm in rad |
Gerth | 3:067c75c62882 | 20 | */ |
Gerth | 1:6cace9fdb088 | 21 | float positiontoangle1 (float x_position,float y_position); |
Gerth | 3:067c75c62882 | 22 | |
Gerth | 3:067c75c62882 | 23 | /** |
Gerth | 3:067c75c62882 | 24 | *Calculates required angle for left arm from desired position. |
Gerth | 3:067c75c62882 | 25 | *@param x_position : float Desired x position in mm |
Gerth | 3:067c75c62882 | 26 | *@param y_position : float Desired y position in mm |
Gerth | 3:067c75c62882 | 27 | *@return Required angle for left arm in rad |
Gerth | 3:067c75c62882 | 28 | */ |
Gerth | 1:6cace9fdb088 | 29 | float positiontoangle2 (float x_position,float y_position); |
Gerth | 3:067c75c62882 | 30 | |
Gerth | 3:067c75c62882 | 31 | /** |
Gerth | 3:067c75c62882 | 32 | *Calculates the x position of the pod from the angles of the arms |
Gerth | 3:067c75c62882 | 33 | *@param theta_r : float Angle of rigth arm in rad |
Gerth | 3:067c75c62882 | 34 | *@param theta_l : float Angle of left arm in rad |
Gerth | 3:067c75c62882 | 35 | *@return X position of pod in mm |
Gerth | 3:067c75c62882 | 36 | */ |
Gerth | 3:067c75c62882 | 37 | float angletoposition (float theta_r,float theta_l); |
Gerth | 3:067c75c62882 | 38 | |
Gerth | 3:067c75c62882 | 39 | /** |
Gerth | 3:067c75c62882 | 40 | *Calculates the y position of the pod from the angles of the arms |
Gerth | 3:067c75c62882 | 41 | *@param theta_r : float Angle of rigth arm in rad |
Gerth | 3:067c75c62882 | 42 | *@param theta_l : float Angle of left arm in rad |
Gerth | 3:067c75c62882 | 43 | *@return Y position of pod in mm |
Gerth | 3:067c75c62882 | 44 | */ |
Gerth | 3:067c75c62882 | 45 | float angletoposition_y(float theta_r,float theta_l); |
Gerth | 3:067c75c62882 | 46 | |
Gerth | 0:b8295c4b5793 | 47 | |
Gerth | 0:b8295c4b5793 | 48 | private: |
Gerth | 0:b8295c4b5793 | 49 | |
Gerth | 0:b8295c4b5793 | 50 | }; |
Gerth | 0:b8295c4b5793 | 51 | #endif |