Metadata-Version: 2.5
Name: robodrome
Version: 0.2.0
Summary: Robodrome developer kit: the bot interface and a local test tool for autonomous racing bots
Project-URL: Homepage, https://robodro.me
Project-URL: Developer guide, https://robodro.me/guide.html
Author: Robodrome
License: Proprietary
Keywords: autonomous driving,bot,education,robodrome,robotics
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: License :: Other/Proprietary License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Education
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: numpy
Description-Content-Type: text/markdown

# Robodrome developer kit

Robodrome is an education platform where students race autonomous driving bots in vehicles simulated with realistic
3D physics. This package contains the interface you need to write a bot, and a test tool that lets you check your bot
on your own computer before uploading it to the platform.

The package provides:

- `Bot`, `Command`, `Observation`, `LidarScan`, `LidarScan3D`: the same interface the platform uses, with type hints
  and documentation. Your editor can auto-complete, and your bot runs on the platform without changes.
- `python -m robodrome test`: runs your bot against observation sequences recorded in real races. It explains errors
  in plain language, compares your step time with the step budget, and checks the format of your commands and state
  estimates.

The race simulation is not part of this package; races run on the platform.

## Installation

Python 3.10 or later is required.

```
pip install robodrome
```

## A minimal bot

`bot.py`:

```python
from robodrome import Bot, Command


class MyBot(Bot):
    def setup(self, info):
        # Called once before the race starts: track map, vehicle and sensor details.
        self.steer_max = info["car"]["steer_max"]

    def step(self, obs):
        # Called every control step. obs.lidar, obs.imu6, obs.enc, obs.pose, obs.v ...
        if obs.lidar is None:
            return Command(throttle=0.2)
        r = obs.lidar.ranges
        n = len(r)
        right, left = r[: n // 3].mean(), r[-n // 3:].mean()
        return Command(throttle=0.3, steer=max(-self.steer_max, min(self.steer_max, 0.3 * (left - right))))
```

A command can take three forms: `Command(throttle, steer)`, body velocity `Command(vx=, vy=, wz=)`, or wheel speeds
`Command(wheels=[...])`. The details are in the `info["drive"]` dictionary passed to `setup` and in the developer guide.

## Test your bot

```
python -m robodrome test bot.py
python -m robodrome test my_project/
python -m robodrome test my_project.zip
```

In a multi-file project the entry file is `bot.py`; modules in the same folder can be imported directly
(`from localization import Estimator`). To see the observation sequences included in the kit, run
`python -m robodrome sequences`. To run a single sequence, add `--sequence junction_level1`; to also get the report
as JSON, add `--json`.

Sample output:

```
[OK] junction_level1: Junction track, level 1, single car, start and first corner
  steps: 350/350   setup: 3.2 ms
  step time: median 0.55 ms · p95 0.80 ms · worst 1.06 ms · first step 0.50 ms (budget 20.0 ms)
```

The test is open loop: your commands do not drive the vehicle, and the observations play back exactly as recorded.
See how well your bot drives in a practice race on the platform. If the test passes, the exit code is 0, so you can
use it in continuous integration.

## Links

- Platform: <https://robodro.me>
- Developer guide: <https://robodro.me/guide.html>

## License

Proprietary software. All rights reserved. The package may be used to develop bots for the Robodrome platform.
