[[px4-analyse-position]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
px4-analyse-position [2018/10/26 20:24]
natwati
px4-analyse-position [2018/10/27 22:02] (current)
natwati
Line 172: Line 172:
 The attitude setpoint pitch is overwritten with the pitch from tecs. This is prevented if the plane is in auto runway takeoff, flaring during landing or in manual attitude cotnrol mode. The attitude setpoint pitch is overwritten with the pitch from tecs. This is prevented if the plane is in auto runway takeoff, flaring during landing or in manual attitude cotnrol mode.
  
-Line 1699 +
-Update curr_pos and ground_speed based on current _global_pos (global vehicle position). +
-Call to control_position() with current position, ground speed and the previous and current setpoint of the position triplet.+
  
 ==== vehicle attitude setpoint ==== ==== vehicle attitude setpoint ====
Line 305: Line 303:
  
  
-==== Other Functions ​====+==== calculate_target_airspeed() ​====
 <code c++ FixedwingPositionControl.hpp>​ <code c++ FixedwingPositionControl.hpp>​
 float calculate_target_airspeed(float airspeed_demand);​ float calculate_target_airspeed(float airspeed_demand);​
 </​code>​ </​code>​
-A previously calculated _groundspeed_undershoot value is added to the airspeed. The returned airspeed is constrained to a value between FW_AIRSPD_MAX and an increased FW_AIRSPD_MIN. FW_AIRSPEED_MIN is increased to ensure the increased demand for lift if plane (current _att_sp) has a roll angle is met. +A previously calculated _groundspeed_undershoot value is added to the airspeed. The returned airspeed is constrained to a value between FW_AIRSPD_MAX and an increased FW_AIRSPD_MIN. FW_AIRSPEED_MIN is increased to ensure the increased demand for lift if the plane (current _att_sp) has a roll angle is met. This increase is only applied if airspeed is vaild (_airspeed_valid).  
 + 
 +==== calculate_gndspeed_undershoot() ====
  
 <code c++ FixedwingPositionControl.hpp>​ <code c++ FixedwingPositionControl.hpp>​
Line 316: Line 316:
 The minimum desired ground speed is the minimum airspeed projected on to the ground using the altitude and horizontal difference between the waypoints if available. _groundspeed_undershoot ensures that a plane (as long as its throttle capability is not exceeded) travels towards a waypoint (and is not pushed more and more away by wind). Not countering this would lead to a fly-away. The minimum desired ground speed is the minimum airspeed projected on to the ground using the altitude and horizontal difference between the waypoints if available. _groundspeed_undershoot ensures that a plane (as long as its throttle capability is not exceeded) travels towards a waypoint (and is not pushed more and more away by wind). Not countering this would lead to a fly-away.
  
 +==== get_waypoint_heading_distance() ====
 <code c++ FixedwingPositionControl.hpp>​ <code c++ FixedwingPositionControl.hpp>​
 static constexpr float HDG_HOLD_DIST_NEXT = 3000.0f; // initial distance of waypoint in front of plane in heading hold mode static constexpr float HDG_HOLD_DIST_NEXT = 3000.0f; // initial distance of waypoint in front of plane in heading hold mode
Line 325: Line 326:
 If flag_init is false the passed waypoint_next and waypoint_prev are used to generate a line. The waypoint_prev is generated on the line 1100 meters behind waypoint_next and the new waypoint_next is generated on the line 4000 meters ahead of the old waypoint_next.\\ If flag_init is false the passed waypoint_next and waypoint_prev are used to generate a line. The waypoint_prev is generated on the line 1100 meters behind waypoint_next and the new waypoint_next is generated on the line 4000 meters ahead of the old waypoint_next.\\
 _hold_alt is used for all waypoints. _hold_alt is used for all waypoints.
 +
 +==== update_desired_altitude() ====
 <code c++ FixedwingPositionControl.hpp>​ <code c++ FixedwingPositionControl.hpp>​
  bool update_desired_altitude(float dt);  bool update_desired_altitude(float dt);
 </​code>​ </​code>​
 Update desired altitude base on user pitch stick input based on _manual.x (from manual_control_setpoint) and a dt (delta time) argument. Update desired altitude base on user pitch stick input based on _manual.x (from manual_control_setpoint) and a dt (delta time) argument.
 +
 +==== handle_command() ====
 +This funcion solely handles the VEHICLE_CMD_DO_GO_AROUND.
 +It  abort landing before point of no return (horizontal and vertical) by setting _fw_pos_ctrl_status.abort_landing to true.
 +
 +
 +==== airspeed_poll() ====
 +
 +Updates the airspeed (_airspeed) to the indicated airspeed published (ORB airspeed).
 +If there was no airspeed update for more then a seconde _airspeed_valid is set to false.
 +
 +If the true airspeed is larger than the indicated airspeed _eas2tas is updated which is used when calling _tecs.update_pitch_throttle().
 +
 +TECS is notified if airspeed is still valid by calling _tecs.enable_airspeed(_airspeed_valid).
  
 ==== control_takeoff() ==== ==== control_takeoff() ====
 Not examined yet Not examined yet
 ==== control_landing() ==== ==== control_landing() ====
-Not examined yet 
-==== handle_command() ==== 
 Not examined yet Not examined yet
 ==== tecs_update_pitch_throttle() ==== ==== tecs_update_pitch_throttle() ====
 Not examined yet Not examined yet
  
-==== airspeed_poll() ==== 
-Not examined yet 
 ===== Copyright ===== ===== Copyright =====
- 
  
 The following copyright applies to all sourcecode shown on this page: The following copyright applies to all sourcecode shown on this page:
  • px4-analyse-position.1540578247.txt.gz
  • Last modified: 2018/10/26 20:24
  • by natwati