当前位置: 首页>>代码示例>>Java>>正文


Java LatLongAlt类代码示例

本文整理汇总了Java中com.o3dr.services.android.lib.coordinate.LatLongAlt的典型用法代码示例。如果您正苦于以下问题:Java LatLongAlt类的具体用法?Java LatLongAlt怎么用?Java LatLongAlt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LatLongAlt类属于com.o3dr.services.android.lib.coordinate包,在下文中一共展示了LatLongAlt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onApiConnected

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void onApiConnected() {
	if (mMapFragment != null)
		mMapFragment.clearAll();

	drone = getDrone();
	missionProxy = getMissionProxy();

	home = new GraphicHome(drone, getContext());
	mMapFragment.addMarker(home);

	graphicDrone = new GraphicDrone(drone);
	mMapFragment.addMarker(graphicDrone);

	guided = new GraphicGuided(drone);
	mMapFragment.addMarker(guided);

       for(LatLongAlt point : flightPathPoints) {
           mMapFragment.addFlightPathPoint(point);
       }

	onMissionUpdate();
	getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:25,代码来源:DroneMap.java

示例2: getRemainingMissionLength

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
private double getRemainingMissionLength(){
    Gps gps = drone.getAttribute(AttributeType.GPS);
    if(mission == null || mission.getMissionItems().size() == 0 || gps == null || !gps.isValid())
        return -1;
    LatLong dronePos = gps.getPosition();
    List<MissionItem> missionItems = mission.getMissionItems();
    List<LatLong> path = new ArrayList<LatLong>();
    path.add(dronePos);
    for(int i = Math.max(nextWaypoint - 1, 0); i < missionItems.size(); i++){
        MissionItem item = missionItems.get(i);
        if(item instanceof MissionItem.SpatialItem){
            MissionItem.SpatialItem spatialItem = (MissionItem.SpatialItem)item;
            LatLongAlt coordinate = spatialItem.getCoordinate();
            path.add(new LatLong(coordinate.getLatitude(), coordinate.getLongitude()));
        }

    }
    return MathUtils.getPolylineLength(path);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:20,代码来源:ModeAutoFragment.java

示例3: onGuidedClick

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void onGuidedClick(LatLong coord) {
    final Drone drone = getDrone();
    final FollowState followState = drone.getAttribute(AttributeType.FOLLOW_STATE);
    if (followState != null && followState.isEnabled() && followState.getMode().hasParam(FollowType.EXTRA_FOLLOW_ROI_TARGET)) {
        Toast.makeText(getContext(), R.string.guided_scan_roi_set_message, Toast.LENGTH_LONG).show();

        final double roiHeight = roiHeightWheel.getCurrentValue().toBase().getValue();
        final LatLongAlt roiCoord = new LatLongAlt(coord.getLatitude(), coord.getLongitude(), roiHeight);

        pushROITargetToVehicle(drone, roiCoord);
        updateROITargetMarker(coord);
    } else {
        super.onGuidedClick(coord);
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:17,代码来源:ModeFollowFragment.java

示例4: addFlightPathPoint

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void addFlightPathPoint(final LatLongAlt coord) {
    final LatLng position = MapUtils.coordToLatLng(coord);

    getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap googleMap) {
            if (showFlightPath) {
                if (flightPath == null) {
                    PolylineOptions flightPathOptions = new PolylineOptions();
                    flightPathOptions.color(FLIGHT_PATH_DEFAULT_COLOR)
                            .width(FLIGHT_PATH_DEFAULT_WIDTH).zIndex(1);
                    flightPath = googleMap.addPolyline(flightPathOptions);
                }

                List<LatLng> oldFlightPath = flightPath.getPoints();
                oldFlightPath.add(position);
                flightPath.setPoints(oldFlightPath);
            }
        }
    });
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:23,代码来源:GoogleMapFragment.java

示例5: onApiConnected

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void onApiConnected() {
    final Drone drone = getDrone();

    if (mAltitudeWheel != null) {
        GuidedState guidedState = drone.getAttribute(AttributeType.GUIDED_STATE);
        LatLongAlt coordinate = guidedState == null ? null : guidedState.getCoordinate();

        final LengthUnit initialValue = getLengthUnitProvider().boxBaseValueToTarget(
                Math.max(guidedState == null
                                ? DEFAULT_ALTITUDE
                                : coordinate == null ? DEFAULT_ALTITUDE : coordinate.getAltitude(),
                        DEFAULT_ALTITUDE));
        mAltitudeWheel.setCurrentValue(initialValue);
    }

    parentActivity.setGuidedClickListener(this);
    Type droneType = drone.getAttribute(AttributeType.TYPE);
    if(droneType.getDroneType() == Type.TYPE_ROVER){
        mAltitudeWheel.setVisibility(View.GONE);
    }
    else{
        mAltitudeWheel.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:26,代码来源:ModeGuidedFragment.java

示例6: updateDistanceFromHome

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
protected void updateDistanceFromHome() {
    TextView distanceTextView = (TextView) findViewById(R.id.distanceValueTextView);
    Altitude droneAltitude = this.drone.getAttribute(AttributeType.ALTITUDE);
    double vehicleAltitude = droneAltitude.getAltitude();
    Gps droneGps = this.drone.getAttribute(AttributeType.GPS);
    LatLong vehiclePosition = droneGps.getPosition();

    double distanceFromHome = 0;

    if (droneGps.isValid()) {
        LatLongAlt vehicle3DPosition = new LatLongAlt(vehiclePosition.getLatitude(), vehiclePosition.getLongitude(), vehicleAltitude);
        Home droneHome = this.drone.getAttribute(AttributeType.HOME);
        distanceFromHome = distanceBetweenPoints(droneHome.getCoordinate(), vehicle3DPosition);
    } else {
        distanceFromHome = 0;
    }

    distanceTextView.setText(String.format("%3.1f", distanceFromHome) + "m");
}
 
开发者ID:3drobotics,项目名称:DroneKit-Android-Starter,代码行数:20,代码来源:MainActivity.java

示例7: onCreateView

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
	final View view = inflater.inflate(R.layout.fragment_drone_map, viewGroup, false);
	updateMapFragment();

	if(bundle != null){
		flightPathPoints.clear();
		List<LatLongAlt> flightPoints = (List<LatLongAlt>) bundle.getSerializable(EXTRA_DRONE_FLIGHT_PATH);
		if(flightPoints != null && !flightPoints.isEmpty()){
               flightPathPoints.addAll(flightPoints);
		}
	}

	return view;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:16,代码来源:DroneMap.java

示例8: updateFlightPath

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
private void updateFlightPath(){
    if(showFlightPath()) {
        LatLongAlt currentFlightPoint = getCurrentFlightPoint();
        if(currentFlightPoint != null){
            mMapFragment.addFlightPathPoint(currentFlightPoint);
            flightPathPoints.add(currentFlightPoint);
        }
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:10,代码来源:DroneMap.java

示例9: getCurrentFlightPoint

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
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;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:11,代码来源:DroneMap.java

示例10: getTotalMissionLength

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
private double getTotalMissionLength(){
    List<MissionItem> missionItems = mission.getMissionItems();
    List<LatLong> path = new ArrayList<LatLong>();
    for(int i = 0; i < missionItems.size(); i++){
        MissionItem item = missionItems.get(i);
        if(item instanceof MissionItem.SpatialItem){
            MissionItem.SpatialItem spatialItem = (MissionItem.SpatialItem)item;
            LatLongAlt coordinate = spatialItem.getCoordinate();
            path.add(new LatLong(coordinate.getLatitude(), coordinate.getLongitude()));
        }

    }
    return MathUtils.getPolylineLength(path);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:15,代码来源:ModeAutoFragment.java

示例11: onApiConnected

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void onApiConnected() {
    final Drone drone = getDrone();

    if (mAltitudeWheel != null) {
        final DroidPlannerPrefs dpPrefs = getAppPrefs();

        final double maxAlt = dpPrefs.getMaxAltitude();
        final double minAlt = dpPrefs.getMinAltitude();
        final double defaultAlt = dpPrefs.getDefaultAltitude();

        GuidedState guidedState = drone.getAttribute(AttributeType.GUIDED_STATE);
        LatLongAlt coordinate = guidedState == null ? null : guidedState.getCoordinate();

        final double baseValue = Math.min(maxAlt,
                Math.max(minAlt, coordinate == null ? defaultAlt : coordinate.getAltitude()));
        final LengthUnit initialValue = getLengthUnitProvider().boxBaseValueToTarget(baseValue);
        mAltitudeWheel.setCurrentValue(initialValue);
    }

    parent.setGuidedClickListener(this);
    Type droneType = drone.getAttribute(AttributeType.TYPE);
    if (droneType.getDroneType() == Type.TYPE_ROVER) {
        mAltitudeWheel.setVisibility(View.GONE);
    } else {
        mAltitudeWheel.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:29,代码来源:ModeGuidedFragment.java

示例12: onScrollingEnded

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
public void onScrollingEnded(CardWheelHorizontalView cardWheel, LengthUnit oldValue, LengthUnit newValue) {
    final Drone drone = getDrone();
    switch (cardWheel.getId()) {
        case R.id.radius_spinner:
            if (drone.isConnected()) {
                Bundle params = new Bundle();
                params.putDouble(FollowType.EXTRA_FOLLOW_RADIUS, newValue.toBase().getValue());
                FollowApi.getApi(drone).updateFollowParams(params);
            }
            break;

        case R.id.roi_height_spinner:
            if (drone.isConnected()) {
                final LatLongAlt roiCoord = roiMarkerInfo.getPosition();
                if (roiCoord != null) {
                    roiCoord.setAltitude(newValue.toBase().getValue());
                    pushROITargetToVehicle(drone, roiCoord);
                }
            }
            break;

        default:
            super.onScrollingEnded(cardWheel, oldValue, newValue);
            break;
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:28,代码来源:ModeFollowFragment.java

示例13: pushROITargetToVehicle

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
private void pushROITargetToVehicle(Drone drone, LatLongAlt roiCoord) {
    if (roiCoord == null)
        return;

    Bundle params = new Bundle();
    params.putParcelable(FollowType.EXTRA_FOLLOW_ROI_TARGET, roiCoord);
    FollowApi.getApi(drone).updateFollowParams(params);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:9,代码来源:ModeFollowFragment.java

示例14: getCurrentFlightPoint

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
@Override
protected LatLongAlt getCurrentFlightPoint(){
    LatLongAlt space = super.getCurrentFlightPoint();
    if (space != null) {
        return new SpaceTime(space, System.currentTimeMillis());
    }
    return null;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:9,代码来源:FlightMapFragment.java

示例15: updateHomeDistance

import com.o3dr.services.android.lib.coordinate.LatLongAlt; //导入依赖的package包/类
private void updateHomeDistance(){
    if(distanceView == null && distanceLabelView == null)
        return;

    boolean hideDistanceInfo = true;

    Drone drone = getDrone();
    Home home = drone == null ? null : drone.<Home>getAttribute(AttributeType.HOME);

    if(home != null && home.isValid() && mSelectedProxies.size() == 1) {
        MissionItemProxy itemProxy = mSelectedProxies.get(0);
        MissionItem item = itemProxy.getMissionItem();
        if(item instanceof MissionItem.SpatialItem) {
            LatLongAlt itemCoordinate = ((MissionItem.SpatialItem)item).getCoordinate();
            LatLongAlt homeCoordinate = home.getCoordinate();
            double homeDistance = MathUtils.getDistance3D(homeCoordinate, itemCoordinate);
            if(homeDistance > 0) {
                hideDistanceInfo = false;

                if (distanceView != null) {
                    distanceView.setText(getLengthUnitProvider().boxBaseValueToTarget(homeDistance).toString());
                    distanceView.setVisibility(View.VISIBLE);

                    if (distanceLabelView != null) {
                        distanceLabelView.setVisibility(View.VISIBLE);
                    }
                }
            }
        }
    }

    if(hideDistanceInfo){
        if(distanceView != null)
            distanceView.setVisibility(View.GONE);

        if(distanceLabelView != null){
            distanceLabelView.setVisibility(View.GONE);
        }
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:41,代码来源:MissionDetailFragment.java


注:本文中的com.o3dr.services.android.lib.coordinate.LatLongAlt类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。