ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Intersect ray with plane ground

asked 2012-09-15 05:04:04 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi

I have a webcam, and after calibrating with camera_calibration I created a program that when you click a part of the image will return pixel coordinates.

Assuming that the camera is on the ground, I want to calculate the point where intersect the ray (with projectPixelTo3dRay()) and the plane (the ground plane Z=0), relative to the robot coordinate frame. I have seen these codes but do not understand.

perceive_poo in void imageCb()

object_tracker in void imageCb()

Can anyone help me?

Thanks

edit retag flag offensive close merge delete

Comments

Thanks dejanpan, It seems that this code uses the old version of image_geometry, projectPixelTo3dRay() return a ray or a point?

Alberto Martín gravatar image Alberto Martín  ( 2012-09-21 04:09:41 -0500 )edit

It shall be a ray, that is a normalized vector. Of course you can also represent it as a point.

dejanpan gravatar image dejanpan  ( 2012-09-21 14:45:23 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2012-09-20 14:29:11 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

They are using some basic transformation and trigonometric operations. In the end the ray gives you the direction and through the trigonometry you have to infer the right magnitude of the ray components. The final intersection with the ground (x, y point on the floor in robot's base frame) is saved in the variable poo:

poo.x = cameraOrigin.getX() + baseRay.getX() * s;

poo.y = cameraOrigin.getY() + baseRay.getY() * s;

D.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-15 05:04:04 -0500

Seen: 1,567 times

Last updated: Sep 20 '12