Commit 0c233e8e by gdj

init GeoFlyApi

parents
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
/.mvn/
/mvnw
/mvnw.cmd
/logs/
/src/test/
MIT License
Copyright (c) 2022 DJI-SDK
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# DJI Cloud API
## What is the DJI Cloud API?
The launch of the Cloud API mainly solves the problem of developers reinventing the wheel. For developers who do not need in-depth customization of APP, they can directly use DJI Pilot2 to communicate with the third cloud platform, and developers can focus on the development and implementation of cloud service interfaces.
## Docker
If you don't want to install the development environment, you can try deploying with docker. [Click the link to download.](https://terra-sz-hc1pro-cloudapi.oss-cn-shenzhen.aliyuncs.com/c0af9fe0d7eb4f35a8fe5b695e4d0b96/docker/cloud_api_sample_docker.zip)
## Usage
For more documentation, please visit the [DJI Developer Documentation](https://developer.dji.com/doc/cloud-api-tutorial/cn/).
## Latest Release
Cloud API 1.10.0 was released on 7 Apr 2024. For more information, please visit the [Release Note](https://developer.dji.com/doc/cloud-api-tutorial/cn/).
## License
Cloud API is MIT-licensed. Please refer to the LICENSE file for more information.
{
"id": "8296f786-0eeb-41f9-b52f-da3d64ec8718",
"name": "Cloud API Demo",
"values": [
{
"key": "ip",
"value": "localhost",
"type": "default",
"enabled": true
},
{
"key": "port",
"value": "6789",
"enabled": true
},
{
"key": "workspace_id",
"value": "e3dea0f5-37f2-4d79-ae58-490af3228069",
"enabled": true
},
{
"key": "base_url",
"value": "http://{{ip}}:{{port}}",
"enabled": true
},
{
"key": "element_group_id",
"value": "e3dea0f5-37f2-4d79-ae58-490af3228060",
"enabled": true
},
{
"key": "media_version",
"value": "/media/api/v1",
"enabled": true
},
{
"key": "manage_version",
"value": "/manage/api/v1",
"enabled": true
},
{
"key": "map_version",
"value": "/map/api/v1",
"enabled": true
},
{
"key": "wayline_version",
"value": "/wayline/api/v1",
"enabled": true
},
{
"key": "storage_version",
"value": "/storage/api/v1",
"enabled": true
},
{
"key": "control_version",
"value": "/control/api/v1",
"type": "default",
"enabled": true
},
{
"key": "device_sn",
"value": "xxxxxxxxxx",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2022-09-23T03:53:25.999Z",
"_postman_exported_using": "Postman/9.31.0"
}
\ No newline at end of file
# 如何接入CloudSDK
### 1. 在组件扫描中增加包名:com.dji.sdk
### [2. 连接MQTT](#如何连接MQTT)
### [3. 实现SDK 的方法](#如何实现SDK的方法)
### [4. 调用SDK 的方法](#如何调用SDK的方法)
## 如何连接MQTT
- 在spring容器中注入MqttConnectOptions和MqttPahoClientFactory;
![1](./image/6.png)
- 在application.yml中配置cloud-sdk.mqtt.inbound-topic,未配置则不进行初始化订阅。
## 如何实现SDK的方法
- 定义一个类,继承com.dji.sdk.cloudapi.*.api包中的抽象类;
- 重写具体的方法以实现功能;
- 将定义的类放入spring容器中,由spring管理bean的生命周期。
### 【设备上线】示例:
- 定义一个类:SDKDeviceService 继承AbstractDeviceService;
![1](./image/1.png)
- 重写方法updateTopoOnline,实现设备上线功能。
![1](./image/2.png)
## 如何调用SDK的方法
- 定义一个类,继承com.dji.sdk.cloudapi.*.api包中的抽象类;
- 在需要调用的类中注入该类;
- 调用具体的方法。
### 【航线预下发命令】示例:
- 定义一个类:SDKWaylineService 继承 AbstractWaylineService;
![1](./image/3.png)
- 在WaylineJobServiceImpl中注入该类;
![1](./image/4.png)
- 调用下发命令的方法:
![1](./image/5.png)
## 如何实现CloudAPI 定义的http 接口
- 定义一个类,实现com.dji.sdk.cloudapi.*.api包中的http接口类;
- 重写具体的方法以实现接口,无需定义请求地址和方法等数据。
![1](./image/7.png)
## 如何查看CloudAPI 定义的所有http 接口
- 启动程序
- 浏览器打开:http://localhost:6789/swagger-ui/index.html
## 如何接入WebSocket
- CloudSDK 已经定义了WebSocket服务,但是没有实现WebSocket管理。默认地址为:http://localhost:6789/api/v1/ws
- 自定义接入参考:com.dji.sample.component.websocket.config
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>cloud-api-sample</artifactId>
<groupId>com.dji</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-sdk</artifactId>
<version>${cloud-sdk.revision}</version>
<dependencies>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.dji.sdk.annotations;
import com.dji.sdk.config.version.CloudSDKVersionEnum;
import com.dji.sdk.config.version.GatewayTypeEnum;
import java.lang.annotation.*;
/**
* @author sean
* @version 1.7
* @date 2023/5/22
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
public @interface CloudSDKVersion {
CloudSDKVersionEnum since() default CloudSDKVersionEnum.V0_0_1;
CloudSDKVersionEnum deprecated() default CloudSDKVersionEnum.V99;
GatewayTypeEnum[] include() default {};
GatewayTypeEnum[] exclude() default {};
}
package com.dji.sdk.cloudapi.airsense;
/**
* @author sean
* @version 1.7
* @date 2023/10/16
*/
public class AirsenseWarning {
/**
* ICAO civil aviation aircraft address
*/
private String icao;
/**
* The higher the danger level, the more dangerous it is.
* For levels greater than or equal to 3, it is recommended for aircraft to take evasive action.
*/
private WarningLevelEnum warningLevel;
/**
* The latitude of aircraft location is angular values.
* Negative values for south latitude and positive values for north latitude.
* It is accurate to six decimal places.
*/
private Float latitude;
/**
* The longitude of aircraft location is angular values.
* Negative values for west longitude and positive values for east longitude.
* It is accurate to six decimal places.
*/
private Float longitude;
/**
* Absolute height of flight.
* Unit: meter
*/
private Integer altitude;
/**
* Absolute height type
*/
private AltitudeTypeEnum altitudeType;
/**
* The angle of heading is angular values.
* 0 is north. 90 is east.
* It is accurate to one decimal places.
*/
private Float heading;
/**
* Relative height of flight to aircraft.
* Unit: meter
*/
private Integer relativeAltitude;
/**
* Relative height change trend
*/
private VertTrendEnum vertTrend;
/**
* Horizontal distance to aircraft.
* Unit: meter
*/
private Integer distance;
public AirsenseWarning() {
}
@Override
public String toString() {
return "AirsenseWarning{" +
"icao='" + icao + '\'' +
", warningLevel=" + warningLevel +
", latitude=" + latitude +
", longitude=" + longitude +
", altitude=" + altitude +
", altitudeType=" + altitudeType +
", heading=" + heading +
", relativeAltitude=" + relativeAltitude +
", vertTrend=" + vertTrend +
", distance=" + distance +
'}';
}
public String getIcao() {
return icao;
}
public AirsenseWarning setIcao(String icao) {
this.icao = icao;
return this;
}
public WarningLevelEnum getWarningLevel() {
return warningLevel;
}
public AirsenseWarning setWarningLevel(WarningLevelEnum warningLevel) {
this.warningLevel = warningLevel;
return this;
}
public Float getLatitude() {
return latitude;
}
public AirsenseWarning setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public AirsenseWarning setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Integer getAltitude() {
return altitude;
}
public AirsenseWarning setAltitude(Integer altitude) {
this.altitude = altitude;
return this;
}
public AltitudeTypeEnum getAltitudeType() {
return altitudeType;
}
public AirsenseWarning setAltitudeType(AltitudeTypeEnum altitudeType) {
this.altitudeType = altitudeType;
return this;
}
public Float getHeading() {
return heading;
}
public AirsenseWarning setHeading(Float heading) {
this.heading = heading;
return this;
}
public Integer getRelativeAltitude() {
return relativeAltitude;
}
public AirsenseWarning setRelativeAltitude(Integer relativeAltitude) {
this.relativeAltitude = relativeAltitude;
return this;
}
public VertTrendEnum getVertTrend() {
return vertTrend;
}
public AirsenseWarning setVertTrend(VertTrendEnum vertTrend) {
this.vertTrend = vertTrend;
return this;
}
public Integer getDistance() {
return distance;
}
public AirsenseWarning setDistance(Integer distance) {
this.distance = distance;
return this;
}
}
package com.dji.sdk.cloudapi.airsense;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/10/16
*/
public enum AltitudeTypeEnum {
ELLIPSOID_HEIGHT(0),
ABOVE_SEA_LEVEL(1),
;
private final int type;
AltitudeTypeEnum(int type) {
this.type = type;
}
@JsonValue
public int getType() {
return type;
}
@JsonCreator
public static AltitudeTypeEnum find(int type) {
return Arrays.stream(values()).filter(typeEnum -> typeEnum.type == type).findAny()
.orElseThrow(() -> new CloudSDKException(AltitudeTypeEnum.class, type));
}
}
package com.dji.sdk.cloudapi.airsense;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/10/16
*/
public enum VertTrendEnum {
RELATIVE_HEIGHT_UNCHANGED(0),
RELATIVE_HEIGHT_INCREASE(1),
RELATIVE_HEIGHT_DECREASE(2),
;
private final int trend;
VertTrendEnum(int trend) {
this.trend = trend;
}
@JsonValue
public int getTrend() {
return trend;
}
@JsonCreator
public static VertTrendEnum find(int trend) {
return Arrays.stream(values()).filter(trendEnum -> trendEnum.trend == trend).findAny()
.orElseThrow(() -> new CloudSDKException(VertTrendEnum.class, trend));
}
}
package com.dji.sdk.cloudapi.airsense;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/10/16
*/
public enum WarningLevelEnum {
ZERO(0),
ONE(1),
TWO(2),
THREE(3),
FOUR(4),
;
private final int level;
WarningLevelEnum(int level) {
this.level = level;
}
@JsonValue
public int getLevel() {
return level;
}
@JsonCreator
public static WarningLevelEnum find(int level) {
return Arrays.stream(values()).filter(levelEnum -> levelEnum.level == level).findAny()
.orElseThrow(() -> new CloudSDKException(WarningLevelEnum.class, level));
}
}
package com.dji.sdk.cloudapi.airsense.api;
import com.dji.sdk.annotations.CloudSDKVersion;
import com.dji.sdk.cloudapi.airsense.AirsenseWarning;
import com.dji.sdk.config.version.CloudSDKVersionEnum;
import com.dji.sdk.mqtt.ChannelName;
import com.dji.sdk.mqtt.MqttReply;
import com.dji.sdk.mqtt.events.TopicEventsRequest;
import com.dji.sdk.mqtt.events.TopicEventsResponse;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import java.util.List;
/**
* @author sean
* @version 1.7
* @date 2023/10/16
*/
public abstract class AbstractAirsenseService {
/**
* cloud-custom data transmit from psdk
* @param request data
* @param headers The headers for a {@link Message}.
* @return events_reply
*/
@ServiceActivator(inputChannel = ChannelName.INBOUND_EVENTS_AIRSENSE_WARNING, outputChannel = ChannelName.OUTBOUND_EVENTS)
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
public TopicEventsResponse<MqttReply> airsenseWarning(TopicEventsRequest<List<AirsenseWarning>> request, MessageHeaders headers) {
throw new UnsupportedOperationException("airsenseWarning not implemented");
}
}
package com.dji.sdk.cloudapi.config;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.3
* @date 2022/11/10
*/
public enum ConfigScopeEnum {
PRODUCT("product");
private final String scope;
ConfigScopeEnum(String scope) {
this.scope = scope;
}
@JsonValue
public String getScope() {
return scope;
}
@JsonCreator
public static ConfigScopeEnum find(String scope) {
return Arrays.stream(values()).filter(scopeEnum -> scopeEnum.scope.equals(scope)).findAny()
.orElseThrow(() -> new CloudSDKException(ConfigScopeEnum.class, scope));
}
}
package com.dji.sdk.cloudapi.config;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.3
* @date 2022/11/10
*/
public enum ConfigTypeEnum {
JSON("json");
private final String type;
ConfigTypeEnum(String type) {
this.type = type;
}
@JsonValue
public String getType() {
return type;
}
@JsonCreator
public static ConfigTypeEnum find(String type) {
return Arrays.stream(values()).filter(typeEnum -> typeEnum.type.equals(type)).findAny()
.orElseThrow(() -> new CloudSDKException(ConfigTypeEnum.class, type));
}
}
package com.dji.sdk.cloudapi.config;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.3
* @date 2022/11/10
*/
public class ProductConfigResponse extends BaseModel {
private String ntpServerHost;
@NotNull
private String appId;
@NotNull
private String appKey;
@NotNull
private String appLicense;
public ProductConfigResponse() {
}
@Override
public String toString() {
return "ProductConfigResponse{" +
"ntpServerHost='" + ntpServerHost + '\'' +
", appId='" + appId + '\'' +
", appKey='" + appKey + '\'' +
", appLicense='" + appLicense + '\'' +
'}';
}
public String getNtpServerHost() {
return ntpServerHost;
}
public ProductConfigResponse setNtpServerHost(String ntpServerHost) {
this.ntpServerHost = ntpServerHost;
return this;
}
public String getAppId() {
return appId;
}
public ProductConfigResponse setAppId(String appId) {
this.appId = appId;
return this;
}
public String getAppKey() {
return appKey;
}
public ProductConfigResponse setAppKey(String appKey) {
this.appKey = appKey;
return this;
}
public String getAppLicense() {
return appLicense;
}
public ProductConfigResponse setAppLicense(String appLicense) {
this.appLicense = appLicense;
return this;
}
}
package com.dji.sdk.cloudapi.config;
/**
* @author sean
* @version 1.3
* @date 2022/11/10
*/
public class RequestsConfigRequest {
private ConfigTypeEnum configType;
private ConfigScopeEnum configScope;
public RequestsConfigRequest() {
}
@Override
public String toString() {
return "RequestsConfigRequest{" +
"configType=" + configType +
", configScope=" + configScope +
'}';
}
public ConfigTypeEnum getConfigType() {
return configType;
}
public RequestsConfigRequest setConfigType(ConfigTypeEnum configType) {
this.configType = configType;
return this;
}
public ConfigScopeEnum getConfigScope() {
return configScope;
}
public RequestsConfigRequest setConfigScope(ConfigScopeEnum configScope) {
this.configScope = configScope;
return this;
}
}
package com.dji.sdk.cloudapi.config.api;
import com.dji.sdk.cloudapi.config.ProductConfigResponse;
import com.dji.sdk.cloudapi.config.RequestsConfigRequest;
import com.dji.sdk.mqtt.ChannelName;
import com.dji.sdk.mqtt.requests.TopicRequestsRequest;
import com.dji.sdk.mqtt.requests.TopicRequestsResponse;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public abstract class AbstractConfigService {
/**
* Inform of file uploading progress
* @param request data
* @param headers The headers for a {@link Message}.
* @return requests_reply
*/
@ServiceActivator(inputChannel = ChannelName.INBOUND_REQUESTS_CONFIG, outputChannel = ChannelName.OUTBOUND_REQUESTS)
public TopicRequestsResponse<ProductConfigResponse> requestsConfig(TopicRequestsRequest<RequestsConfigRequest> request, MessageHeaders headers) {
throw new UnsupportedOperationException("requestsConfig not implemented");
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraAimRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private CameraTypeEnum cameraType;
/**
* true: Lock the gimbal, the gimbal and the drone rotate together.
* false: Only the gimbal rotates, but the drone does not.
*/
@NotNull
private Boolean locked;
/**
* upper left corner as center point
*/
@Min(0)
@Max(1)
private Float x;
@Min(0)
@Max(1)
private Float y;
public CameraAimRequest() {
}
@Override
public String toString() {
return "CameraAimRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", locked=" + locked +
", x=" + x +
", y=" + y +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraAimRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public CameraTypeEnum getCameraType() {
return cameraType;
}
public CameraAimRequest setCameraType(CameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public Boolean getLocked() {
return locked;
}
public CameraAimRequest setLocked(Boolean locked) {
this.locked = locked;
return this;
}
public Float getX() {
return x;
}
public CameraAimRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public CameraAimRequest setY(Float y) {
this.y = y;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraExposureModeSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ExposureCameraTypeEnum cameraType;
@NotNull
private ExposureModeEnum exposureMode;
public CameraExposureModeSetRequest() {
}
@Override
public String toString() {
return "CameraExposureModeSetRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", exposureMode=" + exposureMode +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraExposureModeSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ExposureCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraExposureModeSetRequest setCameraType(ExposureCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public ExposureModeEnum getExposureMode() {
return exposureMode;
}
public CameraExposureModeSetRequest setExposureMode(ExposureModeEnum exposureMode) {
this.exposureMode = exposureMode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraExposureSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ExposureCameraTypeEnum cameraType;
@NotNull
private ExposureValueEnum exposureValue;
public CameraExposureSetRequest() {
}
@Override
public String toString() {
return "CameraExposureSetRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", exposureValue=" + exposureValue +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraExposureSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ExposureCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraExposureSetRequest setCameraType(ExposureCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public ExposureValueEnum getExposureValue() {
return exposureValue;
}
public CameraExposureSetRequest setExposureValue(ExposureValueEnum exposureValue) {
this.exposureValue = exposureValue;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraFocalLengthSetRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ZoomCameraTypeEnum cameraType;
@Min(2)
@Max(200)
@NotNull
private Float zoomFactor;
public CameraFocalLengthSetRequest() {
}
@Override
public String toString() {
return "CameraFocalLengthSetRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", zoomFactor=" + zoomFactor +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraFocalLengthSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ZoomCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraFocalLengthSetRequest setCameraType(ZoomCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public Float getZoomFactor() {
return zoomFactor;
}
public CameraFocalLengthSetRequest setZoomFactor(Float zoomFactor) {
this.zoomFactor = zoomFactor;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraFocusModeSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ExposureCameraTypeEnum cameraType;
@NotNull
private FocusModeEnum focusMode;
public CameraFocusModeSetRequest() {
}
@Override
public String toString() {
return "CameraFocusModeSetRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", focusMode=" + focusMode +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraFocusModeSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ExposureCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraFocusModeSetRequest setCameraType(ExposureCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public FocusModeEnum getFocusMode() {
return focusMode;
}
public CameraFocusModeSetRequest setFocusMode(FocusModeEnum focusMode) {
this.focusMode = focusMode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraFocusValueSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ExposureCameraTypeEnum cameraType;
@NotNull
private Integer focusValue;
public CameraFocusValueSetRequest() {
}
@Override
public String toString() {
return "CameraFocusValueSetRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", focusValue=" + focusValue +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraFocusValueSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ExposureCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraFocusValueSetRequest setCameraType(ExposureCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public Integer getFocusValue() {
return focusValue;
}
public CameraFocusValueSetRequest setFocusValue(Integer focusValue) {
this.focusValue = focusValue;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.7
* @date 2023/10/12
*/
public class CameraLookAtRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
/**
* Whether the relative location of drone head and gimbal is locked
*/
@NotNull
private Boolean locked;
/**
* The latitude of target point is angular values.
* Negative values for south latitude and positive values for north latitude.
* It is accurate to six decimal places.
*/
@Min(-90)
@Max(90)
@NotNull
private Float latitude;
/**
* The latitude of target point is angular values.
* Negative values for west longitude and positive values for east longitude.
* It is accurate to six decimal places.
*/
@NotNull
@Min(-180)
@Max(180)
private Float longitude;
/**
* Ellipsoid height
*/
@NotNull
@Min(2)
@Max(10000)
private Float height;
public CameraLookAtRequest() {
}
@Override
public String toString() {
return "CameraLookAtRequest{" +
"payloadIndex=" + payloadIndex +
", locked=" + locked +
", latitude=" + latitude +
", longitude=" + longitude +
", height=" + height +
'}';
}
public CameraLookAtRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public CameraLookAtRequest setLocked(Boolean locked) {
this.locked = locked;
return this;
}
public CameraLookAtRequest setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public CameraLookAtRequest setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public CameraLookAtRequest setHeight(Float height) {
this.height = height;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.CameraModeEnum;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraModeSwitchRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private CameraModeEnum cameraMode;
public CameraModeSwitchRequest() {
}
@Override
public String toString() {
return "CameraModeSwitchRequest{" +
"payloadIndex=" + payloadIndex +
", cameraMode=" + cameraMode +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraModeSwitchRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public CameraModeEnum getCameraMode() {
return cameraMode;
}
public CameraModeSwitchRequest setCameraMode(CameraModeEnum cameraMode) {
this.cameraMode = cameraMode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraPhotoStopRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
public CameraPhotoStopRequest() {
}
@Override
public String toString() {
return "CameraPhotoStopRequest{" +
"payloadIndex=" + payloadIndex +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraPhotoStopRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.wayline.FlighttaskStatusEnum;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraPhotoTakeProgress {
private PhotoTakeProgressExt ext;
private PhotoTakeProgressData progress;
private FlighttaskStatusEnum status;
public CameraPhotoTakeProgress() {
}
@Override
public String toString() {
return "CameraPhotoTakeProgress{" +
"ext=" + ext +
", progress=" + progress +
", status=" + status +
'}';
}
public PhotoTakeProgressExt getExt() {
return ext;
}
public CameraPhotoTakeProgress setExt(PhotoTakeProgressExt ext) {
this.ext = ext;
return this;
}
public PhotoTakeProgressData getProgress() {
return progress;
}
public CameraPhotoTakeProgress setProgress(PhotoTakeProgressData progress) {
this.progress = progress;
return this;
}
public FlighttaskStatusEnum getStatus() {
return status;
}
public CameraPhotoTakeProgress setStatus(FlighttaskStatusEnum status) {
this.status = status;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraPhotoTakeRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
public CameraPhotoTakeRequest() {
}
@Override
public String toString() {
return "CameraPhotoTakeRequest{" +
"payloadIndex=" + payloadIndex +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraPhotoTakeRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class CameraPointFocusActionRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private ExposureCameraTypeEnum cameraType;
/**
* The coordinate x of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the horizontal direction is x.
*/
@NotNull
@Min(0)
@Max(1)
private Float x;
/**
* The coordinate y of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the vertical direction is y.
*/
@NotNull
@Min(0)
@Max(1)
private Float y;
public CameraPointFocusActionRequest() {
}
@Override
public String toString() {
return "CameraPointFocusActionRequest{" +
"payloadIndex=" + payloadIndex +
", cameraType=" + cameraType +
", x=" + x +
", y=" + y +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraPointFocusActionRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public ExposureCameraTypeEnum getCameraType() {
return cameraType;
}
public CameraPointFocusActionRequest setCameraType(ExposureCameraTypeEnum cameraType) {
this.cameraType = cameraType;
return this;
}
public Float getX() {
return x;
}
public CameraPointFocusActionRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public CameraPointFocusActionRequest setY(Float y) {
this.y = y;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraRecordingStartRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
public CameraRecordingStartRequest() {
}
@Override
public String toString() {
return "CameraRecordingStartRequest{" +
"payloadIndex=" + payloadIndex +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraRecordingStartRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class CameraRecordingStopRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
public CameraRecordingStopRequest() {
}
@Override
public String toString() {
return "CameraRecordingStopRequest{" +
"payloadIndex=" + payloadIndex +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraRecordingStopRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.7
* @date 2023/10/12
*/
public class CameraScreenSplitRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
/**
* Whether enable the screen split
*/
@NotNull
private Boolean enable;
public CameraScreenSplitRequest() {
}
@Override
public String toString() {
return "CameraScreenSplitRequest{" +
"payloadIndex=" + payloadIndex +
", enable=" + enable +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public CameraScreenSplitRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public Boolean getEnable() {
return enable;
}
public CameraScreenSplitRequest setEnable(Boolean enable) {
this.enable = enable;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/3
*/
public enum CameraTypeEnum {
ZOOM("zoom"),
WIDE("wide"),
IR("ir");
private final String type;
CameraTypeEnum(String type) {
this.type = type;
}
@JsonValue
public String getType() {
return type;
}
@JsonCreator
public static CameraTypeEnum find(String type) {
return Arrays.stream(values()).filter(typeEnum -> typeEnum.type.equals(type)).findAny()
.orElseThrow(() -> new CloudSDKException(CameraTypeEnum.class, type));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/8/7
*/
public enum CommanderFlightModeEnum {
SMART_HEIGHT(0),
SETTING_HEIGHT(1);
private final int mode;
CommanderFlightModeEnum(int mode) {
this.mode = mode;
}
@JsonValue
public int getMode() {
return mode;
}
@JsonCreator
public static CommanderFlightModeEnum find(int mode) {
return Arrays.stream(values()).filter(modeEnum -> modeEnum.mode == mode).findAny()
.orElseThrow(() -> new CloudSDKException(CommanderFlightModeEnum.class, mode));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/6/6
*/
public enum CommanderModeLostActionEnum {
CONTINUE(0),
EXECUTE_RC_LOST_ACTION(1);
private final int action;
CommanderModeLostActionEnum(int action) {
this.action = action;
}
@JsonValue
public int getAction() {
return action;
}
@JsonCreator
public static CommanderModeLostActionEnum find(int action) {
return Arrays.stream(values()).filter(actionEnum -> actionEnum.action == action).findAny()
.orElseThrow(() -> new CloudSDKException(CommanderModeLostActionEnum.class, action));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.IErrorInfo;
import com.dji.sdk.mqtt.events.IEventsErrorCode;
import com.dji.sdk.mqtt.services.IServicesErrorCode;
import java.util.Arrays;
/**
* @author sean.zhou
* @version 0.1
* @date 2021/11/25
*/
public enum ControlErrorCodeEnum implements IServicesErrorCode, IEventsErrorCode, IErrorInfo {
SETTING_RTH_FAILED(327000, "Height of return to home setting failed."),
SETTING_LOST_ACTION_FAILED(327001, "Signal lost action setting failed."),
OBTAIN_CONTROL_FAILED(327002, "Failed to obtain control."),
DEVICE_OFFLINE(327003, "Failed to obtain control. Device offline."),
DRAG_LIVESTREAM_VIEW_FAILED(327004, "Failed to drag livestream view."),
AIM_FAILED(327005, "Failed to double tab to be AIM."),
TAKE_PHOTO_FAILED(327006, "Failed to take photo."),
START_RECORDING_FAILED(327007, "Failed to start recording."),
STOP_RECORDING_FAILED(327008, "Failed to stop recording."),
SWITCH_CAMERA_MODE_FAILED(327009, "Failed to switch camera modes."),
ZOOM_CAMERA_ZOOM_FAILED(327010, "Failed to zoom in/out with zoom camera."),
IR_CAMERA_ZOOM_FAILED(327011, "Failed to zoom in/out with IR camera."),
DEVICE_LOCK(327012, "Failed to obtain control. Device is locked."),
SETTING_WAYLINE_LOST_ACTION_FAILED(327013, "Wayline signal lost action setting failed."),
GIMBAL_REACH_LIMIT(327014, "Gimbal reached movement limit."),
WRONG_LENS_TYPE(327015, "Invalid camera lens type."),
DRC_ABNORMAL(514300, "DRC abnormal."),
DRC_HEARTBEAT_TIMED_OUT(514301, "DRC heartbeat timed out."),
DRC_CERTIFICATE_ABNORMAL(514302, "DRC certificate is abnormal."),
DRC_LINK_LOST(514303, "DRC link is lost."),
DRC_LINK_REFUSED(514304, "DRC link is refused."),
UNKNOWN(-1, "UNKNOWN"),
;
private final String msg;
private final int code;
ControlErrorCodeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
@Override
public String getMessage() {
return this.msg;
}
@Override
public Integer getCode() {
return this.code;
}
/**
* @param code error code
* @return enumeration object
*/
public static ControlErrorCodeEnum find(int code) {
return Arrays.stream(values()).filter(codeEnum -> codeEnum.code == code).findAny().orElse(UNKNOWN);
}
}
package com.dji.sdk.cloudapi.control;
/**
* @author sean
* @version 1.4
* @date 2023/3/2
*/
public enum ControlMethodEnum {
FLIGHT_AUTHORITY_GRAB("flight_authority_grab"),
PAYLOAD_AUTHORITY_GRAB("payload_authority_grab"),
DRC_MODE_ENTER("drc_mode_enter"),
DRC_MODE_EXIT("drc_mode_exit"),
FLY_TO_POINT("fly_to_point"),
FLY_TO_POINT_STOP("fly_to_point_stop"),
FLY_TO_POINT_UPDATE("fly_to_point_update"),
TAKEOFF_TO_POINT("takeoff_to_point"),
CAMERA_MODE_SWITCH("camera_mode_switch"),
CAMERA_PHOTO_TAKE("camera_photo_take"),
CAMERA_PHOTO_STOP("camera_photo_stop"),
CAMERA_RECORDING_START("camera_recording_start"),
CAMERA_RECORDING_STOP("camera_recording_stop"),
CAMERA_AIM("camera_aim"),
CAMERA_FOCAL_LENGTH_SET("camera_focal_length_set"),
GIMBAL_RESET("gimbal_reset"),
CAMERA_LOOK_AT("camera_look_at"),
CAMERA_SCREEN_SPLIT("camera_screen_split"),
PHOTO_STORAGE_SET("photo_storage_set"),
VIDEO_STORAGE_SET("video_storage_set"),
CAMERA_EXPOSURE_SET("camera_exposure_set"),
CAMERA_EXPOSURE_MODE_SET("camera_exposure_mode_set"),
CAMERA_FOCUS_MODE_SET("camera_focus_mode_set"),
CAMERA_FOCUS_VALUE_SET("camera_focus_value_set"),
IR_METERING_MODE_SET("ir_metering_mode_set"),
IR_METERING_POINT_SET("ir_metering_point_set"),
IR_METERING_AREA_SET("ir_metering_area_set"),
CAMERA_POINT_FOCUS_ACTION("camera_point_focus_action"),
DRONE_CONTROL("drone_control"),
DRONE_EMERGENCY_STOP("drone_emergency_stop"),
HEART_BEAT("heart_beat"),
POI_MODE_ENTER("poi_mode_enter"),
POI_MODE_EXIT("poi_mode_exit"),
POI_CIRCLE_SPEED_SET("poi_circle_speed_set"),
;
private final String method;
ControlMethodEnum(String method) {
this.method = method;
}
public String getMethod() {
return method;
}
}
package com.dji.sdk.cloudapi.control;
import java.util.List;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class DelayInfoPush {
private Integer sdrCmdDelay;
private List<LiveviewDelay> liveviewDelayList;
public DelayInfoPush() {
}
@Override
public String toString() {
return "DelayInfoPush{" +
"sdrCmdDelay=" + sdrCmdDelay +
", liveviewDelayList=" + liveviewDelayList +
'}';
}
public Integer getSdrCmdDelay() {
return sdrCmdDelay;
}
public DelayInfoPush setSdrCmdDelay(Integer sdrCmdDelay) {
this.sdrCmdDelay = sdrCmdDelay;
return this;
}
public List<LiveviewDelay> getLiveviewDelayList() {
return liveviewDelayList;
}
public DelayInfoPush setLiveviewDelayList(List<LiveviewDelay> liveviewDelayList) {
this.liveviewDelayList = liveviewDelayList;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.3
* @date 2023/1/12
*/
public class DrcModeEnterRequest extends BaseModel {
@NotNull
@Valid
private DrcModeMqttBroker mqttBroker;
/**
* range: 1 - 30
*/
@Min(1)
@Max(30)
@NotNull
private Integer osdFrequency;
/**
* range: 1 - 30
*/
@Min(1)
@Max(30)
@NotNull
private Integer hsiFrequency;
public DrcModeEnterRequest() {
}
@Override
public String toString() {
return "DrcModeEnterRequest{" +
"mqttBroker=" + mqttBroker +
", osdFrequency=" + osdFrequency +
", hsiFrequency=" + hsiFrequency +
'}';
}
public DrcModeMqttBroker getMqttBroker() {
return mqttBroker;
}
public DrcModeEnterRequest setMqttBroker(DrcModeMqttBroker mqttBroker) {
this.mqttBroker = mqttBroker;
return this;
}
public Integer getOsdFrequency() {
return osdFrequency;
}
public DrcModeEnterRequest setOsdFrequency(Integer osdFrequency) {
this.osdFrequency = osdFrequency;
return this;
}
public Integer getHsiFrequency() {
return hsiFrequency;
}
public DrcModeEnterRequest setHsiFrequency(Integer hsiFrequency) {
this.hsiFrequency = hsiFrequency;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.3
* @date 2023/1/11
*/
public class DrcModeMqttBroker {
@NotNull
private String address;
@NotNull
private String username;
@NotNull
private String password;
@NotNull
private String clientId;
@NotNull
@Min(1234567890)
@Max(9999999999L)
private Long expireTime;
@NotNull
private Boolean enableTls;
public DrcModeMqttBroker() {
}
@Override
public String toString() {
return "DrcModeMqttBroker{" +
"address='" + address + '\'' +
", username='" + username + '\'' +
", password='" + password + '\'' +
", clientId='" + clientId + '\'' +
", expireTime=" + expireTime +
", enableTls=" + enableTls +
'}';
}
public String getAddress() {
return address;
}
public DrcModeMqttBroker setAddress(String address) {
this.address = address;
return this;
}
public String getUsername() {
return username;
}
public DrcModeMqttBroker setUsername(String username) {
this.username = username;
return this;
}
public String getPassword() {
return password;
}
public DrcModeMqttBroker setPassword(String password) {
this.password = password;
return this;
}
public String getClientId() {
return clientId;
}
public DrcModeMqttBroker setClientId(String clientId) {
this.clientId = clientId;
return this;
}
public Long getExpireTime() {
return expireTime;
}
public DrcModeMqttBroker setExpireTime(Long expireTime) {
this.expireTime = expireTime;
return this;
}
public Boolean getEnableTls() {
return enableTls;
}
public DrcModeMqttBroker setEnableTls(Boolean enableTls) {
this.enableTls = enableTls;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.IErrorInfo;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/17
*/
public enum DrcStatusErrorEnum implements IErrorInfo {
SUCCESS(0, "success"),
MQTT_ERR(514300, "The mqtt connection error."),
HEARTBEAT_TIMEOUT(514301, "The heartbeat times out and the dock disconnects."),
MQTT_CERTIFICATE_ERR(514302, "The mqtt certificate is abnormal and the connection fails."),
MQTT_LOST(514303, "The dock network is abnormal and the mqtt connection is lost."),
MQTT_REFUSE(514304, "The dock connection to mqtt server was refused.");
private final String msg;
private final int code;
DrcStatusErrorEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
@Override
public String getMessage() {
return msg;
}
@Override
public Integer getCode() {
return code;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static DrcStatusErrorEnum find(int code) {
return Arrays.stream(values()).filter(error -> error.code == code).findAny()
.orElseThrow(() -> new CloudSDKException(DrcStatusErrorEnum.class, code));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.DrcStateEnum;
/**
* @author sean
* @version 1.4
* @date 2023/3/17
*/
public class DrcStatusNotify {
private DrcStatusErrorEnum result;
private DrcStateEnum drcState;
public DrcStatusNotify() {
}
@Override
public String toString() {
return "DrcStatusNotify{" +
"result=" + result +
", drcState=" + drcState +
'}';
}
public DrcStatusErrorEnum getResult() {
return result;
}
public DrcStatusNotify setResult(DrcStatusErrorEnum result) {
this.result = result;
return this;
}
public DrcStateEnum getDrcState() {
return drcState;
}
public DrcStatusNotify setDrcState(DrcStateEnum drcState) {
this.drcState = drcState;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class DroneControlRequest extends BaseModel {
@NotNull
private Long seq;
@Min(-17)
@Max(17)
private Float x;
@Min(-17)
@Max(17)
private Float y;
@Min(-4)
@Max(5)
private Float h;
@Min(-90)
@Max(90)
private Float w;
@Min(2)
@Max(10)
private Integer freq;
@Min(100)
@Max(1000)
private Integer delayTime;
public DroneControlRequest() {
}
@Override
public String toString() {
return "DroneControlRequest{" +
"seq=" + seq +
", x=" + x +
", y=" + y +
", h=" + h +
", w=" + w +
", freq=" + freq +
", delayTime=" + delayTime +
'}';
}
public Long getSeq() {
return seq;
}
public DroneControlRequest setSeq(Long seq) {
this.seq = seq;
return this;
}
public Float getX() {
return x;
}
public DroneControlRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public DroneControlRequest setY(Float y) {
this.y = y;
return this;
}
public Float getH() {
return h;
}
public DroneControlRequest setH(Float h) {
this.h = h;
return this;
}
public Float getW() {
return w;
}
public DroneControlRequest setW(Float w) {
this.w = w;
return this;
}
public Integer getFreq() {
return freq;
}
public DroneControlRequest setFreq(Integer freq) {
this.freq = freq;
return this;
}
public Integer getDelayTime() {
return delayTime;
}
public DroneControlRequest setDelayTime(Integer delayTime) {
this.delayTime = delayTime;
return this;
}
}
package com.dji.sdk.cloudapi.control;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class DroneControlResponse {
private Long seq;
public DroneControlResponse() {
}
@Override
public String toString() {
return "DroneControlResponse{" +
"seq=" + seq +
'}';
}
public Long getSeq() {
return seq;
}
public DroneControlResponse setSeq(Long seq) {
this.seq = seq;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum ExposureCameraTypeEnum {
ZOOM("zoom"),
WIDE("wide");
private final String type;
ExposureCameraTypeEnum(String type) {
this.type = type;
}
@JsonValue
public String getType() {
return type;
}
@JsonCreator
public static ExposureCameraTypeEnum find(String type) {
return Arrays.stream(values()).filter(typeEnum -> typeEnum.type.equals(type)).findAny()
.orElseThrow(() -> new CloudSDKException(ExposureCameraTypeEnum.class, type));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum ExposureModeEnum {
AUTO(1),
SHUTTER_PRIORITY(2),
APERTURE_PRIORITY(3),
MANUAL(4),
;
private final int mode;
ExposureModeEnum(int mode) {
this.mode = mode;
}
@JsonValue
public int getMode() {
return mode;
}
@JsonCreator
public static ExposureModeEnum find(int mode) {
return Arrays.stream(values()).filter(modeEnum -> modeEnum.mode == mode).findAny()
.orElseThrow(() -> new CloudSDKException(ExposureModeEnum.class, mode));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum ExposureValueEnum {
MINUS_5_DOT_0(1, "-5.0EV"),
MINUS_4_DOT_7(2, "-4.7EV"),
MINUS_4_DOT_3(3, "-4.3EV"),
MINUS_4_DOT_0(4, "-4.0EV"),
MINUS_3_DOT_7(5, "-3.7EV"),
MINUS_3_DOT_3(6, "-3.3EV"),
MINUS_3_DOT_0(7, "-3.0EV"),
MINUS_2_DOT_7(8, "-2.7EV"),
MINUS_2_DOT_3(9, "-2.3EV"),
MINUS_2_DOT_0(10, "-2.0EV"),
MINUS_1_DOT_7(11, "-1.7EV"),
MINUS_1_DOT_3(12, "-1.3EV"),
MINUS_1_DOT_0(13, "-1.0EV"),
MINUS_0_DOT_7(14, "-0.7EV"),
MINUS_0_DOT_3(15, "-0.3EV"),
_0(16, "0EV"),
_0_DOT_3(17, "0.3EV"),
_0_DOT_7(18, "0.7EV"),
_1_DOT_0(19, "1.0EV"),
_1_DOT_3(20, "1.3EV"),
_1_DOT_7(21, "1.7EV"),
_2_DOT_0(22, "2.0EV"),
_2_DOT_3(23, "2.3EV"),
_2_DOT_7(24, "2.7EV"),
_3_DOT_0(25, "3.0EV"),
_3_DOT_3(26, "3.3EV"),
_3_DOT_7(27, "3.7EV"),
_4_DOT_0(28, "4.0EV"),
_4_DOT_3(29, "4.3EV"),
_4_DOT_7(30, "4.7EV"),
_5_DOT_0(31, "5.0EV"),
FIXED(255, "FIXED"),
;
private final int value;
private final String desc;
ExposureValueEnum(int value, String desc) {
this.value = value;
this.desc = desc;
}
@JsonValue
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
@JsonCreator
public static ExposureValueEnum find(int value) {
return Arrays.stream(values()).filter(valueEnum -> valueEnum.value == value).findAny()
.orElseThrow(() -> new CloudSDKException(ExposureValueEnum.class, value));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.wayline.WaylineErrorCodeEnum;
/**
* @author sean
* @version 1.4
* @date 2023/3/14
*/
public class FlyToPointProgress {
private WaylineErrorCodeEnum result;
private FlyToStatusEnum status;
private String flyToId;
private Integer wayPointIndex;
public FlyToPointProgress() {
}
@Override
public String toString() {
return "FlyToPointProgress{" +
"result=" + result +
", status=" + status +
", flyToId='" + flyToId + '\'' +
", wayPointIndex=" + wayPointIndex +
'}';
}
public WaylineErrorCodeEnum getResult() {
return result;
}
public FlyToPointProgress setResult(WaylineErrorCodeEnum result) {
this.result = result;
return this;
}
public FlyToStatusEnum getStatus() {
return status;
}
public FlyToPointProgress setStatus(FlyToStatusEnum status) {
this.status = status;
return this;
}
public String getFlyToId() {
return flyToId;
}
public FlyToPointProgress setFlyToId(String flyToId) {
this.flyToId = flyToId;
return this;
}
public Integer getWayPointIndex() {
return wayPointIndex;
}
public FlyToPointProgress setWayPointIndex(Integer wayPointIndex) {
this.wayPointIndex = wayPointIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
/**
* @author sean
* @version 1.3
* @date 2023/2/14
*/
public class FlyToPointRequest extends BaseModel {
@Pattern(regexp = "^[^<>:\"/|?*._\\\\]+$")
@NotNull
private String flyToId;
@Min(1)
@Max(15)
@NotNull
private Integer maxSpeed;
/**
* The M30 series only support one point.
*/
@Size(min = 1)
@NotNull
private List<@Valid Point> points;
public FlyToPointRequest() {
}
@Override
public String toString() {
return "FlyToPointRequest{" +
"flyToId='" + flyToId + '\'' +
", maxSpeed=" + maxSpeed +
", points=" + points +
'}';
}
public String getFlyToId() {
return flyToId;
}
public FlyToPointRequest setFlyToId(String flyToId) {
this.flyToId = flyToId;
return this;
}
public Integer getMaxSpeed() {
return maxSpeed;
}
public FlyToPointRequest setMaxSpeed(Integer maxSpeed) {
this.maxSpeed = maxSpeed;
return this;
}
public List<Point> getPoints() {
return points;
}
public FlyToPointRequest setPoints(List<Point> points) {
this.points = points;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class FlyToPointUpdateRequest extends BaseModel {
@Min(1)
@Max(15)
@NotNull
private Integer maxSpeed;
/**
* The M30 series only support one point.
*/
@Size(min = 1, max = 1)
@NotNull
private List<@Valid Point> points;
public FlyToPointUpdateRequest() {
}
@Override
public String toString() {
return "FlyToPointUpdateRequest{" +
"maxSpeed=" + maxSpeed +
", points=" + points +
'}';
}
public Integer getMaxSpeed() {
return maxSpeed;
}
public FlyToPointUpdateRequest setMaxSpeed(Integer maxSpeed) {
this.maxSpeed = maxSpeed;
return this;
}
public List<Point> getPoints() {
return points;
}
public FlyToPointUpdateRequest setPoints(List<Point> points) {
this.points = points;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/14
*/
public enum FlyToStatusEnum {
WAYLINE_PROGRESS("wayline_progress", "The FlyTo job is in progress."),
WAYLINE_FAILED("wayline_failed", "The FlyTo job execution failed."),
WAYLINE_OK("wayline_ok", "The FlyTo job executed successfully."),
WAYLINE_CANCEL("wayline_cancel", "The FlyTo job is closed.");
private final String status;
private final String message;
FlyToStatusEnum(String status, String message) {
this.status = status;
this.message = message;
}
public String getMessage() {
return message;
}
@JsonValue
public String getStatus() {
return status;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static FlyToStatusEnum find(String status) {
return Arrays.stream(values()).filter(statusEnum -> statusEnum.status.equals(status)).findAny()
.orElseThrow(() -> new CloudSDKException(FlyToStatusEnum.class, status));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum FocusModeEnum {
MF(0),
AFS(1),
AFC(2),
;
private final int mode;
FocusModeEnum(int mode) {
this.mode = mode;
}
@JsonValue
public int getMode() {
return mode;
}
@JsonCreator
public static FocusModeEnum find(int mode) {
return Arrays.stream(values()).filter(modeEnum -> modeEnum.mode == mode).findAny()
.orElseThrow(() -> new CloudSDKException(FocusModeEnum.class, mode));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/13
*/
public enum GimbalResetModeEnum {
RECENTER(0),
DOWN(1),
RECENTER_PAN(2),
PITCH_DOWN(3);
private final int mode;
GimbalResetModeEnum(int mode) {
this.mode = mode;
}
@JsonValue
public int getMode() {
return mode;
}
@JsonCreator
public static GimbalResetModeEnum find(int mode) {
return Arrays.stream(values()).filter(resetModeEnum -> resetModeEnum.ordinal() == mode).findAny()
.orElseThrow(() -> new CloudSDKException(GimbalResetModeEnum.class, mode));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class GimbalResetRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private GimbalResetModeEnum resetMode;
public GimbalResetRequest() {
}
@Override
public String toString() {
return "GimbalResetRequest{" +
"payloadIndex=" + payloadIndex +
", resetMode=" + resetMode +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public GimbalResetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public GimbalResetModeEnum getResetMode() {
return resetMode;
}
public GimbalResetRequest setResetMode(GimbalResetModeEnum resetMode) {
this.resetMode = resetMode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class HeartBeatRequest extends BaseModel {
@NotNull
private Long seq;
@NotNull
@Min(123456789012L)
private Long timestamp;
public HeartBeatRequest() {
}
@Override
public String toString() {
return "HeartBeatRequest{" +
"seq=" + seq +
", timestamp=" + timestamp +
'}';
}
public Long getSeq() {
return seq;
}
public HeartBeatRequest setSeq(Long seq) {
this.seq = seq;
return this;
}
public Long getTimestamp() {
return timestamp;
}
public HeartBeatRequest setTimestamp(Long timestamp) {
this.timestamp = timestamp;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import java.util.List;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class HsiInfoPush {
private Integer upDistance;
private Integer downDistance;
private List<Integer> aroundDistance;
private Boolean upEnable;
private Boolean upWork;
private Boolean downEnable;
private Boolean downWork;
private Boolean leftEnable;
private Boolean leftWork;
private Boolean rightEnable;
private Boolean rightWork;
private Boolean frontEnable;
private Boolean frontWork;
private Boolean backEnable;
private Boolean backWork;
private Boolean verticalEnable;
private Boolean verticalWork;
private Boolean horizontalEnable;
private Boolean horizontalWork;
public HsiInfoPush() {
}
@Override
public String toString() {
return "HsiInfoPush{" +
"upDistance=" + upDistance +
", downDistance=" + downDistance +
", aroundDistance=" + aroundDistance +
", upEnable=" + upEnable +
", upWork=" + upWork +
", downEnable=" + downEnable +
", downWork=" + downWork +
", leftEnable=" + leftEnable +
", leftWork=" + leftWork +
", rightEnable=" + rightEnable +
", rightWork=" + rightWork +
", frontEnable=" + frontEnable +
", frontWork=" + frontWork +
", backEnable=" + backEnable +
", backWork=" + backWork +
", verticalEnable=" + verticalEnable +
", verticalWork=" + verticalWork +
", horizontalEnable=" + horizontalEnable +
", horizontalWork=" + horizontalWork +
'}';
}
public Integer getUpDistance() {
return upDistance;
}
public HsiInfoPush setUpDistance(Integer upDistance) {
this.upDistance = upDistance;
return this;
}
public Integer getDownDistance() {
return downDistance;
}
public HsiInfoPush setDownDistance(Integer downDistance) {
this.downDistance = downDistance;
return this;
}
public List<Integer> getAroundDistance() {
return aroundDistance;
}
public HsiInfoPush setAroundDistance(List<Integer> aroundDistance) {
this.aroundDistance = aroundDistance;
return this;
}
public Boolean getUpEnable() {
return upEnable;
}
public HsiInfoPush setUpEnable(Boolean upEnable) {
this.upEnable = upEnable;
return this;
}
public Boolean getUpWork() {
return upWork;
}
public HsiInfoPush setUpWork(Boolean upWork) {
this.upWork = upWork;
return this;
}
public Boolean getDownEnable() {
return downEnable;
}
public HsiInfoPush setDownEnable(Boolean downEnable) {
this.downEnable = downEnable;
return this;
}
public Boolean getDownWork() {
return downWork;
}
public HsiInfoPush setDownWork(Boolean downWork) {
this.downWork = downWork;
return this;
}
public Boolean getLeftEnable() {
return leftEnable;
}
public HsiInfoPush setLeftEnable(Boolean leftEnable) {
this.leftEnable = leftEnable;
return this;
}
public Boolean getLeftWork() {
return leftWork;
}
public HsiInfoPush setLeftWork(Boolean leftWork) {
this.leftWork = leftWork;
return this;
}
public Boolean getRightEnable() {
return rightEnable;
}
public HsiInfoPush setRightEnable(Boolean rightEnable) {
this.rightEnable = rightEnable;
return this;
}
public Boolean getRightWork() {
return rightWork;
}
public HsiInfoPush setRightWork(Boolean rightWork) {
this.rightWork = rightWork;
return this;
}
public Boolean getFrontEnable() {
return frontEnable;
}
public HsiInfoPush setFrontEnable(Boolean frontEnable) {
this.frontEnable = frontEnable;
return this;
}
public Boolean getFrontWork() {
return frontWork;
}
public HsiInfoPush setFrontWork(Boolean frontWork) {
this.frontWork = frontWork;
return this;
}
public Boolean getBackEnable() {
return backEnable;
}
public HsiInfoPush setBackEnable(Boolean backEnable) {
this.backEnable = backEnable;
return this;
}
public Boolean getBackWork() {
return backWork;
}
public HsiInfoPush setBackWork(Boolean backWork) {
this.backWork = backWork;
return this;
}
public Boolean getVerticalEnable() {
return verticalEnable;
}
public HsiInfoPush setVerticalEnable(Boolean verticalEnable) {
this.verticalEnable = verticalEnable;
return this;
}
public Boolean getVerticalWork() {
return verticalWork;
}
public HsiInfoPush setVerticalWork(Boolean verticalWork) {
this.verticalWork = verticalWork;
return this;
}
public Boolean getHorizontalEnable() {
return horizontalEnable;
}
public HsiInfoPush setHorizontalEnable(Boolean horizontalEnable) {
this.horizontalEnable = horizontalEnable;
return this;
}
public Boolean getHorizontalWork() {
return horizontalWork;
}
public HsiInfoPush setHorizontalWork(Boolean horizontalWork) {
this.horizontalWork = horizontalWork;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class IrMeteringAreaSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
/**
* The coordinate x of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the horizontal direction is x.
*/
@NotNull
@Min(0)
@Max(1)
private Float x;
/**
* The coordinate y of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the vertical direction is y.
*/
@NotNull
@Min(0)
@Max(1)
private Float y;
/**
* Temperature measurement area width
*/
@NotNull
@Min(0)
@Max(1)
private Float width;
/**
* Temperature measurement area height
*/
@NotNull
@Min(0)
@Max(1)
private Float height;
public IrMeteringAreaSetRequest() {
}
@Override
public String toString() {
return "IrMeteringAreaSetRequest{" +
"payloadIndex=" + payloadIndex +
", x=" + x +
", y=" + y +
", width=" + width +
", height=" + height +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public IrMeteringAreaSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public Float getX() {
return x;
}
public IrMeteringAreaSetRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public IrMeteringAreaSetRequest setY(Float y) {
this.y = y;
return this;
}
public Float getWidth() {
return width;
}
public IrMeteringAreaSetRequest setWidth(Float width) {
this.width = width;
return this;
}
public Float getHeight() {
return height;
}
public IrMeteringAreaSetRequest setHeight(Float height) {
this.height = height;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class IrMeteringModeSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
@NotNull
private MeteringModeEnum mode;
public IrMeteringModeSetRequest() {
}
@Override
public String toString() {
return "IrMeteringModeSetRequest{" +
"payloadIndex=" + payloadIndex +
", mode=" + mode +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public IrMeteringModeSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public MeteringModeEnum getMode() {
return mode;
}
public IrMeteringModeSetRequest setMode(MeteringModeEnum mode) {
this.mode = mode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class IrMeteringPointSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
/**
* The coordinate x of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the horizontal direction is x.
*/
@NotNull
@Min(0)
@Max(1)
private Float x;
/**
* The coordinate y of the temperature measurement point is the upper left corner of the lens as the coordinate center point, and the vertical direction is y.
*/
@NotNull
@Min(0)
@Max(1)
private Float y;
public IrMeteringPointSetRequest() {
}
@Override
public String toString() {
return "IrMeteringPointSetRequest{" +
"payloadIndex=" + payloadIndex +
", x=" + x +
", y=" + y +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public IrMeteringPointSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public Float getX() {
return x;
}
public IrMeteringPointSetRequest setX(Float x) {
this.x = x;
return this;
}
public Float getY() {
return y;
}
public IrMeteringPointSetRequest setY(Float y) {
this.y = y;
return this;
}
}
package com.dji.sdk.cloudapi.control;
/**
* @author sean
* @version 1.4
* @date 2023/3/14
*/
public class JoystickInvalidNotify {
private JoystickInvalidReasonEnum reason;
public JoystickInvalidNotify() {
}
@Override
public String toString() {
return "JoystickInvalidNotify{" +
"reason=" + reason +
'}';
}
public JoystickInvalidReasonEnum getReason() {
return reason;
}
public JoystickInvalidNotify setReason(JoystickInvalidReasonEnum reason) {
this.reason = reason;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/14
*/
public enum JoystickInvalidReasonEnum {
RC_LOST(0, "The remote controller is lost."),
BATTERY_LOW_GO_HOME(1, "Due to low battery, the drone automatically returned home."),
BATTERY_SUPER_LOW_LANDING(2, "Due to the serious low battery, the drone landed automatically."),
NEAR_BOUNDARY(3, "The drone is near a not-fly zone."),
RC_AUTHORITY(4, "The remote controller grabs control authority.");
private final int reason;
private final String message;
JoystickInvalidReasonEnum(int reason, String message) {
this.reason = reason;
this.message = message;
}
@JsonValue
public int getVal() {
return reason;
}
public String getMessage() {
return message;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static JoystickInvalidReasonEnum find(int reason) {
return Arrays.stream(values()).filter(reasonEnum -> reasonEnum.reason == reason).findAny()
.orElseThrow(() -> new CloudSDKException(JoystickInvalidReasonEnum.class, reason));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.7
* @date 2023/10/12
*/
public enum LensStorageSettingsEnum {
CURRENT("current"),
ZOOM("zoom"),
WIDE("wide"),
VISION("vision"),
INFRARED("ir");
private final String lens;
LensStorageSettingsEnum(String lens) {
this.lens = lens;
}
@JsonValue
public String getLens() {
return lens;
}
@JsonCreator
public static LensStorageSettingsEnum find(String lens) {
return Arrays.stream(values()).filter(lensEnum -> lensEnum.lens.equals(lens)).findAny()
.orElseThrow(() -> new CloudSDKException(LensStorageSettingsEnum.class, lens));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.VideoId;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class LiveviewDelay {
private Integer liveviewDelayTime;
private VideoId videoId;
public LiveviewDelay() {
}
@Override
public String toString() {
return "LiveviewDelay{" +
"liveviewDelayTime=" + liveviewDelayTime +
", videoId=" + videoId +
'}';
}
public Integer getLiveviewDelayTime() {
return liveviewDelayTime;
}
public LiveviewDelay setLiveviewDelayTime(Integer liveviewDelayTime) {
this.liveviewDelayTime = liveviewDelayTime;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum MeteringModeEnum {
DISABLE(0),
SPOT(1),
AREA(2),
;
private final int mode;
MeteringModeEnum(int mode) {
this.mode = mode;
}
@JsonValue
public int getMode() {
return mode;
}
@JsonCreator
public static MeteringModeEnum find(int mode) {
return Arrays.stream(values()).filter(modeEnum -> modeEnum.mode == mode).findAny()
.orElseThrow(() -> new CloudSDKException(MeteringModeEnum.class, mode));
}
}
package com.dji.sdk.cloudapi.control;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class OsdInfoPush {
private Float attitudeHead;
private Float latitude;
private Float longitude;
private Float height;
private Float speedX;
private Float speedY;
private Float speedZ;
private Float gimbalPitch;
private Float gimbalRoll;
private Float gimbalYaw;
public OsdInfoPush() {
}
@Override
public String toString() {
return "OsdInfoPush{" +
"attitudeHead=" + attitudeHead +
", latitude=" + latitude +
", longitude=" + longitude +
", height=" + height +
", speedX=" + speedX +
", speedY=" + speedY +
", speedZ=" + speedZ +
", gimbalPitch=" + gimbalPitch +
", gimbalRoll=" + gimbalRoll +
", gimbalYaw=" + gimbalYaw +
'}';
}
public Float getAttitudeHead() {
return attitudeHead;
}
public OsdInfoPush setAttitudeHead(Float attitudeHead) {
this.attitudeHead = attitudeHead;
return this;
}
public Float getLatitude() {
return latitude;
}
public OsdInfoPush setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public OsdInfoPush setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Float getHeight() {
return height;
}
public OsdInfoPush setHeight(Float height) {
this.height = height;
return this;
}
public Float getSpeedX() {
return speedX;
}
public OsdInfoPush setSpeedX(Float speedX) {
this.speedX = speedX;
return this;
}
public Float getSpeedY() {
return speedY;
}
public OsdInfoPush setSpeedY(Float speedY) {
this.speedY = speedY;
return this;
}
public Float getSpeedZ() {
return speedZ;
}
public OsdInfoPush setSpeedZ(Float speedZ) {
this.speedZ = speedZ;
return this;
}
public Float getGimbalPitch() {
return gimbalPitch;
}
public OsdInfoPush setGimbalPitch(Float gimbalPitch) {
this.gimbalPitch = gimbalPitch;
return this;
}
public Float getGimbalRoll() {
return gimbalRoll;
}
public OsdInfoPush setGimbalRoll(Float gimbalRoll) {
this.gimbalRoll = gimbalRoll;
return this;
}
public Float getGimbalYaw() {
return gimbalYaw;
}
public OsdInfoPush setGimbalYaw(Float gimbalYaw) {
this.gimbalYaw = gimbalYaw;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.7
* @date 2023/6/29
*/
public class PayloadAuthorityGrabRequest extends BaseModel {
@NotNull
private PayloadIndex payloadIndex;
public PayloadAuthorityGrabRequest() {
}
@Override
public String toString() {
return "PayloadAuthorityGrabRequest{" +
"payloadIndex=" + payloadIndex +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public PayloadAuthorityGrabRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import com.dji.sdk.exception.CloudSDKException;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/2
*/
public enum PayloadControlMethodEnum {
CAMERA_MODE_SWITCH(ControlMethodEnum.CAMERA_MODE_SWITCH, CameraModeSwitchRequest.class),
CAMERA_PHOTO_TAKE(ControlMethodEnum.CAMERA_PHOTO_TAKE, CameraPhotoTakeRequest.class),
CAMERA_PHOTO_STOP(ControlMethodEnum.CAMERA_PHOTO_STOP, CameraPhotoStopRequest.class),
CAMERA_RECORDING_START(ControlMethodEnum.CAMERA_RECORDING_START, CameraRecordingStartRequest.class),
CAMERA_RECORDING_STOP(ControlMethodEnum.CAMERA_RECORDING_STOP, CameraRecordingStopRequest.class),
CAMERA_AIM(ControlMethodEnum.CAMERA_AIM, CameraAimRequest.class),
CAMERA_FOCAL_LENGTH_SET(ControlMethodEnum.CAMERA_FOCAL_LENGTH_SET, CameraFocalLengthSetRequest.class),
GIMBAL_RESET(ControlMethodEnum.GIMBAL_RESET, GimbalResetRequest.class),
CAMERA_LOOK_AT(ControlMethodEnum.CAMERA_LOOK_AT, CameraLookAtRequest.class),
CAMERA_SCREEN_SPLIT(ControlMethodEnum.CAMERA_SCREEN_SPLIT, CameraScreenSplitRequest.class),
PHOTO_STORAGE_SET(ControlMethodEnum.PHOTO_STORAGE_SET, PhotoStorageSetRequest.class),
VIDEO_STORAGE_SET(ControlMethodEnum.VIDEO_STORAGE_SET, VideoStorageSetRequest.class),
CAMERA_EXPOSURE_SET(ControlMethodEnum.CAMERA_EXPOSURE_SET, CameraExposureSetRequest.class),
CAMERA_EXPOSURE_MODE_SET(ControlMethodEnum.CAMERA_EXPOSURE_MODE_SET, CameraExposureModeSetRequest.class),
CAMERA_FOCUS_MODE_SET(ControlMethodEnum.CAMERA_FOCUS_MODE_SET, CameraFocusModeSetRequest.class),
CAMERA_FOCUS_VALUE_SET(ControlMethodEnum.CAMERA_FOCUS_VALUE_SET, CameraFocusValueSetRequest.class),
IR_METERING_MODE_SET(ControlMethodEnum.IR_METERING_MODE_SET, IrMeteringModeSetRequest.class),
IR_METERING_POINT_SET(ControlMethodEnum.IR_METERING_POINT_SET, IrMeteringPointSetRequest.class),
IR_METERING_AREA_SET(ControlMethodEnum.IR_METERING_AREA_SET, IrMeteringAreaSetRequest.class),
CAMERA_POINT_FOCUS_ACTION(ControlMethodEnum.CAMERA_POINT_FOCUS_ACTION, CameraPointFocusActionRequest.class),
;
private final ControlMethodEnum payloadMethod;
private final Class<? extends BaseModel> clazz;
PayloadControlMethodEnum(ControlMethodEnum payloadMethod, Class<? extends BaseModel> clazz) {
this.payloadMethod = payloadMethod;
this.clazz = clazz;
}
public ControlMethodEnum getPayloadMethod() {
return payloadMethod;
}
public Class<? extends BaseModel> getClazz() {
return clazz;
}
public static PayloadControlMethodEnum find(String method) {
return Arrays.stream(values()).filter(methodEnum -> methodEnum.payloadMethod.getMethod().equals(method)).findAny()
.orElseThrow(() -> new CloudSDKException(PayloadControlMethodEnum.class, method));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.PayloadIndex;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @author sean
* @version 1.7
* @date 2023/10/12
*/
public class PhotoStorageSetRequest extends BaseModel {
/**
* Camera enumeration.
* It is unofficial device_mode_key.
* The format is *{type-subtype-gimbalindex}*.
* Please read [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html)
*/
@NotNull
private PayloadIndex payloadIndex;
/**
* Photo storage type. Multi-selection.
*/
@NotNull
@Size(min = 1)
private List<LensStorageSettingsEnum> photoStorageSettings;
public PhotoStorageSetRequest() {
}
@Override
public String toString() {
return "PhotoStorageSetRequest{" +
"payloadIndex=" + payloadIndex +
", photoStorageSettings=" + photoStorageSettings +
'}';
}
public PayloadIndex getPayloadIndex() {
return payloadIndex;
}
public PhotoStorageSetRequest setPayloadIndex(PayloadIndex payloadIndex) {
this.payloadIndex = payloadIndex;
return this;
}
public List<LensStorageSettingsEnum> getPhotoStorageSettings() {
return photoStorageSettings;
}
public PhotoStorageSetRequest setPhotoStorageSettings(List<LensStorageSettingsEnum> photoStorageSettings) {
this.photoStorageSettings = photoStorageSettings;
return this;
}
}
package com.dji.sdk.cloudapi.control;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class PhotoTakeProgressData {
private PhotoTakeProgressStepEnum currentStep;
private Integer percent;
public PhotoTakeProgressData() {
}
@Override
public String toString() {
return "PhotoTakeProgressData{" +
"currentStep=" + currentStep +
", percent=" + percent +
'}';
}
public PhotoTakeProgressStepEnum getCurrentStep() {
return currentStep;
}
public PhotoTakeProgressData setCurrentStep(PhotoTakeProgressStepEnum currentStep) {
this.currentStep = currentStep;
return this;
}
public Integer getPercent() {
return percent;
}
public PhotoTakeProgressData setPercent(Integer percent) {
this.percent = percent;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.device.CameraModeEnum;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class PhotoTakeProgressExt {
private CameraModeEnum cameraMode;
public PhotoTakeProgressExt() {
}
@Override
public String toString() {
return "PhotoTakeProgressExt{" +
"cameraMode=" + cameraMode +
'}';
}
public CameraModeEnum getCameraMode() {
return cameraMode;
}
public PhotoTakeProgressExt setCameraMode(CameraModeEnum cameraMode) {
this.cameraMode = cameraMode;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum PhotoTakeProgressStepEnum {
NORMAL(0),
PANORAMA_NOT_STARTED_OR_ENDED(3000),
PANORAMA_TAKING(3002),
PANORAMA_COMPOSITING(3005),
;
private final int step;
PhotoTakeProgressStepEnum(int step) {
this.step = step;
}
@JsonValue
public int getStep() {
return step;
}
@JsonCreator
public static PhotoTakeProgressStepEnum find(int step) {
return Arrays.stream(values()).filter(stepEnum -> stepEnum.step == step).findAny()
.orElseThrow(() -> new CloudSDKException(PhotoTakeProgressStepEnum.class, step));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class PoiCircleSpeedSetRequest extends BaseModel {
@NotNull
private Float circleSpeed;
public PoiCircleSpeedSetRequest() {
}
@Override
public String toString() {
return "PoiCircleSpeedSetRequest{" +
"circleSpeed=" + circleSpeed +
'}';
}
public Float getCircleSpeed() {
return circleSpeed;
}
public PoiCircleSpeedSetRequest setCircleSpeed(Float circleSpeed) {
this.circleSpeed = circleSpeed;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.common.BaseModel;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class PoiModeEnterRequest extends BaseModel {
@Min(-90)
@Max(90)
@NotNull
private Float latitude;
@NotNull
@Min(-180)
@Max(180)
private Float longitude;
@NotNull
@Min(2)
@Max(10000)
private Float height;
public PoiModeEnterRequest() {
}
@Override
public String toString() {
return "PoiModeEnterRequest{" +
"latitude=" + latitude +
", longitude=" + longitude +
", height=" + height +
'}';
}
public Float getLatitude() {
return latitude;
}
public PoiModeEnterRequest setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public PoiModeEnterRequest setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Float getHeight() {
return height;
}
public PoiModeEnterRequest setHeight(Float height) {
this.height = height;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.cloudapi.wayline.FlighttaskStatusEnum;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public class PoiStatusNotify {
private FlighttaskStatusEnum status;
private PoiStatusReasonEnum reason;
private Float circleRadius;
private Float circleSpeed;
private Float maxCircleSpeed;
public PoiStatusNotify() {
}
@Override
public String toString() {
return "PoiStatusNotify{" +
"status=" + status +
", reason=" + reason +
", circleRadius=" + circleRadius +
", circleSpeed=" + circleSpeed +
", maxCircleSpeed=" + maxCircleSpeed +
'}';
}
public FlighttaskStatusEnum getStatus() {
return status;
}
public PoiStatusNotify setStatus(FlighttaskStatusEnum status) {
this.status = status;
return this;
}
public PoiStatusReasonEnum getReason() {
return reason;
}
public PoiStatusNotify setReason(PoiStatusReasonEnum reason) {
this.reason = reason;
return this;
}
public Float getCircleRadius() {
return circleRadius;
}
public PoiStatusNotify setCircleRadius(Float circleRadius) {
this.circleRadius = circleRadius;
return this;
}
public Float getCircleSpeed() {
return circleSpeed;
}
public PoiStatusNotify setCircleSpeed(Float circleSpeed) {
this.circleSpeed = circleSpeed;
return this;
}
public Float getMaxCircleSpeed() {
return maxCircleSpeed;
}
public PoiStatusNotify setMaxCircleSpeed(Float maxCircleSpeed) {
this.maxCircleSpeed = maxCircleSpeed;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.9
* @date 2023/12/12
*/
public enum PoiStatusReasonEnum {
NORMAL(0),
UNADAPTED_PAYLOAD(1),
CAMERA_MODE_NOT_SUPPORTED(2),
ILLEGAL_CMD(3),
POSITIONING_FAILED(4),
ON_THE_GROUND(5),
DRONE_MODE_ERROR(6),
NOT_AVAILABLE_MODE(7),
RC_DISCONNECTED(8),
;
private final int reason;
PoiStatusReasonEnum(int reason) {
this.reason = reason;
}
@JsonValue
public int getReason() {
return reason;
}
@JsonCreator
public static PoiStatusReasonEnum find(int reason) {
return Arrays.stream(values()).filter(reasonEnum -> reasonEnum.reason == reason).findAny()
.orElseThrow(() -> new CloudSDKException(PoiStatusReasonEnum.class, reason));
}
}
package com.dji.sdk.cloudapi.control;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @author sean
* @version 1.3
* @date 2023/2/14
*/
public class Point {
@Min(-90)
@Max(90)
@NotNull
private Float latitude;
@NotNull
@Min(-180)
@Max(180)
private Float longitude;
/**
* WGS84
* The M30 series are ellipsoidal heights.
*/
@NotNull
@Min(2)
@Max(10000)
private Float height;
public Point() {
}
@Override
public String toString() {
return "Point{" +
"latitude=" + latitude +
", longitude=" + longitude +
", height=" + height +
'}';
}
public Float getLatitude() {
return latitude;
}
public Point setLatitude(Float latitude) {
this.latitude = latitude;
return this;
}
public Float getLongitude() {
return longitude;
}
public Point setLongitude(Float longitude) {
this.longitude = longitude;
return this;
}
public Float getHeight() {
return height;
}
public Point setHeight(Float height) {
this.height = height;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.exception.CloudSDKException;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
/**
* @author sean
* @version 1.4
* @date 2023/3/17
*/
public enum TakeoffStatusEnum {
TASK_READY("task_ready", "The drone is preparing to take off."),
WAYLINE_PROGRESS("wayline_progress", "The drone is taking off."),
WAYLINE_FAILED("wayline_failed", "The drone failed to take off."),
WAYLINE_OK("wayline_ok", "The drone took off successfully."),
WAYLINE_CANCEL("wayline_cancel", "The drone takeoff job has been cancelled."),
TASK_FINISH("task_finish", "The drone takeoff job is completed.");
private final String status;
private final String message;
TakeoffStatusEnum(String status, String message) {
this.status = status;
this.message = message;
}
@JsonValue
public String getStatus() {
return status;
}
public String getMessage() {
return message;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static TakeoffStatusEnum find(String status) {
return Arrays.stream(values()).filter(statusEnum -> statusEnum.status.equals(status)).findAny()
.orElseThrow(() -> new CloudSDKException(TakeoffStatusEnum.class, status));
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.annotations.CloudSDKVersion;
import com.dji.sdk.cloudapi.wayline.WaylineErrorCodeEnum;
import com.dji.sdk.config.version.CloudSDKVersionEnum;
import java.util.List;
/**
* @author sean
* @version 1.4
* @date 2023/3/14
*/
public class TakeoffToPointProgress {
private WaylineErrorCodeEnum result;
private TakeoffStatusEnum status;
private String flightId;
private String trackId;
private Integer wayPointIndex;
/**
* Remaining mission distance
* unit: m
*/
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
private Float remainingDistance;
/**
* Remaining mission time
* unit: s
*/
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
private Integer remainingTime;
/**
* Planned trajectory point list
*/
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
private List<Point> plannedPathPoints;
public TakeoffToPointProgress() {
}
@Override
public String toString() {
return "TakeoffToPointProgress{" +
"result=" + result +
", status=" + status +
", flightId='" + flightId + '\'' +
", trackId='" + trackId + '\'' +
", wayPointIndex=" + wayPointIndex +
", remainingDistance=" + remainingDistance +
", remainingTime=" + remainingTime +
", plannedPathPoints=" + plannedPathPoints +
'}';
}
public WaylineErrorCodeEnum getResult() {
return result;
}
public TakeoffToPointProgress setResult(WaylineErrorCodeEnum result) {
this.result = result;
return this;
}
public TakeoffStatusEnum getStatus() {
return status;
}
public TakeoffToPointProgress setStatus(TakeoffStatusEnum status) {
this.status = status;
return this;
}
public String getFlightId() {
return flightId;
}
public TakeoffToPointProgress setFlightId(String flightId) {
this.flightId = flightId;
return this;
}
public String getTrackId() {
return trackId;
}
public TakeoffToPointProgress setTrackId(String trackId) {
this.trackId = trackId;
return this;
}
public Integer getWayPointIndex() {
return wayPointIndex;
}
public TakeoffToPointProgress setWayPointIndex(Integer wayPointIndex) {
this.wayPointIndex = wayPointIndex;
return this;
}
public Float getRemainingDistance() {
return remainingDistance;
}
public TakeoffToPointProgress setRemainingDistance(Float remainingDistance) {
this.remainingDistance = remainingDistance;
return this;
}
public Integer getRemainingTime() {
return remainingTime;
}
public TakeoffToPointProgress setRemainingTime(Integer remainingTime) {
this.remainingTime = remainingTime;
return this;
}
public List<Point> getPlannedPathPoints() {
return plannedPathPoints;
}
public TakeoffToPointProgress setPlannedPathPoints(List<Point> plannedPathPoints) {
this.plannedPathPoints = plannedPathPoints;
return this;
}
}
package com.dji.sdk.cloudapi.control;
import com.dji.sdk.annotations.CloudSDKVersion;
import com.dji.sdk.cloudapi.device.ExitWaylineWhenRcLostEnum;
import com.dji.sdk.cloudapi.device.RcLostActionEnum;
import com.dji.sdk.cloudapi.wayline.RthModeEnum;
import com.dji.sdk.cloudapi.wayline.SimulateMission;
import com.dji.sdk.common.BaseModel;
import com.dji.sdk.config.version.CloudSDKVersionEnum;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* @author sean
* @version 1.4
* @date 2023/3/1
*/
public class TakeoffToPointRequest extends BaseModel {
@Pattern(regexp = "^[^<>:\"/|?*._\\\\]+$")
@NotNull
private String flightId;
@Min(-180)
@Max(180)
@NotNull
private Float targetLongitude;
@Min(-90)
@Max(90)
@NotNull
private Float targetLatitude;
@Min(2)
@Max(10000)
@NotNull
private Float targetHeight;
@Min(20)
@Max(1500)
@NotNull
private Float securityTakeoffHeight;
@Min(2)
@Max(1500)
@NotNull
private Float rthAltitude;
@NotNull
private RcLostActionEnum rcLostAction;
@NotNull
@CloudSDKVersion(deprecated = CloudSDKVersionEnum.V1_0_0)
private ExitWaylineWhenRcLostEnum exitWaylineWhenRcLost;
@Min(1)
@Max(15)
@NotNull
private Integer maxSpeed;
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
@NotNull
private RthModeEnum rthMode;
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
@NotNull
private CommanderModeLostActionEnum commanderModeLostAction;
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
@NotNull
private CommanderFlightModeEnum commanderFlightMode;
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
@NotNull
@Min(2)
@Max(3000)
private Float commanderFlightHeight;
@Valid
@CloudSDKVersion(since = CloudSDKVersionEnum.V1_0_0)
private SimulateMission simulateMission;
public TakeoffToPointRequest() {
}
@Override
public String toString() {
return "TakeoffToPointRequest{" +
"flightId='" + flightId + '\'' +
", targetLongitude=" + targetLongitude +
", targetLatitude=" + targetLatitude +
", targetHeight=" + targetHeight +
", securityTakeoffHeight=" + securityTakeoffHeight +
", rthAltitude=" + rthAltitude +
", rcLostAction=" + rcLostAction +
", exitWaylineWhenRcLost=" + exitWaylineWhenRcLost +
", maxSpeed=" + maxSpeed +
", rthMode=" + rthMode +
", commanderModeLostAction=" + commanderModeLostAction +
", commanderFlightMode=" + commanderFlightMode +
", commanderFlightHeight=" + commanderFlightHeight +
", simulateMission=" + simulateMission +
'}';
}
public String getFlightId() {
return flightId;
}
public TakeoffToPointRequest setFlightId(String flightId) {
this.flightId = flightId;
return this;
}
public Float getTargetLongitude() {
return targetLongitude;
}
public TakeoffToPointRequest setTargetLongitude(Float targetLongitude) {
this.targetLongitude = targetLongitude;
return this;
}
public Float getTargetLatitude() {
return targetLatitude;
}
public TakeoffToPointRequest setTargetLatitude(Float targetLatitude) {
this.targetLatitude = targetLatitude;
return this;
}
public Float getTargetHeight() {
return targetHeight;
}
public TakeoffToPointRequest setTargetHeight(Float targetHeight) {
this.targetHeight = targetHeight;
return this;
}
public Float getSecurityTakeoffHeight() {
return securityTakeoffHeight;
}
public TakeoffToPointRequest setSecurityTakeoffHeight(Float securityTakeoffHeight) {
this.securityTakeoffHeight = securityTakeoffHeight;
return this;
}
public Float getRthAltitude() {
return rthAltitude;
}
public TakeoffToPointRequest setRthAltitude(Float rthAltitude) {
this.rthAltitude = rthAltitude;
return this;
}
public RcLostActionEnum getRcLostAction() {
return rcLostAction;
}
public TakeoffToPointRequest setRcLostAction(RcLostActionEnum rcLostAction) {
this.rcLostAction = rcLostAction;
return this;
}
public ExitWaylineWhenRcLostEnum getExitWaylineWhenRcLost() {
return exitWaylineWhenRcLost;
}
public TakeoffToPointRequest setExitWaylineWhenRcLost(ExitWaylineWhenRcLostEnum exitWaylineWhenRcLost) {
this.exitWaylineWhenRcLost = exitWaylineWhenRcLost;
return this;
}
public Integer getMaxSpeed() {
return maxSpeed;
}
public RthModeEnum getRthMode() {
return rthMode;
}
public TakeoffToPointRequest setRthMode(RthModeEnum rthMode) {
this.rthMode = rthMode;
return this;
}
public CommanderModeLostActionEnum getCommanderModeLostAction() {
return commanderModeLostAction;
}
public TakeoffToPointRequest setCommanderModeLostAction(CommanderModeLostActionEnum commanderModeLostAction) {
this.commanderModeLostAction = commanderModeLostAction;
return this;
}
public CommanderFlightModeEnum getCommanderFlightMode() {
return commanderFlightMode;
}
public TakeoffToPointRequest setCommanderFlightMode(CommanderFlightModeEnum commanderFlightMode) {
this.commanderFlightMode = commanderFlightMode;
return this;
}
public Float getCommanderFlightHeight() {
return commanderFlightHeight;
}
public TakeoffToPointRequest setCommanderFlightHeight(Float commanderFlightHeight) {
this.commanderFlightHeight = commanderFlightHeight;
return this;
}
public TakeoffToPointRequest setMaxSpeed(Integer maxSpeed) {
this.maxSpeed = maxSpeed;
return this;
}
public SimulateMission getSimulateMission() {
return simulateMission;
}
public TakeoffToPointRequest setSimulateMission(SimulateMission simulateMission) {
this.simulateMission = simulateMission;
return this;
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment