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

Mixer load test. More...

#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <px4_platform_common/px4_config.h>
#include <lib/mixer/MixerGroup.hpp>
#include <lib/mixer/mixer_load.h>
#include <output_limit/output_limit.h>
#include <drivers/drv_hrt.h>
#include <drivers/drv_pwm_output.h>
#include <px4iofirmware/mixer.h>
#include <px4iofirmware/protocol.h>
#include <uORB/topics/actuator_controls.h>
#include "tests_main.h"
#include <unit_test.h>
Include dependency graph for test_mixer.cpp:

Go to the source code of this file.

Classes

class  MixerTest
 

Macros

#define MIXER_DIFFERENCE_THRESHOLD   2
 
#define PATH_MAX   4096
 
#define MIXER_ONBOARD_PATH   "/etc/mixers"
 
#define MIXER_PATH(_file)   MIXER_ONBOARD_PATH"/"#_file
 
#define MIXER_VERBOSE
 

Functions

static int mixer_callback (uintptr_t handle, uint8_t control_group, uint8_t control_index, float &control)
 
 ut_declare_test_c (test_mixer, MixerTest) bool MixerTest
 

Variables

static const unsigned output_max = 8
 
static float actuator_controls [output_max]
 
static bool should_prearm = false
 

Detailed Description

Mixer load test.

Definition in file test_mixer.cpp.

Macro Definition Documentation

◆ MIXER_DIFFERENCE_THRESHOLD

#define MIXER_DIFFERENCE_THRESHOLD   2

Definition at line 72 of file test_mixer.cpp.

Referenced by MixerTest::mixerTest().

◆ MIXER_ONBOARD_PATH

#define MIXER_ONBOARD_PATH   "/etc/mixers"

Definition at line 87 of file test_mixer.cpp.

Referenced by MixerTest::loadAllTest().

◆ MIXER_PATH

◆ MIXER_VERBOSE

#define MIXER_VERBOSE

Definition at line 92 of file test_mixer.cpp.

◆ PATH_MAX

#define PATH_MAX   4096

Definition at line 79 of file test_mixer.cpp.

Referenced by MixerTest::loadAllTest().

Function Documentation

◆ mixer_callback()

static int mixer_callback ( uintptr_t  handle,
uint8_t  control_group,
uint8_t  control_index,
float &  control 
)
static

Definition at line 574 of file test_mixer.cpp.

References actuator_controls, and should_prearm.

Referenced by MixerTest::load_mixer().

Here is the caller graph for this function:

◆ ut_declare_test_c()

ut_declare_test_c ( test_mixer  ,
MixerTest   
)

Definition at line 128 of file test_mixer.cpp.

References MixerTest::load_mixer(), and MIXER_PATH.

Here is the call graph for this function:

Variable Documentation

◆ actuator_controls

float actuator_controls[output_max]
static

Definition at line 66 of file test_mixer.cpp.

Referenced by mixer_callback(), and MixerTest::mixerTest().

◆ output_max

const unsigned output_max = 8
static

Definition at line 65 of file test_mixer.cpp.

Referenced by MixerTest::mixerTest().

◆ should_prearm

bool should_prearm = false
static

Definition at line 67 of file test_mixer.cpp.

Referenced by mixer_callback(), and MixerTest::mixerTest().