Skip to content

Commit

Permalink
SITL: modify for quad motors on first 4 outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Sep 6, 2024
1 parent 694000a commit 0aec005
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_Aircraft.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class Aircraft {
Location location;
} smoothing;

LowPassFilterFloat servo_filter[5];
LowPassFilterFloat servo_filter[16];

Buzzer *buzzer;
Sprayer *sprayer;
Expand Down
10 changes: 5 additions & 5 deletions libraries/SITL/SIM_Plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ Vector3f Plane::getForce(float inputAileron, float inputElevator, float inputRud

void Plane::calculate_forces(const struct sitl_input &input, Vector3f &rot_accel)
{
float aileron = filtered_servo_angle(input, 0);
float elevator = filtered_servo_angle(input, 1);
float rudder = filtered_servo_angle(input, 3);
float aileron = filtered_servo_angle(input, 9);
float elevator = filtered_servo_angle(input, 5);
float rudder = filtered_servo_angle(input, 10);
bool launch_triggered = input.servos[6] > 1700;
float throttle;
if (reverse_elevator_rudder) {
Expand Down Expand Up @@ -303,9 +303,9 @@ void Plane::calculate_forces(const struct sitl_input &input, Vector3f &rot_accel
//printf("Aileron: %.1f elevator: %.1f rudder: %.1f\n", aileron, elevator, rudder);

if (reverse_thrust) {
throttle = filtered_servo_angle(input, 2);
throttle = filtered_servo_angle(input, 4);
} else {
throttle = filtered_servo_range(input, 2);
throttle = filtered_servo_range(input, 4);
}

float thrust = throttle;
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_QuadPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ QuadPlane::QuadPlane(const char *frame_str) :
{
// default to X frame
const char *frame_type = "x";
uint8_t motor_offset = 4;
uint8_t motor_offset = 0;

ground_behavior = GROUND_BEHAVIOR_NO_MOVEMENT;

Expand Down

0 comments on commit 0aec005

Please sign in to comment.