Files
RDC_Simulation/docs/rover_controller.md
2025-12-31 23:50:26 +00:00

2.6 KiB

Rover Controller

The RoverController creates a moving landing pad target.

Usage

The rover controller is automatically included when running controllers.py:

# Stationary rover (default)
python controllers.py

# Moving rover
python controllers.py --pattern circular --speed 0.3

Options

Option Short Default Description
--pattern -p stationary Movement pattern
--speed -s 0.5 Speed in m/s
--amplitude -a 2.0 Amplitude in meters

Movement Patterns

Stationary

python controllers.py --pattern stationary

Rover stays at origin. Best for initial testing.

Linear

python controllers.py --pattern linear --speed 0.3 --amplitude 2.0

Oscillates along X-axis.

Circular

python controllers.py --pattern circular --speed 0.5 --amplitude 2.0

Follows circular path of radius amplitude.

Random

python controllers.py --pattern random --speed 0.3 --amplitude 2.0

Moves to random positions. Changes target every 3 seconds.

Square

python controllers.py --pattern square --speed 0.5 --amplitude 2.0

Square pattern with corners at (±amplitude, ±amplitude).

Difficulty Levels

Level Pattern Speed Description
Beginner stationary 0.0 Static target
Easy linear 0.2 Predictable 1D
Medium circular 0.3 Smooth 2D
Hard random 0.3 Unpredictable
Expert square 0.5 Sharp turns

Progressive Testing

Start easy and increase difficulty:

# Step 1: Static target
python controllers.py --pattern stationary

# Step 2: Slow linear motion
python controllers.py --pattern linear --speed 0.2

# Step 3: Slow circular motion
python controllers.py --pattern circular --speed 0.2

# Step 4: Faster circular
python controllers.py --pattern circular --speed 0.4

# Step 5: Random
python controllers.py --pattern random --speed 0.3

Published Topics

Topic Type Description
/rover/cmd_vel Twist Velocity commands
/rover/position Point Current position
/rover/telemetry String Full state (JSON)

GPS-Denied Note

In GPS-denied mode, the drone cannot directly access rover position. Instead, it must detect the landing pad visually via landing_pad sensor data.

The /rover/telemetry topic is used internally by the RoverController but the DroneController should primarily rely on vision-based landing_pad detection in the drone telemetry.