Skip to content

Commit

Permalink
Release 0.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbouteiller committed May 5, 2024
1 parent 913ee82 commit 923091e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion readme/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ _(Instructions for TrackMania 2020)_
```shell
python -m tmrl --record-reward
```
- If you are on Windows, press `e` to start recording _(on Linux, recording starts automatically)_
- Wait for the recording to start (a message will be displayed in the terminal)
- Complete the track
- Check that your reward and environment work correctly:
- Execute:
Expand Down
2 changes: 1 addition & 1 deletion readme/reference_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ All parameters are described below.
python -m tmrl --test
```

- Record a reward function in TrackMania. In Windows, press `e` to start recording. In Linux, recording starts automatically. You should start recording at the beginning of the track. The script will compute the reward function automatically when you cross the finish line:
- Record a reward function in TrackMania. You should start recording at the beginning of the track. The script will compute the reward function automatically when you cross the finish line:
```bash
python -m tmrl --record-reward
```
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ def url_retrieve(url: str, outfile: Path, overwrite: bool = False):

setup(
name='tmrl',
version='0.6.3',
version='0.6.4',
description='Network-based framework for real-time robot learning',
long_description=README,
long_description_content_type='text/markdown',
keywords='reinforcement learning, robot learning, trackmania, self driving, roborace',
url='https://github.com/trackmania-rl/tmrl',
download_url='https://github.com/trackmania-rl/tmrl/archive/refs/tags/v0.6.3.tar.gz',
download_url='https://github.com/trackmania-rl/tmrl/archive/refs/tags/v0.6.4.tar.gz',
author='Yann Bouteiller, Edouard Geze',
author_email='[email protected], [email protected]',
license='MIT',
Expand Down
18 changes: 3 additions & 15 deletions tmrl/tools/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

PATH_REWARD = cfg.REWARD_PATH
DATASET_PATH = cfg.DATASET_PATH
SYSTEM = cfg.SYSTEM

if SYSTEM == "Windows":
import keyboard


def record_reward_dist(path_reward=PATH_REWARD):
Expand All @@ -27,21 +23,13 @@ def record_reward_dist(path_reward=PATH_REWARD):
is_recording = False
while True:
if not is_recording:
if SYSTEM == "Windows":
if keyboard.is_pressed('e'):
logging.info(f"start recording")
is_recording = True
else:
logging.info(f"start recording")
is_recording = True
logging.info(f"start recording")
is_recording = True

if is_recording:
data = client.retrieve_data(sleep_if_empty=0.01) # we need many points to build a smooth curve
terminated = bool(data[8])
if SYSTEM == "Windows":
early_stop = keyboard.is_pressed('q')
else:
early_stop = False
early_stop = False
if early_stop or terminated:
logging.info(f"Computing reward function checkpoints from captured positions...")
logging.info(f"Initial number of captured positions: {len(positions)}")
Expand Down

0 comments on commit 923091e

Please sign in to comment.