mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-20 16:41:36 +08:00
crazyflie: fix PWM channel ordering
Channels belonging to a certain timer were not all grouped together. This is required by the .first_channel_index and .last_channel_index data members. We introduce a new mixer geometry to solve the problem.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
|
||||
set MIXER quad_x
|
||||
set MIXER quad_x_cw
|
||||
set PWM_OUT 1234
|
||||
if [ $AUTOCNF = yes ]
|
||||
then
|
||||
|
||||
@@ -71,6 +71,7 @@ px4_add_romfs_files(
|
||||
quad_+_vtol.main.mix
|
||||
quad_w.main.mix
|
||||
quad_x.main.mix
|
||||
quad_x_cw.main.mix
|
||||
quad_x_vtol.main.mix
|
||||
stampede.main.mix
|
||||
tri_y_yaw-.main.mix
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# @board px4_fmu-v2 exclude
|
||||
# Quad X with clock-wise motor assigment
|
||||
|
||||
R: 4xcw 10000 10000 10000 0
|
||||
|
||||
@@ -92,6 +92,15 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
.ccr_offset = STM32_GTIM_CCR2_OFFSET,
|
||||
.masks = GTIM_SR_CC2IF | GTIM_SR_CC2OF
|
||||
},
|
||||
{
|
||||
// M2
|
||||
.gpio_out = GPIO_TIM2_CH4OUT,
|
||||
.gpio_in = GPIO_TIM2_CH4IN,
|
||||
.timer_index = 0,
|
||||
.timer_channel = 4,
|
||||
.ccr_offset = STM32_GTIM_CCR4_OFFSET,
|
||||
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
|
||||
},
|
||||
{
|
||||
// M3
|
||||
.gpio_out = GPIO_TIM2_CH1OUT,
|
||||
@@ -110,13 +119,4 @@ __EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
|
||||
.ccr_offset = STM32_GTIM_CCR4_OFFSET,
|
||||
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
|
||||
},
|
||||
{
|
||||
// M2
|
||||
.gpio_out = GPIO_TIM2_CH4OUT,
|
||||
.gpio_in = GPIO_TIM2_CH4IN,
|
||||
.timer_index = 0,
|
||||
.timer_channel = 4,
|
||||
.ccr_offset = STM32_GTIM_CCR4_OFFSET,
|
||||
.masks = GTIM_SR_CC4IF | GTIM_SR_CC4OF
|
||||
},
|
||||
};
|
||||
|
||||
@@ -48,6 +48,7 @@ set(geometry_files
|
||||
quad_s250aq.toml
|
||||
quad_vtail.toml
|
||||
quad_wide.toml
|
||||
quad_x_cw.toml
|
||||
quad_x.toml
|
||||
quad_x_pusher.toml
|
||||
quad_y.toml
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# Generic Quadcopter in X configuration
|
||||
# with clock-wise motor numbering
|
||||
|
||||
[info]
|
||||
key = "4xcw"
|
||||
description = "Quadcopter in X configuration with clock-wise motor numbering"
|
||||
|
||||
[rotor_default]
|
||||
direction = "CW"
|
||||
axis = [0.0, 0.0, -1.0]
|
||||
Ct = 1.0
|
||||
Cm = 0.05
|
||||
|
||||
[[rotors]]
|
||||
name = "front_right"
|
||||
position = [0.707107, 0.707107, 0.0]
|
||||
direction = "CCW"
|
||||
|
||||
[[rotors]]
|
||||
name = "rear_right"
|
||||
position = [-0.707107, 0.707107, 0.0]
|
||||
|
||||
[[rotors]]
|
||||
name = "rear_left"
|
||||
position = [-0.707107, -0.707107, 0.0]
|
||||
direction = "CCW"
|
||||
|
||||
[[rotors]]
|
||||
name = "front_left"
|
||||
position = [0.707107, -0.707107, 0.0]
|
||||
Reference in New Issue
Block a user