Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copter: auto mode takeoff complete pos fix #28061

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ArduCopter/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class _AutoTakeoff {
public:
void run();
void start(float complete_alt_cm, bool terrain_alt);
bool get_position(Vector3p& completion_pos);
bool get_completion_pos(Vector3p& pos_neu_cm);

bool complete; // true when takeoff is complete

Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ bool ModeAuto::wp_start(const Location& dest_loc)
Vector3f stopping_point;
if (_mode == SubMode::TAKEOFF) {
Vector3p takeoff_complete_pos;
if (auto_takeoff.get_position(takeoff_complete_pos)) {
if (auto_takeoff.get_completion_pos(takeoff_complete_pos)) {
stopping_point = takeoff_complete_pos.tofloat();
}
}
Expand Down
6 changes: 3 additions & 3 deletions ArduCopter/takeoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ void _AutoTakeoff::start(float _complete_alt_cm, bool _terrain_alt)
}
}

// return takeoff final position if takeoff has completed successfully
bool _AutoTakeoff::get_position(Vector3p& _complete_pos)
// return takeoff final target position in cm from the EKF origin if takeoff has completed successfully
bool _AutoTakeoff::get_completion_pos(Vector3p& pos_neu_cm)
{
// only provide location if takeoff has completed
if (!complete) {
return false;
}

complete_pos = _complete_pos;
pos_neu_cm = complete_pos;
return true;
}

Expand Down
Loading