Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import android.os.Handler;

import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.common.msg_global_position_int;
import com.MAVLink.common.msg_vfr_hud;
import com.MAVLink.enums.MAV_TYPE;
import com.github.zafarkhaja.semver.Version;
import com.o3dr.android.client.apis.CapabilityApi;
Expand Down Expand Up @@ -41,32 +39,6 @@ public FirmwareType getFirmwareType() {
return FirmwareType.ARDU_PLANE;
}

@Override
protected void processVfrHud(msg_vfr_hud vfrHud){
//Nothing to do. Plane used GLOBAL_POSITION_INT to set altitude and speeds unlike copter
}

/**
* Used to update the vehicle location, and altitude.
* @param gpi
*/
@Override
protected void processGlobalPositionInt(msg_global_position_int gpi){
if(gpi == null)
return;

super.processGlobalPositionInt(gpi);

final double relativeAlt = gpi.relative_alt / 1000.0;

final double groundSpeedX = gpi.vx / 100.0;
final double groundSpeedY = gpi.vy / 100.0;
final double groundSpeed = Math.sqrt(Math.pow(groundSpeedX, 2) + Math.pow(groundSpeedY, 2));

final double climbRate = gpi.vz / 100.0;
setAltitudeGroundAndAirSpeeds(relativeAlt, groundSpeed, groundSpeed, climbRate);
}

@Override
protected boolean isFeatureSupported(String featureId){
switch(featureId){
Expand Down