Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Update the simulated robot API to (mostly) match sr.robot3 - #350

Merged
PeterJCLaw merged 20 commits into
masterfrom
update-api
Oct 20, 2022
Merged

Update the simulated robot API to (mostly) match sr.robot3#350
PeterJCLaw merged 20 commits into
masterfrom
update-api

Conversation

@PeterJCLaw

@PeterJCLaw PeterJCLaw commented Oct 16, 2022

Copy link
Copy Markdown
Member

This updates the simulated sr.robot3 API to mostly match the one in the published package of the same name.

There are some differences here, mostly driven by what the simulator doesn't (usually cannot) support. In general I've gone with completely omitting members which don't work in the simulator, though in a few places I've implemented dummy versions that record the nature of the simulator.

The split here is approximately between things that it seems "safe" to emulate as a no-op versus those which are likely to change the behaviour of the robot substantially. Many of these are fuzzy, so we might want to revisit the decisions, but it probably makes sense to get these changes live first and iterate.

The changes here were determined through a mixture of code inspection of the sr.robot3 source and comparison against the docs. The latter was a mix of manual comparison and using https://gist.github.com/PeterJCLaw/318d392c46daff36577df5e24866d5b0 to gather sample code to run mypy against.

Not included here are:

If we have any example robot code which works for sr.robot3 it would be handy to try it against this PR's simulator and see what works/what doesn't.

Fixes #199

This actually changed back in 21ba150, but this check was missed.
Not because this does anything useful, but rather because adding
this is easy for compatbility.
The other change here is the name of the 'note' -> 'pitch' argument.
We only expose those which actually work in the simulator, though
this gets the rest of them present internally should we want them.
@PeterJCLaw
PeterJCLaw requested a review from Adimote October 17, 2022 21:27
@PeterJCLaw
PeterJCLaw marked this pull request as ready for review October 17, 2022 21:27

@Adimote Adimote left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PeterJCLaw
PeterJCLaw merged commit 0af75f8 into master Oct 20, 2022
@PeterJCLaw
PeterJCLaw deleted the update-api branch October 20, 2022 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lack of compatibility with Kit API

2 participants