Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
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
Baitboat
Commits
429f9004
Commit
429f9004
authored
12 years ago
by
Randy Mackay
Browse files
Options
Downloads
Patches
Plain Diff
Copter: bug fix for RTL bearing
Also smooth RTL's initial climb stage by projecting stopping point
parent
61288fcb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ArduCopter/commands_logic.pde
+15
-5
15 additions, 5 deletions
ArduCopter/commands_logic.pde
with
15 additions
and
5 deletions
ArduCopter/commands_logic.pde
+
15
−
5
View file @
429f9004
...
...
@@ -582,11 +582,13 @@ static bool verify_RTL()
// first stage of RTL is the initial climb so just hold current yaw
set_yaw_mode
(
YAW_HOLD
);
// get current position
// To-Do: use projection of safe stopping point based on current location and velocity
Vector3f
target_pos
=
inertial_nav
.
get_position
();
target_pos
.
z
=
get_RTL_alt
();
wp_nav
.
set_destination
(
target_pos
);
// use projection of safe stopping point based on current location and velocity
Vector3f
origin
,
dest
;
wp_nav
.
get_stopping_point
(
inertial_nav
.
get_position
(),
inertial_nav
.
get_velocity
(),
origin
);
dest
.
x
=
origin
.
x
;
dest
.
y
=
origin
.
y
;
dest
.
z
=
get_RTL_alt
();
wp_nav
.
set_origin_and_destination
(
origin
,
dest
);
// advance to next rtl state
rtl_state
=
RTL_STATE_INITIAL_CLIMB
;
...
...
@@ -596,6 +598,10 @@ static bool verify_RTL()
// Set wp navigation target to above home
wp_nav
.
set_destination
(
Vector3f
(
0
,
0
,
get_RTL_alt
()));
// initialise original_wp_bearing which is used to point the nose home
wp_bearing
=
wp_nav
.
get_bearing_to_destination
();
original_wp_bearing
=
wp_bearing
;
// advance to next rtl state
rtl_state
=
RTL_STATE_RETURNING_HOME
;
...
...
@@ -610,6 +616,10 @@ static bool verify_RTL()
// Set wp navigation target to above home
wp_nav
.
set_destination
(
Vector3f
(
0
,
0
,
get_RTL_alt
()));
// initialise original_wp_bearing which is used to point the nose home
wp_bearing
=
wp_nav
.
get_bearing_to_destination
();
original_wp_bearing
=
wp_bearing
;
// point nose towards home (maybe)
set_yaw_mode
(
get_wp_yaw_mode
(
true
));
...
...
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