PX4 Firmware
PX4 Autopilot Software http://px4.io
vmount.cpp File Reference
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <systemlib/err.h>
#include <lib/parameters/param.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/tasks.h>
#include "input_mavlink.h"
#include "input_rc.h"
#include "input_test.h"
#include "output_rc.h"
#include "output_mavlink.h"
#include <uORB/Subscription.hpp>
#include <uORB/topics/parameter_update.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/module.h>
Include dependency graph for vmount.cpp:

Go to the source code of this file.

Classes

struct  ThreadData
 
struct  Parameters
 
struct  ParameterHandles
 

Functions

static void usage ()
 
static void update_params (ParameterHandles &param_handles, Parameters &params, bool &got_changes)
 
static bool get_params (ParameterHandles &param_handles, Parameters &params)
 
static int vmount_thread_main (int argc, char *argv[])
 
__EXPORT int vmount_main (int argc, char *argv[])
 The main command function. More...
 

Variables

static volatile bool thread_should_exit = false
 
static volatile bool thread_running = false
 
static constexpr int input_objs_len_max = 3
 
static volatile ThreadDatag_thread_data = nullptr
 

Detailed Description

Author
Leon Müller (thedevleon)
Beat Küng beat-.nosp@m.kuen.nosp@m.g@gmx.nosp@m..net
Julian Oes julia.nosp@m.n@oe.nosp@m.s.ch
Matthew Edwards (mje-nz)

Driver for to control mounts such as gimbals or servos. Inputs for the mounts can RC and/or mavlink commands. Outputs to the mounts can be RC (PWM) output or mavlink.

Definition in file vmount.cpp.

Function Documentation

◆ get_params()

bool get_params ( ParameterHandles param_handles,
Parameters params 
)
static

Definition at line 548 of file vmount.cpp.

References ParameterHandles::mnt_do_stab, ParameterHandles::mnt_man_pitch, ParameterHandles::mnt_man_roll, ParameterHandles::mnt_man_yaw, ParameterHandles::mnt_mav_compid, ParameterHandles::mnt_mav_sysid, ParameterHandles::mnt_mode_in, ParameterHandles::mnt_mode_out, ParameterHandles::mnt_ob_lock_mode, ParameterHandles::mnt_ob_norm_mode, ParameterHandles::mnt_off_pitch, ParameterHandles::mnt_off_roll, ParameterHandles::mnt_off_yaw, ParameterHandles::mnt_range_pitch, ParameterHandles::mnt_range_roll, ParameterHandles::mnt_range_yaw, param_find(), PARAM_INVALID, and update_params().

Referenced by vmount_thread_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_params()

void update_params ( ParameterHandles param_handles,
Parameters params,
bool &  got_changes 
)
static

◆ usage()

static void usage ( void  )
static

Definition at line 591 of file vmount.cpp.

Referenced by vmount_main(), and vmount_thread_main().

Here is the caller graph for this function:

◆ vmount_main()

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

The main command function.

Processes command line arguments and starts the daemon.

Definition at line 427 of file vmount.cpp.

References counter, ThreadData::input_objs, ThreadData::input_objs_len, ThreadData::output_obj, vmount::InputBase::print_status(), vmount::OutputBase::print_status(), thread_running, thread_should_exit, usage(), and vmount_thread_main().

Here is the call graph for this function:

◆ vmount_thread_main()

static int vmount_thread_main ( int  argc,
char *  argv[] 
)
static

Variable Documentation

◆ g_thread_data

volatile ThreadData* g_thread_data = nullptr
static

Definition at line 84 of file vmount.cpp.

◆ input_objs_len_max

constexpr int input_objs_len_max = 3
static

Definition at line 77 of file vmount.cpp.

Referenced by vmount_thread_main().

◆ thread_running

volatile bool thread_running = false
static

Definition at line 75 of file vmount.cpp.

Referenced by vmount_main(), and vmount_thread_main().

◆ thread_should_exit

volatile bool thread_should_exit = false
static

Definition at line 74 of file vmount.cpp.

Referenced by vmount_main(), and vmount_thread_main().