mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 06:31:37 +08:00
Navigator: VTOL: remove generate_waypoint_from_heading()
The FW Position controller sets the wp to be tracked during a VTOL front transition, the coordinates sp set here weren't used. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Roman Bapst
parent
10ceea2fe6
commit
ba1526896d
@@ -339,7 +339,8 @@ Mission::set_execution_mode(const uint8_t mode)
|
|||||||
|
|
||||||
position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
|
position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
|
||||||
pos_sp_triplet->previous = pos_sp_triplet->current;
|
pos_sp_triplet->previous = pos_sp_triplet->current;
|
||||||
generate_waypoint_from_heading(&pos_sp_triplet->current, _mission_item.yaw);
|
// keep current setpoints (FW position controller generates wp to track during transition)
|
||||||
|
pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||||
publish_navigator_mission_item(); // for logging
|
publish_navigator_mission_item(); // for logging
|
||||||
_navigator->set_position_setpoint_triplet_updated();
|
_navigator->set_position_setpoint_triplet_updated();
|
||||||
issue_command(_mission_item);
|
issue_command(_mission_item);
|
||||||
@@ -863,8 +864,8 @@ Mission::set_mission_items()
|
|||||||
set_vtol_transition_item(&_mission_item, vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW);
|
set_vtol_transition_item(&_mission_item, vtol_vehicle_status_s::VEHICLE_VTOL_STATE_FW);
|
||||||
_mission_item.yaw = _navigator->get_local_position()->heading;
|
_mission_item.yaw = _navigator->get_local_position()->heading;
|
||||||
|
|
||||||
/* set position setpoint to target during the transition */
|
// keep current setpoints (FW position controller generates wp to track during transition)
|
||||||
generate_waypoint_from_heading(&pos_sp_triplet->current, _mission_item.yaw);
|
pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* takeoff completed and transitioned, move to takeoff wp as fixed wing */
|
/* takeoff completed and transitioned, move to takeoff wp as fixed wing */
|
||||||
@@ -1069,9 +1070,9 @@ Mission::set_mission_items()
|
|||||||
/* re-enable weather vane again after alignment */
|
/* re-enable weather vane again after alignment */
|
||||||
pos_sp_triplet->current.disable_weather_vane = false;
|
pos_sp_triplet->current.disable_weather_vane = false;
|
||||||
|
|
||||||
/* set position setpoint to target during the transition */
|
|
||||||
pos_sp_triplet->previous = pos_sp_triplet->current;
|
pos_sp_triplet->previous = pos_sp_triplet->current;
|
||||||
generate_waypoint_from_heading(&pos_sp_triplet->current, pos_sp_triplet->current.yaw);
|
// keep current setpoints (FW position controller generates wp to track during transition)
|
||||||
|
pos_sp_triplet->current.type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore certain commands in mission fast forward
|
// ignore certain commands in mission fast forward
|
||||||
@@ -1801,17 +1802,6 @@ Mission::need_to_reset_mission()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Mission::generate_waypoint_from_heading(struct position_setpoint_s *setpoint, float yaw)
|
|
||||||
{
|
|
||||||
waypoint_from_heading_and_distance(
|
|
||||||
_navigator->get_global_position()->lat, _navigator->get_global_position()->lon,
|
|
||||||
yaw, 1000000.0f,
|
|
||||||
&(setpoint->lat), &(setpoint->lon));
|
|
||||||
setpoint->type = position_setpoint_s::SETPOINT_TYPE_POSITION;
|
|
||||||
setpoint->yaw = yaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t
|
int32_t
|
||||||
Mission::index_closest_mission_item() const
|
Mission::index_closest_mission_item() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -218,11 +218,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
bool need_to_reset_mission();
|
bool need_to_reset_mission();
|
||||||
|
|
||||||
/**
|
|
||||||
* Project current location with heading to far away location and fill setpoint.
|
|
||||||
*/
|
|
||||||
void generate_waypoint_from_heading(struct position_setpoint_s *setpoint, float yaw);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find and store the index of the landing sequence (DO_LAND_START)
|
* Find and store the index of the landing sequence (DO_LAND_START)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user