Ask Your Question

Calculating the distance between two planes in rviz

asked 2013-01-06 10:51:58 -0500

metal gravatar image

Hello everyone, I am working on a project to calculate the distance between the vehicle's base and the ground. I am working on Ubuntu 11.10 with ROS-electric(with PCL) and using Asus xtion pro live RGB-D sensor. I have successfully filtered two planes. Necessary for the foot placement of a humanoid robot. Here is the video: . Is there an easy way to calculate the distance between these two planes rather than me plugging in formula(or developing a ROS node) to calculate the distance between the planes.

thanks, karthik.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-01-07 18:53:05 -0500

jbinney gravatar image

You've already written a ROS node in C++ to find the two planes, right? You can do the calculation in that same node using C++.

What specifically do you want to calculate? The vertical distance between planes? Or the distance between the closest two points on the planes? Or something else? Either of these could be calculated using PCL/Eigen

Also, electric is a pretty old version of ROS, you may want to upgrade to fuerte or groovy if you can :-)

edit flag offensive delete link more

answered 2013-01-08 00:17:38 -0500

updated 2013-01-08 00:18:29 -0500

the distance between two planes is always zero unless they are parallel. so i assume in your case the two planes are parallel. the mathematical expression of a plane is ax+by+cz+d=0. if two planes are parallel, they should have the same coefficients a, b and c. so let's say plane 1 is: ax+by+cz+d1=0, plane 2 is: ax+by+cz+d2=0. in this case the distance between these two planes is: abs(d1-d2)/sqrt(a * a+b * b+c * c). if you are using PCL to fit the plane, you will get four coefficient for a plane, which just correspond to a, b, c and d as mentioned above.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-01-06 10:51:58 -0500

Seen: 967 times

Last updated: Jan 08 '13