Commit Graph

206 Commits

Author SHA1 Message Date
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
Paul Riseborough fc65939f0e ekf2: Add support for use of multiple GPS receivers (#9765) 2018-07-22 12:18:30 -04:00
Dennis Mannhart 0f4be12646 msg: first draft of vehicle_constraints message 2018-07-20 09:26:18 +02:00
Martina e7cf2c5675 remove unused trajectory_bezier message 2018-07-12 16:36:11 -04:00
Martina c15f2e45d6 add vehicle_trajectory_waypoint message 2018-07-12 16:36:11 -04:00
Martina e59a29197e replace obstacle_avoidance message with trajectory_waypoint and trajectory_bezier 2018-07-12 16:36:11 -04:00
ChristophTobler 82e0547f6e add first draft of the avoidance msg 2018-07-12 16:36:11 -04:00
acfloria d8cf012641 IridiumSBD: Add iridiumsbd_status uorb message 2018-05-27 12:11:35 -04:00
Mohammed Kabir 8d6e209888 msg : add ping message 2018-05-15 18:57:34 +02:00
Mohammed Kabir 39bb65ffd7 mavlink : add advanced timesync algorithm 2018-05-03 09:59:16 +02: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
Daniel Agar 3b5b12e1d1 move baro and magnetometer data out of sensor_combined 2018-04-11 23:26:58 -04:00
Daniel Agar 416feea9e4 uORB print_message cleanup
- indent field print with tabs instead of spaces
 - print a newline before printing a nested field
 - cmake add generator dependencies
2018-03-28 09:15:41 -04:00
Daniel Agar 3db17a04fc uORB generate message print functions 2018-03-28 09:15:41 -04:00
Karl Schwabe 2a5a7b3a1e Adds ability to have out-of-tree uORB message definitions
If the EXTERNAL_MODULES_LOCATION variable has been set, and the
EXTERNAL_MODULES_LOCATION/msg/ directory exists containing a
CMakeLists.txt file with the following format:
    set(config_msg_list_external
      message1.msg
      message2.msg
      message3.msg
      ...
      PARENT_SCOPE
      )
then the messages defined in config_msg_list_external are added to the
msg_files list in Firmware/msg/CMakeLists.txt and are used to generate uORB
message headers. The generate uORB message headers are generated in the same
location as the normal uORB message headers in the build directory, namely,
<build_dir>/uORB/topics. The uORB topic sources are generated in
<build_dir>/msg/topics_sources.
2018-03-14 10:01:43 +01:00
Martina 883fb8ce57 CMakeLists: add obstacle_distance message 2018-02-16 19:59:31 +01:00
Simone Guscetti e139446d09 msg: add new tune_control messege 2018-01-29 09:45:59 -05:00
Andreas Antener 98441ac100 Log rate controller integrators (FW + MC) 2018-01-29 09:10:56 -05:00
Nicolas de Palezieux 8c0542bdb8 msgs : add support for precision landing 2018-01-15 10:27:23 +01:00
Daniel Agar b8e24b5d2f uORB delete unused vehicle_force_setpoint 2017-11-26 16:39:30 -05:00
Daniel Agar d3c87c77d2 uORB delete unused pwm_output 2017-11-26 16:39:30 -05:00
Daniel Agar 6ca86c3608 uORB delete unused filtered_bottom_flow 2017-11-26 16:39:30 -05:00
Daniel Agar ae42923025 uORB msg delete unused hil_sensor 2017-11-24 19:46:33 -05:00
Daniel Agar d83073f016 move RTPS to dedicated px4fmu-v{3,4,4pro,5}, posix, sdflight builds (#8113) 2017-10-17 16:29:55 -04:00
Daniel Agar 651df03f76 RTPS and micro-CDR build system cleanup (#8084) 2017-10-11 13:05:44 -04:00
Daniel Agar 48f1e3ed1c uORB generation move to msg/ 2017-09-29 10:13:51 -04:00
Daniel Agar b4755297ec delete control_state and cleanup vehicle_attitude (#7882) 2017-09-21 16:24:53 -04:00
Daniel Agar 3498fe0c6f delete sdlog2 EKF2 replay (#7982) 2017-09-19 10:20:41 -04:00
Julien Lecoeur 12353f4da7 Add support for mavlink message DEBUG_VECT 2017-08-30 14:45:02 +01:00
Julien Lecoeur eeb966d375 Add support for mavlink message DEBUG 2017-08-30 14:45:02 +01:00
Beat Küng 3d3e6428c2 msg/geofence_update.msg: remove this topic
We'll use dataman to check for geofence data updates.
2017-08-04 18:08:51 +02:00
Beat Küng 82716012bd geofence_update.msg: notify navigator on geofence update 2017-08-04 18:08:51 +02:00
Beat Küng 52ca49c682 geofence: remove fence & fence_vertex messages
- this was never read
- it was implemented wrong, leading to memory access violations in
  publishFence (an integer was passed instead of the fence_s struct)
2017-08-04 18:08:51 +02:00
Beat Küng 2815c62acf fix power button shutdown: use an orb topic instead of a work queue call
px4_shutdown_request() was called from the power button IRQ callback, which
invoked a work queue callback. But on NuttX, the work queue uses a
semaphore, and thus it cannot be called from IRQ context.
This patch switches to publishing an uORB msg instead, which is handled in
the commander main thread.

To increase failure resistance, we could subscribe to the same topic in
another module for redundancy, in case commander runs wild.
2017-07-29 23:10:47 +02:00
Daniel Agar f947205cbe delete vehicle_global_velocity_setpoint 2017-06-26 11:31:25 -04:00
Mohammed Kabir de19af456d msg : add camera feedback message 2017-05-12 22:11:17 +02:00
Paul Riseborough 3d3e04cb48 msg: create uORB topic for sensor selection data 2017-05-03 08:37:14 +02:00
Daniel Agar c5e0bf1c2f uORB combine VTOL FW and MC virtual topics (#7008) 2017-04-09 13:17:20 -04:00
Beat Küng 43b98d9a2f lib/led: add led class with led_control uorb topic
This is the new interface to control external LED's (user-facing).
Features:
- Supports maximum N Leds (where the board can define N)
- on/off/blink M times
- Different priorities
- Allows setting a single led or multiple at once
2017-03-12 00:08:35 +01:00
Beat Küng df3ef3660b ekf2_timestamps.msg: add new message with ekf2 timestamps 2017-03-04 22:47:54 +08:00
Kabir Mohammed f8775306d3 Remove deprecated vision_position_estimate topic 2017-02-15 21:48:33 +01:00
Simone Guscetti 2c2addad53 Add new message vehicle_status_flags for the commander status_flags 2017-02-04 21:13:59 +01:00
Beat Küng 5c2fa034da load_mon: rename low_stack -> task_stack_info & always publish it
- use uorb queue to not drop any info, only do 2 tasks per cycle
- also print a warning on low stack (which will be added to ulog)

this allows to gather statistics of each task's stack usage over time.
2017-02-04 12:15:59 +01:00
Paul Riseborough 9599f58c5d msg: add uORB topic for IMU sensor corrections 2017-01-19 19:24:52 +01:00
mazahner 06d28b2635 Rework Includes during the uorb message generation
each CMakeFile that generates parameters should add its path to the msg_include_path
which will then be handled in the px_generate_uorb_topic_files.py
2017-01-14 10:07:12 -08:00
Andreas Antener 62103be7ba Load monitor: report and log processes low on stack 2016-12-09 21:12:12 +01:00
Julian Oes 0109f6f549 update mavlink to master, rename MOUNT_STATUS
The mavlink message MOUNT_STATUS has been renamed to MOUNT_ORIENTATION.

This changes the Firmware code accordingly.
2016-11-28 21:01:22 +01:00
Paul Riseborough c07f7b5659 msg: Add topic for pre-flight sensor checks 2016-11-19 15:12:08 +01:00
Andreas Antener dd8d178168 MAVLink Streams: added collision stream 2016-11-19 14:46:20 +01:00
Julian Oes 7e312f3961 msg: Added message for mount status 2016-11-09 10:23:34 +01:00
Beat Küng b7d07d77d6 msg files: add ulog_stream & ulog_stream_ack 2016-10-19 13:13:47 +02:00
Leon faebdeedcf vmount: add mount and ROI implementation
MavLink spec implementation

implemented vehicle_roi topic

rename old gimbal to rc_gimbal

little changes

corrected RC Gimbal group

Starting ROI implementation in commander

implementation done, needs to be tested

uhm..

add todo

Change to float32 for x,y and z

remove mission topic again, not needed

change roi coordinates to lat, lon and alt

adjust to float64

starting mount implementation

correcting small mistakes, compiles now

add todos

further progress

implementing parameters

adjust default parameters

started implementation of mavlink

fix typo

change to lat, lon and alt

fix typo :D

change to double (to represent float64)

add global_position_

add mount topic

commander mount implementation done

cleanup

almost finished

little fix

codestyle fixes

leave pitch at 0 degrees

added pitch calculation

codestyle changes

Undo vehicle_mount, react to updated parameters, parsing of CMD_DO_MOUNT_* in mount.cpp

start implementing mode override

forgot a semikolon.

add debug

Finish implementation of mount override and manual control.

fix codestyle

correct cleanup

rename to vmount

works now

fix rebase error

fix polling

refactoring and custom airframe for gimbal

couple changes

remove warnx

almost done

finally

What is going on?

change back to actuator_controls_2

working

bump parameter version number and some clarification

fix submodules
2016-09-06 11:33:18 +02:00
Beat Küng df53fb0fde logging: publish a message for PX4_{WARN,ERR} & store them to the ulog file
- ulog file message rate limited to 50Hz
- queuing with size 2
- this replaces the mavlink log message in the ulog
  (but the mavlink warnings & errors still go to the ulog)
2016-08-24 21:24:35 +02:00
Beat Küng ee58f0d11d encoders.msg: remove this topic, it's never published (#5074) 2016-07-15 14:59:52 -07:00
Beat Küng 09ecc84cc7 gps file dump: re-implement with an uORB topic & write to the log file (#4987)
Drawbacks of the previous method: when writing to the SD card, there are
high delays in the write() call of several 100ms, every now and then. The
frequency and length of these events depend on:
- SD card
- used logger bandwidth
- bandwidth of gps data (RTCM)
Since the whole gps thread was blocked during this period, it lead to
gps timeouts and lost module.

What we do now is: publish an orb topic with queuing. This makes it async
and the logger takes care of buffering. This means it's best to:
- use high logger rate
- use large logger buffer
- reduce logger bandwith by disabling unused topics
2016-07-06 09:32:37 +02:00
Beat Küng 7f65e01d07 cmake: avoid GLOB for *.msg files and use an explicit .msg file enumeration
This makes sure that adding & removing of .msg files is handled properly
by the build system.
2016-05-17 09:08:13 +02:00