As a pre-cursor to the overhaul of the MoveIt2 behaviors, this PR does a smaller overhaul of ActionServerBT (ASBT)
The key idea is that a given ASBT object should act as a generator, where create_tree can be called numerous times with different names and get logically distinct trees. This tree creation should be entirely independent of the action server logic so that it can be used for sub-trees.
Additionally, send_goal, get_result, and get_feedback should be able to be called on any result of create_tree in order to populate / read from the tree's data to implement the action server logic.
Individual behaviors should get their ROS2 Node from setup (as per #105), but the node is currently passed to the ASBT in __init__ in order to:
Be used in all the AS logic (send_goal, get_result, and get_feedback; likely just for the node clock)
Be used in create_tree to handle only behaviors that don't yet get their ROS node in setup.
Once #105 is solved, it may make sense to remove node from init and pass it directly to the AS functions, but I don't think that's necessary.
Testing procedure
Test all MoveTo trees as documented in README (Note: AcquireFood should now fail with a 5s Timeout given an empty message, as there is no valid TF between world and empty string)
Test AcquireFood as documented in #102
Make sure to run AcquireFood twice to verify that MoveToVisitor is re-initialized (feedback planning_time should start again at 0).
Before opening a pull request
[x] Format your code using black formatterpython3 -m black .
[x] 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 ..
Description
As a pre-cursor to the overhaul of the MoveIt2 behaviors, this PR does a smaller overhaul of ActionServerBT (ASBT)
The key idea is that a given ASBT object should act as a generator, where
create_tree
can be called numerous times with different names and get logically distinct trees. This tree creation should be entirely independent of the action server logic so that it can be used for sub-trees.Additionally,
send_goal
,get_result
, andget_feedback
should be able to be called on any result ofcreate_tree
in order to populate / read from the tree's data to implement the action server logic.Individual behaviors should get their ROS2 Node from
setup
(as per #105), but the node is currently passed to the ASBT in__init__
in order to:send_goal
,get_result
, andget_feedback
; likely just for the node clock)create_tree
to handle only behaviors that don't yet get their ROS node in setup.Once #105 is solved, it may make sense to remove node from init and pass it directly to the AS functions, but I don't think that's necessary.
Testing procedure
world
and empty string)AcquireFood
as documented in #102AcquireFood
twice to verify thatMoveToVisitor
is re-initialized (feedback planning_time should start again at 0).Before opening a pull request
python3 -m black .
ada_feeding
directory, run:pylint --recursive=y --rcfile=.pylintrc .
.Before Merging
Squash & Merge