mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-19 19:11:48 +02:00
updated documentation of getTilt
This commit is contained in:
parent
bcd03a6148
commit
14de5a626e
@ -89,8 +89,8 @@ Orientation MotionDetection::getTilt(){
|
|||||||
yAngle = atan(float(reading.x)/reading.z)*180/3.1415+0.5;
|
yAngle = atan(float(reading.x)/reading.z)*180/3.1415+0.5;
|
||||||
xAngle = atan(float(reading.y)/reading.z)*180/3.1415+0.5;
|
xAngle = atan(float(reading.y)/reading.z)*180/3.1415+0.5;
|
||||||
} else {
|
} else {
|
||||||
yAngle = 90;
|
yAngle = 90*(reading.x > 0) - (reading.x < 0);
|
||||||
xAngle = 90;
|
xAngle = 90*(reading.y > 0) - (reading.y < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//shift quadrants depending on signum
|
//shift quadrants depending on signum
|
||||||
|
@ -144,8 +144,9 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief calculates how the robot is tilted. It is set, that when the robot is placed normally on a flat table, the result will be (0,0)
|
* @brief calculates how the robot is tilted. It is set, that when the robot is placed normally on a flat table, the result will be (0,0)
|
||||||
* Tilting the robot, so that the front leg is deeper than the other to results in an increasing value, tilting the front leg up will let the value jump to 359 and then decreasing
|
* Tilting the robot, so that the front leg is deeper than the other to results in an increasing degrees, tilting the front leg up will increase negativ degrees
|
||||||
* Tilting the robot to the right (..) will increase the value, tilting it left will jump to 359 and then decreased.
|
* Tilting the robot to the right will increase the degrees until 180° (upside down), tilting it left will result in increasing negativ degrees (-1,-2,...,-180).
|
||||||
|
* On the top there is a jump of the values from 180->-180 and vice versa.
|
||||||
*
|
*
|
||||||
* Precision is rounded to 1 deg steps
|
* Precision is rounded to 1 deg steps
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user