systemetric / shepherd-2 Goto Github PK
View Code? Open in Web Editor NEWA rewrite of shepherd
License: Apache License 2.0
A rewrite of shepherd
License: Apache License 2.0
USB sticks behave as they do in shepherd-1
DONE IS:
NOTES
See here for shepherd-1 implementation: https://github.com/systemetric/shepherd/blob/28473503130cddd2c40702240f3deaad3a21e52b/shepherd/__init__.py#L56
Add a favicon.ico
Could use old shepered logo or use the RC logo.
Currently shepherd has the states:
Really there is a period of time between when the usercode is started and when it is ready to run, this is the "INIT" state. For now READY has been renamed to INIT but a new READY state needs to be re-introduced. In this state code has reached the break point in robot.Robot()
but has not yet been sent the start signal.
Hopefully this does not block #3
AS A shepherd developer
I WANT to not be allowed to commit broken code to master
SO THAT the user expierence is bug free
DONE IS:
/test
NOTES:
DONE IS:
\upload
NOTES:
Ideally use the current endpoints in shepherd-1
AS A shepherd dev
I WANT the run to be sane and bug free
SO THAT I can be confident about altering it that it is bug free
DONE IS:
Robot.Reset
is called (need a mock made for testing so that shepherd can run on x86.Notes:
The shepherd-2
run is heavily refactored from shepherd-1
. We need to make sure that we support any API end points which are used by sheep.
We continously forget that blockly is a thing. We should have tests to make sure that the code which ship works and is upto date.
DONE IS:
robotlib
files/
is correct.DONE IS:
NOTES:
Might need to worry about FASTAPI
's own docs at /docs
might have moved that
Should be a copy paste job from shepherd-1 otherwise
AS A robocon release manager
I WANT to know that the compiled version of the docs and sheep is the correct ones
SO THAT I don't get compatability bugs with them falling out of sync
DONE IS:
NOTES:
Currently the landing page for shepherd-2
is JSON a webpage.
I am currenlty wondering if we should serve sheep as the default page with a help/getting started
button.
Either way we should have some kind of website thing, the current homepage will suffice if the implementer believes so.
DONE IS:
Weak coupling between usercode and the robot code is desirable as it reduces the security risk on thre brain and makes the understanding of the state of the brain more sensible. The Robot doesn't blow up when the usercode exits.
AS A person running robocon
I WANT a thin interface for the usercode to the robot libarry and the actual code avaiable over a network socket
SO THAT
DONE IS
R.see()
is evaluated to ensure that it returning large matracies does not take significantly more timeR.see()
performance is anything more than 250ms worse an investigation into how to reduce the return payload is implemented.NOTES:
Alternatives prebuilt RPC is:
@shardros 's Personal opion is taht RPPy should be used.
AS A robocon developer
I WANT to not break sheep
SO THAT we only change one thing at a time
DONE IS:
/upload
which matches shepherd-1
Note: If there is a more elegant way to implement this, do that and we will try and depricate the old way
AS A Robocon Competitor
I WANT to have accurate intelisense
SO THAT I don't have to read docs
DONE IS:
The image where there is a rest preview which needs to be re-fetched everytime is not great but I think it should still be supported just incase an arena rewrite is not done. It would also be a good fail safe and useful for debugging.
DONE IS:
static/image.jpg
is the last image that the camera sawconfig.py
for this.Shepherd is usally used by a single user at a time yet there are probally still benifits to be gained by sprinkling async
everywhere.
Not sure if this requires us to do anything fancy with FastAPI.
DONE IS:
Currently we pass in
{ "mode": "comp",
"zone": int(config.zone),
"arena": "A",
}
To the robot lib do we need all of this?
Due to a python bug not all of the interfaces are compatible.
The fastapi.UploadFile
type inherits from SpooledTemporaryFile
a builtin
which does not specify the abstract for IOBase
and does not support the
seekable
method which is required for writing to the file sys. There is
some work to fix this:
https://bugs.python.org/issue26175
A fix for this has been merged in into the 3.11 rc so hopefully this will be
fixed soon:
For now we reach in to the object to try and patch it ourselves.
This will not work for files larger than UploadFile._max_size
as the
attributes change:
https://stackoverflow.com/a/47169185/5006710
We make sure that the object has a large enough size in
increase_max_file_size
When 3.11 rolls out (and we are able to use it) _fix_bad_spools
and
increase_max_file_size
can be deleted.
AS A consumer of logs
I WANT to be notified when a new event happens
SO THAT I don't have to poll
DONE IS
NOTES:
This interface should also allow for a seperate
MQTT is one such publish subscribe interface which is already used in the arena
When robot.Robot()
is caleld the user code waits for the start signal to be sent. We need to send the start signal in the transition to running state function.
DONE IS:
RUNNING
stateRUNNING
state the block at robot.Robot
is unblocked.Notes:
Shepherd-1 implementation: https://github.com/systemetric/shepherd/blob/28473503130cddd2c40702240f3deaad3a21e52b/shepherd/__init__.py#L101
Remember to add pull ups
DONE IS:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.