Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Ardupilot
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Ardupilot
Commits
1332ed3b
Commit
1332ed3b
authored
12 years ago
by
rmackay9
Browse files
Options
Downloads
Patches
Plain Diff
ArduCopter: restore initial climb to RTL
parent
c1abd96e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ArduCopter/commands_logic.pde
+24
-11
24 additions, 11 deletions
ArduCopter/commands_logic.pde
ArduCopter/defines.h
+5
-4
5 additions, 4 deletions
ArduCopter/defines.h
with
29 additions
and
15 deletions
ArduCopter/commands_logic.pde
+
24
−
11
View file @
1332ed3b
...
...
@@ -219,28 +219,21 @@ static bool verify_may()
static
void
do_RTL
(
void
)
{
// set rtl state
rtl_state
=
RTL_STATE_
RETURNING_HOME
;
rtl_state
=
RTL_STATE_
INITIAL_CLIMB
;
// set roll, pitch and yaw modes
set_roll_pitch_mode
(
RTL_RP
);
set_yaw_mode
(
RTL_YAW
);
set_yaw_mode
(
YAW_HOLD
);
// first stage of RTL is the initial climb so just hold current yaw
set_throttle_mode
(
RTL_THR
);
// set navigation mode
wp_control
=
WP
_MODE
;
wp_control
=
LOITER
_MODE
;
//
so we know where we are navigating from
//
initial climb starts at current location
next_WP
=
current_loc
;
// Set navigation target to home
set_next_WP
(
&
home
);
// override altitude to RTL altitude
set_new_altitude
(
get_RTL_alt
());
// output control mode to the ground station
// -----------------------------------------
gcs_send_message
(
MSG_HEARTBEAT
);
}
/********************************************************************************/
...
...
@@ -480,6 +473,26 @@ static bool verify_RTL()
switch
(
rtl_state
)
{
case
RTL_STATE_INITIAL_CLIMB
:
// rely on verify_altitude function to update alt_change_flag when we've reached the target
if
(
alt_change_flag
==
REACHED_ALT
)
{
// Set navigation target to home
set_next_WP
(
&
home
);
// override target altitude to RTL altitude
set_new_altitude
(
get_RTL_alt
());
// set navigation mode
wp_control
=
WP_MODE
;
// set yaw mode
set_yaw_mode
(
RTL_YAW
);
// advance to next rtl state
rtl_state
=
RTL_STATE_RETURNING_HOME
;
}
break
;
case
RTL_STATE_RETURNING_HOME
:
// if we've reached home initiate loiter
if
(
wp_distance
<=
g
.
waypoint_radius
*
100
||
check_missed_wp
())
{
...
...
This diff is collapsed.
Click to expand it.
ArduCopter/defines.h
+
5
−
4
View file @
1332ed3b
...
...
@@ -214,10 +214,11 @@
#define WP_OPTION_NEXT_CMD 128
// RTL state
#define RTL_STATE_RETURNING_HOME 0
#define RTL_STATE_LOITERING_AT_HOME 1
#define RTL_STATE_FINAL_DESCENT 2
#define RTL_STATE_LAND 3
#define RTL_STATE_INITIAL_CLIMB 0
#define RTL_STATE_RETURNING_HOME 1
#define RTL_STATE_LOITERING_AT_HOME 2
#define RTL_STATE_FINAL_DESCENT 3
#define RTL_STATE_LAND 4
//repeating events
#define RELAY_TOGGLE 5
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment