Skip to content

Commit

Permalink
daffy
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCensi committed Oct 13, 2019
1 parent f0d5073 commit 36b3c8e
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 78 deletions.
8 changes: 4 additions & 4 deletions LF.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
challenge: aido2-LF-sim-validation
challenge: aido3-LF-sim-validation

title: "LF 🚗 - Lane following (simulation 👾, validation 🏋)"
tags: [visible, ml-validation, aido2, aido2-embodied, LF, v4, simulation]
Expand All @@ -7,8 +7,9 @@ description: |
protocol: aido2_db18_agent-z2

date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z


scoring: !include scoring.yaml

Expand All @@ -35,4 +36,3 @@ steps:
robots_npcs: 0
build:
context: ./scenario_maker

9 changes: 4 additions & 5 deletions LFV.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
challenge: aido2-LFV-sim-validation
challenge: aido3-LFV-sim-validation

title: "LFV 🚗🚗 - Lane following + Vehicles (simulation 👾, validation 🏋)"
tags: [visible, ml-validation, aido2, aido2-embodied, LFV, v4, simulation]
Expand All @@ -7,8 +7,9 @@ description: |
protocol: aido2_db18_agent-z2

date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z


scoring: !include scoring.yaml

Expand Down Expand Up @@ -40,5 +41,3 @@ steps:
robots_npcs: 4
build:
context: ./scenario_maker


9 changes: 4 additions & 5 deletions LFVI.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
challenge: aido2-LFVI-sim-validation
challenge: aido3-LFVI-sim-validation

title: "LFVI 🚗🚗🚦 - Lane following + Vehicles + Intersections (simulation 👾, validation 🏋) "
tags: [visible, ml-validation, aido2, aido2-embodied, LFVI, v4, simulation]
tags: [visible, ml-validation, aido3, aido3-embodied, LFVI, v4, simulation]
description: |
protocol: aido2_db18_agent-z2

date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z

scoring: !include scoring.yaml

Expand Down Expand Up @@ -35,4 +35,3 @@ steps:
robots_npcs: 4
build:
context: ./scenario_maker

10 changes: 5 additions & 5 deletions LFVI_test.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
challenge: aido2-LFVI-sim-testing
challenge: aido3-LFVI-sim-testing

title: "LFVI 🚗🚗🚦 - Lane following + Vehicles + Intersections (simulation 👾, testing 🥇) "
tags: [visible, ml-testing, aido2, aido2-embodied, LFVI, v4, simulation]
tags: [visible, ml-testing, aido3, aido3-embodied, LFVI, v4, simulation]
description: |
protocol: aido2_db18_agent-z2

date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z

scoring: !include scoring.yaml

steps:
Expand All @@ -33,4 +34,3 @@ steps:
robots_npcs: 4
build:
context: ./scenario_maker

9 changes: 4 additions & 5 deletions LFV_test.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
challenge: aido2-LFV-sim-testing
challenge: aido3-LFV-sim-testing

title: "LFV 🚗🚗 - Lane following + Vehicles (simulation 👾, testing 🥇)"
tags: [visible, ml-testing, aido2, aido2-embodied, LFV, v4, simulation]
Expand All @@ -7,8 +7,9 @@ description: |
protocol: aido2_db18_agent-z2

date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z


scoring: !include scoring.yaml

Expand Down Expand Up @@ -40,5 +41,3 @@ steps:
robots_npcs: 4
build:
context: ./scenario_maker


9 changes: 4 additions & 5 deletions LF_test.challenge.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
challenge: aido2-LF-sim-testing
challenge: aido3-LF-sim-testing

title: "LF 🚗 - Lane following (simulation 👾, testing 🥇)"
tags: [visible, ml-testing, aido2, aido2-embodied, LF, v4, simulation]
tags: [visible, ml-testing, aido3, aido3-embodied, LF, v4, simulation]
description: |
Lane following challenge.
protocol: aido2_db18_agent-z2


date-open: 2019-04-10
date-close: 2019-05-21T13:00Z
date-open: 2019-10-10
date-close: 2019-12-12T13:00Z

scoring: !include scoring.yaml

Expand All @@ -36,4 +36,3 @@ steps:
robots_npcs: 0
build:
context: ./scenario_maker

4 changes: 2 additions & 2 deletions duckiebot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

push: build
docker push $(tag)
4 changes: 1 addition & 3 deletions duckiebot/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@


-e git://github.com/AndreaCensi/zuper-nodes-python2.git@z2#egg=zuper-nodes-python2
zuper-nodes-python2-z5
cbor2
2 changes: 1 addition & 1 deletion experiment_manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM duckietown/aido2-base-python3:z2
FROM duckietown/aido3-base-python3:daffy


COPY requirements.txt requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions experiment_manager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

push: build
docker push $(tag)
Expand Down
27 changes: 14 additions & 13 deletions experiment_manager/experiment_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@
from contextlib import contextmanager
from dataclasses import dataclass
from threading import Thread
from typing import *
from typing import cast, Dict, Iterator, List

import numpy as np
import yaml

