Skip to content

Commit

Permalink
update readme (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Sep 6, 2021
1 parent 0a9ea8d commit e3a9f2f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ Pressing W, A, S, D to move and turn and T to trigger the auto-drive mode!
python -m metadrive.examples.drive_in_single_agent_env
```

Besides, a scenario where safety must be concerned is included in examples, and this environment also shows how
to compose a sophisticate scenario.

```bash
python -m metadrive.examples.drive_in_safe_metadrive_env
```

You can also drive in our Multi-agent RL environment.

```bash
python -m metadrive.examples.drive_in_multiagent_env --env [env_name]
python -m metadrive.examples.drive_in_multi_agent_env --env roundabout
```
Accepted arguments:
- roundabout (default)
Expand Down
2 changes: 1 addition & 1 deletion metadrive/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from panda3d.core import Vec3
from panda3d.core import Vec4, BitMask32

EDITION = "MetaDrive v0.2.0"
EDITION = "MetaDrive v0.2.2"
DEFAULT_AGENT = "default_agent"
RENDER_MODE_NONE = "none" # Do not render
RENDER_MODE_ONSCREEN = "onscreen" # Pop up a window and draw image in it
Expand Down
12 changes: 11 additions & 1 deletion metadrive/engine/core/manual_controller.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import logging

from direct.controls.InputState import InputState

from metadrive.utils import is_win, is_mac
Expand All @@ -7,7 +9,7 @@
import evdev
from evdev import ecodes, InputDevice
except ImportError:
print("Install evdev to enable steering wheel control")
pass

from metadrive.utils import import_pygame

Expand Down Expand Up @@ -67,6 +69,14 @@ class SteeringWheelController(Controller):
STEERING_MAKEUP = 1.5

def __init__(self):
try:
import evdev
from evdev import ecodes, InputDevice
except ImportError:
print(
"Fail to load evdev, which is required for steering wheel control. "
"Install evdev via pip install evdev"
)
pygame.display.init()
pygame.joystick.init()
assert not is_win(), "Joystick is supported in linux and mac only"
Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def is_win():
print("We will install the following packages: ", packages)

""" ===== Remember to modify the PG_EDITION at first ====="""
version = "0.2.0"
version = "0.2.2"

ext_modules = cythonize([Extension(
"metadrive.cutils", ["metadrive/cutils.pyx"], include_dirs=[numpy.get_include()]
Expand Down Expand Up @@ -74,37 +74,37 @@ def is_win():

msg = """
If you encounter the following error:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Please feel free to continue! We will disable cython utility and fall back to all python code. Please enjoy!
"""
print(msg)

"""
How to publish to pypi? Noted by Zhenghao in Dec 27, 2020.
1. Remove old files
1. Remove old files ext_modules from setup() to get a clean wheel for all platforms in py3-none-any.wheel
rm -rf dist/ build/ documentation/build/ metadrive.egg-info/ docs/build/
2. Rename current version to X.Y.Z.rcA, where A is arbitrary value represent "release candidate A".
This is really important since pypi do not support renaming and re-uploading.
3. Get wheel
python setup.py sdist bdist_wheel
WARNING: wheel should not be created on windows, since assets will not be included in the .whl file !!!
4. Upload to test channel
twine upload --repository testpypi dist/*
5. Test as next line. If failed, change the version name and repeat 1, 2, 3, 4, 5.
pip install --index-url https://test.pypi.org/simple/ metadrive
6. Rename current version to X.Y.Z in setup.py, rerun 1, 3 steps.
7. Upload to production channel
twine upload dist/*
"""

0 comments on commit e3a9f2f

Please sign in to comment.