• 大小: 7.98MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-02
  • 语言: 其他
  • 标签: apm  

资源简介

apm飞控源码

资源截图

代码片段和文件信息



#include 

#include “downstream.h“
#include “state.h“

extern const AP_HAL::HAL& hal;
extern mavlink_channel_t downstream_channel;

extern FMStateMachine sm;

static void downstream_handle_heartbeat(mavlink_message_t* msg) __attribute__((noinline));
static void downstream_handle_heartbeat(mavlink_message_t* msg) {
    mavlink_heartbeat_t pkt;
    mavlink_msg_heartbeat_decode(msg &pkt);
    sm.on_downstream_heartbeat(&pkt);
}

static void downstream_handle_gps(mavlink_message_t* msg) __attribute__((noinline));
static void downstream_handle_gps(mavlink_message_t* msg) {
    mavlink_gps_raw_int_t pkt;
    mavlink_msg_gps_raw_int_decode(msg &pkt);
    sm.on_downstream_gps_raw_int(&pkt);
}

void downstream_handler(mavlink_channel_t from mavlink_message_t* msg) {
    switch (msg->msgid) {
      case MAVlink_MSG_ID_HEARTBEAT:
        downstream_handle_heartbeat(msg); 
        _mavlink_resend_uart(downstream_channel msg);
        break;
      case MAVlink_MSG_ID_GPS_RAW_INT:
        downstream_handle_gps(msg);
        _mavlink_resend_uart(downstream_channel msg);
        break;
      default:
        _mavlink_resend_uart(downstream_channel msg);
    }
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-07-15 01:30  ArduPlane-2.74b\
     文件         513  2013-05-13 07:01  ArduPlane-2.74b\Vagrantfile
     目录           0  2013-07-15 01:30  ArduPlane-2.74b\mk\
     文件          84  2013-05-13 07:01  ArduPlane-2.74b\mk\board_px4.mk
     文件        3655  2013-04-07 00:16  ArduPlane-2.74b\mk\environ.mk
     目录           0  2013-07-15 01:30  ArduPlane-2.74b\mk\PX4\
     目录           0  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\
     目录           0  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\
     文件        1611  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_RET.mix
     文件         188  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_octo_x.mix
     文件        2270  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_AERT.mix
     文件         187  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_hex_+.mix
     文件        1372  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_X5.mix
     文件        5414  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\README
     文件         187  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_quad_v.mix
     文件         554  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_pass.mix
     文件         188  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_hex_x.mix
     文件        1406  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_Q.mix
     文件         186  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_quad_+.mix
     文件         187  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_quad_x.mix
     文件         187  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_octo_+.mix
     文件        1372  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_delta.mix
     文件        1969  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\mixers\FMU_AET.mix
     目录           0  2013-07-15 01:30  ArduPlane-2.74b\mk\PX4\ROMFS\init.d\
     文件        3522  2013-07-15 01:30  ArduPlane-2.74b\mk\PX4\ROMFS\init.d\rc.APM
     文件        1735  2013-05-13 07:01  ArduPlane-2.74b\mk\PX4\ROMFS\init.d\rcS
     文件        1914  2013-07-15 01:30  ArduPlane-2.74b\mk\PX4\config_px4fmu_APM.mk
     文件         909  2013-04-07 00:16  ArduPlane-2.74b\mk\apm.mk
     文件        3337  2013-07-15 01:30  ArduPlane-2.74b\mk\board_avr_sitl.mk
     文件        1889  2013-05-13 07:01  ArduPlane-2.74b\mk\find_tools.mk
     文件        4920  2013-05-13 07:01  ArduPlane-2.74b\mk\sketch_sources.mk
............此处省略1664个文件信息

评论

共有 条评论