-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add py_trees.behaviours Behaviours, build a functional beams run
command
#47
Conversation
beams run
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My notes here are super minor, I like how the interactive ticks look and the options you've selected for them.
I have not run this myself.
beams/bin/run_main.py
Outdated
show_blackboard) | ||
) | ||
tree.setup() | ||
for _ in range(tick_count): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cli help text says that tick counts <=0 result in continuous ticking, but here it seems like they result in no ticks at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. Well I'm glad I at least communicated my intent instead of forgetting entirely
…ick as promised, fix cli flags
I've been seeing the dead workers too, see #49 . It doesn't prevent the tests from passing, fwiw |
Gotcha we can keep it to a separate issue, theres a few ways to fix it |
Co-authored-by: Zachary Lentz <ZLLentz@users.noreply.github.com>
The pre-commit failure is a new one to me
|
Description
beams run
command, with options to controlBaseItem
subclasses for the built-in py-trees behaviours. This lets us use them in our own trees.Also now I'm naturally spelling "Behaviour" with the "u", and the American in me is mad
Motivation and Context
The original goal was to make
beams run
usable. The side-effect was me being forced to enable beams to specify trees that had nothing to do with EPICS CA. I think these will be useful in the long run.Tangent: code golf
I initially balked at the idea of writing a whole dataclass for each
py_trees.behaviours.Behaviour
, when the Behaviour itself already has the type-hinted arguments I need. Could we not just inspect the__init__
signature and dynamically construct the dataclass?The answer is yes, with a couple of code-inspection/static-analysis caveats:
new_dataclass.__module__
to point tobeams.tree_config
BaseItem
s we supported (and more importantly the auto-api generated docs)This last point was the dealbreaker for me, after which I just caved and wrote out the classes manually. (but not until I had already sunk a couple hours on Friday afternoon trying to get it to work)
The code, for the curious
How Has This Been Tested?
Tests added.
Where Has This Been Documented?
This PR, minimal docstrings have been added so far
interactive mode, 5-ticks. Waits for key input between each tick (ctrl+C halts operation)
Pre-merge checklist
docs/pre-release-notes.sh
and created a pre-release documentation page