Skip to content

Commit

Permalink
#570 Added documentation for LH2 to LH1 angle conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Sep 18, 2020
1 parent 391265e commit e0d20f2
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/functional-areas/lighthouse/angle_conversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Lighthouse angle conversion
page_id: lh_angle_conversion
---

One way to get started with lighthouse 2 is to create a conversion from lighthouse 2 angles to lighthouse 1 angles, and
use the functionality that has already been implemented for lighthouse 1. Even though it is an easy way to get started,
the main drawback is that we need both sweeps for the conversion.

The strategy when creating an equation to convert from lighthouse 2 sweep angles to lighthouse 1, is to find the intersection
line between the two light planes. From the intersection line we can easily calculate the lighthouse 1 sweep angles.

The following calculations are all in the base station reference frame.

Assume we know the normals for the two light planes, $$\vec{n_1}$$ and $$\vec{n_2}$$. The cross product of the normals $$\vec{v} = \vec{n_1} \times \vec{n_2}$$
gives us the direction of the intersection line. We also know it is passing through the origin as we are using the base station
reference frame.

## Normals of the light planes

Start by figuring out the normals when $$\alpha=0$$, and then rotate them around the Z-axis using a rotation matrix.

The rotation matrix is

$$R_{z} = \left[\begin{array}{ccc}
cos{\alpha} & -sin{\alpha} & 0 \\
sin{\alpha} & cos{\alpha} & 0 \\
0 & 0 & 1
\end{array}\right]$$

and the resulting normals

$$\vec{n1}=R_z \cdot \begin{bmatrix}0 & -cos{(t)} & sin{(t)}\end{bmatrix} = \begin{bmatrix}cos{(t)}sin{(\alpha^{lh2}_1)} & -cos{(t)}cos{(\alpha^{lh2}_1)} & sin{(t)}\end{bmatrix}$$

$$\vec{n2}=R_z \cdot \begin{bmatrix}0 & -cos{(t)} & -sin{(t)}\end{bmatrix} = \begin{bmatrix}cos{(t)}sin{(\alpha^{lh2}_2)} & -cos{(t)}cos{(\alpha^{lh2}_2)} & -sin{(t)}\end{bmatrix}$$

where $$t=\pi/6$$ is the tilt angle of the light planes.


## The intersection vector

$$\vec{v} = \vec{n_1} \times \vec{n_2} = \begin{bmatrix}-\sin{(t)}\cos{(t)}(\cos{(\alpha^{lh2}_1)} + \cos{(\alpha^{lh2}_2)}) & -\sin{(t)}\cos{(t)}(\sin{(\alpha^{lh2}_1)} + \sin{(\alpha^{lh2}_2)}) & \cos^2{(t)}(\sin{(\alpha^{lh2}_1)}\cos{(\alpha^{lh2}_2)}-\cos{(\alpha^{lh2}_1)}\sin{(\alpha^{lh2}_2)})\end{bmatrix}$$

## Lighthouse 1 angles

Finally we can calculate the lighthouse 1 angles

$$\alpha^{lh1}_1 = \tan^{-1}(\frac{v_2}{v_1}) = \tan^{-1}(\frac{-\sin{(t)}\cos{(t)}(\sin{(\alpha^{lh2}_1)} + \sin{(\alpha^{lh2}_2)})}{-\sin{(t)}\cos{(t)}(\cos{(\alpha^{lh2}_1)} + \cos{(\alpha^{lh2}_2)})}) = \frac{\alpha^{lh2}_1 + \alpha^{lh2}_2}{2}$$

$$\alpha^{lh1}_2 = \tan^{-1}(\frac{v_3}{v_1}) =
\tan^{-1}(\frac{\cos^2{(t)}(\sin{(\alpha^{lh2}_1)}\cos{(\alpha^{lh2}_2)}-\cos{(\alpha^{lh2}_1)}\sin{(\alpha^{lh2}_2)})}{-\sin{(t)}\cos{(t)}(\cos{(\alpha^{lh2}_1)} + \cos{(\alpha^{lh2}_2)})}) =
\tan^{-1}(\frac{\sin{(\alpha^{lh2}_2 - \alpha^{lh2}_1)}}{\tan{(t)} (\cos{(\alpha^{lh2}_1)} + \cos{(\alpha^{lh2}_2)})})$$
1 change: 1 addition & 0 deletions docs/functional-areas/lighthouse/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ The basics:

Development related pages
* [Terminology and definitions](/docs/functional-areas/lighthouse/terminology_definitions.md)
* [Conversion from LH2 angles to LH1](/docs/functional-areas/lighthouse/angle_conversion.md)
* [Kalman estimator measurement model](/docs/functional-areas/lighthouse/kalman_measurement_model.md)

0 comments on commit e0d20f2

Please sign in to comment.