Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
point.c File Reference

Determines camera pan and tilt angles. More...

#include <math.h>
#include "cam.h"
#include "point.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "subsystems/navigation/common_nav.h"
#include "subsystems/gps.h"
#include "math/pprz_geodetic_float.h"
+ Include dependency graph for point.c:

Go to the source code of this file.

Data Structures

struct  VECTOR
 
struct  MATRIX
 

Functions

void vSubtractVectors (VECTOR *svA, VECTOR svB, VECTOR svC)
 
void vMultiplyMatrixByVector (VECTOR *svA, MATRIX smB, VECTOR svC)
 
void vPoint (float fPlaneEast, float fPlaneNorth, float fPlaneAltitude, float fRollAngle, float fPitchAngle, float fYawAngle, float fObjectEast, float fObjectNorth, float fAltitude, float *fPan, float *fTilt)
 

Variables

float cam_theta
 
float cam_phi
 
bool_t heading_positive = 0
 
float memory_x
 
float memory_y
 
float memory_z
 

Detailed Description

Determines camera pan and tilt angles.

project: Paparazzi description: Determines camera pan and tilt angles from plane's and object's positions and plane's pitch and roll angles. Software might be optimized by removing multiplications with 0, it is left this way for better understandabilty and changeability.

author: Arnold Schroeter, Martin Mueller

hardware:

The camera control is made of normal servos. Usually servos have a turn angle of about 90°. This is changed electrically so that they can do a 180°. It is achieved by adding two serial resistors at both sides of the potentiometer (P1), one for increasing the usable angle (R1) and the other for moving the middle position to a useful angle (R2). Therefore a servo with a 270° potentiometer is needed. Very small and light servos have 180° potentiometers, these do not allow a 180° degrees sweep. Cut the outer two connections between the potentiometer and the board to insert the resistors. The values for R1 and R2 should be found out by testing as there might be serial resistors on the servo board that affect the values. Start with about 1/2 the value of P1 for R1 and change R1 until you get a little more than 180° sweep. Then insert and modify R2 to set neutral back to the middle position of the potentiometer.

                ^
               /
         ----------
 *-------I   /    I-------*
 I       ----------       I
 I         /     P1       I
 I         I              I
 I         I              I
---        I             ---
I I        I             I I
I I        I             I I
I I        I             I I
--- R1     I             --- R2
 I         I              I
 I         I              I

Definition in file point.c.


Data Structure Documentation

struct VECTOR

Definition at line 83 of file point.c.

Data Fields
float fx
float fy
float fz
struct MATRIX

Definition at line 89 of file point.c.

Data Fields
float fx1
float fx2
float fx3
float fy1
float fy2
float fy3
float fz1
float fz2
float fz3

Function Documentation

void vMultiplyMatrixByVector ( VECTOR svA,
MATRIX  smB,
VECTOR  svC 
)

Definition at line 127 of file point.c.

References VECTOR::fx, MATRIX::fx1, MATRIX::fx2, MATRIX::fx3, VECTOR::fy, MATRIX::fy1, MATRIX::fy2, MATRIX::fy3, VECTOR::fz, MATRIX::fz1, MATRIX::fz2, and MATRIX::fz3.

Referenced by vPoint().

+ Here is the caller graph for this function:

void vPoint ( float  fPlaneEast,
float  fPlaneNorth,
float  fPlaneAltitude,
float  fRollAngle,
float  fPitchAngle,
float  fYawAngle,
float  fObjectEast,
float  fObjectNorth,
float  fAltitude,
float *  fPan,
float *  fTilt 
)
void vSubtractVectors ( VECTOR svA,
VECTOR  svB,
VECTOR  svC 
)

Definition at line 115 of file point.c.

References VECTOR::fx, VECTOR::fy, and VECTOR::fz.

Referenced by vPoint().

+ Here is the caller graph for this function:

Variable Documentation

float cam_phi

Definition at line 96 of file point.c.

Referenced by vPoint().

float cam_theta

Definition at line 95 of file point.c.

Referenced by vPoint().

bool_t heading_positive = 0

Definition at line 97 of file point.c.

float memory_x

Definition at line 98 of file point.c.

Referenced by vPoint().

float memory_y

Definition at line 98 of file point.c.

Referenced by vPoint().

float memory_z

Definition at line 98 of file point.c.

Referenced by vPoint().