From 8e2d6a864a43dae962f5620efdbf00ed59718779 Mon Sep 17 00:00:00 2001 From: Yaacov Zamir Date: Tue, 30 Jul 2024 12:57:26 +0300 Subject: [PATCH] Update README.md --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 8956d4c..310ccef 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,14 @@ podman run --rm --network host -it quay.io/rose/rose-game-engine:latest podman run --rm --network host -it quay.io/rose/rose-game-web-ui:latest ``` +### Running community contributed driver ( on http://127.0.0.1:8082 ) + +You can use community drivers to compare and evaluate your driver during the development process. + +``` bash +podman run --rm --network host -it quay.io/yaacov/rose-go-driver:latest --port 8082 +``` + ### Running your self driving module, requires a local `driver.py` file with your driving module. ( on http://127.0.0.1:8081 ) ``` bash @@ -82,3 +90,40 @@ podman run --rm --network host -it \ -e DRIVER=/driver/mydriver.py \ quay.io/rose/rose-game-ai-reference:latest ``` + +### Testing your driver + +Send `car` and `track` information by uring `POST` request to your driver ( running on http://127.0.0.1:8081 ): + +``` bash +curl -X POST -H "Content-Type: application/json" -d '{ + "info": { + "car": { + "x": 3, + "y": 8 + } + }, + "track": [ + ["", "", "bike", "", "", ""], + ["", "crack", "", "", "trash", ""], + ["", "", "penguin", "", "", "water"], + ["", "water", "", "trash", "", ""], + ["barrier", "", "", "", "bike", ""], + ["", "", "trash", "", "", ""], + ["", "crack", "", "", "", "bike"], + ["", "", "", "penguin", "water", ""], + ["", "", "bike", "", "", ""] + ] + }' http://localhost:8081/ +``` + +The response in `JSON` format should include the car name and the recommended action: + +``` json +{ + "info": { + "name": "Go Cart", + "action": "pickup" + } +} +```