Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
c21cfb7b
Commit
c21cfb7b
authored
Mar 10, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ArduPilot compass cal
parent
687468cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
APMCompassCal.cc
src/AutoPilotPlugins/APM/APMCompassCal.cc
+5
-7
Vehicle.cc
src/Vehicle/Vehicle.cc
+20
-1
Vehicle.h
src/Vehicle/Vehicle.h
+1
-0
No files found.
src/AutoPilotPlugins/APM/APMCompassCal.cc
View file @
c21cfb7b
...
...
@@ -143,18 +143,16 @@ CalWorkerThread::calibrate_return CalWorkerThread::calibrate(void)
free
(
worker_data
.
z
[
cur_mag
]);
}
AutoPilotPlugin
*
plugin
=
_vehicle
->
autopilotPlugin
();
if
(
result
==
calibrate_return_ok
)
{
for
(
unsigned
cur_mag
=
0
;
cur_mag
<
max_mags
;
cur_mag
++
)
{
if
(
rgCompassAvailable
[
cur_mag
])
{
_emitVehicleTextMessage
(
QString
(
"[cal] mag #%1 off: x:%2 y:%3 z:%4"
).
arg
(
cur_mag
).
arg
(
-
sphere_x
[
cur_mag
]).
arg
(
-
sphere_y
[
cur_mag
]).
arg
(
-
sphere_z
[
cur_mag
]));
const
char
*
offsetParam
=
rgCompassParams
[
cur_mag
][
0
];
plugin
->
getParameterFact
(
-
1
,
offsetParam
)
->
setRawValue
(
-
sphere_x
[
cur_mag
]);
offsetParam
=
rgCompassParams
[
cur_mag
][
1
];
plugin
->
getParameterFact
(
-
1
,
offsetParam
)
->
setRawValue
(
-
sphere_y
[
cur_mag
]);
offsetParam
=
rgCompassParams
[
cur_mag
][
2
];
plugin
->
getParameterFact
(
-
1
,
offsetParam
)
->
setRawValue
(
-
sphere_z
[
cur_mag
]);
if
(
cur_mag
!=
2
)
{
float
sensorId
;
sensorId
=
cur_mag
==
0
?
2.0
f
:
5.0
f
;
_vehicle
->
doCommandLong
(
0
,
MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS
,
sensorId
,
-
sphere_x
[
cur_mag
],
-
sphere_y
[
cur_mag
],
-
sphere_z
[
cur_mag
]);
}
}
}
}
...
...
src/Vehicle/Vehicle.cc
View file @
c21cfb7b
...
...
@@ -1485,12 +1485,31 @@ void Vehicle::emergencyStop(void)
cmd
.
param7
=
0.0
f
;
cmd
.
target_system
=
id
();
cmd
.
target_component
=
0
;
mavlink_msg_command_long_encode
(
_mavlink
->
getSystemId
(),
_mavlink
->
getComponentId
(),
&
msg
,
&
cmd
);
sendMessage
(
msg
);
}
void
Vehicle
::
doCommandLong
(
int
component
,
MAV_CMD
command
,
float
param1
,
float
param2
,
float
param3
,
float
param4
,
float
param5
,
float
param6
,
float
param7
)
{
mavlink_message_t
msg
;
mavlink_command_long_t
cmd
;
cmd
.
command
=
command
;
cmd
.
confirmation
=
0
;
cmd
.
param1
=
param1
;
cmd
.
param2
=
param2
;
cmd
.
param3
=
param3
;
cmd
.
param4
=
param4
;
cmd
.
param5
=
param5
;
cmd
.
param6
=
param6
;
cmd
.
param7
=
param7
;
cmd
.
target_system
=
id
();
cmd
.
target_component
=
component
;
mavlink_msg_command_long_encode
(
_mavlink
->
getSystemId
(),
_mavlink
->
getComponentId
(),
&
msg
,
&
cmd
);
sendMessage
(
msg
);
}
const
char
*
VehicleGPSFactGroup
::
_hdopFactName
=
"hdop"
;
const
char
*
VehicleGPSFactGroup
::
_vdopFactName
=
"vdop"
;
...
...
src/Vehicle/Vehicle.h
View file @
c21cfb7b
...
...
@@ -504,6 +504,7 @@ public:
static
const
int
cMaxRcChannels
=
18
;
bool
containsLink
(
LinkInterface
*
link
)
{
return
_links
.
contains
(
link
);
}
void
doCommandLong
(
int
component
,
MAV_CMD
command
,
float
param1
=
0
.
0
f
,
float
param2
=
0
.
0
f
,
float
param3
=
0
.
0
f
,
float
param4
=
0
.
0
f
,
float
param5
=
0
.
0
f
,
float
param6
=
0
.
0
f
,
float
param7
=
0
.
0
f
);
public
slots
:
void
setLatitude
(
double
latitude
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment