Skip to content

Vec stamped #15

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Use stamped vector
  • Loading branch information
mamueluth committed Jun 18, 2024
commit 8178a7a67716ae8aaeccef60b41264af8d2d74f9
30 changes: 19 additions & 11 deletions sr_moveit2_utils/sr_moveit2_utils/robot_client_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,16 @@ def compute_manip_pose(
pose_source_frame = deepcopy(source_pose)
if use_offset:
offset_transformed = self.tcp_transforms.to_from_tcp_vec3_conversion(
offset_dir, offset_dir.header.frame_id, pose_source_frame.header.frame_id
offset_dir, pose_source_frame.header.frame_id
)
# add offset
dir = np.array([offset_transformed.x, offset_transformed.y, offset_transformed.z])
dir = np.array(
[
offset_transformed.vector.x,
offset_transformed.vector.y,
offset_transformed.vector.z,
]
)
offset = dir * offset_distance
pose_source_frame.pose.position.x += offset[0]
pose_source_frame.pose.position.y += offset[1]
Expand Down Expand Up @@ -457,17 +463,19 @@ def manip_execute_cb(self, goal_handle: ServerGoalHandle):
ret = self.move_client.send_move_request(
reach_pose_robot_base_frame,
cartesian_trajectory=False,
planner_profile=request.planner_profile
if request.planner_profile
else "ompl",
planner_profile=(
request.planner_profile if request.planner_profile else "ompl"
),
)
if manip == ManipType.MANIP_REACH_PREPLACE:
ret = self.move_client.send_move_request(
reach_pose_robot_base_frame,
cartesian_trajectory=False,
planner_profile=request.planner_profile
if request.planner_profile
else "ompl_with_constraints",
planner_profile=(
request.planner_profile
if request.planner_profile
else "ompl_with_constraints"
),
)

if not self.did_manip_plan_succeed(ret, "Reach", goal_handle):
Expand Down Expand Up @@ -585,9 +593,9 @@ def manip_execute_cb(self, goal_handle: ServerGoalHandle):
move_pose_robot_base_frame,
cartesian_trajectory=True,
velocity_scaling_factor=0.1,
planner_profile=request.planner_profile
if request.planner_profile
else "pilz_lin",
planner_profile=(
request.planner_profile if request.planner_profile else "pilz_lin"
),
)

if not self.did_manip_plan_succeed(ret, "Move", goal_handle):
Expand Down