Skip to content
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

Revamp MoveToMouth/MoveFromMouth with MoveIt2Plan/Execute and BlackboardBehavior #124

Merged
merged 9 commits into from
Oct 27, 2023

Conversation

amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented Oct 24, 2023

Description

Since MoveToMouth/MoveFromMouth was originally written, a lot of intermediate classes have been added to the codebase that make it easier to write cleaner code (e.g., #102 #114 #115 ). This PR focuses on moving the old movement trees and its associated behaviors to the new paradigm.

Testing procedure

Run the code as documented in the README. Then, run the below sequence of actions and verify that they work as expected.

  • Sim:
    • ros2 action send_goal /MoveAbovePlate ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToRestingPosition ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToMouth ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveFromMouthToRestingPosition ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToMouth ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveFromMouthToAbovePlate ada_feeding_msgs/action/MoveTo "{}" --feedback
  • Real:
    • ros2 action send_goal /MoveAbovePlate ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToRestingPosition ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToMouth ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveFromMouthToRestingPosition ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveToMouth ada_feeding_msgs/action/MoveTo "{}" --feedback
    • ros2 action send_goal /MoveFromMouthToAbovePlate ada_feeding_msgs/action/MoveTo "{}" --feedback

Before opening a pull request

  • Format your code using black formatter python3 -m black .
  • Run your code through pylint and address all warnings/errors. The only warnings that are acceptable to not address is TODOs that should be addressed in a future PR. From the top-level ada_feeding directory, run: pylint --recursive=y --rcfile=.pylintrc ..

Before Merging

  • Squash & Merge

@amalnanavati amalnanavati marked this pull request as draft October 24, 2023 06:46
Remaining:
- Move behaviors to separate folder
- Test / cleanup / remove unused code
@amalnanavati amalnanavati changed the title [WIP] Revamp MoveToMouth/MoveFromMouth with MoveIt2Plan/Execute and BlackboardBehavior Revamp MoveToMouth/MoveFromMouth with MoveIt2Plan/Execute and BlackboardBehavior Oct 26, 2023
@amalnanavati amalnanavati marked this pull request as ready for review October 26, 2023 03:09
Copy link
Collaborator

@egordon egordon left a comment

Choose a reason for hiding this comment

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

I don't think any comments are dealbreakers. And it would be good to merge this in so I can fix up #122 based on the updates here.

)
from .move_to import MoveTo
from .move_to_dummy import MoveToDummy
from .toggle_collision_object import ToggleCollisionObject
Copy link
Collaborator

Choose a reason for hiding this comment

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

This breaks egordon/full_schema as-is, so we should merge this first and then fix egordon/full_schema before merging.

ada_feeding/ada_feeding/helpers.py Show resolved Hide resolved

# Third-party imports
from overrides import override
import py_trees

# Local imports
from ada_feeding import ActionServerBT
from ada_feeding.visitors import MoveToVisitor


class MoveToTree(ActionServerBT, ABC):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to @egordon for #122
AcquireFoodTree can become a MoveToTree again

self.start_time = self.node.get_clock().now()
self.feedback.is_planning = behaviour.tree_blackboard.is_planning
elif (
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to @egordon for #122
It is best to create a ServoMove Behavior (which takes in a twist and duration) so that this Visitor can capture that as part of the feedback (currently it is treated as "planning", which is incorrect).

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