Skip to content

Commit

Permalink
SITL: allow for extra actuators to be marked as motors
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Oct 16, 2022
1 parent dc3f6fe commit 1138f9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/SITL/SIM_Aircraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void Aircraft::fill_fdm(struct sitl_fdm &fdm)
fdm.velocity_air_bf = velocity_air_bf;
fdm.battery_voltage = battery_voltage;
fdm.battery_current = battery_current;
fdm.motor_mask = motor_mask;
fdm.motor_mask = motor_mask | sitl->vibe_motor_mask;
memcpy(fdm.rpm, rpm, sizeof(fdm.rpm));
fdm.rcin_chan_count = rcin_chan_count;
fdm.range = rangefinder_range();
Expand Down
3 changes: 3 additions & 0 deletions libraries/SITL/SITL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ const AP_Param::GroupInfo SIM::var_info2[] = {
// motor harmonics
AP_GROUPINFO("VIB_MOT_HMNC", 60, SIM, vibe_motor_harmonics, 1),

// motor mask, allowing external simulators to mark motors
AP_GROUPINFO("VIB_MOT_MASK", 5, SIM, vibe_motor_mask, 0),

// max motor vibration frequency
AP_GROUPINFO("VIB_MOT_MAX", 61, SIM, vibe_motor, 0.0f),
// minimum throttle for simulated ins noise
Expand Down
3 changes: 3 additions & 0 deletions libraries/SITL/SITL.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ class SIM {
// what harmonics to generate
AP_Int16 vibe_motor_harmonics;

// what servos are motors
AP_Int32 vibe_motor_mask;

// minimum throttle for addition of ins noise
AP_Float ins_noise_throttle_min;

Expand Down

0 comments on commit 1138f9e

Please sign in to comment.