Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange tf bug #118

Open
edvart-ros opened this issue Apr 5, 2022 · 1 comment
Open

strange tf bug #118

edvart-ros opened this issue Apr 5, 2022 · 1 comment

Comments

@edvart-ros
Copy link

This package works pretty well, but ive come across a strange bug.
Whenever the object that is detected crosses a certain threshold, the tf is messed up. The object is still seemingly detected correctly, but there is some trouble when it tries to publish the tf for the object.

GUI:
image
Rviz:
image
Console output:
image

When the object is on the other side of this threshold, it gets the pose correctly, with pretty good accuracy.
I'm not 100% sure about this, but it seems like the pose is wrong as soon as it crosses the z axis (when x goes from positive to negative value), so maybe that helps.

functioning normally on other side of threshold:

GUI:
image

Rviz:
image

Console output:
image

I dont really understand whats going on here... any ideas? again, the camera depth is working, and the object detection itself seems to work, but something is going wrong with the transform i think.

@matlabbe
Copy link
Member

It is like the wrong depth is used for TF. The algo is pretty simple:

// Find center of the object
QPointF center = iter->map(QPointF(objectWidth/2, objectHeight/2));
cv::Vec3f center3D = this->getDepth(depth,
center.x()+0.5f, center.y()+0.5f,
float(depth.cols/2)-0.5f, float(depth.rows/2)-0.5f,
1.0f/depthConstant, 1.0f/depthConstant);

it finds the depth in the middle of the object, then apply camera calibration matrix to find the 3D point accordingly to camera.

You may put side-by-side the depth and rgb image, just to make sure they match perfectly. It seems so as the color in the point cloud seems at the good place. With the right case, the z value is 1.18 meters, while left case it is 0.55 meters. Other thing could be the calibration camera matrix that is wrong (for example the width/height in camera_info doesn't match the actual size of the depth image).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants