Commit Graph

1198 Commits

Author SHA1 Message Date
Beat Küng fe924334c2 px4_cli: add px4_get_parameter_value CLI helper method 2018-09-25 07:53:29 +02:00
Beat Küng 4e6139d9fb Posix: add '#pragma GCC poison exit'
Generally exit() should not be used on Posix, because it exits the whole
program instead of only the task.
2018-08-31 18:11:58 +02:00
Beat Küng fe502ffd33 fix tone_alarm: avoid using exit()
On POSIX it exits the process.
2018-08-31 18:11:58 +02:00
David Sidrane a063de093a posix:tonealrmsim: use workqueue 2018-08-30 19:11:17 +02:00
David Sidrane 250c561963 posix simulated tone_alarm: Use tune_control
Refactor to use the tune_control interface
2018-08-30 19:11:17 +02:00
mcsauder bf87270ded Doxy documenting in send_event.cpp/h and px4_module.h. 2018-08-29 09:50:21 +02:00
Daniel Agar dbf2d25e2f uORB move to standalone CDev
- uORB topics should not be Devices with bus, address, device id
2018-08-27 13:14:15 -04:00
mcsauder de92e699bf Doxy documentation work in px4_module_params.h and px4_module.h. 2018-08-24 23:07:01 +02:00
Beat Küng 22b47a84f5 px4_log.c: fix cygwin include 2018-08-08 21:09:39 +02:00
Beat Küng b306935de0 module base: use PX4_INFO_RAW instead of printf 2018-08-08 21:09:39 +02:00
Beat Küng 7359f44835 fix px4_log.c: avoid potential buffer overflow
The buffer length given to snprintf() is unsigned, so we must check for
an overflow after each call.

