Commit Graph

308 Commits

Author SHA1 Message Date
Julian Oes e7d0cabb52 logger: fix uninitialized member variable
This was reported by Coverity Scan.
2019-06-05 14:46:03 +02:00
Beat Küng d68dcb9cf7 log_writer_file: increase stack size by 20 bytes
Seems to be due to the console buffer.
2019-06-04 11:57:54 +02:00
Beat Küng 0d71eeccbf console buffer: write to log as 'boot_console_output' message 2019-06-04 11:57:54 +02:00
Daniel Agar 2c63e335e9 uORB::Subscription subscribe directly to uORB device node object 2019-06-03 17:06:21 -04:00
Beat Küng ed9d25a75a logger: add arming/disarming via AUX1 RC channel logging mode 2019-05-29 11:41:22 +02:00
Beat Küng 721f9f901f log_writer_file: fix race condition for fast consecutive stop & start calls 2019-05-29 11:41:22 +02:00
Daniel Agar 0206375de6 logger reduce default topics 2019-04-09 10:14:49 -04:00
Daniel Agar 6648937789 logger increase stack 3600 -> 3700 bytes 2019-04-03 14:32:45 -04:00
Beat Küng 14ef009aab logging: add SDLOG_MODE = -1 to disable logging completely 2019-03-21 08:15:48 +01:00
Daniel Agar b35d048566 cmake enable -Wcast-align and disable per module 2019-03-16 11:47:15 -04:00
DanielePettenuzzo 15abb159a8 camera_capture: change topic namings to make logging, mavlink streaming and geotagging easier 2019-02-10 18:07:44 -05:00
Daniel Agar 2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Daniel Agar edeb59a8c3 move logger array.h -> containers/Array.hpp 2019-01-20 12:03:53 +01:00
Beat Küng c2f82b5996 logger: disable mission log by default (SDLOG_MISSION=0)
- I enabled it by default mostly for testing purposes
- Disabling it reduces resource usage as most setups don't need it
2019-01-09 08:59:29 -05:00
Julian Oes 5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Christian Rauch 8a2e3800d8 check CONFIG_SCHED_INSTRUMENTATION for print_load_nuttx 2018-12-21 05:43:21 -08:00
Beat Küng dc49e259b3 logger: add separate profile for vision/avoidance
Keeps things more modular.
2018-12-07 11:51:59 +01:00
Beat Küng fced1ce33b logger: remove some unused logged topics in SITL 2018-12-07 11:51:59 +01:00
Daniel Agar 3e0a3559a9 cmake use standard mechanisms for settings flags 2018-11-26 14:40:14 -08:00
Mara Bos e9fb17c51a Always use FILE* for standard output.
The threads running commands for clients through the Posix daemon used
to write to a char buffer through snprintf (etc.) which was then written
directly to the file descriptor, whereas in the other case printf
(etc.) was used to write to stdout (FILE*). Both versions used some
macro's and repeated code to have the same output.

This change unifies these two cases by using a FILE* in both cases. The
(line) buffering is done by the standard C library's implementation
(just like with stdout), and px4_log.c now uses the same code in all
cases (using fprintf, etc.) for printing (colored) output.
2018-11-23 12:15:41 +01:00
baumanta db514fe441 Add a collision avoidance library which uses range data 2018-11-20 14:11:33 +01:00
Daniel Agar bba475aca1 logger limit trajectory_setpoint rate 2018-11-19 09:59:22 -05:00
TSC21 05d9932f6c logger: limit vehicle_*_odometry topics to 30hz on default logging 2018-11-16 09:44:32 +01:00
TSC21 2c111222cf logger: fix vision topics naming 2018-11-16 09:44:32 +01:00
bresch 7205e8f359 Auto traj - Add Trajectory logging
- move the update after the integration: a new computed jerk has an impact at the next epoch only
- add jerk reduction in case of too large integration time: when a jerk of "min_jerk" during dt is too much
- add jerk reduction if the integration time is larger than the predicted one and that integrating that jerk would lead to an acceleration overshoot
- rename some variables
2018-11-06 22:17:00 +01:00
Beat Küng df559f3042 logger: unlock the mutex for fsync & call fsync only when backend is running
- fsync can be a long blocking operation, so we need to make sure the main
  logger thread does not block during this time, when it tries to aquire
  the mutex
