Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airframe config for Kopis 2 #12549

Merged
merged 4 commits into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions ROMFS/px4fmu_common/init.d/airframes/4053_holybro_kopis2
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/sh
#
# @name Holybro Kopis 2
#
# @type Quadrotor x
# @class Copter
#
# @maintainer Beat Kueng <beat@px4.io>
#
# @board px4_fmu-v2 exclude
#

sh /etc/init.d/rc.mc_defaults

set MIXER quad_x
set PWM_OUT 1234

if [ $AUTOCNF = yes ]
then
param set BAT_N_CELLS 4

param set GPS_1_CONFIG 0
param set RC_PORT_CONFIG 201

param set IMU_GYRO_CUTOFF 120
param set MC_DTERM_CUTOFF 0

param set MC_ROLLRATE_P 0.036
param set MC_ROLLRATE_I 0.25
param set MC_ROLLRATE_D 0.0006
param set MC_ROLLRATE_MAX 1600
param set MC_ROLL_P 10

param set MC_PITCHRATE_P 0.036
param set MC_PITCHRATE_I 0.32
param set MC_PITCHRATE_D 0.0004
param set MC_PITCHRATE_MAX 1600
param set MC_PITCH_P 10

param set MC_YAWRATE_MAX 1000
param set MC_YAWRATE_P 0.04
param set MC_YAW_P 4

param set MOT_ORDERING 1
param set MPC_MANTHR_MIN 0
param set MPC_MAN_TILT_MAX 60
param set PWM_MAX 1950
param set PWM_MIN 1075
param set PWM_RATE 400

param set OSD_ATXXXX_CFG 1

param set THR_MDL_FAC 0.7

param set MPC_THR_CURVE 1
param set MPC_THR_HOVER 0.12

param set MC_AIRMODE 1

param set EV_TSK_RC_LOSS 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potaito really handy feature :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😁

fi

1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ px4_add_romfs_files(
4050_generic_250
4051_s250aq
4052_holybro_qav250
4053_holybro_kopis2
4060_dji_matrice_100
4070_aerofc
4080_zmr250
Expand Down
2 changes: 1 addition & 1 deletion Tools/validate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def load_yaml_file(file_name):
if verbose: print("Validating {:}".format(yaml_file))
document = load_yaml_file(yaml_file)
# ignore top-level entries prefixed with __
for key in document.keys():
for key in list(document.keys()):
if key.startswith('__'): del document[key]

if not validator.validate(document):
Expand Down
15 changes: 0 additions & 15 deletions boards/holybro/kakutef7/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,6 @@

#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5)

/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))

#if BOARD_HAS_USB_VALID == 1
# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#else
# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#endif

#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK1_VALID (1)

#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

/* This board provides a DMA pool and APIs */
Expand Down
2 changes: 2 additions & 0 deletions msg/tune_control.msg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ uint8 volume # value between 0-100 if supported by backend
uint8 VOLUME_LEVEL_MIN = 0
uint8 VOLUME_LEVEL_DEFAULT = 40
uint8 VOLUME_LEVEL_MAX = 100

uint8 ORB_QUEUE_LENGTH = 3
2 changes: 1 addition & 1 deletion src/drivers/mkblctrl/mkblctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ MK::task_main()
* advertise the tune_control.
*/
tune_control_s tune = {};
_tune_control_sub = orb_advertise(ORB_ID(tune_control), &tune);
_tune_control_sub = orb_advertise_queue(ORB_ID(tune_control), &tune, tune_control_s::ORB_QUEUE_LENGTH);

pollfd fds[2];
fds[0].fd = _t_actuators;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/commander/commander_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int buzzer_init()
tune_durations[TONE_BATTERY_WARNING_FAST_TUNE] = 800000;
tune_durations[TONE_BATTERY_WARNING_SLOW_TUNE] = 800000;
tune_durations[TONE_SINGLE_BEEP_TUNE] = 300000;
tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, tune_control_s::ORB_QUEUE_LENGTH);
return PX4_OK;
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/events/rc_loss_alarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void RC_Loss_Alarm::play_tune()
tune_control.volume = tune_control_s::VOLUME_LEVEL_MAX;

if (_tune_control_pub == nullptr) {
_tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
_tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, tune_control_s::ORB_QUEUE_LENGTH);

} else {
orb_publish(ORB_ID(tune_control), _tune_control_pub, &tune_control);
Expand All @@ -118,7 +118,7 @@ void RC_Loss_Alarm::stop_tune()
tune_control.timestamp = hrt_absolute_time();

if (_tune_control_pub == nullptr) {
_tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
_tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, tune_control_s::ORB_QUEUE_LENGTH);

} else {
orb_publish(ORB_ID(tune_control), _tune_control_pub, &tune_control);
Expand Down
3 changes: 2 additions & 1 deletion src/systemcmds/tests/test_tone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ int test_tone(int argc, char *argv[])
tune_control_s tune_control = {};
tune_control.tune_id = static_cast<int>(TuneID::NOTIFY_NEGATIVE);

orb_advert_t tune_control_pub = orb_advertise(ORB_ID(tune_control), &tune_control);
orb_advert_t tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control,
tune_control_s::ORB_QUEUE_LENGTH);

if (argc == 1) {
PX4_INFO("Volume silenced for testing predefined tunes 0-20.");
Expand Down
2 changes: 1 addition & 1 deletion src/systemcmds/tune_control/tune_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void publish_tune_control(tune_control_s &tune_control)

if (tune_control_pub == nullptr) {
// We have a minimum of 3 so that tune, stop, tune will fit
tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, 3);
tune_control_pub = orb_advertise_queue(ORB_ID(tune_control), &tune_control, tune_control_s::ORB_QUEUE_LENGTH);

} else {
orb_publish(ORB_ID(tune_control), tune_control_pub, &tune_control);
Expand Down