Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont change pytonpath #12

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test:

run:
@echo "Running driver logic server ..."
PYTHONPATH=$(SRC_DIR):$$PYTHONPATH python rose/main.py --port $(PORT) --driver $(DRIVER_PATH)
python main.py --port $(PORT) --driver $(DRIVER_PATH)

build-image:
@echo "Building container image ..."
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ Self driving car module example | https://github.com/RedHat-Israel/rose-game-ai-

Clone this repository, and make sure you have a game engine running.

Install requirements:

```bash
# Install requirements
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

Write your own driving module, you can use the file `mydriver.py`:

```bash
Expand All @@ -41,7 +49,7 @@ vi mydriver.py
Run using `mydriver.py` as the driving module:

```bash
make run
python main.py --driver mydriver.py
```

## Running ROSE game components containerized
Expand Down
1 change: 1 addition & 0 deletions examples/driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This driver implement some logic.
"""

from rose.common import obstacles, actions # NOQA

driver_name = "Driver"
Expand Down
1 change: 1 addition & 0 deletions examples/none.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This driver does not do any action.
"""

from rose.common import obstacles, actions # NOQA

driver_name = "No Driver"
Expand Down
1 change: 1 addition & 0 deletions examples/random-driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is a rather silly driver choosing the next action randomly. It is not a
very good driver but the implementation is very elegant.
"""

import random
from rose.common import obstacles, actions # NOQA

Expand Down
3 changes: 3 additions & 0 deletions rose/main.py → main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def main():

if args.driver == "":
print("Error: missing driver command line argument")
print("")
print("Example:")
print(" python main.py --driver mydriver.py")
return

try:
Expand Down
1 change: 1 addition & 0 deletions mydriver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This driver does not do any action.
"""

from rose.common import obstacles, actions # NOQA

driver_name = "MyDriver"
Expand Down
Loading