This commit is contained in:
trung09122002
2026-09-22 17:28:01 +07:00
parent f17dbdce2b
commit dbcbf84dc3
4 changed files with 33 additions and 25 deletions

View File

@@ -48,15 +48,14 @@ void PressEnable(GamepadMapper* m, GamepadState* s, const GamepadConfig& c,
// --- Quy uoc dau cua truc --------------------------------------------------
TEST(Gamepad, KhongDaoDauTruc) {
// ⚠️ BAI TEST NAY KHOA MOT BUG DA XAY RA TREN ROBOT THAT.
// Ham nay KHONG dao dau: no chi doi int16 sang [-1, 1].
//
// Da co mot ban them phep dao dau vao day, voi lap luan "joydev quy uoc
// len/trai la am, joy_node cua ROS dao dau nen ban port phai dao theo". Lap
// luan do suy tu mot dong log sim chu khong tu phep do, va robot that bac
// bo: ban co dao dau lam day can len thi xe LUI, gat trai thi xe re PHAI.
// Phep dao thuoc ve config (`invert_linear` / `invert_angular`), va tren
// robot nay ca hai deu bat -- do tren "Logitech F710" qua xpad: joydev tra
// ve AM khi day can len, nen chay khong dao thi banh quay LUI.
//
// Bo tay cam khac co the khac chieu -- khi do dung invert_linear /
// invert_angular, DUNG sua ham nay.
// Dat phep dao o config chu khong o day vi bo tay cam khac co the khac
// chieu, va chieu chi kiem duoc tren robot that.
EXPECT_DOUBLE_EQ(NormalizeJoydevAxis(32767), 1.0);
EXPECT_DOUBLE_EQ(NormalizeJoydevAxis(-32767), -1.0);
EXPECT_DOUBLE_EQ(NormalizeJoydevAxis(0), 0.0);