Skip to content

Commit

Permalink
fix:FATAL flight mode unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
HefnySco committed Nov 13, 2022
1 parent 96a25c3 commit 3c968ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ android {
applicationId 'arudpilot.andruav'
minSdkVersion android_build_min_sdk_version
targetSdkVersion android_build_target_sdk_version
versionName '5.04.12'
versionName '5.04.13'
signingConfig signingConfigs.config
versionCode 50412
versionCode 50413
multiDexEnabled true

//testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public void onDroneEvent_HeartBeat (final int sysid, final short type, final int
mAndruavUnitBase.setVehicleType(MavLink_Helpers.setCommonVehicleType (type));
canFly = MavLink_Helpers.isCanFly (type);

isArmed = ((base_mode & MAV_MODE_FLAG.MAV_MODE_FLAG_SAFETY_ARMED) == MAV_MODE_FLAG.MAV_MODE_FLAG_SAFETY_ARMED) || (App.droneKitServer.getAPM_VehicleType() == VehicleTypes.VEHICLE_ROVER);
isArmed = ((base_mode & MAV_MODE_FLAG.MAV_MODE_FLAG_SAFETY_ARMED) == MAV_MODE_FLAG.MAV_MODE_FLAG_SAFETY_ARMED) || (mAndruavUnitBase.getVehicleType() == VehicleTypes.VEHICLE_ROVER);
this.mAndruavUnitBase.IsArmed(isArmed);

final int vehicle_type = AndruavSettings.andruavWe7daBase.getVehicleType();
Expand Down Expand Up @@ -1149,15 +1149,15 @@ public void onDroneEvent_MissionItemReached (final int missionItemIndex)
public void onDroneEvent_VehicleMode (final VehicleMode vehicleMode)
{

mAndruavUnitBase.setFlightModeFromBoard (MavLink_Helpers.getAndruavStandardFlightMode(App.droneKitServer.getAPM_VehicleType(), (short) vehicleMode.getMode()));
mAndruavUnitBase.setFlightModeFromBoard (MavLink_Helpers.getAndruavStandardFlightMode(mType, (short) vehicleMode.getMode()));

mAndruavUnitBase.setManualTXBlockedSubAction(adjustRCActionByMode (mAndruavUnitBase.getManualTXBlockedSubAction(), mAndruavUnitBase.getFlightModeFromBoard()));
}


public void onDroneEvent_StateArming (final State vehicleState)
{
isArmed = vehicleState.isArmed() || (App.droneKitServer.getAPM_VehicleType() == VehicleTypes.VEHICLE_ROVER);
isArmed = vehicleState.isArmed() || (mType == VehicleTypes.VEHICLE_ROVER);
this.mAndruavUnitBase.IsArmed(isArmed);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ public int getCompID ()
final MAVLinkPacket msg_command_ack = new msg_command_ack().pack();
//////////BUS EVENT


public int getAPM_VehicleType()
{
return APM_VehicleType;
}

@Override
public void onSocketData(final Event_SocketData event)
{
Expand Down

0 comments on commit 3c968ae

Please sign in to comment.