Revision bc4b408e
ID | bc4b408e206dea9fe99d5bcd0f695b75b613e518 |
Added velocity_control to MikrocopterControl class, which was added to
work with joystick control. Takes forward and lateral speeds and
combines them to set pitch and roll.
mikrokopter/src/nav_lib.cpp | ||
---|---|---|
16 | 16 |
control.config = 1; |
17 | 17 |
} |
18 | 18 |
|
19 |
void MikrokopterControl::velocity_control(int forward_speed, int lateral_speed) |
|
20 |
{ |
|
21 |
int k = 1; // TODO set scaling constant and check signs |
|
22 |
control.roll = k*(forward_speed - lateral_speed); |
|
23 |
control.pitch = k*(forward_speed + lateral_speed); |
|
24 |
} |
|
25 |
|
|
19 | 26 |
void MikrokopterControl::forward() |
20 | 27 |
{ |
21 | 28 |
control.roll = 15; |
Also available in: Unified diff