Calculate enclosing pitch angles of a box in a coordinate system given center position c, orientation q(quaternion) and dimensions l, w, h of the box

36 Views Asked by At

Illustration of the problem

Given a coordinate system (which could sit at the center of a laser sensor) and a box with dimensions $l$, $w$, $h$ and position of center $\vec{c}$ ($c_x$, $c_y$, $c_z$) and its orientation as a quaternion $q$ ($q_x$, $q_y$, $q_z$, $q_w$) in that coordinate system I want to find the minimal enclosing pitch angles (from the perspective of the coordinate system) of a box $β_{max}$ and $β_{min}$ (that means the pitch angles of pitch planes that touch the highest projected point and the lowest projected point - from the perspective of the coordinate system in the laser sensor).

This question seems to be very tricky, because how do I know which is the "highest and lowest point" from the perspective of the coordinate system? It obviously depends on the orientation and and the dimensions of the box: it could be the edge of the box or just the corner, but I have no mathematical way of expressing it.

1

There are 1 best solutions below

0
On BEST ANSWER

I have found the solution myself. it's surprisingly simple:

We can simplify the problem tremendously due to the following observation of the property of the box: We observe that regardless of the orientation of the box, the highest or lowest point of the box from the perspective of the coordinate system is either

  1. a single vertex
  2. an edge comprising of multiple vertices (Multiple vertices share the same max/min value)

That means, that in every case at least two of the eight vertices contain implicitly the $β_{max}$ and the $β_{min}$ values of the box.

We compute all eight vertices of the box in absolute coordinates and their pitch angles in the coordinates and set the minimum, maximum value of all the angles to $β_{max}$ and $β_{min}$.