PX4 Firmware
PX4 Autopilot Software http://px4.io
camera_trigger.cpp File Reference

External camera-IMU synchronisation and triggering, and support for camera manipulation using PWM signals over FMU auxillary pins. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stdbool.h>
#include <poll.h>
#include <mathlib/mathlib.h>
#include <matrix/math.hpp>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <systemlib/err.h>
#include <parameters/param.h>
#include <systemlib/mavlink_log.h>
#include <uORB/PublicationQueued.hpp>
#include <uORB/Subscription.hpp>
#include <uORB/topics/camera_trigger.h>
#include <uORB/topics/camera_capture.h>
#include <uORB/topics/sensor_combined.h>
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/vehicle_command_ack.h>
#include <uORB/topics/vehicle_local_position.h>
#include <uORB/topics/vehicle_global_position.h>
#include <drivers/drv_hrt.h>
#include "interfaces/src/camera_interface.h"
#include "interfaces/src/gpio.h"
#include "interfaces/src/pwm.h"
#include "interfaces/src/seagull_map2.h"
Include dependency graph for camera_trigger.cpp:

Go to the source code of this file.

Classes

class  CameraTrigger
 

Namespaces

 camera_trigger
 

Macros

#define commandParamToInt(n)   static_cast<int>(n >= 0 ? n + 0.5f : n - 0.5f)
 

Enumerations

enum  camera_interface_mode_t : int32_t {
  CAMERA_INTERFACE_MODE_NONE = 0, CAMERA_INTERFACE_MODE_GPIO, CAMERA_INTERFACE_MODE_SEAGULL_MAP2_PWM, CAMERA_INTERFACE_MODE_MAVLINK,
  CAMERA_INTERFACE_MODE_GENERIC_PWM
}
 
enum  trigger_mode_t : int32_t {
  TRIGGER_MODE_NONE = 0, TRIGGER_MODE_INTERVAL_ON_CMD, TRIGGER_MODE_INTERVAL_ALWAYS_ON, TRIGGER_MODE_DISTANCE_ALWAYS_ON,
  TRIGGER_MODE_DISTANCE_ON_CMD
}
 

Functions

__EXPORT int camera_trigger_main (int argc, char *argv[])
 
static int usage ()
 

Variables

CameraTriggercamera_trigger::g_camera_trigger
 

Detailed Description

External camera-IMU synchronisation and triggering, and support for camera manipulation using PWM signals over FMU auxillary pins.

Author
Mohammed Kabir kabir.nosp@m.@uas.nosp@m.ys.io
Kelly Steich kelly.nosp@m..ste.nosp@m.ich@w.nosp@m.ingt.nosp@m.ra.co.nosp@m.m
Andreas Bircher andre.nosp@m.as@w.nosp@m.ingtr.nosp@m.a.co.nosp@m.m

Definition in file camera_trigger.cpp.

Macro Definition Documentation

◆ commandParamToInt

#define commandParamToInt (   n)    static_cast<int>(n >= 0 ? n + 0.5f : n - 0.5f)

Definition at line 93 of file camera_trigger.cpp.

Referenced by CameraTrigger::Run().

Enumeration Type Documentation

◆ camera_interface_mode_t

enum camera_interface_mode_t : int32_t
Enumerator
CAMERA_INTERFACE_MODE_NONE 
CAMERA_INTERFACE_MODE_GPIO 
CAMERA_INTERFACE_MODE_SEAGULL_MAP2_PWM 
CAMERA_INTERFACE_MODE_MAVLINK 
CAMERA_INTERFACE_MODE_GENERIC_PWM 

Definition at line 77 of file camera_trigger.cpp.

◆ trigger_mode_t

enum trigger_mode_t : int32_t
Enumerator
TRIGGER_MODE_NONE 
TRIGGER_MODE_INTERVAL_ON_CMD 
TRIGGER_MODE_INTERVAL_ALWAYS_ON 
TRIGGER_MODE_DISTANCE_ALWAYS_ON 
TRIGGER_MODE_DISTANCE_ON_CMD 

Definition at line 85 of file camera_trigger.cpp.

Function Documentation

◆ camera_trigger_main()

int camera_trigger_main ( int  argc,
char *  argv[] 
)

Definition at line 825 of file camera_trigger.cpp.

References CameraTrigger::CameraTrigger(), camera_trigger::g_camera_trigger, CameraTrigger::start(), CameraTrigger::status(), CameraTrigger::stop(), CameraTrigger::test(), CameraTrigger::toggle_power(), and usage().

Here is the call graph for this function:

◆ usage()

static int usage ( void  )
static

Definition at line 819 of file camera_trigger.cpp.

Referenced by camera_trigger_main().

Here is the caller graph for this function: