mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
Reset alt/position when entring position control from auto
This commit is contained in:
+41
-113
@@ -1,50 +1,8 @@
|
|||||||
{
|
{
|
||||||
"build_systems":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"cmd":
|
|
||||||
[
|
|
||||||
"make"
|
|
||||||
],
|
|
||||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
|
||||||
"name": "PX4: make all",
|
|
||||||
"shell": true,
|
|
||||||
"working_dir": "${project_path}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cmd":
|
|
||||||
[
|
|
||||||
"make upload px4fmu-v2_default -j8"
|
|
||||||
],
|
|
||||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
|
||||||
"name": "PX4: make and upload",
|
|
||||||
"shell": true,
|
|
||||||
"working_dir": "${project_path}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cmd":
|
|
||||||
[
|
|
||||||
"make posix"
|
|
||||||
],
|
|
||||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
|
||||||
"name": "PX4: make posix",
|
|
||||||
"shell": true,
|
|
||||||
"working_dir": "${project_path}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cmd":
|
|
||||||
[
|
|
||||||
"make upload mindpx-v2_default -j8"
|
|
||||||
],
|
|
||||||
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
|
||||||
"name": "MindPX_V2: make and upload",
|
|
||||||
"shell": true,
|
|
||||||
"working_dir": "${project_path}"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"folders":
|
"folders":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
"path": ".",
|
||||||
"file_exclude_patterns":
|
"file_exclude_patterns":
|
||||||
[
|
[
|
||||||
"*.o",
|
"*.o",
|
||||||
@@ -68,87 +26,57 @@
|
|||||||
".settings",
|
".settings",
|
||||||
"nuttx/arch/arm/src/board",
|
"nuttx/arch/arm/src/board",
|
||||||
"nuttx/arch/arm/src/chip"
|
"nuttx/arch/arm/src/chip"
|
||||||
],
|
]
|
||||||
"path": "."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "build_posix_sitl_default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "build_px4fmu-v2_default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "build_px4fmu-v4_default"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "cmake"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "Debug"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "Documentation"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "Images"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "integrationtests"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "launch"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "mavlink"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "misc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "msg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "NuttX"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "nuttx-configs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "posix-configs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "ROMFS"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "src"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "test_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "Tools"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "unittests"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings":
|
"settings":
|
||||||
{
|
{
|
||||||
|
"tab_size": 8,
|
||||||
|
"translate_tabs_to_spaces": false,
|
||||||
|
"highlight_line": true,
|
||||||
"AStyleFormatter":
|
"AStyleFormatter":
|
||||||
{
|
{
|
||||||
"options_c":
|
"options_c":
|
||||||
{
|
{
|
||||||
"additional_options_file": "${project_path}/Tools/astylerc",
|
"use_only_additional_options": true,
|
||||||
"use_only_additional_options": true
|
"additional_options_file": "${project_path}/Tools/astylerc"
|
||||||
},
|
},
|
||||||
"options_c++":
|
"options_c++":
|
||||||
{
|
{
|
||||||
"additional_options_file": "${project_path}/Tools/astylerc",
|
"use_only_additional_options": true,
|
||||||
"use_only_additional_options": true
|
"additional_options_file": "${project_path}/Tools/astylerc"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build_systems":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "PX4: make all",
|
||||||
|
"working_dir": "${project_path}",
|
||||||
|
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||||
|
"cmd": ["make"],
|
||||||
|
"shell": true
|
||||||
},
|
},
|
||||||
"highlight_line": true,
|
{
|
||||||
"tab_size": 8,
|
"name": "PX4: make and upload",
|
||||||
"translate_tabs_to_spaces": false
|
"working_dir": "${project_path}",
|
||||||
}
|
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||||
|
"cmd": ["make upload px4fmu-v2_default -j8"],
|
||||||
|
"shell": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PX4: make posix",
|
||||||
|
"working_dir": "${project_path}",
|
||||||
|
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||||
|
"cmd": ["make posix"],
|
||||||
|
"shell": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MindPX_V2: make and upload",
|
||||||
|
"working_dir": "${project_path}",
|
||||||
|
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
|
||||||
|
"cmd": ["make upload mindpx-v2_default -j8"],
|
||||||
|
"shell": true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -865,6 +865,14 @@ MulticopterPositionControl::limit_pos_sp_offset()
|
|||||||
void
|
void
|
||||||
MulticopterPositionControl::control_manual(float dt)
|
MulticopterPositionControl::control_manual(float dt)
|
||||||
{
|
{
|
||||||
|
/* Entering manual control from non-manual control mode, reset alt/pos setpoints */
|
||||||
|
if (_mode_auto) {
|
||||||
|
_mode_auto = false;
|
||||||
|
|
||||||
|
_reset_pos_sp = true;
|
||||||
|
_reset_alt_sp = true;
|
||||||
|
}
|
||||||
|
|
||||||
math::Vector<3> req_vel_sp; // X,Y in local frame and Z in global (D), in [-1,1] normalized range
|
math::Vector<3> req_vel_sp; // X,Y in local frame and Z in global (D), in [-1,1] normalized range
|
||||||
req_vel_sp.zero();
|
req_vel_sp.zero();
|
||||||
|
|
||||||
@@ -1433,7 +1441,6 @@ MulticopterPositionControl::task_main()
|
|||||||
if (_control_mode.flag_control_manual_enabled) {
|
if (_control_mode.flag_control_manual_enabled) {
|
||||||
/* manual control */
|
/* manual control */
|
||||||
control_manual(dt);
|
control_manual(dt);
|
||||||
_mode_auto = false;
|
|
||||||
|
|
||||||
} else if (_control_mode.flag_control_offboard_enabled) {
|
} else if (_control_mode.flag_control_offboard_enabled) {
|
||||||
/* offboard control */
|
/* offboard control */
|
||||||
|
|||||||
Reference in New Issue
Block a user