Skip to content

Commit 2193e28

Browse files
committed
sucessful full motion sequence
1 parent 162b464 commit 2193e28

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

src/percussion_motion/percussion_motion/percussion_motion_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(self) -> None:
9191

9292
# --- Parameters ---
9393
self.declare_parameter('robot_ip', '169.254.0.22')
94-
self.declare_parameter('home_pose', [-0.0068470948161484385, 0.43908904189889597, 0.5208511217908346, 1.9216815074629128, 0.7705997896029447, 1.5926581228860712]
94+
self.declare_parameter('home_pose', [0.0652, 0.4498, 0.4911, 1.9767, 0.9942, 1.6870]
9595
)
9696
self.declare_parameter('default_velocity', 0.2)
9797
self.declare_parameter('default_accel', 0.2)

src/percussion_motion/percussion_motion/rtde_motions.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,22 @@ def move_to_pose(
122122
----------
123123
target_pose : [x, y, z, rx, ry, rz] in the robot base frame
124124
"""
125+
126+
current_Q = rtde_r.getActualQ()
125127
try:
126-
rtde_c.moveJ_IK(target_pose, velocity, acceleration, blend)
127-
final = _current_tcp(rtde_r)
128-
return MoveResult(MoveStatus.SUCCESS, 'Reached target pose.', final)
129-
except Exception as exc:
130-
return MoveResult(MoveStatus.FAILED, f'moveJ_IK failed: {exc}')
128+
target_Q = rtde_c.getInverseKinematics(target_pose, current_Q)
129+
except Exception as e:
130+
return MoveResult(MoveStatus.FAILED, f'IK failed: {e}')
131+
except len(target_Q) != 6:
132+
return MoveResult(MoveStatus.FAILED, f'IK failed: no Q vector returned')
133+
try:
134+
rtde_c.moveJ(target_Q, velocity, acceleration, blend)
135+
except Exception as e:
136+
return MoveResult(MoveStatus.FAILED, f'moveJ failed: {e}')
137+
# rtde_c.moveJ_IK(target_pose, velocity, acceleration, blend)
138+
final = _current_tcp(rtde_r)
139+
return MoveResult(MoveStatus.SUCCESS, 'Reached target pose.', final)
140+
131141

132142

133143
def move_until_contact(

src/percussion_task_manager/percussion_task_manager/task_manager_node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _build_sequence(self, marker_pose: Pose6D) -> List[dict]:
8383
{
8484
'motion_type': 'RELATIVE_MOVE', # move backwards from Ledger + UP
8585
'marker_pose': _make_pose6d(),
86-
'approach_offset': [0, 0.12, -0.05, 0, 0.0, 0.0], # TCP frame
86+
'approach_offset': [0, 0.15, -0.05, 0, 0.0, 0.0], # TCP frame
8787
},
8888
{
8989
'motion_type': 'RELATIVE_MOVE', # Rotate Tool to face wedgelock
@@ -93,7 +93,7 @@ def _build_sequence(self, marker_pose: Pose6D) -> List[dict]:
9393
{
9494
'motion_type': 'RELATIVE_MOVE', # Move towards wedgelock (sideways) for contact 2D
9595
'marker_pose': _make_pose6d(),
96-
'approach_offset': [0.080, 0, 0, 0, 0.0, 0.0], # TCP frame
96+
'approach_offset': [0.080, -0.05, 0, 0, 0.0, 0.0], # TCP frame
9797
},
9898
{
9999
'motion_type': 'MOVE_TO_CONTACT', # Touch ledger top down
@@ -118,7 +118,7 @@ def _build_sequence(self, marker_pose: Pose6D) -> List[dict]:
118118
{
119119
'motion_type': 'RELATIVE_MOVE', # Move into striking position
120120
'marker_pose': _make_pose6d(),
121-
'approach_offset': [0.0, 0.0, -0.00200, 0.0, 0.0, 0.0], # TCP frame
121+
'approach_offset': [0.0, 0.0, -0.00150, 0.0, 0.0, 0.0], # TCP frame
122122
},
123123
]
124124

0 commit comments

Comments
 (0)