Teleoperation Control
Master manual control and understand motion control systems
Tutorial Overview
π― Learning Objectives
By the end of this tutorial, you will:
β Understand teleoperation architecture
β Master joystick control techniques
β Implement keyboard teleoperation
β Create custom control interfaces
β Understand velocity ramping and safety systems
β Tune motion control parameters
β Debug control issues
β Compare different control methods
β±οΈ Time Required
Reading & Theory: 20 minutes
Joystick Control Practice: 25 minutes
Keyboard Implementation: 30 minutes
Custom Control: 25 minutes
Parameter Tuning: 20 minutes
Total: ~120 minutes
π Prerequisites
β Completed ROS2 Communication & Tools
β Can visualize robot in RViz
β Understand topics and services
β Comfortable with command line
β Basic Python knowledge (for custom control)
π οΈ What You'll Need
β Beetlebot (powered, fully charged)
β Laptop with ROS2 Jazzy
β Wireless controller (Cosmic Byte Nexus)
β USB keyboard
β Open space (3m Γ 3m minimum)
β RViz for visualization
Part 1: Teleoperation Architecture
Understanding the Control Chain
Complete signal flow:
Key Nodes Explained
1. joy_node (ROS2 standard)
Reads USB controller via Linux input system
Publishes raw button/axis data
Topic:
/joyRate: ~50-100 Hz (when buttons pressed)
2. lyra_teleop_node (Beetlebot-specific)
Maps joystick axes to velocities
Handles deadman switch (LB button)
Publishes velocity commands
Topic:
/cmd_vel_joy
3. cmd_vel_mux (multiplexer)
Combines multiple velocity sources:
/cmd_vel_joy(joystick - highest priority)/cmd_vel_nav(autonomous navigation)/cmd_vel(keyboard/external)
Joystick always wins (safety!)
Output:
/cmd_vel
4. lyra_cmd_vel_gate_node (safety)
Checks if robot is ARMED
Applies velocity limits
Emergency stop logic
Topic:
/cmd_vel_safe
5. lyra_node (motor control)
Velocity ramping (smooth acceleration)
PID control for each wheel
Sends commands to STM32
Receives encoder feedback
Velocity Ramping Deep Dive
Critical feature: Beetlebot doesn't jump to commanded velocity instantly!
How it works:
Ramp rate: 8 RPM per control cycle
Control frequency: 20 Hz (every 50ms)
Total ramp time: ~1 second (0 β max speed)
Equivalent linear acceleration: ~1.09 m/sΒ²
CRITICAL: Emergency Stop Behavior
LB button (deadman switch) has special behavior:
While LB held: Smooth ramping (as described above)
LB released: β οΈ IMMEDIATE STOP
No ramping! Motors stop instantly
Robot disarms (requires re-pressing LB to move again)
Safety feature: operator must maintain control
Why immediate stop on LB release?
Deadman switch must be instant (safety requirement)
Operator losing control = robot must stop NOW
Cannot wait 1 second for ramp-down
Example scenario:
Part 2: Mastering Joystick Control
Controller Layout Review
Cosmic Byte Nexus controller:
Beetlebot mapping:
LB (Left Bumper): ARM/Deadman switch (MUST hold!)
Left Stick Y-axis: Forward/backward speed
Right Stick X-axis: Turning (left/right)
RB (Right Bumper): Turbo mode (2Γ speed)
Other buttons: Currently unused
Basic Control Techniques
Exercise 6.1: Smooth Acceleration
Task: Feel the velocity ramping
What you learned:
Ramping makes motion smooth and predictable
LB release = emergency stop (no ramp)
Robot feels professional (not jerky like toy robots)
Advanced Driving Patterns
Exercise 6.2: Precision Maneuvering
Task 1: Straight line
Task 2: 90Β° turn
Task 3: Figure-8 pattern
Task 4: Parallel parking
Exercise 6.3: Turbo Mode
RB button doubles max speed (safety feature disabled!)
Task: Compare normal vs turbo
Understanding Joystick Dead Zones
Problem: Joystick resting position isn't exactly centered
Reads ~0.02 instead of 0.00
Would cause slow creep
Solution: Dead zone
Values < threshold treated as zero
Typical: Β±5% dead zone
Check dead zone:
Part 3: Keyboard Teleoperation
Using Built-in Keyboard Teleop
Standard ROS2 tool:
Try driving patterns:
Creating Custom Keyboard Control
More ergonomic layout: WASD + arrow keys
Script:
Run custom teleop:
Drive with WASD keys!
Exercise 6.4: Compare Control Methods
Task: Drive same path with different control methods
Path: 2m Γ 2m square
Method 1: Joystick
Time yourself
Count how many "corrections" needed
Rate smoothness (1-10)
Method 2: Standard keyboard (i/j/k/l)
Time yourself
Count corrections
Rate smoothness
Method 3: Custom keyboard (WASD)
Time yourself
Count corrections
Rate smoothness
Analysis:
Which was fastest?
Which was smoothest?
Which required most corrections?
Which did you prefer?
Part 4: Understanding /cmd_vel Topic
Twist Message Structure
Topic: /cmd_vel
Type: geometry_msgs/msg/Twist
Message definition:
For Beetlebot (differential drive):
Publishing Manual Commands
Test commands via command line:
β οΈ Important: These are single commands! Robot executes then stops.
For continuous motion:
Exercise 6.5: Command Line Control Patterns
Task: Drive patterns using only CLI
Pattern 1: Drive 1 meter forward
Pattern 2: Turn 180Β°
Pattern 3: Circle (radius 1m)
Part 5: Safety Systems
ARM/DISARM Mechanism
Purpose: Prevent accidental motion
ARM = Motors enabled
Can respond to /cmd_vel commands
Joystick LB button pressed
Or service call:
/lyra/arm
DISARM = Motors disabled
Ignores /cmd_vel commands (for safety)
Joystick LB button released
Or service call:
/lyra/disarmOr timeout: No cmd_vel for 500ms
Check ARM Status
Manual ARM/DISARM
Command Timeout Safety
Built-in safety: If no cmd_vel received for 500ms β DISARM
Test:
Why? Safety! If controller disconnects or node crashes, robot stops.
Emergency Stop
Immediately stop robot:
When to use:
Robot behaving unexpectedly
About to collide
Software error
Any emergency situation
Velocity Limits (Safety Gate)
Safety gate node enforces maximum speeds:
Even if cmd_vel requests faster, these limits are enforced!
Example:
Part 6: Motion Control Parameters
Key Parameters
Location: /lyra_node parameters
Critical parameters:
Tuning Max Speed
Change maximum velocity:
Tuning Turn Rate
Exercise 6.6: Speed Tuning Experiment
Task: Find your preferred speed settings
Test 1: Conservative (beginner-friendly)
Test 2: Moderate (default)
Test 3: Aggressive (advanced)
Record your preferences!
Making Parameter Changes Permanent
Problem: Parameters reset on reboot
Solution: Edit config file
Part 7: Debugging Control Issues
Problem: Robot Doesn't Respond to Commands
Systematic debug process:
If still not working: β‘ Power cycle robot
Problem: Robot Moves When Joystick Centered
Cause: Joystick dead zone too small or joystick drift
Debug:
Problem: Jerky Motion
Possible causes:
Low battery
Network latency
Wheel obstruction
Check wheels spin freely
Remove any debris
Parameter issues
Problem: Robot Drifts to One Side
Causes:
Uneven floor (robot is fine, floor is tilted)
Wheel diameter mismatch (calibration needed)
Motor power imbalance (one motor weaker)
Test on flat surface first!
If problem persists:
Part 8: Advanced Control Techniques
Ackermann-Style Control (Simulated)
Beetlebot is differential drive, but can simulate car-like steering:
Create car-style control node:
Script:
Try car-style control!
Velocity Smoothing Script
Further smooth joystick input (beyond hardware ramping):
Part 9: Performance Metrics
Measure Control Latency
How long from button press to robot motion?
Test setup:
Measure Control Accuracy
How closely does robot follow commands?
Part 10: Knowledge Check
Concept Quiz
What happens when you release the LB button?
What's the purpose of velocity ramping?
Why does joystick override autonomous navigation?
What does /cmd_vel_safe do that /cmd_vel doesn't?
If robot won't move, what's the first thing to check?
Hands-On Challenge
Task: Create autonomous square driver
Requirements:
Python script that drives 1m Γ 1m square
No joystick input (purely programmatic)
ARMs robot at start
Uses /cmd_vel topic
Accurate timing for sides and turns
Stops and disarms at end
Bonus:
Add parameter for square size
Visualize in RViz during execution
Measure final position error
Part 11: What You've Learned
β
Congratulations!
You now understand:
Control Architecture:
β Complete teleoperation signal chain
β Joy β Teleop β Mux β Safety Gate β Motor Control
β ARM/DISARM mechanism
β Emergency stop systems
Velocity Ramping:
β Smooth acceleration (8 RPM/cycle)
β LB release = immediate stop (no ramp)
β Benefits for hardware and odometry
Control Methods:
β Joystick (analog, smooth)
β Keyboard (discrete, precise)
β Programmatic (/cmd_vel topic)
β Custom control interfaces
Safety Systems:
β Deadman switch (LB button)
β Command timeout (500ms)
β Velocity limits (safety gate)
β Emergency stop service
Practical Skills:
β Driving techniques (straight, turns, patterns)
β Parameter tuning (speed, turn rate)
β Debugging control issues
β Creating custom teleop nodes
Next Steps
π― You're Now Ready For:
Immediate Next: β Sensor Fusion with EKF - Combine wheel odom + IMU for better accuracy
Navigation: β SLAM Mapping - Build maps while driving β Autonomous Navigation - Let robot drive itself
Advanced Control:
Path following algorithms
Obstacle avoidance behaviors
Multi-robot coordination
Quick Reference
Essential Control Commands
Joystick Button Reference
LB
ARM / Deadman
MUST hold to move
Left Stick Y
Forward/Backward
Push up = forward
Right Stick X
Turn Left/Right
Push left = turn left
RB
Turbo Mode
2Γ speed (use carefully!)
Release LB
Emergency Stop
Immediate stop, disarm
Completed Teleoperation Control! π
β Continue to Sensor Fusion with EKF β Or return to Tutorial Index
Last Updated: January 2026 Tutorial 6 of 11 - Intermediate Level Estimated completion time: 120 minutes
Last updated