#include <AP_SmartRTL.h>
|
enum | SRTL_Actions {
SRTL_POINT_ADD,
SRTL_POINT_PRUNE,
SRTL_POINT_SIMPLIFY,
SRTL_ADD_FAILED_NO_SEMAPHORE,
SRTL_ADD_FAILED_PATH_FULL,
SRTL_POP_FAILED_NO_SEMAPHORE,
SRTL_DEACTIVATED_INIT_FAILED,
SRTL_DEACTIVATED_BAD_POSITION,
SRTL_DEACTIVATED_BAD_POSITION_TIMEOUT,
SRTL_DEACTIVATED_PATH_FULL_TIMEOUT,
SRTL_DEACTIVATED_PROGRAM_ERROR
} |
|
Definition at line 28 of file AP_SmartRTL.h.
◆ SRTL_Actions
Enumerator |
---|
SRTL_POINT_ADD | |
SRTL_POINT_PRUNE | |
SRTL_POINT_SIMPLIFY | |
SRTL_ADD_FAILED_NO_SEMAPHORE | |
SRTL_ADD_FAILED_PATH_FULL | |
SRTL_POP_FAILED_NO_SEMAPHORE | |
SRTL_DEACTIVATED_INIT_FAILED | |
SRTL_DEACTIVATED_BAD_POSITION | |
SRTL_DEACTIVATED_BAD_POSITION_TIMEOUT | |
SRTL_DEACTIVATED_PATH_FULL_TIMEOUT | |
SRTL_DEACTIVATED_PROGRAM_ERROR | |
Definition at line 87 of file AP_SmartRTL.h.
◆ ThoroughCleanupType
Enumerator |
---|
THOROUGH_CLEAN_DEFAULT | |
THOROUGH_CLEAN_ALL | |
THOROUGH_CLEAN_SIMPLIFY_ONLY | |
THOROUGH_CLEAN_PRUNE_ONLY | |
Definition at line 62 of file AP_SmartRTL.h.
◆ AP_SmartRTL()
AP_SmartRTL::AP_SmartRTL |
( |
bool |
example_mode = false | ) |
|
◆ add_loop()
bool AP_SmartRTL::add_loop |
( |
uint16_t |
start_index, |
|
|
uint16_t |
end_index, |
|
|
const Vector3f & |
midpoint |
|
) |
| |
|
private |
◆ add_point()
bool AP_SmartRTL::add_point |
( |
const Vector3f & |
point | ) |
|
|
private |
◆ cancel_request_for_thorough_cleanup()
void AP_SmartRTL::cancel_request_for_thorough_cleanup |
( |
| ) |
|
◆ deactivate()
void AP_SmartRTL::deactivate |
( |
SRTL_Actions |
action, |
|
|
const char * |
reason |
|
) |
| |
|
private |
◆ detect_loops()
void AP_SmartRTL::detect_loops |
( |
| ) |
|
|
private |
This method runs for the allotted time, and detects loops in a path. Any detected loops are added to _prune.loops, this function does not alter the path in memory. It works by comparing the line segment between any two sequential points to the line segment between any other two sequential points. If they get close enough, anything between them could be pruned.
reset_pruning should have been called at least once before this function is called to setup the indexes (_prune.i, etc)
Definition at line 526 of file AP_SmartRTL.cpp.
Referenced by routine_cleanup(), and thorough_cleanup().
◆ detect_simplifications()
void AP_SmartRTL::detect_simplifications |
( |
| ) |
|
|
private |
◆ get_num_points()
uint16_t AP_SmartRTL::get_num_points |
( |
| ) |
const |
◆ get_point()
const Vector3f& AP_SmartRTL::get_point |
( |
uint16_t |
index | ) |
const |
|
inline |
◆ init()
void AP_SmartRTL::init |
( |
void |
| ) |
|
◆ is_active()
bool AP_SmartRTL::is_active |
( |
| ) |
const |
|
inline |
◆ log_action()
◆ loops_overlap()
◆ pop_point()
bool AP_SmartRTL::pop_point |
( |
Vector3f & |
point | ) |
|
◆ remove_points_by_loops()
bool AP_SmartRTL::remove_points_by_loops |
( |
uint16_t |
num_points_to_remove | ) |
|
|
private |
◆ remove_points_by_simplify_bitmask()
void AP_SmartRTL::remove_points_by_simplify_bitmask |
( |
| ) |
|
|
private |
◆ request_thorough_cleanup()
◆ reset_pruning()
void AP_SmartRTL::reset_pruning |
( |
| ) |
|
|
private |
◆ reset_simplification()
void AP_SmartRTL::reset_simplification |
( |
| ) |
|
|
private |
◆ restart_pruning()
void AP_SmartRTL::restart_pruning |
( |
uint16_t |
path_points_count | ) |
|
|
private |
◆ restart_pruning_if_new_points()
void AP_SmartRTL::restart_pruning_if_new_points |
( |
| ) |
|
|
private |
◆ restart_simplification()
void AP_SmartRTL::restart_simplification |
( |
uint16_t |
path_points_count | ) |
|
|
private |
◆ restart_simplify_if_new_points()
void AP_SmartRTL::restart_simplify_if_new_points |
( |
uint16_t |
path_points_count | ) |
|
|
private |
◆ routine_cleanup()
void AP_SmartRTL::routine_cleanup |
( |
uint16_t |
path_points_count, |
|
|
uint16_t |
path_points_complete_limit |
|
) |
| |
|
private |
◆ run_background_cleanup()
void AP_SmartRTL::run_background_cleanup |
( |
| ) |
|
◆ segment_segment_dist()
Returns the closest distance in 3D space between any part of two input segments, defined from p1 to p2 and from p3 to p4. Also returns the point which is halfway between
Limitation: This function does not work for parallel lines. In this case, dist_point.distance will be FLT_MAX. This does not matter for the path cleanup algorithm because the pruning will still occur fine between the first parallel segment and a segment which is directly before or after the second segment.
Definition at line 785 of file AP_SmartRTL.cpp.
Referenced by detect_loops().
◆ set_home() [1/2]
void AP_SmartRTL::set_home |
( |
bool |
position_ok | ) |
|
◆ set_home() [2/2]
void AP_SmartRTL::set_home |
( |
bool |
position_ok, |
|
|
const Vector3f & |
current_pos |
|
) |
| |
◆ thorough_cleanup()
bool AP_SmartRTL::thorough_cleanup |
( |
uint16_t |
path_points_count, |
|
|
ThoroughCleanupType |
clean_type |
|
) |
| |
|
private |
◆ update() [1/2]
void AP_SmartRTL::update |
( |
bool |
position_ok, |
|
|
bool |
save_position |
|
) |
| |
◆ update() [2/2]
void AP_SmartRTL::update |
( |
bool |
position_ok, |
|
|
const Vector3f & |
current_pos |
|
) |
| |
◆ _accuracy
AP_Float AP_SmartRTL::_accuracy |
|
private |
◆ _active
bool AP_SmartRTL::_active |
|
private |
◆ _example_mode
bool AP_SmartRTL::_example_mode |
|
private |
◆ _home_saved
bool AP_SmartRTL::_home_saved |
|
private |
◆ _last_good_position_ms
uint32_t AP_SmartRTL::_last_good_position_ms |
|
private |
◆ _last_position_save_ms
uint32_t AP_SmartRTL::_last_position_save_ms |
|
private |
◆ _path
◆ _path_points_completed_limit
uint16_t AP_SmartRTL::_path_points_completed_limit |
|
private |
◆ _path_points_count
uint16_t AP_SmartRTL::_path_points_count |
|
private |
◆ _path_points_max
uint16_t AP_SmartRTL::_path_points_max |
|
private |
◆ _path_sem
◆ _points_max
AP_Int16 AP_SmartRTL::_points_max |
|
private |
◆ _prune
struct { ... } AP_SmartRTL::_prune |
◆ _simplify
struct { ... } AP_SmartRTL::_simplify |
◆ _thorough_clean_complete_ms
uint32_t AP_SmartRTL::_thorough_clean_complete_ms |
|
private |
◆ _thorough_clean_request_ms
uint32_t AP_SmartRTL::_thorough_clean_request_ms |
|
private |
◆ _thorough_clean_type
◆ bitmask
◆ complete
bool AP_SmartRTL::complete |
◆ loops
◆ loops_count
uint16_t AP_SmartRTL::loops_count |
◆ loops_max
uint16_t AP_SmartRTL::loops_max |
◆ path_points_completed
◆ path_points_count
uint16_t AP_SmartRTL::path_points_count |
◆ removal_required
bool AP_SmartRTL::removal_required |
◆ stack
◆ stack_count
uint16_t AP_SmartRTL::stack_count |
◆ stack_max
uint16_t AP_SmartRTL::stack_max |
◆ var_info
The documentation for this class was generated from the following files: