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
8debcba4
Commit
8debcba4
authored
11 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
AntennaTracker: fixed manual control, and added baro calibration
this allows baro offsets to be compensated for before takeoff
parent
a15e4633
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Tools/AntennaTracker/AntennaTracker.pde
+4
-0
4 additions, 0 deletions
Tools/AntennaTracker/AntennaTracker.pde
Tools/AntennaTracker/GCS_Mavlink.pde
+2
-0
2 additions, 0 deletions
Tools/AntennaTracker/GCS_Mavlink.pde
Tools/AntennaTracker/tracking.pde
+17
-3
17 additions, 3 deletions
Tools/AntennaTracker/tracking.pde
with
23 additions
and
3 deletions
Tools/AntennaTracker/AntennaTracker.pde
+
4
−
0
View file @
8debcba4
...
...
@@ -105,6 +105,10 @@ static struct {
float
distance
;
float
pitch
;
float
altitude_difference
;
float
altitude_offset
;
bool
manual_control_yaw
:
1
;
bool
manual_control_pitch
:
1
;
bool
need_altitude_calibration
:
1
;
}
nav_status
;
static
uint32_t
start_time_ms
;
...
...
This diff is collapsed.
Click to expand it.
Tools/AntennaTracker/GCS_Mavlink.pde
+
2
−
0
View file @
8debcba4
...
...
@@ -666,6 +666,8 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
calibrate_ins
();
}
else
if
(
packet
.
param3
==
1
)
{
init_barometer
();
// zero the altitude difference on next baro update
nav_status
.
need_altitude_calibration
=
true
;
}
if
(
packet
.
param4
==
1
)
{
// Cant trim radio
...
...
This diff is collapsed.
Click to expand it.
Tools/AntennaTracker/tracking.pde
+
17
−
3
View file @
8debcba4
...
...
@@ -230,8 +230,12 @@ static void update_tracking(void)
float
pitch
=
degrees
(
atan2f
(
nav_status
.
altitude_difference
,
distance
));
// update nav_status for NAV_CONTROLLER_OUTPUT
nav_status
.
bearing
=
bearing
;
nav_status
.
pitch
=
pitch
;
if
(
!
nav_status
.
manual_control_yaw
)
{
nav_status
.
bearing
=
bearing
;
}
if
(
!
nav_status
.
manual_control_pitch
)
{
nav_status
.
pitch
=
pitch
;
}
nav_status
.
distance
=
distance
;
switch
(
control_mode
)
{
...
...
@@ -277,7 +281,15 @@ static void tracking_update_pressure(const mavlink_scaled_pressure_t &msg)
// calculate altitude difference based on difference in barometric pressure
float
alt_diff
=
logf
(
scaling
)
*
(
ground_temp
+
273.15
f
)
*
29271.267
*
0.001
f
;
if
(
!
isnan
(
alt_diff
))
{
nav_status
.
altitude_difference
=
alt_diff
;
nav_status
.
altitude_difference
=
alt_diff
+
nav_status
.
altitude_offset
;
}
if
(
nav_status
.
need_altitude_calibration
)
{
// we have done a baro calibration - zero the altitude
// difference to the aircraft
nav_status
.
altitude_offset
=
-
nav_status
.
altitude_difference
;
nav_status
.
altitude_difference
=
0
;
nav_status
.
need_altitude_calibration
=
false
;
}
}
...
...
@@ -289,5 +301,7 @@ static void tracking_manual_control(const mavlink_manual_control_t &msg)
nav_status
.
bearing
=
msg
.
x
;
nav_status
.
pitch
=
msg
.
y
;
nav_status
.
distance
=
0.0
;
nav_status
.
manual_control_yaw
=
(
msg
.
x
!=
0x7FFF
);
nav_status
.
manual_control_pitch
=
(
msg
.
y
!=
0x7FFF
);
// z, r and buttons are not used
}
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