Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
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 "modules/nav/common_nav.h"
#include "modules/gps/gps.h"
#include "math/pprz_geodetic_float.h"
#include "state.h"
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 | heading_positive = 0 |
float | memory_x |
float | memory_y |
float | memory_z |
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.
struct MATRIX |
Definition at line 128 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().
void vPoint | ( | float | fPlaneEast, |
float | fPlaneNorth, | ||
float | fPlaneAltitude, | ||
float | fRollAngle, | ||
float | fPitchAngle, | ||
float | fYawAngle, | ||
float | fObjectEast, | ||
float | fObjectNorth, | ||
float | fAltitude, | ||
float * | fPan, | ||
float * | fTilt | ||
) |
Definition at line 164 of file point.c.
References point::a, AP_MODE_AUTO2, autopilot_get_mode(), cam_lock, cam_mode, CAM_MODE_RC, CAM_MODE_STABILIZED, CAM_MODE_WP_TARGET, CAM_MODE_XY_TARGET, CAM_PAN_MAX, CAM_PAN_MIN, cam_phi, cam_theta, CAM_TILT_MAX, CAM_TILT_MIN, UtmCoor_f::east, FALSE, VECTOR::fx, MATRIX::fx1, MATRIX::fx2, MATRIX::fx3, VECTOR::fy, MATRIX::fy1, MATRIX::fy2, MATRIX::fy3, VECTOR::fz, MATRIX::fz1, MATRIX::fz2, MATRIX::fz3, ground_alt, LlaCoor_f::lat, lla_of_utm_f(), LlaCoor_f::lon, MAX_PPRZ, memory_x, memory_y, memory_z, MIN_PPRZ, nav_utm_east0, nav_utm_north0, nav_utm_zone0, UtmCoor_f::north, PPRZ_MUTEX_LOCK, PPRZ_MUTEX_UNLOCK, radio_control_get(), RADIO_PITCH, RADIO_ROLL, stateGetPositionUtm_f(), vMultiplyMatrixByVector(), vSubtractVectors(), waypoints, point::x, point::y, and UtmCoor_f::zone.
Referenced by cam_target().
Definition at line 116 of file point.c.
References VECTOR::fx, VECTOR::fy, and VECTOR::fz.
Referenced by vPoint().