mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-27 00:21:26 +00:00
Adding back PID gains since they didn't survive the merge for some reason
This commit is contained in:
@@ -51,7 +51,6 @@ title('Altitude vs Time')
|
|||||||
xlabel('Time (s)')
|
xlabel('Time (s)')
|
||||||
ylabel('Altitude (m)')
|
ylabel('Altitude (m)')
|
||||||
ylim([0 z(1)+5])
|
ylim([0 z(1)+5])
|
||||||
saveas(gcf,'outputs/Accel-Vel-Alt vs Time.png')
|
|
||||||
|
|
||||||
figure(2)
|
figure(2)
|
||||||
|
|
||||||
@@ -75,7 +74,6 @@ plot(t, rolldot)
|
|||||||
title('Angular Velocity vs Time')
|
title('Angular Velocity vs Time')
|
||||||
xlabel('Time (ms)')
|
xlabel('Time (ms)')
|
||||||
ylabel('Angular Velocity (deg/s)')
|
ylabel('Angular Velocity (deg/s)')
|
||||||
saveas(gcf,'outputs/Euler Angles vs Time.png')
|
|
||||||
legend("yawdot", "pitchdot", "rolldot")
|
legend("yawdot", "pitchdot", "rolldot")
|
||||||
|
|
||||||
figure(3)
|
figure(3)
|
||||||
@@ -93,4 +91,3 @@ plot(t, Servo2)
|
|||||||
title('Servo 2 Position vs Time')
|
title('Servo 2 Position vs Time')
|
||||||
xlabel('Time (ms)')
|
xlabel('Time (ms)')
|
||||||
ylabel('Servo 2 Position (rad)')
|
ylabel('Servo 2 Position (rad)')
|
||||||
saveas(gcf,'outputs/Servo Position vs Time.png')
|
|
||||||
|
@@ -17,14 +17,19 @@ int main() {
|
|||||||
Vehicle State;
|
Vehicle State;
|
||||||
Vehicle PrevState;
|
Vehicle PrevState;
|
||||||
|
|
||||||
|
// PID Gains
|
||||||
|
State.Kp = -6.8699;
|
||||||
|
State.Ki = 0;
|
||||||
|
State.Kd = -0.775;
|
||||||
|
|
||||||
// Initial Velocity
|
// Initial Velocity
|
||||||
State.vx = 0; // [m/s]
|
State.vx = 0; // [m/s]
|
||||||
State.vy = 0; // [m/s]
|
State.vy = 0; // [m/s]
|
||||||
State.vz = 0; // [m/s]
|
State.vz = 0; // [m/s]
|
||||||
|
|
||||||
// Initial YPR
|
// Initial YPR
|
||||||
State.yaw = 10 * M_PI / 180; // [rad]
|
State.yaw = 75 * M_PI / 180; // [rad]
|
||||||
State.pitch = 5 * M_PI / 180; // [rad]
|
State.pitch = 35 * M_PI / 180; // [rad]
|
||||||
State.roll = 0 * M_PI / 180; // [rad]
|
State.roll = 0 * M_PI / 180; // [rad]
|
||||||
|
|
||||||
// Initial YPRdot
|
// Initial YPRdot
|
||||||
|
Reference in New Issue
Block a user