179 Commits

Author SHA1 Message Date
Lorenz Meier
413b161250 Logger: Style cleanup and comments 2018-01-08 09:27:22 +01:00
Daniel Agar
1ea5de43cf logger add vehicle_status_flags 2017-12-22 10:42:14 -05:00
Daniel Agar
642aeccd1e logger add home_position to the default set 2017-12-17 00:57:17 -05:00
lamping7
63718bf27b fix MISSION_ITEM REACHED message broadcast (#8332) 2017-12-10 02:30:58 -05:00
Beat Küng
1dbeec6a19 logger: do not write param changes if _should_stop_file_log is set
_should_stop_file_log is set after disarming: logging continues for 1s
to measure the CPU usage.
During that time, other modules might change params (such as ekf), and
we don't need to have these the log. However currently all modules do
not notify the system when setting params after disarming.
Meaning this patch is not strictly needed, it's more a preventive
measure.
2017-12-07 11:55:51 +00:00
Beat Küng
41a4d07e4f logger: make type passed to param_get() explicit 2017-10-27 10:43:15 +02:00
Paul Riseborough
c9f44531c2 logger: Add logging profile to support comparison of multiple sensors (#8134) 2017-10-20 09:30:55 -04:00
Beat Küng
8b797d9b05 logger: use int for loop counter 2017-10-18 08:40:32 +02:00
Beat Küng
7381ea8222 logger: remove unused topics commander_state & rc_channels
flight review now uses vehicle_status & manual_control_setpoint
2017-10-18 08:40:32 +02:00
Beat Küng
deaf125c81 logger: check for newly published topics while not logging
If logger is started very early, orb_exists() will fail for a lot of
topics, they will be advertised within the next few seconds.
Logger already dynamically adds subscriptions during logging, but if we
do that before as well, we'll avoid any delays and having to subscribe
to a lot of topics all at once.
2017-10-18 08:40:32 +02:00
Beat Küng
3be252289a logger: use orb_exists to check if we need to subscribe to the first instance
To keep track of the configured interval, we store it as negative file
descriptor, until we do the subscription.

This frees up a considerable amount of file descriptors in most use-cases.
2017-10-18 08:40:32 +02:00
Beat Küng
98e6ba858d logger: change SDLOG_PROFILE into a bitset
This is more flexible, allowing a combination of sets.

The default enables the same set & rates as before
2017-10-14 14:21:11 +02:00
Beat Küng
be6079bc52 logger: add high rate & debug profiles 2017-10-14 14:21:11 +02:00
Beat Küng
4da4093839 logger status output: print 'Not logging' if not actually logging 2017-10-12 16:40:47 +02:00
Dario Röthlisberger
3dd4454a87 version: include FIRMWARE_TYPE in vendor version 2017-10-09 14:41:58 +02:00
Dario Röthlisberger
257e54b304 logger: write vendor version if existent 2017-10-09 14:41:58 +02:00
Daniel Agar
086ddf5078 logger coverity fix 143427 2017-09-16 21:28:24 +01:00
Daniel Agar
e15afcca7a vehicle_command commands are uint16, not uint32 2017-09-08 09:06:30 +02:00
Daniel Agar
4e557e0f14 logger add manual_control_setpoint 2017-09-06 05:32:35 +02:00
Beat Küng
201b2bd75e logger: remove non-existing topics arm_auth_ack & arm_auth_request 2017-09-05 18:40:53 +02:00
Daniel Agar
49dceb2bff logger update topics (#7914)
- fixes #7911
2017-09-05 10:43:38 -04:00
Julien Lecoeur
be74a1a4ed Log debug topics 2017-08-30 14:45:02 +01:00
José Roberto de Souza
3fd7e3f89c modules: commander: Implement arm authorization request
If the second bit of COM_ARM_MIS_EXT_REQ is set the vehicle
will only arm after receive an authorization.

The authorization flow:
vehicle/external -> command: arm authorization request -> arm authorizer
vehicle <- command ack with result in progress <- arm authorizer
vehicle <- any data request <- arm authorizer
vehicle -> data response -> arm authorizer
vehicle <- command ack authorizing or denying <- arm authorizer

Right now there is 2 ways to start the arm authorization request,
that can be configured by COM_ARM_AUTH parameter.
- One arm: When pilot request the vehicle to arm, it will request
authorization blocking the arm process up to the timeout defined in
COM_ARM_AUTH parameter.
- Two arms request: The first arm request will request the
authorization and will deny the first arm request, if authorizer
approved the request, pilot can arm again within the authorized
time and arm without any block.

The arm authorizer can be running anywhere(compute board or PX4
itself) and it is responsible to request the mission list or any
other information to vehicle before send a final response, it
should send to vehicle a COMMAND_ACK with
result = MAV_RESULT_IN_PROGRESS as soon as it receive the arm
authorization request and the final result
as after it got all the data that it needs authorize or deny the
request.
2017-08-28 08:28:57 +02:00
Daniel Agar
e63da5860e uORB cleanup Subscription/Publication c++ 2017-08-20 20:42:42 +02:00
José Roberto de Souza
4462869432 Add support to new fields in command_ack 2017-08-19 09:04:52 +02:00
José Roberto de Souza
925efe990d Initialize all outgoing vehicle_command_ack_s and vehicle_command_s
This will initialize those structs with zero in all fields not set
and all fields set will only be change once to the final value not
wasting CPU time zeroing it.

This will guarantee that no non-unitialized structs will have
a trash value on from_external causing it to be sent to the
MAVLink channel without need it.
2017-08-08 21:46:30 +02:00
Lorenz Meier
08e49806c8 Logger: use default scheduling priorities 2017-08-02 21:18:35 +02:00
Beat Küng
0109154c43 logger: avoid logging the UUID if the system does not provide it
The linux targets don't have it and setting a fixed constant causes
wrong vehicle associationss in Flight Review.
2017-07-24 09:01:02 +02:00
Beat Küng
a43f135ad4 minor documentation updates to some commands 2017-07-14 11:57:11 +02:00
Beat Küng
053eb12329 Module documentation: switch to Markdown 2017-07-14 11:57:11 +02:00
Beat Küng
59bde454b5 ModuleBase: instanciate -> instantiate 2017-07-14 11:57:11 +02:00
Beat Küng
7361244359 logger: convert to use ModuleBase 2017-07-14 11:57:11 +02:00
Lorenz Meier
f2b8291587 Logger: Run at lower priority than core control pipeline
This should ensure that controllers run first and log data copying happens after.
;
2017-07-09 21:59:01 +02:00
Daniel Agar
61fd6f4c8a uorb failure print topic name 2017-07-09 14:40:11 +02:00
Beat Küng
c775b07b43 logger: use INFO_MULTIPLE for top & perf output 2017-07-07 17:06:48 +02:00
Beat Küng
b515873bee ULog: add INFO_MULTIPLE & FLAG_BITS messages
This requires support in the parsers, and thus the ULog file version is
increased.
As long as no data is appended, both, existing pyulog & FlightPlot, can
still read the new logs (they will output a warning).
The replay module will print an error, but still continue.
2017-07-07 17:06:48 +02:00
Beat Küng
18ea5ec1f8 logger: add git branch name to the log 2017-07-07 17:06:48 +02:00
James Goppert
ac8ef5f338 Formatting. 2017-07-06 09:02:13 +02:00
James Goppert
16f46c15d3 Switch to class enum and cleanup log profiles. 2017-07-06 09:02:13 +02:00
Beat Küng
784cec1cae logger: check if topic already added & if so only update the interval 2017-07-06 09:02:13 +02:00
James Goppert
15ae3a9eb7 Add estimator replay topics to default. 2017-07-06 09:02:13 +02:00
James Goppert
d10a491243 Add logging profiles to logger module. 2017-07-06 09:02:13 +02:00
Daniel Agar
f947205cbe delete vehicle_global_velocity_setpoint 2017-06-26 11:31:25 -04:00
Mohammed Kabir
b146e7afde logger : log geotagging packet 2017-05-12 22:11:17 +02:00
Beat Küng
1d1eedb086 logger: register shutdown hook for graceful shutdown
This will avoid file system corruptions in cases where px4_shutdown_request
is used. However it will not help obviously when the battery is pulled
directly.
2017-04-20 10:01:51 +02:00
Beat Küng
24380ae88c logger: add SDLOG_DIRS_MAX param to limit the max number of log directories
Disabled by default, so that logs are not deleted unexpectedly.
2017-04-10 23:37:09 +02:00
Beat Küng
75bd4f1121 logger: implement a logrotate
Remove old log directories on startup if free space falls below a threshold.
The threshold is 300MB or 10% of the disk capacity if that's smaller.
2017-04-10 23:37:09 +02:00
Beat Küng
2a175aa2f9 logger: use nullptr instead of NULL 2017-04-01 20:19:52 +02:00
Beat Küng
190c14c186 logger: add preflight & postflight process usage & perf counters to the log
For the process usage: we need to measure over a certain period of time,
then we can use the results. To avoid blocking, this does:
- after log is started, initialze the load counters, then one second later
  add the results to the log
- after disarming: continue logging for one more second, then add the process
  load to the log and stop logging.
- to avoid a delay, 'logger stop' will stop immediately and not log
  postflight process usage.
2017-04-01 20:19:52 +02:00
Beat Küng
358bcb6ae0 visibility.h: add #pragma GCC poison getenv setenv putenv
Just to make sure that it will never be used on NuttX. This is not an
architectural limitation, just a memory optimization, since we call
clearenv() on NuttX.
2017-03-29 23:02:09 +02:00