0
$\begingroup$

Rosanswers logo

Hi all,

I'm not sure what information would be sufficient for this question, so please feel free to ask about any details.

The problem is as follows: I have recorded a dataset with kinect, based on the PR2, which provides the tf topic. I then construct the point clouds from depth images and want to translate those point clouds into the world frame. I know, that the world frame is represented by /odom_combined and camera frame by /head_mount_kinect_rgb_link, so I lookup the transform:

listener.lookupTransform("/head_mount_kinect_rgb_link", "/odom_combined", time, transform);

And apply it to the point cloud via

pcl_ros::transformPointCloud(*filteredCloud,*filteredCloud,transform);

This works, but gives some strange results. As I have recorded the dataset with the robot, I definitely know how it looks and that the camera was only rotating with the robot base, so the floor should normally stay horizontal, while in my case whenever the robot turns the floor starts turning so it starts to look like a wall and then eventually as ceiling. I know this may be a bad way to explain the situation, but for now it's the best I can do.

Does anyone have any idea what happens there and what can be done to avoid keep the floor horizontal?

Thanks in advance.

UPD: It seems like the wrong rotation is performed on the point cloud. So, when the robot turns around the y axes the point cloud is turned around the x (??) axes. And that seems to be the problem. Could maybe anyone suggest how to deal with that?

UPD2: Added the tf_frames.pdf on my google drive


Originally posted by niosus on ROS Answers with karma: 386 on 2012-10-19

Post score: 0

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

Are you sure you are using the correct frame? I recommend changing to:

listener.lookupTransform(filteredCloud->header.frame_id, "/odom_combined", filteredCloud->header.stamp, transform);

Of course this only works if the cloud has the correct frame when arriving, and you haven't yet modified it. Speaking of which, make sure you set the correct frame after you transform:

pcl_ros::transformPointCloud(*filteredCloud, *filteredCloud, transform);
filteredCloud->header.frame_id = "/odom_combined"

EDIT

Based on the attached pdf of the frames, it appears that the correct frame for your cloud might be /head_mount_kinect_rgb_optical_frame and not /head_mount_kinect_rgb_link.


Originally posted by Ivan Dryanovski with karma: 4954 on 2012-10-20

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by niosus on 2012-10-21:
Thanks for the answer.I'm not sure if it has the correct frame when arriving as I create it myself from the depth image topic. But I'm sure which frame SHOULD produce it.

Comment by Ivan Dryanovski on 2012-10-21:
Have you verified the frame orientation, in the start? Maybe it's a mixup between the camera frame and camera optical frame

Comment by niosus on 2012-10-21:
No and I'm afraid I don't understand what do you mean by "varifying the orientation of the frame in the start". Can you tell me more about it?

Comment by Ivan Dryanovski on 2012-10-22:
Could you post the output of "rosrun tf view_frames"

Comment by niosus on 2012-10-22:
added the pdf to my question as an update.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Are you sure you're looking the transform up in the correct direction? You might just have it flipped.


Originally posted by Mac with karma: 4119 on 2012-10-21

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by niosus on 2012-10-21:
Tried it both ways, sinse wasn't sure about the direction. Doesn't help.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hi all! I have asked in the lab and eventually the problem is solved. The problems were in 2 different places. The first one was that I used the ros::Time(0) instead of the timestamp already provided my info message from the camera i.e. info_msg->header.stamp. The second one was that I got confused with the order of the topics to give into the "lookuptransform" function. The correct order should be (as suggested by @Mac):

listener.lookupTransform( "/odom_combined",filteredCloud->header.frame_id, time, transform);

After that I get the expected result. Thanks everyone for help.


Originally posted by niosus with karma: 386 on 2012-10-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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