APISonar


com.o3dr.services.android.lib.drone.attribute.AttributeType.GPS

> com > o3dr > services > android > lib > drone > attribute > AttributeType > GPS
com APIs o3dr APIs services APIs android APIs lib APIs drone APIs attribute APIs AttributeType APIs GPS APIs

Example 1
public List<LatLong> getPathPoints() {
		List<LatLong> path = new ArrayList<LatLong>();
        GuidedState guidedPoint = drone.getAttribute(AttributeType.GUIDED_STATE);
		if (guidedPoint != null && guidedPoint.isActive()) {
            Gps gps = drone.getAttribute(AttributeType.GPS);
			if (gps != null && gps.isValid()) {
				path.add(gps.getPosition());
			}
			path.add(guidedPoint.getCoordinate());
		}
		return path;
	}
Example 2
public void goToDroneLocation() {
        Drone dpApi = getDroneApi();
        if (!dpApi.isConnected())
            return;

        Gps gps = dpApi.getAttribute(AttributeType.GPS);
        if (!gps.isValid()) {
            Toast.makeText(getActivity().getApplicationContext(), R.string.drone_no_location, Toast.LENGTH_SHORT).show();
            return;
        }

        final float currentZoomLevel = getMap().getCameraPosition().zoom;
        final LatLong droneLocation = gps.getPosition();
        updateCamera(droneLocation, (int) currentZoomLevel);
    }
Example 3
public LatLong getPosition() {
        Gps droneGps = drone.getAttribute(AttributeType.GPS);
        return isValid() ? droneGps.getPosition() :  null;
	}
Example 4
private void updateGps(Drone drone) {
        if (mInboxBuilder == null)
            return;

        Gps droneGps = drone.getAttribute(AttributeType.GPS);
        String update = droneGps == null ? "--" : String.format(
                "%d, %s", droneGps.getSatellitesCount(), droneGps.getFixType());
        mInboxBuilder.setLine(1, SpannableUtils.normal("Satellite:   ", SpannableUtils.bold(update)));
    }
Example 5
protected LatLongAlt getCurrentFlightPoint(){
        final Gps droneGps = drone.getAttribute(AttributeType.GPS);
        if (droneGps != null && droneGps.isValid()) {
            Altitude droneAltitude = drone.getAttribute(AttributeType.ALTITUDE);
            LatLongAlt point = new LatLongAlt(droneGps.getPosition(),
                droneAltitude.getAltitude());
            return point;
        }
        return null;
    }