Skip to content

Publish twist - #35

Merged
msavchen-nasa merged 16 commits into
mainfrom
msavchen/publish-twist
Aug 26, 2026
Merged

msavchen-nasa merged 16 commits into
mainfrom
msavchen/publish-twist

Conversation

@msavchen-nasa

Copy link
Copy Markdown
Contributor

Two new behaviors,

  • PublishTwist
    • Publishes TwistStamped message on a desired topic.
    • Useful for commanding mobile robots directly.
  • TimeoutPort:
    • an alternative to Timeout behavior. Timeout duration is provided via port instead of init to allow for port remapping.
    • temporary fix until proper fix in py_trees is implemented.

@msavchen-nasa
msavchen-nasa marked this pull request as ready for review August 25, 2026 20:51
Comment thread src/imetro_behavior/imetro_behavior/decorators.py Outdated
Comment thread src/imetro_behavior/imetro_behavior/geometry_behaviors.py Outdated
Comment thread src/imetro_behavior/imetro_behavior/geometry_behaviors.py Outdated
Comment thread src/imetro_behavior/imetro_behavior/geometry_behaviors.py
Comment thread src/imetro_behavior/tests/test_decorators.py Outdated
Comment thread src/imetro_behavior/tests/test_decorators.py Outdated
assert child.status == Status.FAILURE


def test_timeout() -> None:

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.

generally, this test is quite verbose -- I get that it probably uses a lot of fancy bells and whistles from py_trees itself, but it's a little difficult to understand. If there's anything you don't find super critical, I'd encourage simplifying where possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I simplified, but still kept all of the testing, pass-through for success and failure should definitely be checked.
Re-initialization test caught on my first implementation so i think it's valuable.
The pass-through order test is specific to timeout decorator, but i think we get some pretty valuable insight from it.

Does this look better?

@scastro-nasa scastro-nasa 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.

Looks great -- thanks for turning around the comments so quickly!

Comment on lines +96 to +101
class TimeoutPort(PortsMixin, Decorator):
"""
Reimplementation of the Timeout behavior from the py_trees library
[Link](https://py-trees.readthedocs.io/en/devel/modules.html#py_trees.decorators.Timeout) for reference.

NOTE: This behavior is supposed to be temporary.

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.

I ended up landing splintered-reality/py_trees#513; I'm gonna work on a PR to update to the latest PyTrees on here and maybe we can remove this sooner than we thought!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you dealing with that, im still going to take a looks just for my own understanding.
Ill also submit a PR to remove this from the library when it's time.

@msavchen-nasa
msavchen-nasa merged commit 7cb0d4e into main Aug 26, 2026
3 checks passed
@msavchen-nasa
msavchen-nasa deleted the msavchen/publish-twist branch August 26, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants