Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.

Dependencies:   mbed Watchdog SDFileSystem DigoleSerialDisp

Committer:
shimniok
Date:
Fri Nov 30 16:11:53 2018 +0000
Revision:
25:bb5356402687
Parent:
0:a6a169de725f
Initial publish of revised version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimniok 0:a6a169de725f 1 /* MAVLink adapter header */
shimniok 0:a6a169de725f 2 #ifndef __MAVLINK_BRIDGE_HEADER_H
shimniok 0:a6a169de725f 3 #define __MAVLINK_BRIDGE_HEADER_H
shimniok 0:a6a169de725f 4
shimniok 0:a6a169de725f 5 #define MAVLINK_USE_CONVENIENCE_FUNCTIONS
shimniok 0:a6a169de725f 6
shimniok 0:a6a169de725f 7 #include "mavlink_types.h"
shimniok 0:a6a169de725f 8
shimniok 0:a6a169de725f 9 /* Struct that stores the communication settings of this system.
shimniok 0:a6a169de725f 10 you can also define / alter these settings elsewhere, as long
shimniok 0:a6a169de725f 11 as they're included BEFORE mavlink.h.
shimniok 0:a6a169de725f 12 So you can set the
shimniok 0:a6a169de725f 13
shimniok 0:a6a169de725f 14 mavlink_system.sysid = 100; // System ID, 1-255
shimniok 0:a6a169de725f 15 mavlink_system.compid = 50; // Component/Subsystem ID, 1-255
shimniok 0:a6a169de725f 16
shimniok 0:a6a169de725f 17 Lines also in your main.c, e.g. by reading these parameter from EEPROM.
shimniok 0:a6a169de725f 18 */
shimniok 0:a6a169de725f 19 mavlink_system_t mavlink_system;
shimniok 0:a6a169de725f 20
shimniok 0:a6a169de725f 21 /**
shimniok 0:a6a169de725f 22 * @brief Send one char (uint8_t) over a comm channel
shimniok 0:a6a169de725f 23 *
shimniok 0:a6a169de725f 24 * @param chan MAVLink channel to use, usually MAVLINK_COMM_0 = UART0
shimniok 0:a6a169de725f 25 * @param ch Character to send
shimniok 0:a6a169de725f 26 */
shimniok 0:a6a169de725f 27 static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch) {
shimniok 0:a6a169de725f 28 extern Serial pc;
shimniok 0:a6a169de725f 29
shimniok 0:a6a169de725f 30 if (chan == MAVLINK_COMM_0) {
shimniok 0:a6a169de725f 31 pc.putc(ch);
shimniok 0:a6a169de725f 32 }
shimniok 0:a6a169de725f 33 if (chan == MAVLINK_COMM_1) {
shimniok 0:a6a169de725f 34 // write to mavlink logfile
shimniok 0:a6a169de725f 35 }
shimniok 0:a6a169de725f 36 }
shimniok 0:a6a169de725f 37
shimniok 0:a6a169de725f 38 #include "protocol.h"
shimniok 0:a6a169de725f 39 #include "common/common.h"
shimniok 0:a6a169de725f 40
shimniok 0:a6a169de725f 41 #endif /* YOUR_MAVLINK_BRIDGE_HEADER_H *//* MAVLink adapter header */