DonkeySim:Multi-player

マルチプレイヤー

DonkeyCarコンテナを同時に作成

chen@Hongs-MacBook-Pro donkeycar-docker % python multi_player.py
Enter number of racer: 4
docker run -p 8000:8000 -p 8887:8887 -v /Users/chen/Docker/donkeycar-docker/mycar1:/root/mycar -v mycar1_db:/donkeycar-console -e WEB_CONTROL_PORT=8887 -e mode=docker –name donkeycar1 –hostname donkeycar1 -d robocarstore/donkeycar:latest
8ada9e9e07a62d1c07c872d1ac5cef78cea931d2d3783e88797bdc25c4f3128f

using donkey v3.1.5 …
Creating car folder: /root/mycar
making dir /root/mycar
Creating data & model folders.
making dir /root/mycar/models
making dir /root/mycar/data
making dir /root/mycar/logs
Copying car application template: complete
Copying car config defaults. Adjust these before starting your car.
Copying train script. Adjust these before starting your car.
Copying calibrate script. Adjust these before starting your car.
Copying my car config overrides
Donkey setup complete.

 

docker run -p 8001:8000 -p 9887:9887 -v /Users/chen/Docker/donkeycar-docker/mycar2:/root/mycar -v mycar2_db:/donkeycar-console -e WEB_CONTROL_PORT=9887 -e mode=docker –name donkeycar2 –hostname donkeycar2 -d robocarstore/donkeycar:latest
5271640695a91d97204f4df669a358f0ceb72bd46eea65bf9b8e6e8c262ddcf4

using donkey v3.1.5 …
Creating car folder: /root/mycar
making dir /root/mycar
Creating data & model folders.
making dir /root/mycar/models
making dir /root/mycar/data
making dir /root/mycar/logs
Copying car application template: complete
Copying car config defaults. Adjust these before starting your car.
Copying train script. Adjust these before starting your car.
Copying calibrate script. Adjust these before starting your car.
Copying my car config overrides
Donkey setup complete.

 

docker run -p 8002:8000 -p 10887:10887 -v /Users/chen/Docker/donkeycar-docker/mycar3:/root/mycar -v mycar3_db:/donkeycar-console -e WEB_CONTROL_PORT=10887 -e mode=docker –name donkeycar3 –hostname donkeycar3 -d robocarstore/donkeycar:latest
6ea11e310c4b039199d101c68e5898736120f3912bf2ddba4b931f5a051cff4c

using donkey v3.1.5 …
Creating car folder: /root/mycar
making dir /root/mycar
Creating data & model folders.
making dir /root/mycar/models
making dir /root/mycar/data
making dir /root/mycar/logs
Copying car application template: complete
Copying car config defaults. Adjust these before starting your car.
Copying train script. Adjust these before starting your car.
Copying calibrate script. Adjust these before starting your car.
Copying my car config overrides
Donkey setup complete.

 

docker run -p 8003:8000 -p 11887:11887 -v /Users/chen/Docker/donkeycar-docker/mycar4:/root/mycar -v mycar4_db:/donkeycar-console -e WEB_CONTROL_PORT=11887 -e mode=docker –name donkeycar4 –hostname donkeycar4 -d robocarstore/donkeycar:latest
ffb1b61eaaa207e4bd8ac9be7bfe6603f9943c267a633654516579b827a4e0da

using donkey v3.1.5 …
Creating car folder: /root/mycar
making dir /root/mycar
Creating data & model folders.
making dir /root/mycar/models
making dir /root/mycar/data
making dir /root/mycar/logs
Copying car application template: complete
Copying car config defaults. Adjust these before starting your car.
Copying train script. Adjust these before starting your car.
Copying calibrate script. Adjust these before starting your car.
Copying my car config overrides
Donkey setup complete.

 

chen@Hongs-MacBook-Pro donkeycar-docker % docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ffb1b61eaaa2 robocarstore/donkeycar:latest “/bin/sh -c ‘/${RUNT…” 11 seconds ago Up 10 seconds 0.0.0.0:11887->11887/tcp, 0.0.0.0:8003->8000/tcp donkeycar4
6ea11e310c4b robocarstore/donkeycar:latest “/bin/sh -c ‘/${RUNT…” 14 seconds ago Up 13 seconds 0.0.0.0:10887->10887/tcp, 0.0.0.0:8002->8000/tcp donkeycar3
5271640695a9 robocarstore/donkeycar:latest “/bin/sh -c ‘/${RUNT…” 17 seconds ago Up 16 seconds 0.0.0.0:9887->9887/tcp, 0.0.0.0:8001->8000/tcp donkeycar2
8ada9e9e07a6 robocarstore/donkeycar:latest “/bin/sh -c ‘/${RUNT…” 19 seconds ago Up 19 seconds 0.0.0.0:8000->8000/tcp, 0.0.0.0:8887->8887/tcp donkeycar1
chen@Hongs-MacBook-Pro donkeycar-docker %

4台立ち上げていることを確認した。

DonkeySimを予め立ち上げてください。

dockerへシェルのアクセス

1台目へアクセス(2−4も同じ方法)
docker exec -it donkeycar1 bash
ここで、myconfig.py で各車両の名前、色などは指定できる。
次はそのDonkey Car をスタートする
# python manage.py drive
(専用Appからもスタートできる)

4台起動してレースする

また山道のレースも可能

Leave a Reply

Your email address will not be published. Required fields are marked *