Skip to content

Tracing v1.7 fix bug #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: v1.7.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d68e3d3
Merge branch 'v1.7.0'
DJIsean Sep 18, 2023
585f723
Merge branch 'v1.7.0'
DJIsean Sep 19, 2023
ebd883d
Merge commit 'b390ebe579bd0b003e5d9ff20629b4ad3c341e1d' into flision/…
witcom Sep 20, 2023
b301d70
fix: flightId是应用层提供的,应用层有自己的id构建规则,如果不是设备原因必须指定格式,最好就不要控制flightId的格式了
witcom Sep 22, 2023
95df8f7
Merge branch 'main' into flision/v1.7.0
witcom Sep 22, 2023
c8a40b9
fix: 修复未启动debug时仍然需要构造debug参数的问题
witcom Sep 22, 2023
0850908
fix: OsdRouter在设备未注册的情况下报osd时产生大量日志
witcom Sep 22, 2023
9d392c5
feat: 为publishWithReply提供配置选项.
witcom Sep 22, 2023
163f08a
fix: MqttGatewayPublish#publish() log.debug 未判定isDebugEnable
witcom Sep 22, 2023
a79449a
fix: SdkManager改接口,由客户实现gateway管理策略
witcom Sep 25, 2023
52ec346
feat: 新增全局发送默认设置接口
witcom Sep 25, 2023
6e92736
feat: 使栅栏标识可由用户自定义标识生成
witcom Sep 25, 2023
97c4d3f
fix: 调整publish hook参数使客户看到更多信息
witcom Sep 25, 2023
9627b13
fix: 修复设备未注册前设备推送state导致产生大量日志的问题
witcom Oct 8, 2023
89c3433
fix: 修复flow.transform不能返回null导致产生大量日志的问题
witcom Oct 9, 2023
9d9d0cf
feat: PropertySetPublish 新增CompletableFuture支持方法
witcom Oct 9, 2023
4f38be0
fix: 取消FlyToPoint, TakeoffToPoint flightId规则限制
witcom Oct 9, 2023
3753374
fix: 简化SDKManager所需实现接口
witcom Oct 12, 2023
07b0fd3
fix: 修复一些npe问题
witcom Oct 30, 2023
c5e0961
fix: RemoteDebugSteoKeyEnum添加Unknown值
witcom Oct 31, 2023
6f2fd1e
fix: mark an bug
witcom Nov 9, 2023
1772588
fix: Cannot construct instance of `com.dji.sdk.cloudapi.device.Camera…
witcom Dec 8, 2023
9efb6d8
fix: * bug: Cannot deserialize value of type `com.dji.sdk.clouda…
witcom Dec 8, 2023
5c80307
bug report: some AliOss object need to close manually. otherwise wil…
witcom Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Optional;

