graspnet / graspnetAPI

Toolbox for our GraspNet-1Billion dataset.
https://graspnet.net/index.html
203 stars 52 forks source link

convert Grasps between ann_ids #17

Closed cww97 closed 3 years ago

cww97 commented 3 years ago

I see version 1.2.6 supports transform for grasps, f312d7e2a73ca97f9e791cf3f1ab3aeacebac3e9

I have another idea: I found that the grasps are all in camera coordinate, I am in ann_id == i but I wanna to use grasp in ann_id == j, seems I need this

class AroundViewGrasp(Grasp):
    @property
    def ann_id(self):
        return self._ann_id

    @ann_id.setter
    def ann_id(self, idx):
        assert idx in range(256)
        self._ann_id = idx

    def to_view(self, target_id):
        T = some_magic(self.ann_id, target_id)
        self.transform(T)
        self.ann_id = target_id

I guess I can get some idea from here

table_trans = transform_points(table, np.linalg.inv(np.matmul(align_mat, camera_pose)))

but my mind is still all a mess about how could I construct this matrix T

GouMinghao commented 3 years ago

Sorry for the delay, we are both very busy these days. You don't need to use align_mat. camera_pose[n] record the transformation matrix from the first camera pose to the n^th camera pose. camera_pose[i] and camera_pose[j] will be enough.