From 45deddd095a48267c8ce2d53e4790a3452e36639 Mon Sep 17 00:00:00 2001 From: adev Date: Tue, 22 Sep 2020 13:35:33 +0200 Subject: [PATCH 1/2] update --- Tools/sitl_gazebo | 2 +- src/lib/mixer/MultirotorMixer | 2 +- src/lib/mixer_module/mixer_module.cpp | 75 +++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/Tools/sitl_gazebo b/Tools/sitl_gazebo index 9d2b19784cb3..6d0daa2dc517 160000 --- a/Tools/sitl_gazebo +++ b/Tools/sitl_gazebo @@ -1 +1 @@ -Subproject commit 9d2b19784cb34bf8f397ab2e2f368f682f2d5d5a +Subproject commit 6d0daa2dc517e52b6c04026c0749110b9cceb25b diff --git a/src/lib/mixer/MultirotorMixer b/src/lib/mixer/MultirotorMixer index d83fb395ddf3..a6a935aa4e32 160000 --- a/src/lib/mixer/MultirotorMixer +++ b/src/lib/mixer/MultirotorMixer @@ -1 +1 @@ -Subproject commit d83fb395ddf3396ec65456c21229525eef3d2659 +Subproject commit a6a935aa4e32141a47bcd2f6054d43eda73a1327 diff --git a/src/lib/mixer_module/mixer_module.cpp b/src/lib/mixer_module/mixer_module.cpp index 679bf329542e..b25795407cd6 100644 --- a/src/lib/mixer_module/mixer_module.cpp +++ b/src/lib/mixer_module/mixer_module.cpp @@ -517,6 +517,81 @@ int MixingOutput::controlCallback(uintptr_t handle, uint8_t control_group, uint8 { const MixingOutput *output = (const MixingOutput *)handle; + if(control_group==100) + { + int input_int=0; + input_int--; + switch (control_index) + {//AUTOGENERATED START + case 18: ///AUTOGENERATED + param_get(param_find("PWM_TILT_MAX2"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 17: ///AUTOGENERATED + param_get(param_find("PWM_TILT_MAX1"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 16: ///AUTOGENERATED + param_get(param_find("PWM_TILT_MIN2"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 15: ///AUTOGENERATED + param_get(param_find("PWM_TILT_MIN1"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 14: ///AUTOGENERATED + param_get(param_find("PWM_MIN"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 13: ///AUTOGENERATED + param_get(param_find("PWM_MAX"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 12: ///AUTOGENERATED + param_get(param_find("MC_YAWRATE_K"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 11: ///AUTOGENERATED + param_get(param_find("MC_PITCHRATE_K"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 10: ///AUTOGENERATED + param_get(param_find("MC_ROLLRATE_K"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 9: ///AUTOGENERATED + param_get(param_find("ANG_TILT_MIN2"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 8: ///AUTOGENERATED + param_get(param_find("ANG_TILT_MAX2"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 7: ///AUTOGENERATED + param_get(param_find("ANG_TILT_MIN1"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 6: ///AUTOGENERATED + param_get(param_find("ANG_TILT_MAX1"), &input_int); ///AUTOGENERATED + input=input_int; ///AUTOGENERATED + break; ///AUTOGENERATED + case 5: ///AUTOGENERATED + param_get(param_find("MC_CM_DRAG"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 4: ///AUTOGENERATED + param_get(param_find("MC_CT_LIFT"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 3: ///AUTOGENERATED + param_get(param_find("MC_INERTIA_ZZ"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 2: ///AUTOGENERATED + param_get(param_find("MC_INERTIA_YY"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 1: ///AUTOGENERATED + param_get(param_find("MC_INERTIA_XX"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + case 0: ///AUTOGENERATED + param_get(param_find("MC_MASS"), &input); ///AUTOGENERATED + break; ///AUTOGENERATED + break; + }//AUTOGENERATED END + return 0; + } + input = output->_controls[control_group].control[control_index]; /* limit control input */ From 0150b4bb70473e4d3d74ebabc69f02e8628bfdd0 Mon Sep 17 00:00:00 2001 From: adev Date: Tue, 22 Sep 2020 13:50:20 +0200 Subject: [PATCH 2/2] minor change --- src/lib/mixer/MultirotorMixer | 2 +- src/lib/parameters/CMakeLists.txt | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/lib/mixer/MultirotorMixer b/src/lib/mixer/MultirotorMixer index a6a935aa4e32..a5ee11f3815b 160000 --- a/src/lib/mixer/MultirotorMixer +++ b/src/lib/mixer/MultirotorMixer @@ -1 +1 @@ -Subproject commit a6a935aa4e32141a47bcd2f6054d43eda73a1327 +Subproject commit a5ee11f3815beb596ee6c397881e0e1397dd26b4 diff --git a/src/lib/parameters/CMakeLists.txt b/src/lib/parameters/CMakeLists.txt index dd9785a1f879..33b7f0438563 100644 --- a/src/lib/parameters/CMakeLists.txt +++ b/src/lib/parameters/CMakeLists.txt @@ -41,8 +41,6 @@ endif() get_property(module_list GLOBAL PROPERTY PX4_MODULE_PATHS) get_property(module_config_files GLOBAL PROPERTY PX4_MODULE_CONFIG_FILES) - - if(DISABLE_PARAMS_MODULE_SCOPING) # search all directories with .c files (potentially containing parameters) file(GLOB_RECURSE c_files @@ -80,7 +78,7 @@ add_custom_command(OUTPUT ${generated_serial_params_file} COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/serial/generate_config.py --params-file ${generated_serial_params_file} --serial-ports ${board_serial_ports} ${added_arguments} - --config-files ${module_config_files} #--verbose + --config-files ${module_config_files} #--verbose DEPENDS ${module_config_files} ${jinja_templates} @@ -91,8 +89,7 @@ add_custom_command(OUTPUT ${generated_serial_params_file} set(parameters_xml ${PX4_BINARY_DIR}/parameters.xml) set(parameters_json ${PX4_BINARY_DIR}/parameters.json) file(GLOB_RECURSE param_src_files ${PX4_SOURCE_DIR}/src/*params.c) - -add_custom_command(OUTPUT ${parameters_xml} ${parameters_json} +add_custom_command(OUTPUT ${parameters_xml} ${parameters_json} ${parameters_json}.gz COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/px_process_params.py --src-path ${module_list} ${generated_params_dir} --xml ${parameters_xml} @@ -101,7 +98,7 @@ add_custom_command(OUTPUT ${parameters_xml} ${parameters_json} --inject-xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters_injected.xml --overrides ${PARAM_DEFAULT_OVERRIDES} --board ${PX4_BOARD} - #--verbose + #--verbose DEPENDS ${param_src_files} ${generated_serial_params_file} @@ -112,7 +109,7 @@ add_custom_command(OUTPUT ${parameters_xml} ${parameters_json} px4params/xmlout.py px_process_params.py parameters_injected.xml - COMMENT "Generating parameters.xml [${CMAKE_CURRENT_SOURCE_DIR}/px_process_params.py]" + COMMENT "Generating parameters.xml" ) add_custom_target(parameters_xml DEPENDS ${parameters_xml}) @@ -126,7 +123,6 @@ add_custom_command(OUTPUT px4_parameters.c px4_parameters.h px4_parameters_publi templates/px4_parameters.c.jinja templates/px4_parameters.h.jinja templates/px4_parameters_public.h.jinja - COMMENT " [${CMAKE_CURRENT_SOURCE_DIR}/px_generate_params.py]" ) set(SRCS) @@ -148,6 +144,7 @@ if(${PX4_PLATFORM} STREQUAL "nuttx") endif() # TODO: find a better way to do this +if (NOT "${PX4_BOARD}" MATCHES "px4_io") add_library(parameters ${SRCS} px4_parameters.c @@ -155,7 +152,7 @@ endif() px4_parameters_public.h ) - if ("${CONFIG_SHMEM}" STREQUAL "1") + if ("${CONFIG_SHMEM}" STREQUAL "1") target_link_libraries(parameters PRIVATE px4_layer) endif() @@ -166,7 +163,9 @@ endif() -Wno-cast-align # TODO: fix and enable -Wno-sign-compare # TODO: fix and enable ) - +else() + add_library(parameters ${PX4_SOURCE_DIR}/platforms/common/empty.c) +endif() add_dependencies(parameters prebuild_targets) if(${PX4_PLATFORM} STREQUAL "nuttx")