mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
feat: add rumble on headless mode switch (core/arm)
This commit is contained in:
@@ -133,13 +133,19 @@ class Headless(Node):
|
||||
|
||||
|
||||
global ctrl_mode
|
||||
new_ctrl_mode = ctrl_mode # if "" then inequality will always be true
|
||||
|
||||
# Check for control mode change
|
||||
dpad_input = self.gamepad.get_hat(0)
|
||||
if dpad_input[1] == 1:
|
||||
ctrl_mode = "arm"
|
||||
new_ctrl_mode = "arm"
|
||||
elif dpad_input[1] == -1:
|
||||
ctrl_mode = "core"
|
||||
new_ctrl_mode = "core"
|
||||
|
||||
if new_ctrl_mode != ctrl_mode:
|
||||
self.gamepad.rumble(0.5, 0.5, 100)
|
||||
ctrl_mode = new_ctrl_mode
|
||||
self.get_logger().info(f"Switched to {ctrl_mode} control mode")
|
||||
|
||||
|
||||
# CORE
|
||||
|
||||
Reference in New Issue
Block a user