IntelligentRoboticsLabs / gb_visual_detection_3d

87 stars 32 forks source link

How can I get the xcenter, ycenter, z values..? #51

Closed gusrbgks closed 3 years ago

gusrbgks commented 3 years ago

Hi.

I think I've finished installing and running the darknet_3d package.

darknet_3d_rqt_graph darknet_3d_topic_msgs

The darknet_ros_3d package outputs a 3D box.

As shown above, boundingBox3d message provides xmax, xmin, ymax, ymin, zmax, zmin .

But I only need the 3d coordinates of the center point of the 2D bbox detected by ros-darknet.

How can I get the xcenter, ycenter, z values..?

please answer about my question. Thank you.

fmrico commented 3 years ago

Well, you can modify the code to adapt it to your needs.

Maybe you will better need something like https://github.com/gentlebots/gb_perception/blob/dadebe3d90719d6e01528ca68c44dfa80199b5c1/gb_perception_utils/src/gb_perception_utils/Perceptor3D.cpp#L77 but in Melodic.

Good luck!!!

gusrbgks commented 3 years ago

Hi. I seem to have found a way to get the 3D coordinates of the Center Point of a 2D bbox. This is the center_point in this code. is this right?

[Darknet3D.cpp] image

fgonzalezr1998 commented 3 years ago

Hi @gusrbgks First part is correct. However, the last part is not. You can not get the index in the point cloud from the (x,y) coordinates (At least, in this way) because that x and y are not pixels but they are 3D coordinates (in meters) taking the 'camera_link' (or what you use) frame.

gusrbgks commented 2 years ago

Hi. @fgonzalezr1998

The coordinates detected in Yolo were converted to the robot's base coordinates and moved, but they did not move to the desired coordinates.

I suspect it's because I put the wrong 3d coordinates.

So how can I get the 3D coordinates I want?