This commit is contained in:
2026-03-28 04:32:08 +08:00
parent 14c87856e7
commit b8dbb5aa47

View File

@@ -30,8 +30,7 @@ static bool sendTarget(Serial &serial, double yaw_deg, double pitch_deg, double
#endif #endif
// ---- 新格式: 字符串帧 ---- // ---- 新格式: 字符串帧 ----
// 格式: "# s <type> <yaw_int> <pitch_int> *\n" // 格式: "s <yaw_int> <pitch_int> <dist> <shoot_delay> e\n"
// type: 'r'=红色装甲板, 'b'=蓝色, 'u'=未知
int16_t yaw_tmp = static_cast<int16_t>(yaw_deg / ANGLE_SCALE); int16_t yaw_tmp = static_cast<int16_t>(yaw_deg / ANGLE_SCALE);
int16_t pitch_tmp = static_cast<int16_t>(pitch_deg / ANGLE_SCALE); int16_t pitch_tmp = static_cast<int16_t>(pitch_deg / ANGLE_SCALE);
std::string frame = fmt::format("s {} {} {} {} e\n", yaw_tmp, pitch_tmp, dist, shoot_delay); std::string frame = fmt::format("s {} {} {} {} e\n", yaw_tmp, pitch_tmp, dist, shoot_delay);