srobo / sr-robot3-j5

Python 3 API for Student Robotics Kit - Built with j5
MIT License
4 stars 1 forks source link

Get start state and metadata from Herdsman #14

Closed trickeydan closed 4 years ago

trickeydan commented 4 years ago

This should make the new API work with herdsman in it's current state.

The arguments on the CLI should also be compatible.

I have not be able to run herdsman myself. Perhaps @sersorrel could have a go.

I have been testing it as follows:

from sr.robot3 import *
from sr.robot3.env import *
r = Robot(env=CONSOLE_ENVIRONMENT, verbose=True)

print(r.mode)
print(r.zone)
print(r._arena)  # yeah it's private, to be used in vision

Fixes #5

trickeydan commented 4 years ago

Force pushed to rebase on master

sersorrel commented 4 years ago

fyi, I've now made that herdsman PR: srobo/brain-herdsman#1

raccube commented 4 years ago

@sersorrel I need to get a functioning robot system first

trickeydan commented 4 years ago

lgtm

(might be nice to use a TypedDict for the loaded json data rather than Any, but honestly whatever)

Is there a backport of this to 3.6? I thought TypedDict was only available in 3.8+?

sersorrel commented 4 years ago

looks like typing-extensions has a backport, but I'm not convinced it's worth the extra dependency

trickeydan commented 4 years ago

looks like typing-extensions has a backport, but I'm not convinced it's worth the extra dependency

Pretty certain we already depend on that for Protocol in j5

Not sure if it's in scope here.