- fixes calling fsync on an invalid file descriptor
2018-11-07 00:08:23 +08:00
Beat Küng ee5c18a737 SDLOG_MISSION param: update description 2018-10-26 08:02:42 +02:00
Beat Küng c5d8abff00 log_writer_file: rename argument to avoid shadowing warning 2018-10-26 08:02:42 +02:00
Beat Küng 2642915a76 logger: enable mission log by default
To get it field-tested. This can be reverted for a release...
2018-10-26 08:02:42 +02:00
Beat Küng 3a462c2ba7 refactor logger: move debug buffer printf into separate method (DBGPRINT) 2018-10-26 08:02:42 +02:00
Beat Küng 234ec7f2a2 logger: add mission log to frontend, configurable via SDLOG_MISSION
- mission logs are stored in a separate directory mission_log
- It's disabled by default
- Does not increase RAM usage if disabled (if enabled, only 300 bytes)
- Log rotate does not apply to the mission logs
2018-10-26 08:02:42 +02:00
Beat Küng 4fc1c5c4f5 LogWriterFile: split long header messages that exceed the buffer length
Some message formats are longer than the 300 bytes. We can split the writes
because we have to wait until they are written anyway.
2018-10-26 08:02:42 +02:00
Beat Küng 28ac7679e0 logger: change message id from uint16_t to uint8_t
256 subscriptions are enough for now.
Reduces RAM usage by 300 bytes.
2018-10-26 08:02:42 +02:00
Beat Küng d6e820fe67 logger: add mission file to LogWriterFile backend
Not used yet, it should not affect anything, except for slight RAM
increase.
2018-10-26 08:02:42 +02:00
Beat Küng b86c7d2e8f Logger: only write subscribed topic format definitions
Previously the formats of all known uorb messages were written.

- reduces header size by about 13KB
- reduce ulog_message_format_s size to reduce required stack size.
  Largest message format is about 1000 bytes.
