aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2013-11-01 14:02:55 +0100
committerThomas Gubler <thomasgubler@gmail.com>2013-11-01 14:02:55 +0100
commita6b85cfbf76dbe0e829e503a09660ffb11f003d0 (patch)
treedcfa9aa3bc6a640d8897b5fbefee033442fed8f7 /src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
parent97a54d1b5e684be36819816c03a54fe8bfd1792f (diff)
downloadpx4-firmware-a6b85cfbf76dbe0e829e503a09660ffb11f003d0.tar.gz
px4-firmware-a6b85cfbf76dbe0e829e503a09660ffb11f003d0.tar.bz2
px4-firmware-a6b85cfbf76dbe0e829e503a09660ffb11f003d0.zip
add some comments for clarification
Diffstat (limited to 'src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp')
-rw-r--r--src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
index 97b659af8..a68de4525 100644
--- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
+++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
@@ -729,8 +729,8 @@ FixedwingPositionControl::control_position(const math::Vector2f &current_positio
} else if (global_triplet.current.nav_cmd == NAV_CMD_LAND) {
+ /* Horizontal landing control */
/* switch to heading hold for the last meters, continue heading hold after */
-
float wp_distance = get_distance_to_next_waypoint(prev_wp.getX(), prev_wp.getY(), current_position.getX(), current_position.getY());
//warnx("wp dist: %d, alt err: %d, noret: %s", (int)wp_distance, (int)altitude_error, (land_noreturn) ? "YES" : "NO");
if (wp_distance < 15.0f || land_noreturn) {
@@ -758,16 +758,16 @@ FixedwingPositionControl::control_position(const math::Vector2f &current_positio
/* normal navigation */
_l1_control.navigate_waypoints(prev_wp, next_wp, current_position, ground_speed);
}
+ _att_sp.roll_body = _l1_control.nav_roll();
+ _att_sp.yaw_body = _l1_control.nav_bearing();
+
+
+ /* Vertical landing control */
// /* do not go down too early */
// if (wp_distance > 50.0f) {
// altitude_error = (_global_triplet.current.altitude + 25.0f) - _global_pos.alt;
// }
-
-
- _att_sp.roll_body = _l1_control.nav_roll();
- _att_sp.yaw_body = _l1_control.nav_bearing();
-
/* apply minimum pitch (flare) and limit roll if close to touch down, altitude error is negative (going down) */
// XXX this could make a great param