frame transformation (camera to base) in python
Good evening people,
First of all I would like to apologize for my limited understanding in ROS and Python, as I have been experimenting for almost 3 months now.
I am working with Baxter robot and to keep things short, what I am trying to do is to get the position of an object using augmented reality markers and move the hand to that position in order to grasp it.
I am using ar_tools
package to get the position/orientation of the object, but that with respect to the head_camera which I am using. The last couple of days I've been experimenting with how to change that reference frame (head_camera) to the base frame as this frame is used by moveit to make the plans. I have tried to set frame_id of the header of the message I receive from the ar_tools manually to 'base' pose_target.header.frame_id = 'base'
but the position and orientation I am getting is still WRT the head_camera. I also tried to do a self.tl.lookupTransform("/base", "/head_camera", self.t)
where self.t = self.tl.getLatestCommonTime("/head_camera", "/base")
but I was getting an extrapolation error. It was something like "the transformation requires to extrapolate in the past" I cant really remember now and Im not in the lab atm. Then I thought I might need to run the lookupTransform from the head_cam to head, from head to torso and from torso to Baxter's base.
My question then is, could someone guide me on how to change the frame of the marker of the ar_tools from head_camera to base. Also, for the extrapolation error, is there a way to do this in a static way?
Would you need more information please let me know.
Thanks in advance,
Mike