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
84ed2141
Commit
84ed2141
authored
11 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
AP_Math: fixed float rounding in location_offset()
this prevents rounding of positions in the rover code
parent
3e24ff1b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/AP_Math/location.cpp
+2
-2
2 additions, 2 deletions
libraries/AP_Math/location.cpp
with
2 additions
and
2 deletions
libraries/AP_Math/location.cpp
+
2
−
2
View file @
84ed2141
...
@@ -133,8 +133,8 @@ void location_update(struct Location &loc, float bearing, float distance)
...
@@ -133,8 +133,8 @@ void location_update(struct Location &loc, float bearing, float distance)
void
location_offset
(
struct
Location
&
loc
,
float
ofs_north
,
float
ofs_east
)
void
location_offset
(
struct
Location
&
loc
,
float
ofs_north
,
float
ofs_east
)
{
{
if
(
ofs_north
!=
0
||
ofs_east
!=
0
)
{
if
(
ofs_north
!=
0
||
ofs_east
!=
0
)
{
floa
t
dlat
=
ofs_north
*
LOCATION_SCALING_FACTOR_INV
;
int32_
t
dlat
=
ofs_north
*
LOCATION_SCALING_FACTOR_INV
;
floa
t
dlng
=
(
ofs_east
*
LOCATION_SCALING_FACTOR_INV
)
/
longitude_scale
(
loc
);
int32_
t
dlng
=
(
ofs_east
*
LOCATION_SCALING_FACTOR_INV
)
/
longitude_scale
(
loc
);
loc
.
lat
+=
dlat
;
loc
.
lat
+=
dlat
;
loc
.
lng
+=
dlng
;
loc
.
lng
+=
dlng
;
}
}
...
...
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