0
$\begingroup$

Rosanswers logo

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


Originally posted by ekptwtos on ROS Answers with karma: 35 on 2015-04-14

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi Mike,

ideally you don't need to transform it by hand; it will be automatically done by moveit.

In practice the system might be a bit "deaf" wrt the frame_id attribute of the target pose. In my experience this will help:

mgc.set_pose_reference_frame(pose_target.header.frame_id)

Originally posted by marcoesposito1988 with karma: 191 on 2015-04-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by ekptwtos on 2015-04-16:
hello Marco,

and thanks for the reply. I tried this, but i had no luck. it still sees the reference frame as the "/head_camera" and not the "base".

Comment by ekptwtos on 2015-04-16:
oh... now i get it, it changes the planning frame to the frame from ar_pose marker.. yes this way it kinda works.. when i try to set the end effector to go to the position of the object but follows "crazy" trajectories.. when i try to go to the pose , it returns: ABORTED: No motion plan found.

Comment by buckley.toby on 2017-05-19:
a follow-up question, the python source doesn't have any set_planning_frame functions, and get_current_pose spits out the pose in the planning_frame. Is there a way to get it in the pose frame instead?

Comment by tik0 on 2019-08-19:
In the c++ API it is in fact defined as set_reference_frame but in the python API it is called set_pose_reference_frame. Notice the pose difference!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.