获取osd中的无人机飞行数据

Comments

8 comments

  • Boerma

    mqtt某个topic下的消息就类似一个广播,所有监听这个topic的客户端都能收到并消费

    1
    Comment actions Permalink
  • doushuo

    这个我知道,那个MQTT类似消息队列那种,主要是每太研究明白这个上云APIDemo的源码,我看SDK里是做了消息的处理的,

    public class InboundMessageRouter extends AbstractMessageRouter {

    private static final Logger log = LoggerFactory.getLogger(InboundMessageRouter.class);

    /**
    * All mqtt broker messages will arrive here before distributing them to different channels.
    * @param message message from mqtt broker
    * @return channel
    */
    @Override
    @Router(inputChannel = ChannelName.INBOUND)
    protected Collection<MessageChannel> determineTargetChannels(Message<?> message) {
    MessageHeaders headers = message.getHeaders();
    String topic = headers.get(MqttHeaders.RECEIVED_TOPIC).toString();
    byte[] payload = (byte[])message.getPayload();

    log.debug("received topic: {} \t payload =>{}", topic, new String(payload));

    CloudApiTopicEnum topicEnum = CloudApiTopicEnum.find(topic);
    MessageChannel bean = (MessageChannel) SpringBeanUtils.getBean(topicEnum.getBeanName());

    return Collections.singleton(bean);
    }
    }
    0
    Comment actions Permalink
  • Boerma

    demo是有自己的业务逻辑在里面。可以修改demo完成自己的需求,也可以不用demo,自己开发业务功能,至于pilot 的交互,安装协议提供接口或者自行处理mqtt消息即可。上云api是一套交互协议,并不是sdk

    0
    Comment actions Permalink
  • doushuo

    好的,谢谢

    0
    Comment actions Permalink
  • Cx243690

    可以加个微信,请教个问题吗

     

    0
    Comment actions Permalink
  • Cx243690

    doushuo

     

    0
    Comment actions Permalink
  • doushuo

    都可以,怎么加,你有不懂的可以在这里提问,我也是刚接触这个接无人机的数据

    0
    Comment actions Permalink
  • Cx243690

    你加我v,orcla-java

    0
    Comment actions Permalink

Please sign in to leave a comment.