mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Merge branch 'beta'
This commit is contained in:
7
Makefile
7
Makefile
@@ -169,6 +169,7 @@ TOPICS_DIR = $(PX4_BASE)src/modules/uORB/topics
|
|||||||
MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/$(PX4_TARGET_OS)/px4_messages
|
MULTIPLATFORM_HEADER_DIR = $(PX4_BASE)src/platforms/$(PX4_TARGET_OS)/px4_messages
|
||||||
MULTIPLATFORM_PREFIX = px4_
|
MULTIPLATFORM_PREFIX = px4_
|
||||||
TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
|
TOPICHEADER_TEMP_DIR = $(BUILD_DIR)topics_temporary
|
||||||
|
MULTI_TOPICHEADER_TEMP_DIR = $(BUILD_DIR)multi_topics_temporary
|
||||||
GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
|
GENMSG_PYTHONPATH = $(PX4_BASE)Tools/genmsg/src
|
||||||
GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
|
GENCPP_PYTHONPATH = $(PX4_BASE)Tools/gencpp/src
|
||||||
|
|
||||||
@@ -181,9 +182,7 @@ generateuorbtopicheaders: checksubmodules
|
|||||||
@$(ECHO) "Generating multiplatform uORB topic wrapper headers"
|
@$(ECHO) "Generating multiplatform uORB topic wrapper headers"
|
||||||
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
|
$(Q) (PYTHONPATH=$(GENMSG_PYTHONPATH):$(GENCPP_PYTHONPATH):$(PYTHONPATH) $(PYTHON) \
|
||||||
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
|
$(PX4_BASE)Tools/px_generate_uorb_topic_headers.py \
|
||||||
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
|
-d $(MSG_DIR) -o $(MULTIPLATFORM_HEADER_DIR) -e $(MULTIPLATFORM_TEMPLATE_DIR) -t $(MULTI_TOPICHEADER_TEMP_DIR) -p $(MULTIPLATFORM_PREFIX))
|
||||||
# clean up temporary files
|
|
||||||
$(Q) (rm -r $(TOPICHEADER_TEMP_DIR))
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Testing targets
|
# Testing targets
|
||||||
@@ -230,6 +229,8 @@ clean:
|
|||||||
$(Q) $(RMDIR) $(BUILD_DIR)*.build
|
$(Q) $(RMDIR) $(BUILD_DIR)*.build
|
||||||
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR)
|
$(Q) $(RMDIR) $(PX4_VERSIONING_DIR)
|
||||||
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
|
$(Q) $(REMOVE) $(IMAGE_DIR)*.px4
|
||||||
|
$(Q) $(RMDIR) $(TOPICHEADER_TEMP_DIR)
|
||||||
|
$(Q) $(RMDIR) $(MULTI_TOPICHEADER_TEMP_DIR)
|
||||||
|
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|||||||
@@ -93,6 +93,29 @@ def convert_dir(inputdir, outputdir, templatedir):
|
|||||||
"""
|
"""
|
||||||
Converts all .msg files in inputdir to uORB header files
|
Converts all .msg files in inputdir to uORB header files
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Find the most recent modification time in input dir
|
||||||
|
maxinputtime = 0
|
||||||
|
for f in os.listdir(inputdir):
|
||||||
|
fni = os.path.join(inputdir, f)
|
||||||
|
if os.path.isfile(fni):
|
||||||
|
it = os.path.getmtime(fni)
|
||||||
|
if it > maxinputtime:
|
||||||
|
maxinputtime = it;
|
||||||
|
|
||||||
|
# Find the most recent modification time in output dir
|
||||||
|
maxouttime = 0
|
||||||
|
for f in os.listdir(outputdir):
|
||||||
|
fni = os.path.join(outputdir, f)
|
||||||
|
if os.path.isfile(fni):
|
||||||
|
it = os.path.getmtime(fni)
|
||||||
|
if it > maxouttime:
|
||||||
|
maxouttime = it;
|
||||||
|
|
||||||
|
# Do not generate if nothing changed on the input
|
||||||
|
if (maxinputtime != 0 and maxouttime != 0 and maxinputtime < maxouttime):
|
||||||
|
return False
|
||||||
|
|
||||||
includepath = incl_default + [':'.join([package, inputdir])]
|
includepath = incl_default + [':'.join([package, inputdir])]
|
||||||
for f in os.listdir(inputdir):
|
for f in os.listdir(inputdir):
|
||||||
# Ignore hidden files
|
# Ignore hidden files
|
||||||
@@ -109,6 +132,8 @@ def convert_dir(inputdir, outputdir, templatedir):
|
|||||||
templatedir,
|
templatedir,
|
||||||
includepath)
|
includepath)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def copy_changed(inputdir, outputdir, prefix=''):
|
def copy_changed(inputdir, outputdir, prefix=''):
|
||||||
"""
|
"""
|
||||||
@@ -145,10 +170,11 @@ def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
|||||||
Unchanged existing files are not overwritten.
|
Unchanged existing files are not overwritten.
|
||||||
"""
|
"""
|
||||||
# Create new headers in temporary output directory
|
# Create new headers in temporary output directory
|
||||||
convert_dir(inputdir, temporarydir, templatedir)
|
if (convert_dir(inputdir, temporarydir, templatedir)):
|
||||||
|
|
||||||
# Copy changed headers from temporary dir to output dir
|
# Copy changed headers from temporary dir to output dir
|
||||||
copy_changed(temporarydir, outputdir, prefix)
|
copy_changed(temporarydir, outputdir, prefix)
|
||||||
|
else:
|
||||||
|
print('No changes.')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ MODULES += drivers/ets_airspeed
|
|||||||
MODULES += drivers/meas_airspeed
|
MODULES += drivers/meas_airspeed
|
||||||
MODULES += drivers/frsky_telemetry
|
MODULES += drivers/frsky_telemetry
|
||||||
MODULES += modules/sensors
|
MODULES += modules/sensors
|
||||||
|
MODULES += drivers/px4flow
|
||||||
|
|
||||||
#
|
#
|
||||||
# System commands
|
# System commands
|
||||||
|
|||||||
@@ -913,10 +913,14 @@ MPU6000::gyro_self_test()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum deviation of 20 degrees, according to
|
* Maximum deviation of 20 degrees, according to
|
||||||
* http://www.invensense.com/mems/gyro/documents/PS-MPU-6000A-00v3.4.pdf
|
* http://www.farnell.com/datasheets/1788002.pdf
|
||||||
* Section 6.1, initial ZRO tolerance
|
* Section 6.1, initial ZRO tolerance
|
||||||
|
*
|
||||||
|
* 20 dps (0.34 rad/s) initial offset
|
||||||
|
* and 20 dps temperature drift, so 0.34 rad/s * 2
|
||||||
*/
|
*/
|
||||||
const float max_offset = 0.34f;
|
const float max_offset = 2.0f * 0.34f;
|
||||||
|
|
||||||
/* 30% scale error is chosen to catch completely faulty units but
|
/* 30% scale error is chosen to catch completely faulty units but
|
||||||
* to let some slight scale error pass. Requires a rate table or correlation
|
* to let some slight scale error pass. Requires a rate table or correlation
|
||||||
* with mag rotations + data fit to
|
* with mag rotations + data fit to
|
||||||
|
|||||||
@@ -878,6 +878,8 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
param_t _param_autostart_id = param_find("SYS_AUTOSTART");
|
param_t _param_autostart_id = param_find("SYS_AUTOSTART");
|
||||||
param_t _param_autosave_params = param_find("COM_AUTOS_PAR");
|
param_t _param_autosave_params = param_find("COM_AUTOS_PAR");
|
||||||
param_t _param_rc_in_off = param_find("COM_RC_IN_MODE");
|
param_t _param_rc_in_off = param_find("COM_RC_IN_MODE");
|
||||||
|
param_t _param_eph = param_find("COM_HOME_H_T");
|
||||||
|
param_t _param_epv = param_find("COM_HOME_V_T");
|
||||||
|
|
||||||
const char *main_states_str[vehicle_status_s::MAIN_STATE_MAX];
|
const char *main_states_str[vehicle_status_s::MAIN_STATE_MAX];
|
||||||
main_states_str[vehicle_status_s::MAIN_STATE_MANUAL] = "MANUAL";
|
main_states_str[vehicle_status_s::MAIN_STATE_MANUAL] = "MANUAL";
|
||||||
@@ -1300,6 +1302,10 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Parameter autosave setting */
|
/* Parameter autosave setting */
|
||||||
param_get(_param_autosave_params, &autosave_params);
|
param_get(_param_autosave_params, &autosave_params);
|
||||||
|
|
||||||
|
/* EPH / EPV */
|
||||||
|
param_get(_param_eph, &eph_threshold);
|
||||||
|
param_get(_param_epv, &epv_threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set flag to autosave parameters if necessary */
|
/* Set flag to autosave parameters if necessary */
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2013-2015 PX4 Development Team. All rights reserved.
|
||||||
* Author: Lorenz Meier <lm@inf.ethz.ch>
|
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -37,16 +36,54 @@
|
|||||||
*
|
*
|
||||||
* Parameters defined by the sensors task.
|
* Parameters defined by the sensors task.
|
||||||
*
|
*
|
||||||
* @author Lorenz Meier <lm@inf.ethz.ch>
|
* @author Lorenz Meier <lorenz@px4.io>
|
||||||
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
* @author Thomas Gubler <thomas@px4.io>
|
||||||
* @author Julian Oes <julian@oes.ch>
|
* @author Julian Oes <julian@px4.io>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <px4_config.h>
|
#include <px4_config.h>
|
||||||
#include <systemlib/param/param.h>
|
#include <systemlib/param/param.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll trim
|
||||||
|
*
|
||||||
|
* The trim value is the actuator control value the system needs
|
||||||
|
* for straight and level flight. It can be calibrated by
|
||||||
|
* flying manually straight and level using the RC trims and
|
||||||
|
* copying them using the GCS.
|
||||||
|
*
|
||||||
|
* @group Radio Calibration
|
||||||
|
* @min -0.25
|
||||||
|
* @max 0.25
|
||||||
|
*/
|
||||||
PARAM_DEFINE_FLOAT(TRIM_ROLL, 0.0f);
|
PARAM_DEFINE_FLOAT(TRIM_ROLL, 0.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pitch trim
|
||||||
|
*
|
||||||
|
* The trim value is the actuator control value the system needs
|
||||||
|
* for straight and level flight. It can be calibrated by
|
||||||
|
* flying manually straight and level using the RC trims and
|
||||||
|
* copying them using the GCS.
|
||||||
|
*
|
||||||
|
* @group Radio Calibration
|
||||||
|
* @min -0.25
|
||||||
|
* @max 0.25
|
||||||
|
*/
|
||||||
PARAM_DEFINE_FLOAT(TRIM_PITCH, 0.0f);
|
PARAM_DEFINE_FLOAT(TRIM_PITCH, 0.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Yaw trim
|
||||||
|
*
|
||||||
|
* The trim value is the actuator control value the system needs
|
||||||
|
* for straight and level flight. It can be calibrated by
|
||||||
|
* flying manually straight and level using the RC trims and
|
||||||
|
* copying them using the GCS.
|
||||||
|
*
|
||||||
|
* @group Radio Calibration
|
||||||
|
* @min -0.25
|
||||||
|
* @max 0.25
|
||||||
|
*/
|
||||||
PARAM_DEFINE_FLOAT(TRIM_YAW, 0.0f);
|
PARAM_DEFINE_FLOAT(TRIM_YAW, 0.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,6 +114,7 @@ PARAM_DEFINE_FLOAT(BAT_V_CHARGED, 4.2f);
|
|||||||
*
|
*
|
||||||
* @group Battery Calibration
|
* @group Battery Calibration
|
||||||
* @unit V
|
* @unit V
|
||||||
|
* @min 0.0f
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(BAT_V_LOAD_DROP, 0.07f);
|
PARAM_DEFINE_FLOAT(BAT_V_LOAD_DROP, 0.07f);
|
||||||
|
|
||||||
@@ -87,6 +125,8 @@ PARAM_DEFINE_FLOAT(BAT_V_LOAD_DROP, 0.07f);
|
|||||||
*
|
*
|
||||||
* @group Battery Calibration
|
* @group Battery Calibration
|
||||||
* @unit S
|
* @unit S
|
||||||
|
* @min 1
|
||||||
|
* @max 10
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(BAT_N_CELLS, 3);
|
PARAM_DEFINE_INT32(BAT_N_CELLS, 3);
|
||||||
|
|
||||||
@@ -182,7 +222,31 @@ PARAM_DEFINE_FLOAT(COM_EF_TIME, 10.0f);
|
|||||||
* @min 0
|
* @min 0
|
||||||
* @max 35
|
* @max 35
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(COM_RC_LOSS_T, 0.5);
|
PARAM_DEFINE_FLOAT(COM_RC_LOSS_T, 0.5f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Home set horizontal threshold
|
||||||
|
*
|
||||||
|
* The home position will be set if the estimated positioning accuracy is below the threshold.
|
||||||
|
*
|
||||||
|
* @group Commander
|
||||||
|
* @unit meter
|
||||||
|
* @min 2
|
||||||
|
* @max 15
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(COM_HOME_H_T, 5.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Home set vertical threshold
|
||||||
|
*
|
||||||
|
* The home position will be set if the estimated positioning accuracy is below the threshold.
|
||||||
|
*
|
||||||
|
* @group Commander
|
||||||
|
* @unit meter
|
||||||
|
* @min 5
|
||||||
|
* @max 25
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(COM_HOME_V_T, 10.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Autosaving of params
|
* Autosaving of params
|
||||||
|
|||||||
Reference in New Issue
Block a user