Project

General

Profile

Revision fd29b28e

IDfd29b28eb2f84596cc133172863b245968088898

Added by Priya about 12 years ago

Tested velocity control and added yaw and throttle control to joystick.

View differences:

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)
19
void MikrokopterControl::velocity_control(float forward_speed, float lateral_speed)
20 20
{
21
    int k = 1; // TODO set scaling constant and check signs
21
    int k = 50; // TODO set scaling constant and check signs
22 22
    control.roll = k*(forward_speed - lateral_speed);
23 23
    control.pitch = k*(forward_speed + lateral_speed);
24 24
}
......
53 53
    control.pitch = 0;
54 54
}
55 55

  
56
void MikrokopterControl::set_thrust(int thrust)
56
void MikrokopterControl::set_thrust(float thrust)
57 57
{
58
    control.thrust = thrust;
58
    int k = 100;
59
    control.thrust = k*thrust;
60
}
61

  
62
void MikrokopterControl::set_yaw(float yaw)
63
{
64
    int k = 50;
65
    control.yaw = k*yaw;
59 66
}
60 67

  
61 68
void MikrokopterControl::publish_on(ros::Publisher& pub)

Also available in: Unified diff