This happend for very long printf's (module documentation)
2018-08-08 21:09:39 +02:00
Beat Küng c0cac0594e file paths: add PX4_STORAGEDIR & use it where appropriate 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
Bob-F adf411fdd8 Fixed style issue with Astyle 3.1 2018-08-06 13:32:36 +02:00
Bob-F 2ece14bad1 Port PX4 to BeagleBone Blue Board using library librobotcontrol instead of a submodule 2018-08-06 13:32:36 +02:00
Daniel Agar cc96e5ec5e sensor messages remove unused fields and improve comments 2018-07-29 21:04:21 +02:00
Matthias Grob 152c6db212 Fix logger signed unsigned error with GCC 7.3 in Cygwin (#10009) 2018-07-24 17:39:45 -04:00
Dennis Mannhart 6d716f2d26 px4_module_params: make updateParams virtual 2018-07-20 09:26:18 +02:00
Philipp Oettershagen da2fbf60b5 distance sensors: Improve variable naming / description 2018-07-16 21:59:04 +10:00
Philipp Oettershagen 35bde5c9fc LL40LS: Implement driver-specific filtering based on the datasheet and experiments 2018-07-16 21:59:04 +10:00
Beat Küng 5e3e486527 px4_posix.h: avoid defining PX4_F_RDONLY as O_RDONLY
- There is an assumption un uORB that PX4_F_RDONLY is not 0.
- But O_RDONLY is 0 on Linux. orb_exists passes 0 to px4_open, which in
  uORB::DeviceNode::open leads to an unnecessary allocation of
  SubscriberData()
- PX4_F_RDONLY is only used in combination with px4_open, never with open()

However even if it was wrong/unexpected, it did not cause any problems,
just the unnecessary allocation.
2018-07-13 11:30:23 +02:00
Bram Strack van Schijndel 05fc506a56 [df_ms5607_wrapper] convert to mbar, fix error_count, device_id 2018-07-05 08:07:54 +02:00
Daniel Agar 9ce83f2208 fix all sign-compare warnings 2018-07-01 09:36:55 +00:00
Beat Küng 6a7751496b df_ms5611_wrapper: fix initialization of error_count & device_id 2018-06-20 08:28:33 +02:00
Daniel Agar d73d20bcce systemlib delete unused systemlib.h 2018-06-12 09:06:30 +02:00
Daniel Agar d0bde9ab2a replace geo _wrap_pi with matrix::wrap_pi 2018-06-12 09:00:52 +02:00
Philipp Oettershagen 6f1f414b49 Subsystem_info status flags & checks : Initial commit, updating the health flags in a centralized way mostly in commander and the votedSensorsUpdate function. 2018-06-06 18:54:24 +02:00
Beat Küng d1a7a367ac fix px4_getopt: add argc check for options that take an argument
Fixes the following corner case:
mpu9250 start -R
This would return a valid result (myoptind < argc), but myoptind pointed
to a NULL argument (and thus mpu9250 would crash).
With this patch, px4_getopt will return '?', indicating a parser error.
2018-06-04 16:33:55 +02:00
Roman 835275f1a4 df_mpu9250_wrapper: publish imu based on integrator dt, not fixed count
Signed-off-by: Roman <bapstroman@gmail.com>
2018-05-23 10:08:28 -04:00
Roman f3c12bc7c7 DfBmp280Wrapper: initialise baro report
Signed-off-by: Roman <bapstroman@gmail.com>
2018-05-23 10:08:28 -04:00
Daniel Agar 4e32cb17df clang-tidy modernize-use-equals-default 2018-05-18 22:48:55 +02:00
Beat Küng 13ab5ed0d0 px4_main_t: fix method declaration throughout the code base
px4_main_t is defined as:
typedef int (*px4_main_t)(int argc, char *argv[]);
which matches with the definition in NuttX, given to task_create
2018-05-09 07:59:46 +02:00
Daniel Agar 8404889098 delete unused ADCSIM
- set BOARD_NUMBER_BRICKS to 0 for boards without analog power bricks
2018-04-29 21:48:54 -04:00
Daniel Agar ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Roman 4be4b9810e mpu9250 wrapper: support updating gyro & accel cutoff via parameter
- useful for tuning snapdragon flight

Signed-off-by: Roman <bapstroman@gmail.com>
2018-04-20 11:53:31 -04:00
Daniel Agar d75fd72c02 stop manually defining physical constants 2018-04-19 07:24:58 +02:00
Beat Küng e46e6f99f3 module template: move documentation to a new category 'template' (#9324) 2018-04-18 08:53:52 -04:00
Daniel Agar 3b5b12e1d1 move baro and magnetometer data out of sensor_combined 2018-04-11 23:26:58 -04:00
Daniel Agar 5dc23def2a move pressure altitude from baros to sensors module 2018-04-11 23:26:58 -04:00
Beat Küng b97d432844 px4_param.h: add override to _DEFINE_PARAMETER_UPDATE_METHOD_CUSTOM_PARENT 2018-04-11 07:47:06 +02:00
Daniel Agar 5fba1f38b2 drivers start using uORB message print instead of custom 2018-03-28 09:15:41 -04:00
Daniel Agar 29b3950747 move geo and geo_lookup to PX4/ecl 2018-03-26 23:16:55 -04:00
Daniel Agar 19a4f0988c gyrosim fix transfer hardcoded buffer index
- fixes coverity CID 196758
2018-03-24 13:39:31 -04:00
Beat Küng e32d8ea8b6 ModuleParams: add setParent() method 2018-03-22 08:19:08 +01:00
Daniel Agar 1b174eeca2 drivers replace math::Vector<3> with matrix::Vector3f 2018-03-21 13:48:45 -04:00
Simone Guscetti 217a67f956 px4_micro_hal: Add up_internal for stm32f7 builds
This is included in other stm32 architectures in the stm32.h file.
2018-03-19 09:46:58 +01:00
Beat Küng eb33145ac8 px4_param.h: add ParamExtFloat & ParamExtInt (required by ekf2) 2018-03-13 17:35:15 +01:00
Beat Küng 0d26aeafe2 px4_parameter.h: remove this file - it's not used anymore 2018-03-13 17:35:15 +01:00
Beat Küng fca99cf775 param: refactor BlockParam classes
- make the selected parameter a template argument. This
  enables type-checking at compile-time.
- move things to src/platforms.
  This provides consistent includes with ModuleBase
- add ModuleParams base class (replaces Block & SuperBlock)
- drop the Block* prefix from the class names
2018-03-13 17:35:15 +01:00
Daniel Agar 2ff81393bc move posix, nuttx, qurt components into platforms 2018-01-31 17:17:07 +01:00