Reset alt/position when entring position control from auto

This commit is contained in:
devbharat 2016-11-15 14:25:31 +01:00 committed by Lorenz Meier
parent 59c1dd7183
commit dd1821b02e
2 changed files with 49 additions and 114 deletions

View File

@ -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":
[
{
"path": ".",
"file_exclude_patterns":
[
"*.o",
@ -68,87 +26,57 @@
".settings",
"nuttx/arch/arm/src/board",
"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":
{
"tab_size": 8,
"translate_tabs_to_spaces": false,
"highlight_line": true,
"AStyleFormatter":
{
"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++":
{
"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,
"translate_tabs_to_spaces": false
}
{
"name": "PX4: make and upload",
"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
}
]
}

View File

@ -865,6 +865,14 @@ MulticopterPositionControl::limit_pos_sp_offset()
void
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
req_vel_sp.zero();
@ -1433,7 +1441,6 @@ MulticopterPositionControl::task_main()
if (_control_mode.flag_control_manual_enabled) {
/* manual control */
control_manual(dt);
_mode_auto = false;
} else if (_control_mode.flag_control_offboard_enabled) {
/* offboard control */