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
871d0c0e
Commit
871d0c0e
authored
11 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
APM_Control: moved the log structure to ArduPlane core
this allows it to work with old style .log files
parent
4f250579
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/APM_Control/AP_AutoTune.cpp
+1
-31
1 addition, 31 deletions
libraries/APM_Control/AP_AutoTune.cpp
libraries/APM_Control/AP_AutoTune.h
+12
-3
12 additions, 3 deletions
libraries/APM_Control/AP_AutoTune.h
with
13 additions
and
34 deletions
libraries/APM_Control/AP_AutoTune.cpp
+
1
−
31
View file @
871d0c0e
...
...
@@ -66,8 +66,6 @@ extern const AP_HAL::HAL& hal;
#define AUTOTUNE_MIN_IMAX 2000
#define AUTOTUNE_MAX_IMAX 4000
bool
AP_AutoTune
::
logging_started
=
false
;
// constructor
AP_AutoTune
::
AP_AutoTune
(
ATGains
&
_gains
,
ATType
_type
,
const
AP_Vehicle
::
FixedWing
&
parms
,
...
...
@@ -290,42 +288,14 @@ void AP_AutoTune::save_gains(const ATGains &v)
last_save
=
current
;
}
#define LOG_MSG_ATRP 211
struct
PACKED
log_ATRP
{
LOG_PACKET_HEADER
;
uint32_t
timestamp
;
uint8_t
type
;
uint8_t
state
;
int16_t
servo
;
float
demanded
;
float
achieved
;
float
P
;
};
static
const
struct
LogStructure
at_log_structures
[]
PROGMEM
=
{
{
LOG_MSG_ATRP
,
sizeof
(
log_ATRP
),
"ATRP"
,
"IBBcfff"
,
"TimeMS,Type,State,Servo,Demanded,Achieved,P"
},
};
void
AP_AutoTune
::
write_log_headers
(
void
)
{
if
(
!
logging_started
)
{
logging_started
=
true
;
dataflash
.
AddLogFormats
(
at_log_structures
,
1
);
}
}
void
AP_AutoTune
::
write_log
(
float
servo
,
float
demanded
,
float
achieved
)
{
if
(
!
dataflash
.
logging_started
())
{
return
;
}
write_log_headers
();
struct
log_ATRP
pkt
=
{
LOG_PACKET_HEADER_INIT
(
LOG_
MSG_
ATRP
),
LOG_PACKET_HEADER_INIT
(
LOG_ATRP
_MSG
),
timestamp
:
hal
.
scheduler
->
millis
(),
type
:
type
,
state
:
(
uint8_t
)
state
,
...
...
This diff is collapsed.
Click to expand it.
libraries/APM_Control/AP_AutoTune.h
+
12
−
3
View file @
871d0c0e
...
...
@@ -23,6 +23,18 @@ public:
AUTOTUNE_PITCH
=
1
};
struct
PACKED
log_ATRP
{
LOG_PACKET_HEADER
;
uint32_t
timestamp
;
uint8_t
type
;
uint8_t
state
;
int16_t
servo
;
float
demanded
;
float
achieved
;
float
P
;
};
// constructor
AP_AutoTune
(
ATGains
&
_gains
,
ATType
type
,
const
AP_Vehicle
::
FixedWing
&
parms
,
DataFlash_Class
&
_dataflash
);
...
...
@@ -54,9 +66,6 @@ private:
// did we saturate surfaces?
bool
saturated_surfaces
:
1
;
// have we sent log headers
static
bool
logging_started
;
// values to restore if we leave autotune mode
ATGains
restore
;
...
...
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