mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-21 21:50:35 +08:00
mixer lib remove custom constrain and cleanup includes
This commit is contained in:
+2
-16
@@ -37,24 +37,10 @@
|
||||
* Programmable multi-channel mixer library.
|
||||
*/
|
||||
|
||||
#include <px4_config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <systemlib/err.h>
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#define debug(fmt, args...) do { } while(0)
|
||||
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
|
||||
|
||||
|
||||
@@ -740,7 +740,8 @@ public:
|
||||
HelicopterMixer(ControlCallback control_cb,
|
||||
uintptr_t cb_handle,
|
||||
mixer_heli_s *mixer_info);
|
||||
~HelicopterMixer();
|
||||
|
||||
~HelicopterMixer() = default;
|
||||
|
||||
/**
|
||||
* Factory method.
|
||||
|
||||
@@ -36,37 +36,17 @@
|
||||
*
|
||||
* Helicopter mixers.
|
||||
*/
|
||||
#include <px4_config.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
#define debug(fmt, args...) do { } while(0)
|
||||
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
|
||||
//#include <debug.h>
|
||||
//#define debug(fmt, args...) lowsyslog(fmt "\n", ##args)
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
float constrain(float val, float min, float max)
|
||||
{
|
||||
return (val < min) ? min : ((val > max) ? max : val);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
using math::constrain;
|
||||
|
||||
HelicopterMixer::HelicopterMixer(ControlCallback control_cb,
|
||||
uintptr_t cb_handle,
|
||||
@@ -74,11 +54,6 @@ HelicopterMixer::HelicopterMixer(ControlCallback control_cb,
|
||||
Mixer(control_cb, cb_handle),
|
||||
_mixer_info(*mixer_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HelicopterMixer::~HelicopterMixer()
|
||||
{
|
||||
}
|
||||
|
||||
HelicopterMixer *
|
||||
|
||||
@@ -36,26 +36,13 @@
|
||||
*
|
||||
* Multi-rotor mixers.
|
||||
*/
|
||||
#include <px4_config.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <float.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <mathlib/math/Limits.hpp>
|
||||
#include <drivers/drv_pwm_output.h>
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
#include <cfloat>
|
||||
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
// This file is generated by the px_generate_mixers.py script which is invoked during the build process
|
||||
// #include "mixer_multirotor.generated.h"
|
||||
#include "mixer_multirotor_normalized.generated.h"
|
||||
|
||||
@@ -37,21 +37,6 @@
|
||||
* Simple summing mixer.
|
||||
*/
|
||||
|
||||
#include <px4_config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
#define debug(fmt, args...) do { } while(0)
|
||||
|
||||
Reference in New Issue
Block a user