feat: add Doom-style teleop control module (#1401)#1552
Closed
christiefhyang wants to merge 6 commits intomainfrom
Closed
feat: add Doom-style teleop control module (#1401)#1552christiefhyang wants to merge 6 commits intomainfrom
christiefhyang wants to merge 6 commits intomainfrom
Conversation
* Reapply "Module config adjustments (#1413)" (#1417) This reverts commit 3df8857. * Fixes * Move global_config * Why did this not commit? * Default * Fix * Fix * Fix * Docs * tentative fix for timeout error * Fix * Use create_autospec * TemporalMemory fix * Forbid extra * Fix --------- Co-authored-by: Sam Bull <Sam.B@snowfalltravel.com> Co-authored-by: Paul Nechifor <paul@nechifor.net>
* fix(imports): remove dunder init * fix import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a Doom-style teleoperation module that allows control of robots using a keyboard and mouse, modeled after first-person shooter (FPS) controls. The DoomTeleop module provides continuous velocity control via the /cmd_vel interface and optional pose control via the /goal_pose and /cancel_goal interfaces. It is robot-agnostic and can be integrated into any robot system that uses these standard interfaces.
Details:
Keyboard Control (Velocity):
• The module maps keyboard inputs to robot movements using Twist messages:
• W/S: Move forward/backward.
• A/D: Turn left/right.
• Space: Emergency stop (sets cmd_vel to zero).
• It publishes velocity commands on the /cmd_vel topic, making it compatible with any robot that supports this interface.
Mouse Control (Yaw and Pose):
• Mouse motion controls yaw (rotation around the vertical axis) based on horizontal movement.
• Right-click sends a small forward goal pose (PoseStamped).
• Middle-click rotates the robot in place using a discrete pose goal, if goal topics (goal_pose, cancel_goal) are set.
Discrete Pose Control:
• The module also allows pose control using the PoseStamped message:
• goal_pose: Sends discrete goal poses for navigation.
• cancel_goal: Cancels ongoing goals with a Bool message (triggered by the Space key).
Robot-Agnostic Design:
• The module is robot-agnostic and works with any robot that supports the ROS navigation interfaces like /cmd_vel, /goal_pose, and /cancel_goal.
• It simply publishes Twist, PoseStamped, and Bool messages to existing transport topics and doesn’t introduce new control interfaces.
Threading for Asynchronous Input Handling:
• The teleoperation input handling (keyboard and mouse events) runs in a separate thread using threading.Event and pygame for event management, allowing non-blocking, responsive input during operation.
Breaking Changes
None. This PR introduces a new module that integrates with existing interfaces without modifying or breaking any existing control paths.
How to Test
• Test the Keyboard Teleoperation:
• W/S: Move forward/backward.
• A/D: Turn left/right.
• Space: Emergency stop (sets cmd_vel to zero).
• Test the Mouse Control:
• Mouse motion: Rotate the robot based on horizontal mouse movement.
• Right-click: Send a small forward goal pose (goal_pose).
• Middle-click: Rotate in place using a discrete goal if goal topics are available.
• Test Pose Control:
• Space: Cancel the current goal pose.
• Ensure the robot responds to pose commands and navigates correctly to the set goals.
Contributor License Agreement