/**
Expand All @@ -27,6 +28,9 @@ public class ApplicationBootInitial implements CommandLineRunner {
@Autowired
private IDeviceRedisService deviceRedisService;

@Resource
SDKManager sdkManager;

/**
* Subscribe to the devices that exist in the redis when the program starts,
* to prevent the data from being different from the pilot side due to program interruptions.
Expand All @@ -44,7 +48,7 @@ public void run(String... args) throws Exception {
.map(Optional::get)
.filter(device -> DeviceDomainEnum.DRONE != device.getDomain())
.forEach(device -> deviceService.subDeviceOnlineSubscribeTopic(
SDKManager.registerDevice(device.getDeviceSn(), device.getChildDeviceSn(), device.getDomain(),
sdkManager.registerDevice(device.getDeviceSn(), device.getChildDeviceSn(), device.getDomain(),
device.getType(), device.getSubType(), device.getThingVersion(),
deviceRedisService.getDeviceOnline(device.getChildDeviceSn()).map(DeviceDTO::getThingVersion).orElse(null))));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public Boolean deleteObject(String bucket, String objectKey) {

@Override
public InputStream getObject(String bucket, String objectKey) {
//bug: ossClient.getObject -> OSSObject need to close manually. otherwise will hang up main thread to wait available connection. by witcom @2023.12.08
return ossClient.getObject(bucket, objectKey).getObjectContent();
}

Expand All @@ -94,6 +95,7 @@ public void putObject(String bucket, String objectKey, InputStream input) {
if (ossClient.doesObjectExist(bucket, objectKey)) {
throw new RuntimeException("The filename already exists.");
}
//bug: PutObjectResult need to close manually. otherwise will hang up main thread to wait available connection. by witcom @2023.12.08
PutObjectResult objectResult = ossClient.putObject(new PutObjectRequest(bucket, objectKey, input, new ObjectMetadata()));
log.info("Upload FlighttaskCreateFile: {}", objectResult.getETag());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class ControlServiceImpl implements IControlService {
@Qualifier("SDKWaylineService")
private AbstractWaylineService abstractWaylineService;

@Autowired
SDKManager SDKManager;

private RemoteDebugHandler checkDebugCondition(String sn, RemoteDebugParam param, RemoteDebugMethodEnum controlMethodEnum) {
RemoteDebugHandler handler = Objects.nonNull(controlMethodEnum.getClazz()) ?
mapper.convertValue(Objects.nonNull(param) ? param : new Object(), controlMethodEnum.getClazz())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class DrcServiceImpl implements IDrcService {
@Autowired
private AbstractControlService abstractControlService;

@Autowired
SDKManager SDKManager;

@Override
public void setDrcModeInRedis(String dockSn, String clientId) {
RedisOpsUtils.setWithExpire(RedisConst.DRC_PREFIX + dockSn, clientId, RedisConst.DRC_MODE_ALIVE_SECOND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public class DeviceLogsServiceImpl extends AbstractLogService implements IDevice
@Autowired
private AbstractLogService abstractLogService;

@Autowired
SDKManager SDKManager;

@Override
public PaginationData<DeviceLogsDTO> getUploadedLogs(String deviceSn, DeviceLogsQueryParam param) {
LambdaQueryWrapper<DeviceLogsEntity> queryWrapper = new LambdaQueryWrapper<DeviceLogsEntity>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public class DeviceServiceImpl implements IDeviceService {
@Autowired
private AbstractFirmwareService abstractFirmwareService;

@Autowired
SDKManager SDKManager;

@Override
public void subDeviceOffline(String deviceSn) {
// If no information about this device exists in the cache, the drone is considered to be offline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class LiveStreamServiceImpl implements ILiveStreamService {
@Autowired
private AbstractLivestreamService abstractLivestreamService;

@Autowired
SDKManager SDKManager;

@Override
public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public class SDKDeviceService extends AbstractDeviceService {
@Autowired
private IDevicePayloadService devicePayloadService;

@Autowired
SDKManager SDKManager;

@Override
public TopicStatusResponse<MqttReply> updateTopoOnline(TopicStatusRequest<UpdateTopo> request, MessageHeaders headers) {
UpdateTopoSubDevice updateTopoSubDevice = request.getData().getSubDevices().get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public class FlightTaskServiceImpl extends AbstractWaylineService implements IFl
@Autowired
private ObjectMapper mapper;

@Autowired
SDKManager SDKManager;

@Autowired
private IWebSocketMessageService websocketMessageService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class FlyToPointRequest extends BaseModel {

@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
//@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
@NotNull
private String flyToId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public class TakeoffToPointRequest extends BaseModel {

@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
//@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
@NotNull
private String flightId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public enum RemoteDebugStepKeyEnum {

FREE_PUTTER("free_putter", "Free Putter"),

STOP_CHARGE("stop_charge", "Stop charging");
STOP_CHARGE("stop_charge", "Stop charging"),

UNKNOWN("unknown","Unknown");

private final String stepKey;

Expand All @@ -79,10 +81,11 @@ public String getMessage() {
return message;
}

//fix: 提供unknown取代异常 witcom@2023.10.30
@JsonCreator
public static RemoteDebugStepKeyEnum find(String stepKey) {
return Arrays.stream(values()).filter(stepKeyEnum -> stepKeyEnum.stepKey.equals(stepKey)).findAny()
.orElseThrow(() -> new CloudSDKException(RemoteDebugStepKeyEnum.class,stepKey));
.orElse(UNKNOWN);
}

}
2 changes: 2 additions & 0 deletions src/main/java/com/dji/sdk/cloudapi/device/CameraModeEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
public enum CameraModeEnum {

//fix: Cannot construct instance of `com.dji.sdk.cloudapi.device.CameraModeEnum`, problem: com.dji.sdk.cloudapi.device.CameraModeEnum has unknown data: [-1] vincent @ 2023.12.07
UNKNOWN(-1),
PHOTO(0),

VIDEO(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ public DockLiveErrorStatus(int code) {
}

public String getMessage() {
if(success){ return "success";}
return errorCode.getMessage();
}

@JsonValue
public Integer getCode() {
//witcom: errorCode.getCode() will cause npe 2023.10.30
if(success){ return 0; }
return source.getSource() * MOD + errorCode.getCode();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public enum DroneModeCodeEnum {

APAS(15),

VIRTUAL_JOYSTICK(16);
VIRTUAL_JOYSTICK(16),

//witcom: 飞机报这个号上来报异常
UNKNOWN_1(17);

private final int code;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ public void dockWpmzVersionUpdate(TopicStateRequest<DockWpmzVersion> request, Me
* @param request data
* @param headers The headers for a {@link Message}.
*/
@ServiceActivator(inputChannel = ChannelName.INBOUND_STATE_DOCK_WPMZ_VERSION)
//witcom: wrong ChannelName. is INBOUND_STATE_DOCK_PAYLOAD??
// @ServiceActivator(inputChannel = ChannelName.INBOUND_STATE_DOCK_WPMZ_VERSION)
@ServiceActivator(inputChannel = ChannelName.INBOUND_STATE_DOCK_PAYLOAD)
public void dockPayload(TopicStateRequest<DockPayload> request, MessageHeaders headers) {
throw new UnsupportedOperationException("dockPayload not implemented");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
*/
public class UploadFlighttaskMediaPrioritize extends BaseModel {

/* fix: flightId是应用层提供的,应用层有自己的id构建规则,如果不是设备原因必须指定格式,最好就不要控制flightId的格式了 by witcom@2023.09.22 */
@NotNull
@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
//@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
private String flightId;

public UploadFlighttaskMediaPrioritize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ public String getMsg() {
return msg;
}

//witcom: 这个函数跑不进来,跑了下面的函数,导致FlightTaskProgress报不上来
@JsonCreator
public static ExecutionStepEnum find(int step) {
return Arrays.stream(values()).filter(stepEnum -> stepEnum.min <= step && stepEnum.max >= step).findAny()
.orElseThrow(() -> new CloudSDKException(ExecutionStepEnum.class, step));
}

@JsonCreator
public static ExecutionStepEnum find(String msg) {
return Arrays.stream(values()).filter(stepEnum -> stepEnum.msg.equals(msg)).findAny()
.orElseThrow(() -> new CloudSDKException(ExecutionStepEnum.class, msg));
}
// @JsonCreator
// public static ExecutionStepEnum find(String msg) {
// return Arrays.stream(values()).filter(stepEnum -> stepEnum.msg.equals(msg)).findAny()
// .orElseThrow(() -> new CloudSDKException(ExecutionStepEnum.class, msg));
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,25 @@ public class FlighttaskBreakPoint {
@NotNull
private BreakpointStateEnum state;

/**
* Current wayline segment process
*/
@NotNull
@Min(0)
@Max(1)

// @NotNull
// @Min(0)
// @Max(1)
private Float progress;

/**
* Wayline ID
*/
private Integer waylineID;

/**
* Current wayline segment process
* bug: Cannot deserialize value of type `com.dji.sdk.cloudapi.wayline.FlighttaskBreakReasonEnum` from number 1281: index value outside legal index range [0..-1] mark by witcom 2023.11.09
*/
/**
* Break reason
*/
private FlighttaskBreakReasonEnum breakReason;
private Integer breakReason;

/**
* Breakpoint latitude
Expand Down Expand Up @@ -116,11 +118,11 @@ public FlighttaskBreakPoint setWaylineID(Integer waylineID) {
return this;
}

public FlighttaskBreakReasonEnum getBreakReason() {
public Integer getBreakReason() {
return breakReason;
}

public FlighttaskBreakPoint setBreakReason(FlighttaskBreakReasonEnum breakReason) {
public FlighttaskBreakPoint setBreakReason(Integer breakReason) {
this.breakReason = breakReason;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
*/
public class FlighttaskExecuteRequest extends BaseModel {

/**
* fix: flightId是应用层提供的,应用层有自己的id构建规则,如果不是设备原因必须指定格式,最好就不要控制flightId的格式了 by witcom@2023.09.22
*/
@NotNull
@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
//@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
private String flightId;

public FlighttaskExecuteRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public class FlighttaskPrepareRequest extends BaseModel {

/**
* Task ID
* fix: flightId是应用层提供的,应用层有自己的id构建规则,如果不是设备原因必须指定格式,最好就不要控制flightId的格式了 by witcom@2023.09.22
*/
@NotNull
@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
//@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
private String flightId;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
*/
public class FlighttaskUndoRequest extends BaseModel {

/**
* fix: flightId是应用层提供的,应用层有自己的id构建规则,如果不是设备原因必须指定格式,最好就不要控制flightId的格式了 by witcom@2023.09.22
*/
@NotNull
@Size(min = 1)
private List<@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$") String> flightIds;
private List</*@Pattern(regexp = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$") */String> flightIds;

public FlighttaskUndoRequest() {
}
Expand Down
Loading