Add gimbal control message
parent
2258812fc2
commit
0b238ce048
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "message.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t GIMBAL_HOST = 4;
|
||||
static const uint8_t GIMBAL_INDEX = 0;
|
||||
|
||||
#define GIMBAL_CTRL_SPEED_CMD 0x0C04
|
||||
|
||||
void
|
||||
gimbal_ctrl_speed (
|
||||
union Request* req,
|
||||
uint16_t seq,
|
||||
bool ack,
|
||||
int16_t p,
|
||||
int16_t y,
|
||||
int16_t r );
|
@ -0,0 +1,18 @@
|
||||
#include "message.h"
|
||||
#include "connection.h"
|
||||
#include "robomaster.h"
|
||||
|
||||
void
|
||||
gimbal_ctrl_speed (
|
||||
union Request* req,
|
||||
uint16_t seq,
|
||||
bool ack,
|
||||
int16_t p,
|
||||
int16_t y,
|
||||
int16_t r ) {
|
||||
req->gimbspeed.yaw = y;
|
||||
req->gimbspeed.roll = r;
|
||||
req->gimbspeed.pitch = p;
|
||||
req->gimbspeed.ctrl = 0xDC;
|
||||
req_finalize(seq, GIMBAL_CTRL_SPEED_CMD, ack, req);
|
||||
}
|
Loading…
Reference in New Issue