dji-sdk / DJI-Cloud-API-Demo

MIT License
133 stars 96 forks source link

Feature Request : DJI Pilot 2 - Basic Readonly API #16

Open dariofil-star opened 1 year ago

dariofil-star commented 1 year ago

Hi,

We have a business requirement to obtain GPS position of drone. Currently it is very complex/complicated to do this via CloudAPI.

It would be of benefit to many if the DJI Pilot 2 app exposed a simple output of this information every few seconds. Lat, Long, Battery %, Speed

Just a few read only parrameters that we can use for simple integration to represent the drones on the map.

emilianocds commented 1 year ago

You can get that information from the device_osd event

zhang7249 commented 1 year ago

@dariofil-star package com.dji.sample.component.mqtt.handler;

import com.alibaba.fastjson2.JSONObject; import com.dji.sample.common.util.SpringBeanUtils; import com.dji.sample.component.mqtt.model.ChannelName; import com.dji.sample.component.mqtt.model.DeviceTopicEnum; import com.dji.sample.component.redis.RedisConst; import com.dji.sample.component.redis.RedisOpsUtils; import com.dji.sample.manage.model.dto.DeviceDTO; import com.google.gson.JsonObject; import javax.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.integration.annotation.Router; import org.springframework.integration.config.xml.PayloadDeserializingTransformerParser; import org.springframework.integration.mqtt.support.MqttHeaders; import org.springframework.integration.router.AbstractMessageRouter; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHeaders; import org.springframework.stereotype.Component;

import java.util.Collection; import java.util.Collections; import org.springframework.web.client.RestTemplate;

/**

}