Use KDL for checking IKs

This commit is contained in:
Michel Breyer
2021-09-12 00:21:58 +02:00
parent e8dff9bf5c
commit c821f22523
6 changed files with 76 additions and 53 deletions

View File

@@ -90,7 +90,7 @@ class GraspController:
return from_bbox_msg(res.bbox)
def search_grasp(self, bbox):
self.view_sphere = ViewHalfSphere(bbox, self.min_z_dist, self.moveit)
self.view_sphere = ViewHalfSphere(bbox, self.min_z_dist)
self.policy.activate(bbox, self.view_sphere)
timer = rospy.Timer(rospy.Duration(1.0 / self.control_rate), self.send_vel_cmd)
r = rospy.Rate(self.policy_rate)
@@ -160,12 +160,9 @@ class GraspController:
class ViewHalfSphere:
# TODO move feasibility check to a robot interface module
def __init__(self, bbox, min_z_dist, moveit):
def __init__(self, bbox, min_z_dist):
self.center = bbox.center
self.r = 0.5 * bbox.size[2] + min_z_dist
self.moveit = moveit
self.T_cam_ee = tf.lookup("camera_depth_optical_frame", "panda_link8")
def get_view(self, theta, phi):
eye = self.center + spherical_to_cartesian(self.r, theta, phi)
@@ -174,7 +171,3 @@ class ViewHalfSphere:
def sample_view(self):
raise NotImplementedError
def is_feasible(self, view):
success, _ = self.moveit.plan(view * self.T_cam_ee)
return success