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

Split MoveToMouth Into Two Separate Actions #128

Merged
merged 15 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ indent-after-paren=4
indent-string=' '

# Maximum number of characters on a single line.
max-line-length=100
max-line-length=120

# Maximum number of lines in a module.
max-module-lines=1000
Expand Down
8 changes: 7 additions & 1 deletion ada_feeding/ada_feeding/behaviors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
This package contains custom py_tree behaviors for the Ada Feeding project.
"""
from .blackboard_behavior import BlackboardBehavior
from .ros_utility import UpdateTimestamp
from .ros_utility import (
UpdateTimestamp,
GetTransform,
SetStaticTransform,
ApplyTransform,
CreatePoseStamped,
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from scipy.spatial.transform import Rotation as R

# Local imports
from ada_feeding_msgs.msg import AcquisitionSchema
from ada_feeding_msgs.srv import AcquisitionSelect
from ada_feeding.behaviors import BlackboardBehavior
from ada_feeding.helpers import (
BlackboardKey,
Expand All @@ -35,8 +37,6 @@
set_static_tf,
)
from ada_feeding.idioms.pre_moveto_config import create_ft_thresh_request
from ada_feeding_msgs.msg import AcquisitionSchema
from ada_feeding_msgs.srv import AcquisitionSelect


class ComputeActionConstraints(BlackboardBehavior):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
# Local imports
from ada_feeding_msgs.msg import Mask
from ada_feeding_msgs.srv import AcquisitionSelect
from ada_feeding_perception.helpers import ros_msg_to_cv2_image
from ada_feeding.helpers import (
BlackboardKey,
quat_between_vectors,
get_tf_object,
set_static_tf,
)
from ada_feeding.behaviors import BlackboardBehavior
from ada_feeding_perception.helpers import ros_msg_to_cv2_image


class ComputeFoodFrame(BlackboardBehavior):
Expand Down
12 changes: 3 additions & 9 deletions ada_feeding/ada_feeding/behaviors/moveit2/moveit2_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ def blackboard_inputs(
- `frame_id` defaults to the base link
- `target_link` defaults to end effector
Note: if pose is PoseStamped:
- `frame_id` is pose.header.frame_id (if not "")
- `target_link` is pose.child_frame_id (if not "")
Note: if pose is PoseStamped `frame_id` is pose.header.frame_id (if not "")
Details on parameterization:
https://github.com/ros-planning/moveit_msgs/blob/master/msg/OrientationConstraint.msg
Expand Down Expand Up @@ -468,9 +466,7 @@ def update(self) -> py_trees.common.Status:
"frame_id": pose.header.frame_id
if (isinstance(pose, PoseStamped) and len(pose.header.frame_id) > 0)
else self.blackboard_get("frame_id"),
"target_link": pose.child_frame_id
if (isinstance(pose, PoseStamped) and len(pose.child_frame_id) > 0)
else self.blackboard_get("target_link"),
"target_link": self.blackboard_get("target_link"),
"tolerance": self.blackboard_get("tolerance_orientation"),
"weight": self.blackboard_get("weight_orientation"),
"parameterization": self.blackboard_get("parameterization"),
Expand All @@ -486,9 +482,7 @@ def update(self) -> py_trees.common.Status:
"frame_id": pose.header.frame_id
if (isinstance(pose, PoseStamped) and len(pose.header.frame_id) > 0)
else self.blackboard_get("frame_id"),
"target_link": pose.child_frame_id
if (isinstance(pose, PoseStamped) and len(pose.child_frame_id) > 0)
else self.blackboard_get("target_link"),
"target_link": self.blackboard_get("target_link"),
"tolerance": self.blackboard_get("tolerance_position"),
"weight": self.blackboard_get("weight_position"),
},
Expand Down
Loading