-2
我从无人机套件此源代码,我试图进行硬编码特定坐标的特定位置,使我们的无人机起飞,将在同一地点降落。这里要说的是,我与后无人驾驶飞机的武装,并准备去用户可以点击一个按钮选项链接代码。硬编码一个航点到无人机套件
public void onBtnbringmymail(View view) {
State vehicleState = this.drone.getAttribute(AttributeType.STATE);
if (vehicleState.isFlying()) {
// Land
VehicleApi.getApi(this.drone).setVehicleMode(VehicleMode.COPTER_LAND, new SimpleCommandListener() {
@Override
public void onError(int executionError) {
alertUser("Unable to land the vehicle.");
}
@Override
public void onTimeout() {
alertUser("Unable to land the vehicle.");
}
});
} else if (vehicleState.isArmed()) {
// Take off
ControlApi.getApi(this.drone).takeoff(10, new AbstractCommandListener() {
@Override
public void onSuccess() {
alertUser("Taking off...");
}
@Override
public void onError(int i) {
alertUser("Unable to take off.");
}
@Override
public void onTimeout() {
alertUser("Unable to take off.");
}
});
} else if (!vehicleState.isConnected()) {
// Connect
alertUser("Connect to a drone first");
} else {
// Connected but not Armed
VehicleApi.getApi(this.drone).arm(true, false, new SimpleCommandListener() {
@Override
public void onError(int executionError) {
alertUser("Unable to arm vehicle.");
}
@Override
public void onTimeout() {
alertUser("Arming operation timed out.");
}
});
}
}
什么是你的问题? – Korashen
如何添加如果与坐标功能的语句是活跃的,当用户按下从UI一个按钮来调用无人驾驶飞机去其是上环已经宣布与预定坐标的具体位置? –
如果无人机的武装,起飞,飞向(纬度,经度)和土地 –