#pragma once // Public stuff struct Client; typedef struct Client* Client; #include "message.h" #include "chassis.h" #include "sdk.h" // SIMPLE // Create a client // Connect to a drone // Send messages // Poll for responses Client client_new(); void client_connect(Client client); void poll_message(Client client, union Message* message); static inline uint8_t host2byte(uint8_t host, uint8_t index) { return index * 32 + host; } static inline void byte2host(uint8_t b, uint8_t* host, uint8_t* index) { *host = (b & 0x1F); *index = b >> 5; } /* * Drive the wheels of the robot. Values should be [-1, 1] * * x: positive is forward, negative is backwards * y: positive is right, negative is left * r: positive is clockwise, negative is counterclockwise */ void drive(Client client, float x, float y, float r);