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
24ba59f5
Commit
24ba59f5
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
APM: fixed overflow in geofence code for altitudes above 327 meters
parent
4829e937
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
ArduPlane/geofence.pde
+3
-3
3 additions, 3 deletions
ArduPlane/geofence.pde
with
3 additions
and
3 deletions
ArduPlane/geofence.pde
+
3
−
3
View file @
24ba59f5
...
...
@@ -151,7 +151,7 @@ static bool geofence_check_minalt(void)
if
(
g
.
fence_minalt
==
0
)
{
return
false
;
}
return
(
current_loc
.
alt
<
(
g
.
fence_minalt
*
100
)
+
home
.
alt
);
return
(
current_loc
.
alt
<
(
g
.
fence_minalt
*
100
.0
)
+
home
.
alt
);
}
/*
...
...
@@ -165,7 +165,7 @@ static bool geofence_check_maxalt(void)
if
(
g
.
fence_maxalt
==
0
)
{
return
false
;
}
return
(
current_loc
.
alt
>
(
g
.
fence_maxalt
*
100
)
+
home
.
alt
);
return
(
current_loc
.
alt
>
(
g
.
fence_maxalt
*
100
.0
)
+
home
.
alt
);
}
...
...
@@ -263,7 +263,7 @@ static void geofence_check(bool altitude_check_only)
// invalid min/max, use RTL_altitude
guided_WP
.
alt
=
home
.
alt
+
g
.
RTL_altitude
;
}
else
{
guided_WP
.
alt
=
home
.
alt
+
100
*
(
g
.
fence_minalt
+
g
.
fence_maxalt
)
/
2
;
guided_WP
.
alt
=
home
.
alt
+
100
.0
*
(
g
.
fence_minalt
+
g
.
fence_maxalt
)
/
2
;
}
guided_WP
.
id
=
0
;
guided_WP
.
p1
=
0
;
...
...
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