Skip to content

Commit

Permalink
Merge pull request #12 from yaacov/fix-pythonpath
Browse files Browse the repository at this point in the history
Dont change pytonpath
  • Loading branch information
yaacov authored Jul 26, 2024
2 parents 9bfb465 + 99ce4b9 commit 60d7beb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
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

0 comments on commit 60d7beb

Please sign in to comment.