from aido_schemas import EpisodeStart, protocol_agent, SetMap, SpawnRobot, Step, protocol_simulator, RobotObservations, \
SetRobotCommands, RobotPerformance, RobotState, SimulationState, Scenario, protocol_scenario_maker
from aido_schemas import (EpisodeStart, protocol_agent, protocol_scenario_maker, protocol_simulator, RobotObservations,
RobotPerformance, RobotState, Scenario, SetMap, SetRobotCommands, SimulationState, SpawnRobot,
Step)
from aido_schemas.utils import TimeTracker
from aido_schemas.utils_drawing import read_and_draw
from aido_schemas.utils_video import make_video1
from duckietown_world.rules import RuleEvaluationResult
from duckietown_world.rules.rule import EvaluatedMetric
from zuper_commons.text import indent
from zuper_json.ipce import object_to_ipce, ipce_to_object
from zuper_json.subcheck import can_be_used_as
from zuper_ipce import ipce_from_object, object_from_ipce
from zuper_nodes.structures import RemoteNodeAborted
from zuper_nodes_wrapper.wrapper_outside import ComponentInterface, MsgReceived
from zuper_typing.subcheck import can_be_used_as2

logging.basicConfig()
logger = logging.getLogger('launcher')
Expand Down Expand Up @@ -54,7 +55,7 @@ class MyConfig:
def main(cie, log_dir, attempts):
config_ = env_as_yaml('experiment_manager_parameters')
logger.info('parameters:\n\n%s' % config_)
config = cast(MyConfig, ipce_to_object(config_, {}, expect_type=MyConfig))
config = cast(MyConfig, object_from_ipce(config_, MyConfig))

# first open all fifos
agent_ci = ComponentInterface(config.agent_in, config.agent_out,
Expand Down Expand Up @@ -330,7 +331,7 @@ def run_episode(sim_ci: ComponentInterface,


def log_timing_info(tt, sim_ci: ComponentInterface):
ipce = object_to_ipce(tt, {}, with_schema=True)
ipce = ipce_from_object(tt)
msg = {'compat': ['aido2'], 'topic': 'timing_information', 'data': ipce}
j = sim_ci._serialize(msg)
sim_ci._cc.write(j)
Expand Down Expand Up @@ -358,14 +359,14 @@ def check_compatibility_between_agent_and_sim(agent_ci: ComponentInterface, sim_
type_commands_agent = agent_ci.node_protocol.outputs['commands']
logger.info(f'Agent provides commands {type_commands_agent}')

can_be_obs, why = can_be_used_as(type_observations_sim, type_observations_agent)
if not can_be_obs:
msg = 'Observations mismatch: %s' % why
r = can_be_used_as2(type_observations_sim, type_observations_agent)
if not r.result:
msg = 'Observations mismatch: %s' % r
logger.error(msg)
raise Exception(msg)
can_be_cmd, why = can_be_used_as(type_commands_agent, type_commands_sim)
if not can_be_cmd:
msg = 'Commands mismatch: %s' % why
r = can_be_used_as2(type_commands_agent, type_commands_sim)
if not r:
msg = 'Commands mismatch: %s' % r
logger.error(msg)
raise Exception(msg)

Expand Down
2 changes: 1 addition & 1 deletion minimal_agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM duckietown/aido2-base-python3:z2
FROM duckietown/aido3-base-python3:daffy

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions minimal_agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

#push: build
# docker push $(tag)
Expand All @@ -24,4 +24,4 @@ submit:


submit-robotarium:
dts challenges submit --challenge aido2_LF_r_pri,aido2_LF_r_pub
dts challenges submit --challenge aido2_LF_r_pri,aido2_LF_r_pub
6 changes: 3 additions & 3 deletions minimal_agent_python2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

#push: build
# docker push $(tag)
Expand All @@ -24,4 +24,4 @@ submit:


submit-robotarium:
dts challenges submit --challenge aido2_LF_r_pri,aido2_LF_r_pub
dts challenges submit --challenge aido2_LF_r_pri,aido2_LF_r_pub
3 changes: 1 addition & 2 deletions minimal_agent_python2/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-e git://github.com/AndreaCensi/zuper-nodes-python2.git@z2#egg=zuper-nodes-python2
cbor2

zuper-nodes-python2-z5

2 changes: 1 addition & 1 deletion scenario_maker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM duckietown/aido2-base-python3:z2
FROM duckietown/aido3-base-python3:daffy

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions scenario_maker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

push: build
docker push $(tag)
Expand Down
2 changes: 1 addition & 1 deletion simulator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM duckietown/gym-duckietown-server-python3:aido2
FROM duckietown/gym-duckietown-server-python3:daffy


WORKDIR /project
Expand Down
4 changes: 2 additions & 2 deletions simulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=duckietown/$(repo):$(branch)

build:
docker build -t $(tag) .
docker build --pull -t $(tag) .

build-no-cache:
docker build -t $(tag) --no-cache .
docker build --pull -t $(tag) --no-cache .

push: build
docker push $(tag)
Expand Down
16 changes: 3 additions & 13 deletions simulator/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@


-e git+https://github.com/AndreaCensi/zuper-utils.git@z2#egg=zuper-utils
-e git+https://github.com/AndreaCensi/zuper-nodes.git@z2#egg=zuper-nodes
-e git+https://github.com/AndreaCensi/zuper-commons.git@z2#egg=zuper-commons
-e git+https://github.com/duckietown/aido-protocols.git@z2#egg=aido-protocols

-e git+https://github.com/duckietown/duckietown-world.git@aido2#egg=duckietown-world
-e git+https://github.com/duckietown/gym-duckietown.git@aido2#egg=gym-duckietown


#https://github.com/duckietown/gym-duckietown/archive/aido2.tar.gz#egg=gym-duckietown
aido-protocols-daffy
duckietown-world-daffy
duckietown-gym-daffy

numpy==1.16.2


#PyGeometry




0 comments on commit 36b3c8e

Please sign in to comment.