autodrive_teleop.py is a small Qt-based teleoperation dashboard for
AutoDRIVE RoboRacer and F1TENTH-compatible ROS stacks.
It publishes steering and throttle commands from the keyboard, displays basic
race telemetry, can show the front camera feed, and can switch between
Autonomous Drive and Manual Drive mode. Manual Drive mode publishes native
AutoDRIVE command topics by default, with optional F1TENTH-compatible
sensor_msgs/Joy output.
- Qt Widgets dashboard with keyboard control.
- ROS 1 and ROS 2 support from the same script.
- Native AutoDRIVE command output:
<namespace>/throttle_command<namespace>/steering_command/autodrive/reset_command
- Autonomous Drive and Manual Drive modes with native AutoDRIVE command output.
- Optional F1TENTH-compatible
sensor_msgs/Joyoutput. - Optional front camera preview from
sensor_msgs/Image. - Optional lap time, last lap, best lap, speed, and collision count display.
- Configurable vehicle namespace and telemetry topics.
- Configurable label displayed in the top-left corner of the dashboard.
- Smooth throttle and steering ramping.
You need Python 3, one supported Qt binding, and either ROS 1 or ROS 2 Python packages available in your shell.
Supported Qt bindings:
PyQt5PySide6PySide2
ROS message dependencies:
sensor_msgsstd_msgs
For ROS 1, the script imports rospy.
For ROS 2, the script imports rclpy.
Clone the repository:
git clone <your-repo-url> autodrive_teleop
cd autodrive_teleopInstall a Qt binding if your environment does not already provide one:
python3 -m pip install PyQt5Make the script executable:
chmod +x autodrive_teleop.pySource your ROS environment before running the tool.
ROS 2 example:
source /opt/ros/humble/setup.bash
./autodrive_teleop.py --ros 2ROS 1 example:
source /opt/ros/noetic/setup.bash
./autodrive_teleop.py --ros 1Start AutoDRIVE RoboRacer simulator and bridge first, then run:
./autodrive_teleop.pyBy default, the script targets ROS 2 and the vehicle namespace:
/autodrive/roboracer_1
The default AutoDRIVE command topics are:
/autodrive/roboracer_1/throttle_command
/autodrive/roboracer_1/steering_command
/autodrive/reset_command
If you are building or running the autonomous driving side with AutoDRIVE, treat
/autodrive/deadman_switch as the required authority signal:
- Subscribe to
/autodrive/deadman_switch. - Publish
steering_commandandthrottle_commandonly while the value istrue. - Stop publishing those command topics while the value is
false; AutoDRIVE Teleop is in Manual Drive mode and will send the manual commands instead.
Use a different vehicle namespace with --namespace:
./autodrive_teleop.py --ros 2 --namespace /autodrive/roboracer_sagolyuksuUse --label to display a custom string in the top-left corner of the
dashboard. The default label is Roboracer 1:
./autodrive_teleop.py --ros 2 --label "Roboracer 1 - F1TENTH Model"This is especially useful when running multiple RoboRacer instances. Assign a label that identifies the software or model used by each instance so that the dashboard windows can be distinguished at a glance:
./autodrive_teleop.py \
--ros 2 \
--namespace /autodrive/roboracer_1 \
--label "Pure Pursuit"
./autodrive_teleop.py \
--ros 2 \
--namespace /autodrive/roboracer_2 \
--label "RL Model"The AutoDRIVE bridge or simulator must subscribe to the same command topics. If
your bridge is hard-coded to /autodrive/roboracer_1, update the bridge config
or use ROS remapping.
The dashboard stores window geometry and UI state in .autodrive_teleop.ini
next to the script by default. Set AUTODRIVE_TELEOP_SETTINGS to write the
settings file somewhere else, such as a host-mounted path when running in a
throwaway container.
Click the teleop window first so it has keyboard focus.
| Key | Action |
|---|---|
| Up arrow | Forward throttle |
| Down arrow | Reverse throttle |
| Left arrow | Steer left |
| Right arrow | Steer right |
| Space | Stop throttle and steering |
| R | Stop and publish AutoDRIVE reset command |
| A | Toggle Autonomous Drive/Manual Drive output mode |
| Escape | Quit |
Throttle and steering return toward zero when the arrow keys are released.
Autonomous Drive mode publishes only the drive-state extension topic:
/autodrive/deadman_switch = true
It does not publish teleoperation throttle or steering commands in this mode. This prevents AutoDRIVE Teleop from mixing zero-valued commands with an autonomous driving stack that owns the native AutoDRIVE command topics.
Example:
./autodrive_teleop.py \
--ros 2 \
--mode autonomous \
--namespace /autodrive/roboracer_1autodrive_teleop.py publishes an additional std_msgs/Bool drive-state topic:
/autodrive/deadman_switch
The value indicates which side currently has control:
| Value | Meaning |
|---|---|
true / 1 |
Autonomous Drive mode |
false / 0 |
Manual Drive mode |
This is an AutoDRIVE Teleop extension topic for autonomous driving software
built on the AutoDRIVE Devkit. A controller can subscribe to
/autodrive/deadman_switch and publish to
/autodrive/roboracer_1/throttle_command and
/autodrive/roboracer_1/steering_command only while the value is true.
When the value is false, AutoDRIVE Teleop is in Manual Drive mode and owns the
teleoperation command output.
Manual Drive mode changes /autodrive/deadman_switch to false and publishes
the teleoperation command output. By default, it uses the native AutoDRIVE
command topics:
<namespace>/throttle_command
<namespace>/steering_command
Use --f1tenth only when you want F1TENTH-compatible sensor_msgs/Joy output
instead of AutoDRIVE command messages.
Output topic:
- ROS 1:
/vesc/joy - ROS 2:
/joy
Joy output mapping:
| Joy field | Value |
|---|---|
axes[1] |
throttle |
axes[3] |
steering |
buttons[4] |
1 |
buttons[5] |
0 |
Display control input is read from F1TENTH Ackermann command topics:
- ROS 1:
/vesc/low_level/ackermann_cmd_mux/output - ROS 2:
/drive - Message type:
ackermann_msgs/AckermannDriveStamped
Start directly in Manual Drive mode:
./autodrive_teleop.py --ros 2 --mode manualOr force F1TENTH-only publishing:
./autodrive_teleop.py --ros 2 --f1tenth--f1tenth prevents native AutoDRIVE command publishing in Manual Drive mode.
This is useful when you only want Joy output for a F1TENTH stack.
If not specified, telemetry topics are resolved from --namespace.
| Option | Default |
|---|---|
--camera-topic |
<namespace>/front_camera |
--speed-topic |
<namespace>/speed |
--lap-time-topic |
<namespace>/lap_time |
--last-lap-topic |
<namespace>/last_lap_time |
--best-lap-topic |
<namespace>/best_lap_time |
--collision-count-topic |
<namespace>/collision_count |
Example with custom telemetry:
./autodrive_teleop.py \
--ros 2 \
--namespace /autodrive/roboracer_1 \
--camera-topic /camera/image_raw \
--speed-topic /vehicle/speedThe camera panel supports common image encodings such as rgb8, bgr8,
rgba8, bgra8, and mono8.
The command publish rate defaults to 20 Hz:
./autodrive_teleop.py --rate 30Native AutoDRIVE command output applies a throttle scale so the direct
Float32 command path is less aggressive by default:
./autodrive_teleop.py --autodrive-throttle-scale 0.35You can also adjust the native steering scale:
./autodrive_teleop.py --autodrive-steering-scale 0.8Throttle and steering ramp speed can be adjusted:
./autodrive_teleop.py --throttle-step 1.0 --steer-step 1.8Ramp values are in normalized command units per second. Keyboard input is
clamped to the range [-1.0, 1.0], then native AutoDRIVE scale factors are
applied before publishing.
ROS 2 AutoDRIVE RoboRacer:
./autodrive_teleop.py --ros 2 --namespace /autodrive/roboracer_1ROS 1 AutoDRIVE bridge:
./autodrive_teleop.py --ros 1 --namespace /autodrive/roboracer_1ROS 2 F1TENTH-compatible Joy output:
./autodrive_teleop.py --ros 2 --mode manual --f1tenthROS 1 F1TENTH-compatible VESC Joy output:
./autodrive_teleop.py --ros 1 --mode manual --f1tenthCustom RoboRacer namespace:
./autodrive_teleop.py --ros 2 --namespace /autodrive/roboracer_sagolyuksuIf the window opens but the vehicle does not move, check the command topics:
ros2 topic list
ros2 topic echo /autodrive/roboracer_1/throttle_commandor for ROS 1:
rostopic list
rostopic echo /autodrive/roboracer_1/throttle_commandIf Qt is missing, install one supported binding:
python3 -m pip install PyQt5If ROS imports fail, make sure the correct ROS setup file is sourced in the same terminal where you run the script.
If the keyboard does not control the car, click the teleop window once to give it focus.
- Make the AutoDRIVE Devkit read
/autodrive/deadman_switch. - Add
/autodrive/teleop/steer_commandand/autodrive/teleop/throttle_command. - In Manual Drive mode, make the AutoDRIVE Devkit forward the teleop command topics to the simulator.
The next version should follow this direction so autonomous driving stacks do not need to integrate directly with AutoDRIVE Teleop.