2018-10-26 08:02:42 +02:00
Beat Küng 0745ba9052 refactor logger: move some code inside run() into separate methods 2018-10-26 08:02:42 +02:00
Beat Küng 5eafa1b34b refactor logger: move some independent methods into separate util file 2018-10-26 08:02:42 +02:00
David Sidrane 9709d23179 logger:Use PX4 GUID for sys_uuid 2018-10-03 10:30:10 +02:00
Julien Lecoeur a346619623 Logger: add debug_array topic 2018-09-27 12:33:12 -04:00
Beat Küng 3453506471 logger: log vehicle_air_data and vehicle_magnetometer by default & minor cleanup
Make sure vehicle_air_data & vehicle_magnetometer are logged if ekf2 replay
is disabled.
2018-09-24 13:25:01 +02:00
Daniel Agar 5207c420c3 generic position controller status/feedback message 2018-08-31 14:43:51 -04:00
Daniel Agar d131fea899 vehicle trajectory limit unnecessary updates and reduce logging (#10347)
- fixes #10345
2018-08-30 09:21:13 -04:00
Hamish Willee bbc0c28c2c Improve docs for SD Log profile 2018-08-27 09:38:00 +02:00
Hamish Willee 37aa2132e5 Make it clear up front that SDLOG is a bitmask 2018-08-20 15:12:08 +02:00
Paul Riseborough 57052edfb2 logger: Log GPS drift data
This data is published at the GPS publication rate and only when on ground.
2018-08-17 10:44:07 +10:00
Daniel Agar 36403e9025 Mavlink expand telemetry_status and split radio_status 2018-08-16 17:32:15 +02:00
Beat Küng c0cac0594e file paths: add PX4_STORAGEDIR & use it where appropriate 2018-08-08 21:09:39 +02:00
Beat Küng 6a49d78c4b logger: remove last references to SYS_LOGGER 2018-08-08 21:09:39 +02:00
Julian Oes 0c5c741b1a add posix shell
squashed & rebased version, not including:
- listener changes
- src/firmware renaming

Commits:

tag_to_version.py: fix Python3 error

subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.

cmake: remove folder src/firmware

The folder src/firmware was not intuitive. Why would the binaries for
SITL be inside a src and why even inside a src/firmware folder. Also,
the rootfs was put there which made it even more confusing.

The CMakeLists.txt files are moved into cmake/ and get now called from
the main CMakeLists.txt.

qshell: support for return value

Instead of just sending commands, qshell will now also wait until
the command has finished on QURT and sent back a return value. This will
allow all modules on the DSP side to be spawned from the Linux side
meaning that we only need one config/startup file instead of two.

adb_upload: create folders before pushing

Previously the script failed if the folder on the destination was not
already existing. This therefore makes pushing easier.

posix: spawn PX4 modules in bash

This adds the possibility to spawn PX4 modules out of bash. Basically,
the main executable can now be started as a server/daemon or as a
client.
The server replaces the existing functionality of the main exe with
the pxh shell, however, it also opens a pipe that clients can talk to.

Clients can run or spawn PX4 modules or commands by connecting to the
server over the pipe. They clients will get the stdout and return value
of their commands via a client specific pipe back.

This work will allow to start all modules using a bash script similar to
the way it is done in NuttX where the NuttShell scripts the startup
scripts and starts the modules.

SITL: use new client shell in SITL

This is a first step to use the new shell capabilities for SITL.
The new startup bash script rcS merges (and therefore replaces) the two
existing scripts rcS_gazebo_iris and rcS_jmavsim_iris.

More cleanup will be necessary for the rest of the SITL startup scripts.

Snapdragon: use new shell to start all modules

Instead of different mainapp.config and px4.config files, we can now use
a unified rcS bash script which starts all the modules based on
parameters, mainly the SYS_AUTOSTART param.

Snapdragon: fix the airframe description

pxh: argv needs to end with a nullptr

The comment was wrong that argv needs an additional 0 termination.
Instead it needs a nullptr at the end.

px4_posix_tasks: variable cleanup

The px4_task_spawn_cmd function got a cleanup while debugging, however,
no functional changes.

Snapdragon: move some drivers to 4100 config

These drivers are supported by the community, so they go into the 4100
config.

Snapdragon: update 210qc platform

px4_daemon: use doxygen comments

apps.h_in: fix string printf: use .c_str()

px4_daemon: \b -> \n in printf

px4_daemon: handle error in generate_uuid (close the file on error)

posix main: some clarifications in comment (it's the symlinks not the script aliases)

cmake: remove new install command again

This one was probably wrong and untested. Installing needs revisiting.

POSIX: remove argument USES_TERMINAL

POSIX: copy init and mixer files for SITL

Instead of using non-working install commands, the mixer and startup
files are now copied as part of the build in cmake.

adb_upload.sh: remove leftover commented printf

POSIX main: just the pointer instead of memmove

POSIX main: remove chroot

chroot is removed because it hasn't been used anywhere and seems
untested.

px4_daemon: remove client pipe when cleaning up

px4_daemon: fail if the client pipe already exists

The client pipe is supposed to be specific (by UUID), so the path
shouldn't exist already.

history: limit the number of history entries

This is a protection to avoid filling the memory if we are entering a
lot of commands (e.g. auto-generated).

px4_daemon: add a threadsafe map and use it

px4_daemon: whitespace

px4_daemon: fix client parsing

Sometimes the client ends up reading more than one packet in one read.
The parsing is not made for this and would require a (ring)buffer for
it.

The solution of this commit just reads as much as needed from the pipe
which avoids having to do buffering and parsing.

posix: changes sitl_run.sh and main.cpp cleanup

This changes the paths in sitl_run.sh quite a bit to allow the px4
binary to run in the rootfs directory which should make it convenient
and very close to the NuttX variant.

Also main.cpp got a big cleanup after the big rebase with some
conflicts. Quite some functionality was removed but it has yet to be
seen if it needs to be re-added.

px4_log: cleanup log levels, now they make sense

Before DEBUG and INFO log levels where inverted which didn't make much
sense in my eyes.

dataman: fix path for bash shell

logger: fix paths for bash shell

mavlink: fix paths for bash shell

param: fix path for bash shell

inav: fix paths for bash shell

sdlog2: fix paths for bash shell

ROMFS: add forgotten mixer to list

SITL init: more models, more options

- Support for different models using the unified startup
script rcS.
- Support to choose the estimator by setting the environment variable
  PX4_ESTIMATOR.
- Support to choose the logger by setting the environment variable
  PX4_LOGGER.

rcS: fix string comparison

listener: use template file

Instead of having all of the C++ code inside the Python file it is
nicer to have a separate template file with the C++ headers, etc.

px4_log: add PX4_INFO_RAW for raw printfs

This allows to do custom formatting but is still transported over
sockets to clients.

topic_listener: use PX4_INFO_RAW instead of printf

commander: use PX4_INFO_RAW for status

listener: rewrite to classes and factory

posix: fix some argument warnings

generate_listener.py: by accident changed shebang

listener: big refactor of the generator

Hopefully this makes it easier to read and change in the future.

rcS: manually take over rebase changes

listener: remove leftover try

listener: properly clean up topic instance

rcS: take over some vehicle specific changes

posix-configs: vehicle specifics to separate files

posix-configs: remove leftover lines

uORBDevices: new PX4_INFO_RAW instead of printf

px4_log: just use printf on NuttX

listener: use less binary space, strip on NuttX

generate_listener.py: remove commented code

cmake: fix syntax error from merge

px4_daemon: fixes after rebase of apps.h/cpp fix

px4_daemon: namespace missing

posix: only create stub for fsync on QURT

unitests: reduce dependencies of param test

This makes the unit test compile and link again after the bash changes.

QURT: some compile fixes after a rebase

SITL: arg change for sitl_run.sh to use rcS_test

This allows to use a custom startup file for testing.

SITL: add the folder test_data

SITL: implement shutdown command as systemcmd

The shutdown command needs to be a proper systemcmd, otherwise the alias
and symlink generation doesn't work and we end up calling shutdown of
the host computer which is to be avoided.

px4fmu_test: same IO_pass mixer as px4fmu_default

px4fmu_test: use normal quad x mixer

There is no good reason to use a specific test mixer, except more cmake
code around it. Therefore just use the same mixer as default, and at
some point px4fmu_test and px4fmu_default can get merged

POSIX: cleanup, dir and symlink fixes

This cleans up the logic behind the symlinking and creating directories.

POSIX: correct arg order in usage info

tests: fix paths for SITL tests

POSIX: printf fix

sitl_run.sh: try to make this run on Mac as well

cmake: try to make jenkins happier

Path cleanup, the bin is no longer in src/firmware

POSIX: fix symlink logic

SITL: prefix all exported env variables

cmake: fix path for ROS tests

integrationtests: fix log path

launch: try to make tets with ROS working again

px4_defines: fix after wrong merge deconflicting

px4_defines: get paths for POSIX correct

cmake: fix cmake arguments

This was fine with cmake 3.6 but did not work with cmake 3.2.2

cmake: use cp instead of cmake -E copy

cmake -E copy does not support copying multiple files with versions <
3.5. Therefore, just use cp for now.

ROMFS: fix build error after rebase

cmake: fix paths in configs

launch: use `spawn_model` again

cmake: various fixes after big rebase

param: path fixes after rebase

posix platform: fixes after rebase

test_mixer: fix screwed up rebase
2018-08-08 21:09:39 +02:00
Daniel Agar 9551dcb497 logger increase log_writer_file stack 1072 -> 1150 2018-08-07 17:21:15 +02:00