435 lines
17 KiB
C
435 lines
17 KiB
C
// app
|
|
#include "robot_def.h"
|
|
#include "robot_cmd.h"
|
|
// module
|
|
#include "remote_control.h"
|
|
#include "ins_task.h"
|
|
#include "master_process.h"
|
|
#include "message_center.h"
|
|
#include "general_def.h"
|
|
#include "dji_motor.h"
|
|
#include "auto_aim.h"
|
|
#include "super_cap.h"
|
|
#include "user_lib.h"
|
|
|
|
#include "air_pump.h"
|
|
// bsp
|
|
#include "bsp_dwt.h"
|
|
#include "bsp_log.h"
|
|
#include "referee_task.h"
|
|
#include "referee_VT.h"
|
|
|
|
// 私有宏,自动将编码器转换成角度值
|
|
#define YAW_ALIGN_ANGLE (YAW_CHASSIS_ALIGN_ECD * ECD_ANGLE_COEF_DJI) // 对齐时的角度,0-360
|
|
#define PTICH_HORIZON_ANGLE (PITCH_HORIZON_ECD * ECD_ANGLE_COEF_DJI) // pitch水平时电机的角度,0-360
|
|
|
|
/* cmd应用包含的模块实例指针和交互信息存储*/
|
|
#ifdef GIMBAL_BOARD // 对双板的兼容,条件编译
|
|
#include "can_comm.h"
|
|
static CANCommInstance *cmd_can_comm; // 双板通信
|
|
#endif
|
|
#ifdef ONE_BOARD
|
|
static Publisher_t *chassis_cmd_pub; // 底盘控制消息发布者
|
|
static Subscriber_t *chassis_feed_sub; // 底盘反馈信息订阅者
|
|
#endif // ONE_BOARD
|
|
|
|
static Chassis_Ctrl_Cmd_s chassis_cmd_send; // 发送给底盘应用的信息,包括控制信息和UI绘制相关
|
|
static Chassis_Upload_Data_s chassis_fetch_data; // 从底盘应用接收的反馈信息信息,底盘功率枪口热量与底盘运动状态等
|
|
extern SuperCapInstance *cap; // 超级电容
|
|
static RC_ctrl_t *rc_data; // 遥控器数据,初始化时返回
|
|
//static Vision_Recv_s *vision_recv_data; // 视觉接收数据指针,初始化时返回
|
|
//static Vision_Send_s vision_send_data; // 视觉发送数据
|
|
static RecievePacket_t *vision_recv_data; // 视觉接收数据指针,初始化时返回
|
|
static SendPacket_t vision_send_data; // 视觉发送数据
|
|
|
|
PumpInstance *air_pump; //吸盘
|
|
|
|
//自瞄相关信息
|
|
static Trajectory_Type_t trajectory_cal;
|
|
static Aim_Select_Type_t aim_select;
|
|
static uint32_t no_find_cnt; // 未发现目标计数
|
|
static uint8_t auto_aim_flag = 0; //辅助瞄准标志位 视野内有目标开启 目标丢失关闭
|
|
|
|
static Publisher_t *arm_cmd_pub; // 云台控制消息发布者
|
|
static Subscriber_t *arm_feed_sub; // 云台反馈信息订阅者
|
|
static Arm_Ctrl_Cmd_s arm_cmd_send; // 传递给云台的控制信息
|
|
static Arm_Upload_Data_s gimbal_fetch_data; // 从云台获取的反馈信息
|
|
|
|
static Publisher_t *to_stretch_cmd_pub; // 伸缩控制消息发布者
|
|
static Subscriber_t *to_stretch_feed_sub; // 伸缩反馈信息订阅者
|
|
static To_stretch_Ctrl_Cmd_s to_stretch_cmd_send; // 传递给伸缩的控制信息
|
|
static To_stretch_Upload_Data_s to_stretch_fetch_data; // 从发射伸缩的反馈信息
|
|
|
|
static Robot_Status_e robot_state; // 机器人整体工作状态
|
|
static referee_info_t *referee_data; // 用于获取裁判系统的数据
|
|
|
|
VT_info_t *referee_VT_data; //图传链路数据
|
|
custom_control_t CustomControl; //自定义控制器数据
|
|
|
|
void RobotCMDInit() {
|
|
rc_data = RemoteControlInit(&huart5); // 修改为对应串口,注意如果是自研板dbus协议串口需选用添加了反相器的那个
|
|
// vision_recv_data = VisionInit(&huart1); // 视觉通信串口
|
|
|
|
referee_data = UITaskInit(&huart3, &ui_data); // 裁判系统初始化,会同时初始化UI
|
|
referee_VT_data = VTInit(&huart10);
|
|
|
|
//这里需要改一下气泵的控制电路
|
|
air_pump = PumpInit(&htim1,TIM_CHANNEL_1);
|
|
|
|
arm_cmd_pub = PubRegister("arm_cmd", sizeof(Arm_Ctrl_Cmd_s));
|
|
arm_feed_sub = SubRegister("arm_feed", sizeof(Arm_Upload_Data_s));
|
|
to_stretch_cmd_pub = PubRegister("to_stretch_cmd", sizeof(To_stretch_Ctrl_Cmd_s));
|
|
to_stretch_feed_sub = SubRegister("to_stretch_feed", sizeof(To_stretch_Upload_Data_s));
|
|
|
|
#ifdef ONE_BOARD // 双板兼容
|
|
chassis_cmd_pub = PubRegister("chassis_cmd", sizeof(Chassis_Ctrl_Cmd_s));
|
|
chassis_feed_sub = SubRegister("chassis_feed", sizeof(Chassis_Upload_Data_s));
|
|
#endif // ONE_BOARD
|
|
#ifdef GIMBAL_BOARD
|
|
CANComm_Init_Config_s comm_conf = {
|
|
.can_config = {
|
|
.can_handle = &hcan1,
|
|
.tx_id = 0x312,
|
|
.rx_id = 0x311,
|
|
},
|
|
.recv_data_len = sizeof(Chassis_Upload_Data_s),
|
|
.send_data_len = sizeof(Chassis_Ctrl_Cmd_s),
|
|
};
|
|
cmd_can_comm = CANCommInit(&comm_conf);
|
|
#endif // GIMBAL_BOARD
|
|
//arm_cmd_send.pitch = PITCH_MIN;
|
|
|
|
robot_state = ROBOT_READY; // 启动时机器人进入工作模式,后续加入所有应用初始化完成之后再进入
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* @brief 控制输入为遥控器(调试时)的模式和控制量设置
|
|
*
|
|
*/
|
|
static void update_ui_data() {
|
|
ui_data.gimbal_mode = arm_cmd_send.gimbal_mode;
|
|
ui_data.chassis_mode = chassis_cmd_send.chassis_mode;
|
|
ui_data.to_stretch_mode = to_stretch_cmd_send.to_stretch_mode;
|
|
|
|
ui_data.xyz[1] = to_stretch_fetch_data.protract_x;
|
|
ui_data.xyz[2] = to_stretch_fetch_data.lift_z;
|
|
ui_data.big_pitch_angle = gimbal_fetch_data.arm_feedback;
|
|
}
|
|
|
|
|
|
// 出招表
|
|
|
|
static void RemoteControlSet() {
|
|
// 吸盘气泵控制,拨轮向上打为负,向下为正
|
|
if (rc_data[TEMP].rc.dial < -300) // 向上超过300,打开气泵
|
|
{
|
|
Pump_open(air_pump);
|
|
ui_data.pump_mode = PUMP_OPEN;
|
|
}
|
|
else
|
|
{
|
|
Pump_stop(air_pump);
|
|
ui_data.pump_mode = PUMP_STOP;
|
|
}
|
|
if (switch_is_up(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[上],底盘运动
|
|
{
|
|
chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE;
|
|
// 底盘参数,目前没有加入小陀螺(调试似乎暂时没有必要),系数需要调整,遥控器输入灵敏度
|
|
chassis_cmd_send.vx = 15.0f * (float) rc_data[TEMP].rc.rocker_r_; // _水平方向
|
|
chassis_cmd_send.vy = 15.0f * (float) rc_data[TEMP].rc.rocker_r1; // 1数值方向
|
|
chassis_cmd_send.wz = -1.0f * (float) rc_data[TEMP].rc.rocker_l_; //旋转
|
|
to_stretch_cmd_send.tc = -3.0F * (float) rc_data[TEMP].rc.rocker_l1;//图传
|
|
// 图传限位
|
|
// if (to_stretch_cmd_send.tc >= TUCHUAN_MAX_ANGLE) to_stretch_cmd_send.tc = TUCHUAN_MAX_ANGLE;
|
|
// if (to_stretch_cmd_send.tc <= TUCHUAN_MAX_ANGLE) to_stretch_cmd_send.tc = TUCHUAN_MIN_ANGLE;
|
|
} else if (switch_is_mid(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[中],底盘平移,伸缩运动
|
|
{
|
|
chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
|
|
to_stretch_cmd_send.to_stretch_mode = TO_STRETCH_MODE;
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE;
|
|
to_stretch_cmd_send.tc = 0;
|
|
|
|
chassis_cmd_send.vx = 15.0f * (float) rc_data[TEMP].rc.rocker_r_; // _水平方向
|
|
chassis_cmd_send.vy = 15.0f * (float) rc_data[TEMP].rc.rocker_r1; // 1数值方向
|
|
|
|
to_stretch_cmd_send.ud += 0.0025F * (float) rc_data[TEMP].rc.rocker_l_;//抬升
|
|
to_stretch_cmd_send.fb += 0.0025F * (float) rc_data[TEMP].rc.rocker_l1;//前伸
|
|
|
|
//伸缩限位待添加
|
|
// if (arm_cmd_send.pitch >= PITCH_MAX_ANGLE) arm_cmd_send.pitch = PITCH_MAX_ANGLE;
|
|
// if (arm_cmd_send.pitch <= PITCH_MIN_ANGLE) arm_cmd_send.pitch = PITCH_MIN_ANGLE;
|
|
}
|
|
|
|
// 右侧开关状态为[下],机械臂
|
|
if (switch_is_down(rc_data[TEMP].rc.switch_right)) {
|
|
to_stretch_cmd_send.tc = 0;
|
|
// 左侧开关状态为[下],xyz
|
|
if(switch_is_down(rc_data[TEMP].rc.switch_left))
|
|
{
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE;
|
|
arm_cmd_send.joint1 = 3.0f * (float) rc_data[TEMP].rc.rocker_r1; //增量控制
|
|
arm_cmd_send.joint2 = 7.0f * (float) rc_data[TEMP].rc.rocker_l1; //增量控制
|
|
arm_cmd_send.joint3 = 0.001f * (float) rc_data[TEMP].rc.rocker_l_; //增量控制
|
|
}
|
|
|
|
// 左侧开关状态为[中],腕部
|
|
if(switch_is_mid(rc_data[TEMP].rc.switch_left))
|
|
{
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE;
|
|
arm_cmd_send.joint4 = 0.001f * (float) rc_data[TEMP].rc.rocker_r1;
|
|
arm_cmd_send.joint5 = 1.0f * (float) rc_data[TEMP].rc.rocker_l_;
|
|
arm_cmd_send.joint6 = 1.0f * (float) rc_data[TEMP].rc.rocker_l1;
|
|
}
|
|
|
|
|
|
//自定义控制器各电机角度
|
|
// if(switch_is_mid(rc_data[TEMP].rc.switch_left))
|
|
// {
|
|
// arm_cmd_send.gimbal_mode = GIMBAL_CONTROLLER_MODE;
|
|
// uint16_t tmp;
|
|
// tmp = (uint16_t )((referee_VT_data->CustomControl.data[1]<<8) | referee_VT_data->CustomControl.data[0]);
|
|
// arm_cmd_send.Controller_FeedBackAngle[1] = uint_to_float(tmp,-3.141593f,3.141593f,16)-1.43f;
|
|
//
|
|
// tmp = (uint16_t )((referee_VT_data->CustomControl.data[3]<<8) | referee_VT_data->CustomControl.data[2]);
|
|
// arm_cmd_send.Controller_FeedBackAngle[2] = uint_to_float(tmp,-12.5f,12.5f,16);
|
|
//
|
|
// tmp = (uint16_t )((referee_VT_data->CustomControl.data[5]<<8) | referee_VT_data->CustomControl.data[4]);
|
|
// arm_cmd_send.Controller_FeedBackAngle[3] = uint_to_float(tmp,-12.5f,12.5f,16);
|
|
//
|
|
// tmp = (uint16_t )((referee_VT_data->CustomControl.data[7]<<8) | referee_VT_data->CustomControl.data[6]);
|
|
// arm_cmd_send.Controller_FeedBackAngle[4] = uint_to_float(tmp,-12.5f,12.5f,16);
|
|
//
|
|
// }
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
* @brief 输入为键鼠时模式和控制量设置
|
|
*
|
|
*/
|
|
static void MouseKeySet() {
|
|
chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
|
|
to_stretch_cmd_send.to_stretch_mode = TO_STRETCH_MODE;
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_G] % 2) //G按键开关气泵
|
|
{
|
|
case 0:
|
|
Pump_stop(air_pump);
|
|
ui_data.pump_mode = PUMP_STOP;
|
|
break;
|
|
default:
|
|
Pump_open(air_pump);
|
|
ui_data.pump_mode = PUMP_OPEN;
|
|
break;
|
|
}
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_B] % 2) // CTRL + B键手动刷新UI
|
|
{
|
|
case 1:
|
|
MyUIInit();
|
|
rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_B]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_X] % 2) // X 取银矿模式
|
|
{
|
|
case 1:
|
|
arm_cmd_send.gimbal_mode = GIMBAL_SILVER_MODE; //取银矿姿态
|
|
rc_data[TEMP].key_count[KEY_PRESS][Key_X]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_Z] % 2) // ctrl + Z 取地矿模式
|
|
{
|
|
case 1:
|
|
arm_cmd_send.gimbal_mode = GIMBAL_FLOOR_MODE; //取银矿姿态
|
|
rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_Z]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_C] % 2) // ctrl + Z 取地矿模式
|
|
{
|
|
case 1:
|
|
arm_cmd_send.gimbal_mode = GIMBAL_STORAGE_MODE; //取银矿姿态
|
|
rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_C]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_X] % 2) // ctrl+x 调整零点
|
|
{
|
|
case 1:
|
|
arm_cmd_send.set_zero_flag += 1;
|
|
rc_data[TEMP].key_count[KEY_PRESS_WITH_CTRL][Key_X]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// switch (rc_data[TEMP].key_count[KEY_PRESS][Key_V] % 2) // V 开启自定义控制器
|
|
// {
|
|
// case 1:
|
|
// arm_cmd_send.gimbal_mode = GIMBAL_IKINE_MODE; //自定义
|
|
// rc_data[TEMP].key_count[KEY_PRESS][Key_V]++;
|
|
// break;
|
|
// default:
|
|
// break;
|
|
// }
|
|
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_B] % 2) //B 切手动
|
|
{
|
|
case 0:
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE; //自定义
|
|
rc_data[TEMP].key_count[KEY_PRESS][Key_B]++;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
//银矿 吸盘朝前
|
|
if (arm_cmd_send.gimbal_mode == GIMBAL_SILVER_MODE)
|
|
{ arm_cmd_send.rpy[0] = 0; arm_cmd_send.rpy[1] = -180; arm_cmd_send.rpy[2] = 0;}
|
|
|
|
//地矿 吸盘朝下
|
|
if (arm_cmd_send.gimbal_mode == GIMBAL_FLOOR_MODE)
|
|
{ arm_cmd_send.rpy[0] = 0; arm_cmd_send.rpy[1] = -90; arm_cmd_send.rpy[2] = 0;}
|
|
//存矿 矿仓角度
|
|
if (arm_cmd_send.gimbal_mode == GIMBAL_STORAGE_MODE)
|
|
{ arm_cmd_send.rpy[0] = 0; arm_cmd_send.rpy[1] = -30; arm_cmd_send.rpy[2] = 0;}
|
|
|
|
//手动模式 可以用遥控器调节末端姿态
|
|
if (arm_cmd_send.gimbal_mode == ARM_MANUAL_MODE)
|
|
{ //增量控制
|
|
|
|
}
|
|
|
|
//自定义控制器 控制末端姿态
|
|
if (arm_cmd_send.gimbal_mode == GIMBAL_IKINE_MODE)
|
|
{//自定义控制器控制末端姿态
|
|
|
|
if(rc_data[TEMP].key[KEY_PRESS].ctrl)
|
|
{
|
|
for (int i = 0; i < 4; ++i) {
|
|
arm_cmd_send.quat[i] = (float)(CustomControl.q[i]) * 1e-4f;
|
|
}
|
|
QuaternionToEularAngle(arm_cmd_send.quat, &arm_cmd_send.rpy[2], &arm_cmd_send.rpy[1], &arm_cmd_send.rpy[0]);
|
|
//ctrl按下调整姿态
|
|
} else
|
|
{
|
|
to_stretch_cmd_send.fb += CustomControl.dx * 0.04f;
|
|
to_stretch_cmd_send.ud += CustomControl.dz * 0.15f;
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
to_stretch_cmd_send.ud += (float)(rc_data[TEMP].key[KEY_PRESS].q - rc_data[TEMP].key[KEY_PRESS].e) * 0.15f;
|
|
to_stretch_cmd_send.fb += (float)(rc_data[TEMP].key[KEY_PRESS].z - rc_data[TEMP].key[KEY_PRESS].c) * 0.3f;
|
|
}
|
|
|
|
if(rc_data[TEMP].key[KEY_PRESS].shift) //shift 加速
|
|
{
|
|
chassis_cmd_send.vy = rc_data[TEMP].key[KEY_PRESS].w * 8000 * 3 - rc_data[TEMP].key[KEY_PRESS].s * 8000 * 3; // 系数待测
|
|
chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 8000 * 3- rc_data[TEMP].key[KEY_PRESS].d * 8000 * 3;
|
|
}
|
|
else
|
|
{
|
|
chassis_cmd_send.vy = rc_data[TEMP].key[KEY_PRESS].w * 8000 - rc_data[TEMP].key[KEY_PRESS].s * 8000 ; // 系数待测
|
|
chassis_cmd_send.vx = rc_data[TEMP].key[KEY_PRESS].a * 8000 - rc_data[TEMP].key[KEY_PRESS].d * 8000 ;
|
|
}
|
|
|
|
chassis_cmd_send.wz = -(float) rc_data[TEMP].mouse.x * 8;
|
|
|
|
to_stretch_cmd_send.tc = (float) rc_data[TEMP].mouse.y * 20;
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
* @brief 紧急停止,包括遥控器左上侧拨轮打满/重要模块离线/双板通信失效等
|
|
* 停止的阈值'300'待修改成合适的值,或改为开关控制.
|
|
*
|
|
* @todo 后续修改为遥控器离线则电机停止(关闭遥控器急停),通过给遥控器模块添加daemon实现
|
|
*
|
|
*/
|
|
static void EmergencyHandler() {
|
|
// 拨轮的向下拨超过一半进入急停模式.注意向打时下拨轮是正
|
|
if (rc_data[TEMP].rc.dial > 300 || robot_state == ROBOT_STOP) // 还需添加重要应用和模块离线的判断
|
|
{
|
|
robot_state = ROBOT_STOP;
|
|
arm_cmd_send.gimbal_mode = GIMBAL_ZERO_FORCE;
|
|
chassis_cmd_send.chassis_mode = CHASSIS_ZERO_FORCE;
|
|
to_stretch_cmd_send.to_stretch_mode = TO_STRETCH_ZERO_FORCE;
|
|
LOGERROR("[CMD] emergency stop!");
|
|
}
|
|
// 遥控器右侧开关为[上],恢复正常运行
|
|
if (switch_is_up(rc_data[TEMP].rc.switch_right)) {
|
|
robot_state = ROBOT_READY;
|
|
arm_cmd_send.gimbal_mode = ARM_MANUAL_MODE;
|
|
LOGINFO("[CMD] reinstate, robot ready");
|
|
}
|
|
}
|
|
|
|
/* 机器人核心控制任务,200Hz频率运行(必须高于视觉发送频率) */
|
|
void RobotCMDTask() {
|
|
// 从其他应用获取回传数据
|
|
#ifdef ONE_BOARD
|
|
SubGetMessage(chassis_feed_sub, (void *) &chassis_fetch_data);
|
|
#endif // ONE_BOARD
|
|
#ifdef GIMBAL_BOARD
|
|
chassis_fetch_data = *(Chassis_Upload_Data_s *)CANCommGet(cmd_can_comm);
|
|
#endif // GIMBAL_BOARD
|
|
//获取自定义控制器数据
|
|
memcpy(&CustomControl,&referee_VT_data->CustomControl,sizeof(custom_control_t));
|
|
|
|
SubGetMessage(to_stretch_feed_sub, &to_stretch_fetch_data);
|
|
SubGetMessage(arm_feed_sub, &gimbal_fetch_data);
|
|
|
|
// 根据gimbal的反馈值计算云台和底盘正方向的夹角,不需要传参,通过static私有变量完成
|
|
//CalcOffsetAngle();
|
|
// 根据遥控器左侧开关,确定当前使用的控制模式为遥控器调试还是键鼠
|
|
if (switch_is_down(rc_data[TEMP].rc.switch_left) ||
|
|
switch_is_mid(rc_data[TEMP].rc.switch_left)) // 遥控器左侧开关状态为[下],[中],遥控器控制
|
|
RemoteControlSet();
|
|
else if (switch_is_up(rc_data[TEMP].rc.switch_left)) // 遥控器左侧开关状态为[上],键盘控制
|
|
MouseKeySet();
|
|
|
|
EmergencyHandler(); // 处理模块离线和遥控器急停等紧急情况
|
|
|
|
// //裁判系统断电则不使能
|
|
// if(referee_data->GameRobotState.power_management_chassis_output == 0)
|
|
// {
|
|
// chassis_cmd_send.chassis_mode = CHASSIS_ZERO_FORCE;
|
|
// to_stretch_cmd_send.to_stretch_mode = TO_STRETCH_ZERO_FORCE;
|
|
// }
|
|
// if(referee_data->GameRobotState.power_management_gimbal_output == 0)
|
|
// {
|
|
// arm_cmd_send.gimbal_mode = GIMBAL_ZERO_FORCE;
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 推送消息,双板通信,视觉通信等
|
|
// 其他应用所需的控制数据在remotecontrolsetmode和mousekeysetmode中完成设置
|
|
|
|
update_ui_data();
|
|
#ifdef ONE_BOARD
|
|
PubPushMessage(chassis_cmd_pub, (void *) &chassis_cmd_send);
|
|
#endif // ONE_BOARD
|
|
#ifdef GIMBAL_BOARD
|
|
CANCommSend(cmd_can_comm, (void *)&chassis_cmd_send);
|
|
#endif // GIMBAL_BOARD
|
|
PubPushMessage(to_stretch_cmd_pub, (void *) &to_stretch_cmd_send);
|
|
PubPushMessage(arm_cmd_pub, (void *) &arm_cmd_send);
|
|
}
|
|
|