48#define UWB_SERIAL_PORT (&((SERIAL_UART).device))
52#define UWB_SERIAL_COMM_MAX_MESSAGE 20
53#define UWB_SERIAL_COMM_END_MARKER 255
54#define UWB_SERIAL_COMM_SPECIAL_BYTE 253
55#define UWB_SERIAL_COMM_START_MARKER 254
56#define UWB_SERIAL_COMM_NODE_STATE_SIZE 7
58#define UWB_SERIAL_COMM_NUM_NODES 3
59#define UWB_SERIAL_COMM_DIST_NUM_NODES UWB_SERIAL_COMM_NUM_NODES-1
63#define UWB_SERIAL_COMM_RANGE 0
64#define UWB_SERIAL_COMM_VX 1
65#define UWB_SERIAL_COMM_VY 2
66#define UWB_SERIAL_COMM_Z 3
67#define UWB_SERIAL_COMM_AX 4
68#define UWB_SERIAL_COMM_AY 5
69#define UWB_SERIAL_COMM_YAWR 6
171 (*data_total_send)++;
176 (*data_total_send)++;
249 (*bytes_received) = 0;
Main include for ABI (AirBorneInterface).
static void send_data(uint32_t stamp)
static void checkStatesUpdated(void)
This function checks if all the states of all the distant nodes have at least once been updated.
#define UWB_SERIAL_COMM_NODE_STATE_SIZE
#define UWB_SERIAL_COMM_VX
#define UWB_SERIAL_COMM_AY
#define UWB_SERIAL_COMM_MAX_MESSAGE
void decawave_anchorless_communication_periodic(void)
This function periodically sends state data over the serial (which is received by the arduino)
#define UWB_SERIAL_COMM_VY
static struct nodeState states[UWB_SERIAL_COMM_DIST_NUM_NODES]
bool state_updated[UWB_SERIAL_COMM_NODE_STATE_SIZE]
#define UWB_SERIAL_COMM_END_MARKER
void decawave_anchorless_communication_init(void)
Initialization functio.
struct link_device * external_device
#define UWB_SERIAL_COMM_YAWR
static void handleNewStateValue(uint8_t nodeIndex, uint8_t msg_type, float value)
Function that is called when over the serial a new state value from a remote node is received.
static void sendFloat(uint8_t msg_type, float data)
Function that will send a float over serial.
static void getSerialData(uint8_t *bytes_received)
Function for receiving serial data.
#define UWB_SERIAL_COMM_Z
static void decodeHighBytes(uint8_t bytes_received, uint8_t *received_message)
Function for decoding the high bytes of received serial data and saving the message.
void decawave_anchorless_communication_event(void)
Event function currently checks for serial data and whether an update of states is available for a di...
#define UWB_SERIAL_COMM_DIST_NUM_NODES
#define UWB_SERIAL_COMM_AX
#define UWB_SERIAL_COMM_RANGE
#define UWB_SERIAL_COMM_SPECIAL_BYTE
#define UWB_SERIAL_COMM_START_MARKER
static void encodeHighBytes(uint8_t *send_data, uint8_t msg_size, uint8_t *data_send_buffer, uint8_t *data_total_send)
Function that encodes the high bytes of the serial data to be sent.
static void setNodeStatesFalse(uint8_t index)
Helper function that sets the boolean that tells whether a remote drone has a new state update to fal...
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
Generic interface for radio control modules.
API to get/set the generic vehicle states.
Periodic telemetry system header (includes downlink utility and generated code).
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.