mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
添加了4101新的机型,aux1和aux2输出rp云台的两路信号
This commit is contained in:
34
ROMFS/px4fmu_common/init.d/airframes/4101_quad_x_copy
Normal file
34
ROMFS/px4fmu_common/init.d/airframes/4101_quad_x_copy
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Generic Quadcopter
|
||||
#
|
||||
# @type Quadrotor x
|
||||
# @class Copter
|
||||
#
|
||||
# @output MAIN1 motor 1
|
||||
# @output MAIN2 motor 2
|
||||
# @output MAIN3 motor 3
|
||||
# @output MAIN4 motor 4
|
||||
# @output MAIN5 feed-through of RC AUX1 channel
|
||||
# @output MAIN6 feed-through of RC AUX2 channel
|
||||
#
|
||||
# @output AUX1 feed-through of RC AUX1 channel
|
||||
# @output AUX2 feed-through of RC AUX2 channel
|
||||
# @output AUX3 feed-through of RC AUX3 channel
|
||||
# @output AUX4 feed-through of RC FLAPS channel
|
||||
#
|
||||
# @maintainer Lorenz Meier <lorenz@px4.io>
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
param set YT_TILT_PITCH 1
|
||||
param set YT_TILT_ROLL 1
|
||||
param set-default PWM_AUX_RATE 50
|
||||
param set-default PWM_MAIN_RATE 400
|
||||
|
||||
|
||||
set MIXER quad_x
|
||||
set MIXER_AUX yt_rp
|
||||
|
||||
set PWM_OUT 1234
|
||||
@@ -62,6 +62,7 @@ px4_add_romfs_files(
|
||||
|
||||
# [4000, 4999] Quadrotor x"
|
||||
4001_quad_x
|
||||
4101_quad_x_copy
|
||||
4003_qavr5
|
||||
4009_qav250
|
||||
4010_dji_f330
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#
|
||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||
#
|
||||
echo "setup vehicle_setup"
|
||||
|
||||
#
|
||||
# Fixed wing setup.
|
||||
@@ -82,6 +83,8 @@ then
|
||||
|
||||
# Start standard multicopter apps.
|
||||
. ${R}etc/init.d/rc.mc_apps
|
||||
echo "mc vehicle setup done"
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
@@ -95,4 +95,5 @@ px4_add_romfs_files(
|
||||
vtol_delta.aux.mix
|
||||
vtol_tailsitter_duo.main.mix
|
||||
wingwing.main.mix
|
||||
yt_rp.aux.mix
|
||||
)
|
||||
|
||||
9
ROMFS/px4fmu_common/mixers/yt_rp.aux.mix
Normal file
9
ROMFS/px4fmu_common/mixers/yt_rp.aux.mix
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 0 10000 10000 0 -10000 10000
|
||||
|
||||
M: 1
|
||||
O: 10000 10000 0 -10000 10000
|
||||
S: 1 1 10000 10000 0 -10000 10000
|
||||
|
||||
@@ -34,4 +34,6 @@ ist8310 -X -b 1 -R 10 start
|
||||
|
||||
# upatch_radar start -d /dev/ttyS2
|
||||
# nanoradar_mr72 start -r 25 -d /dev/ttyS2
|
||||
|
||||
# downward
|
||||
tfmini start -R 25 -d /dev/ttyS2
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include <uORB/topics/vehicle_land_detected.h>
|
||||
#include <vtol_att_control/vtol_type.h>
|
||||
#include <lib/ecl/AlphaFilter/AlphaFilter.hpp>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
|
||||
#include <AttitudeControl.hpp>
|
||||
|
||||
@@ -82,6 +83,8 @@ public:
|
||||
static int print_usage(const char *reason = nullptr);
|
||||
|
||||
bool init();
|
||||
actuator_controls_s _acutator_rp;
|
||||
uORB::Publication<actuator_controls_s> _actuators_1_pub{ORB_ID(actuator_controls_1)};
|
||||
|
||||
private:
|
||||
void Run() override;
|
||||
@@ -157,6 +160,10 @@ private:
|
||||
(ParamInt<px4::params::MPC_THR_CURVE>) _param_mpc_thr_curve, /**< throttle curve behavior */
|
||||
|
||||
(ParamInt<px4::params::MC_AIRMODE>) _param_mc_airmode,
|
||||
|
||||
(ParamFloat<px4::params::YT_TILT_ROLL>) _param_yuntai_tilt_roll,
|
||||
(ParamFloat<px4::params::YT_TILT_ROLL>) _param_yuntai_tilt_pitch,
|
||||
|
||||
(ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau
|
||||
)
|
||||
};
|
||||
|
||||
@@ -327,11 +327,21 @@ MulticopterAttitudeControl::Run()
|
||||
_v_rates_sp_pub.publish(v_rates_sp);
|
||||
}
|
||||
|
||||
|
||||
// reset yaw setpoint during transitions, tailsitter.cpp generates
|
||||
// attitude setpoint for the transition
|
||||
_reset_yaw_sp = !attitude_setpoint_generated || _landed || (_vtol && _vtol_in_transition_mode);
|
||||
}
|
||||
|
||||
const Quatf vehicle_att_q{v_att.q};
|
||||
Eulerf vehicle_att_eulerf{vehicle_att_q};
|
||||
|
||||
_acutator_rp.control[actuator_controls_s::INDEX_ROLL] = (float)vehicle_att_eulerf.phi() * (_param_yuntai_tilt_roll.get());
|
||||
_acutator_rp.control[actuator_controls_s::INDEX_PITCH] = vehicle_att_eulerf.theta() * _param_yuntai_tilt_pitch.get();
|
||||
_acutator_rp.timestamp = hrt_absolute_time();
|
||||
_actuators_1_pub.publish(_acutator_rp);
|
||||
|
||||
|
||||
perf_end(_loop_perf);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,3 +158,29 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_MAX, 200.0f);
|
||||
* @group Multicopter Position Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(MC_MAN_TILT_TAU, 0.0f);
|
||||
|
||||
/**
|
||||
* Manual tilt input filter time constant
|
||||
*
|
||||
* Setting this parameter to 0 disables the filter
|
||||
*
|
||||
* @unit s
|
||||
* @min 0.0
|
||||
* @max 12.0
|
||||
* @decimal 2
|
||||
* @group Multicopter Position Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(YT_TILT_ROLL, 0.0f);
|
||||
|
||||
/**
|
||||
* Manual tilt input filter time constant
|
||||
*
|
||||
* Setting this parameter to 0 disables the filter
|
||||
*
|
||||
* @unit s
|
||||
* @min 0.0
|
||||
* @max 10.0
|
||||
* @decimal 2
|
||||
* @group Multicopter Position Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(YT_TILT_PITCH, 0.5f);
|
||||
|
||||
Reference in New Issue
Block a user