mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 23:53:33 +08:00
Merge branch 'master' into navigator_rewrite
Conflicts: src/drivers/gps/gps.cpp src/drivers/gps/mtk.cpp src/modules/commander/commander.cpp src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp src/modules/navigator/mission.cpp src/modules/navigator/mission.h src/modules/navigator/navigator_main.cpp src/modules/navigator/navigator_state.h src/modules/position_estimator_inav/position_estimator_inav_main.c
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Jean Cyr <jean.m.cyr@gmail.com>
|
||||
* @author Thomas Gubler <thomasgubler@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -35,6 +33,9 @@
|
||||
/**
|
||||
* @file geofence.cpp
|
||||
* Provides functions for handling the geofence
|
||||
*
|
||||
* @author Jean Cyr <jean.m.cyr@gmail.com>
|
||||
* @author Thomas Gubler <thomasgubler@gmail.com>
|
||||
*/
|
||||
#include "geofence.h"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Jean Cyr <jean.m.cyr@gmail.com>
|
||||
* @author Thomas Gubler <thomasgubler@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -35,6 +33,9 @@
|
||||
/**
|
||||
* @file geofence.h
|
||||
* Provides functions for handling the geofence
|
||||
*
|
||||
* @author Jean Cyr <jean.m.cyr@gmail.com>
|
||||
* @author Thomas Gubler <thomasgubler@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef GEOFENCE_H_
|
||||
|
||||
@@ -139,7 +139,7 @@ Mission::get_current_mission_item(struct mission_item_s *new_mission_item, bool
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* otherwise fallback to offboard */
|
||||
if (_current_offboard_mission_index < _offboard_mission_item_count) {
|
||||
|
||||
@@ -246,7 +246,7 @@ void
|
||||
Mission::move_to_next()
|
||||
{
|
||||
report_mission_item_reached();
|
||||
|
||||
|
||||
switch (_current_mission_type) {
|
||||
case MISSION_TYPE_ONBOARD:
|
||||
_current_onboard_mission_index++;
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
* @file navigator_mission.h
|
||||
* Helper class to access missions
|
||||
* @author Julian Oes <julian@oes.ch>
|
||||
*
|
||||
* @author Julian Oes <joes@student.ethz.ch>
|
||||
*/
|
||||
|
||||
#ifndef NAVIGATOR_MISSION_H
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -35,6 +33,9 @@
|
||||
/**
|
||||
* @file mission_feasibility_checker.cpp
|
||||
* Provides checks if mission is feasible given the navigation capabilities
|
||||
*
|
||||
* @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||
*/
|
||||
|
||||
#include "mission_feasibility_checker.h"
|
||||
@@ -100,8 +101,8 @@ bool MissionFeasibilityChecker::checkGeofence(dm_item_t dm_current, size_t nMiss
|
||||
/* Check if all mission items are inside the geofence (if we have a valid geofence) */
|
||||
if (geofence.valid()) {
|
||||
for (size_t i = 0; i < nMissionItems; i++) {
|
||||
static struct mission_item_s missionitem;
|
||||
const ssize_t len = sizeof(struct mission_item_s);
|
||||
struct mission_item_s missionitem;
|
||||
const ssize_t len = sizeof(missionitem);
|
||||
|
||||
if (dm_read(dm_current, i, &missionitem, len) != len) {
|
||||
/* not supposed to happen unless the datamanager can't access the SD card, etc. */
|
||||
@@ -125,8 +126,8 @@ bool MissionFeasibilityChecker::checkFixedWingLanding(dm_item_t dm_current, size
|
||||
|
||||
|
||||
for (size_t i = 0; i < nMissionItems; i++) {
|
||||
static struct mission_item_s missionitem;
|
||||
const ssize_t len = sizeof(struct mission_item_s);
|
||||
struct mission_item_s missionitem;
|
||||
const ssize_t len = sizeof(missionitem);
|
||||
if (dm_read(dm_current, i, &missionitem, len) != len) {
|
||||
/* not supposed to happen unless the datamanager can't access the SD card, etc. */
|
||||
return false;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -35,7 +33,11 @@
|
||||
/**
|
||||
* @file mission_feasibility_checker.h
|
||||
* Provides checks if mission is feasible given the navigation capabilities
|
||||
*
|
||||
* @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* @author Thomas Gubler <thomasgubler@student.ethz.ch>
|
||||
*/
|
||||
|
||||
#ifndef MISSION_FEASIBILITY_CHECKER_H_
|
||||
#define MISSION_FEASIBILITY_CHECKER_H_
|
||||
|
||||
|
||||
@@ -47,3 +47,5 @@ SRCS = navigator_main.cpp \
|
||||
geofence_params.c
|
||||
|
||||
INCLUDE_DIRS += $(MAVLINK_SRC)/include/mavlink
|
||||
|
||||
MODULE_STACKSIZE = 1200
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013-2014 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -410,7 +410,7 @@ Navigator::parameters_update()
|
||||
param_get(_parameter_handles.acceptance_radius, &(_parameters.acceptance_radius));
|
||||
param_get(_parameter_handles.loiter_radius, &(_parameters.loiter_radius));
|
||||
param_get(_parameter_handles.onboard_mission_enabled, &(_parameters.onboard_mission_enabled));
|
||||
param_get(_parameter_handles.takeoff_alt, &(_parameters.takeoff_alt));
|
||||
param_get(_parameter_handles.takeoff_alt, &(_parameters.takeoff_alt));
|
||||
|
||||
_mission.set_onboard_mission_allowed((bool)_parameters.onboard_mission_enabled);
|
||||
|
||||
@@ -728,7 +728,7 @@ Navigator::start()
|
||||
_navigator_task = task_spawn_cmd("navigator",
|
||||
SCHED_DEFAULT,
|
||||
SCHED_PRIORITY_MAX - 5,
|
||||
2048,
|
||||
2000,
|
||||
(main_t)&Navigator::task_main_trampoline,
|
||||
nullptr);
|
||||
|
||||
@@ -946,7 +946,7 @@ Navigator::start_loiter()
|
||||
mavlink_log_info(_mavlink_fd, "#audio: loiter at current altitude");
|
||||
|
||||
_update_triplet = true;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -999,7 +999,7 @@ Navigator::set_mission_items()
|
||||
/* convert the current mission item and set it valid */
|
||||
mission_item_to_position_setpoint(&_mission_item, &_pos_sp_triplet.current);
|
||||
_pos_sp_triplet.current.valid = true;
|
||||
|
||||
|
||||
|
||||
mission_item_s next_mission_item;
|
||||
|
||||
@@ -1206,7 +1206,7 @@ Navigator::check_mission_item_reached()
|
||||
}
|
||||
|
||||
if (_waypoint_position_reached && !_waypoint_yaw_reached) {
|
||||
|
||||
|
||||
/* TODO: removed takeoff, why? */
|
||||
if (_vstatus.is_rotary_wing && isfinite(_mission_item.yaw)) {
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
* @author Julian Oes <joes@student.ethz.ch>
|
||||
* @author Anton Babushkin <anton.babushkin@me.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
Reference in New Issue
Block a user