mirror of
https://gitee.com/dlmu-cone/half-steering-basic-framework
synced 2026-10-24 01:52:20 +08:00
6020pitch driver
This commit is contained in:
@@ -207,6 +207,10 @@ static void RemoteControlSet()
|
||||
gimbal_cmd_send.pitch += 0.001f * (float)rc_data[TEMP].rc.rocker_l1;
|
||||
}
|
||||
// 云台软件限位
|
||||
if (gimbal_cmd_send.pitch > PITCH_MAX_ANGLE)
|
||||
gimbal_cmd_send.pitch = PITCH_MAX_ANGLE;
|
||||
else if (gimbal_cmd_send.pitch < PITCH_MIN_ANGLE)
|
||||
gimbal_cmd_send.pitch = PITCH_MIN_ANGLE;
|
||||
|
||||
// 底盘参数,目前没有加入小陀螺(调试似乎暂时没有必要),系数需要调整
|
||||
chassis_cmd_send.vx = 0.15f * (float)rc_data[TEMP].rc.rocker_r_; // _水平方向
|
||||
@@ -243,6 +247,12 @@ static void MouseKeySet()
|
||||
|
||||
gimbal_cmd_send.yaw += (float)rc_data[TEMP].mouse.x / 660 * 10; // 系数待测
|
||||
gimbal_cmd_send.pitch += (float)rc_data[TEMP].mouse.y / 660 * 10;
|
||||
|
||||
// 云台软件限位
|
||||
if (gimbal_cmd_send.pitch > PITCH_MAX_ANGLE)
|
||||
gimbal_cmd_send.pitch = PITCH_MAX_ANGLE;
|
||||
else if (gimbal_cmd_send.pitch < PITCH_MIN_ANGLE)
|
||||
gimbal_cmd_send.pitch = PITCH_MIN_ANGLE;
|
||||
|
||||
switch (rc_data[TEMP].key_count[KEY_PRESS][Key_Z] % 3) // Z键设置弹速
|
||||
{
|
||||
@@ -382,4 +392,4 @@ void RobotCMDTask()
|
||||
PubPushMessage(shoot_cmd_pub, (void *)&shoot_cmd_send);
|
||||
PubPushMessage(gimbal_cmd_pub, (void *)&gimbal_cmd_send);
|
||||
// VisionSend(&vision_send_data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user