2766 Commits

Author SHA1 Message Date
Lorenz Meier
76082da674 Add IST8310 driver 2016-11-03 15:38:28 +01:00
Lucas De Marchi
c5100b6273 tap_esc: fix output order for quadrotor 2016-11-03 15:38:09 +01:00
mantelt
8b237d7cf3 navio_sysfs_pwm_out: Adressing comments of @bkueng
(https://github.com/PX4/Firmware/pull/5704#pullrequestreview-6977559)
2016-11-03 12:37:41 +01:00
mantelt
10491884ca navio_sysfs_pwm_out: command line argument for mixerfile 2016-11-03 09:38:38 +01:00
mantelt
32403ddb90 navio_sysfs_pwm_out: removing default mixer 2016-11-03 08:59:58 +01:00
mantelt
4b8fc2365e navio_sysfs_pwm_out: Use mixer file
use all actuator groups for mixing.
2016-11-02 17:45:30 +01:00
mantelt
4c0c526898 Loading mixer from (hardcoded) file
use actuator_controls_3 for the time being
2016-11-02 17:45:30 +01:00
Henry Zhang
278124bfb8 MindPX: Code clean up. 2016-10-29 10:56:32 +02:00
Henry Zhang
b280e28623 MindPX: Remove hardcode for sensors rotation. 2016-10-29 10:56:32 +02:00
Henry Zhang
f17dc2f2a6 MindPX: Code style and clean up. 2016-10-29 10:56:32 +02:00
Henry Zhang
d6ed416d29 MindPX: Update spi bus and sensors io config. 2016-10-29 10:56:32 +02:00
Henry Zhang
cabcc39816 MindPX: Expand to maximum 8 PWM outputs. 2016-10-29 10:56:32 +02:00
Henry Zhang
53b4996379 MindPX: Use TIM14 CH1 for tone alarm output. 2016-10-29 10:56:32 +02:00
Henry Zhang
b76c8cd80c MindPX: Use i2c rgbled. 2016-10-29 10:56:32 +02:00
Henry Zhang
016aa47dfc MindPX: Enable FrkSky telemetry on usart8/ttys6. 2016-10-29 10:56:32 +02:00
Henry Zhang
2b23835d56 MindPX: Support RSSI. 2016-10-29 10:56:32 +02:00
Henry Zhang
d8ac044414 MindPX: Support serial RC input. 2016-10-29 10:56:32 +02:00
Carlo Wood
90f3e3b5d3 Do not include headers inside __BEGIN_DECLS ... __END_DECLS blocks.
We don't have C++ unsafe headers (anymore).

I added a test to fix_headers.sh that checks if certain "unsafe"
headers are ONLY included inside a __BEGIN_DECLS ... __END_DECLS
(because after all, they are unsafe), as well as checking that
no other header files are included inside such a block. The rationale
of the latter is that if a file is a C header and it declares
function prototypes (otherwise it doesn't matter) and is sometimes
included outside a __BEGIN_DECLS ... __END_DECLS block (from a C++
source file) then it has to be C++ safe and doesn't ever to be
included from inside such a block; while if a file is a C++ header
then obviously it should never be included from such a block.

fix_headers.sh subsequently found several safe headers to be
included from inside such a block, and those that were (apparently
in the past) unsafe were included only sometimes inside such a
block and often outside it. I had a look at those files and saw
that at least an attempt has been made to make them C++ safe,
but especially because they already are included OFTEN outside
a __BEGIN_DECLS ... __END_DECLS (from C++ source files) the
best decision seems to treat them as safe.

This is not risky: .c files that define such functions still
generate C-linkage for their functions. If a C++ unsafe C header
is included outside a __BEGIN_DECLS ... __END_DECLS block then
the only possible result would be an undefined reference to
a function with C++-linkage that will not exist. Aka, when
something links after this commit, then the commit was correct.
I did build all targets and they all linked.
2016-10-28 11:57:08 +02:00
Carlo Wood
baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Beat Küng
a2c493efc7 fix vmount: initialize manual control for mavlink inputs 2016-10-26 08:40:23 +02:00
Mark Whitehorn
4cc97aa705 fix another bug in fmu mode 2016-10-24 18:22:18 +02:00
Lorenz Meier
3bed398a1e FMU: scan longer 2016-10-23 19:58:52 +02:00
Beat Küng
9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00
Beat Küng
03c12c4c78 Device: use uint16_t for _open_count instead of int (save space) 2016-10-23 15:25:20 +02:00
Beat Küng
a5e6f3213f Device: remove _irq_attached flag, test with _irq == 0 instead 2016-10-23 15:25:20 +02:00
David Sidrane
a2ad92b2d7 Bugfix: Hard Fault hmc5883 with not params
Fault results from if (!strcmp(verb, "start")) {``` with null verb
2016-10-22 11:54:38 +02:00
David Sidrane
bdfb2bbb8d Fixed hardfault on fast proc
_baro_topic can be null in init sequence
   init call collect before the topic is inited.

I think this pattern is repeated in other drivers. I would suggest
allowing null in orb_publish to just return.
2016-10-22 11:43:22 +02:00
Siddharth Bharat Purohit
b75ff417ea fmu: fix typo introduced in 78b0d1a which adds PWM1 mode 2016-10-22 08:37:13 +02:00
Carlo Wood
6fc30c76a6 Clean up of app.h
app.h, generated from app.h_in, has unnecessary code duplication
and isn't a header file (it defines globals, static functions
and doesn't have a header guard, moreover, it has a 'using namespace
std;'). Because of this, a real headerfile that declares the stuff
defined in apps.h was missing leading to even more code duplication:
scattered forward declarations in .cpp files and an often repeated
type of std::map<std::string, px4_main_t>.

This patch moves cmake/qurt/apps.h_in to src/platforms/apps.cpp.in
(with some changes) and removes cmake/posix/apps.h_in.
Then src/platforms/apps.cpp.in is split into src/platforms/apps.cpp.in
and src/platforms/apps.h.in, splitting declarations from definitions.

A typedef is defined for the map (apps_map_type).

The main difference between cmake/posix/apps.h_in and
cmake/qurt/apps.h_in was that the first defined a global 'apps',
while qurt stores the apps in QShell. I opted to get rid of
the global variable (which are in general evil for various reasons)
and used the API of cmake/qurt/apps.h_in where a provided 'apps'
map is initialized with a call to init_app_map. Thus removing
the existing code duplication.
2016-10-22 08:31:14 +02:00
Julian Oes
78b0d1a01f tap: add landing gear capability
This configures the PWM output for the landing gear.
2016-10-20 23:17:05 +02:00
Beat Küng
10c4ec2e1a update gps submodule 2016-10-20 21:12:11 +02:00
Lorenz Meier
7b2898eaee Fix merge collision 2016-10-19 18:29:34 +02:00
Lorenz Meier
3f5f74399e Increased SBUS buffer size for more reliable SBUS and DSM parsing 2016-10-19 15:32:30 +02:00
Julian Oes
af5d2c488c st24: fix RC lost detection based on error count
The packet_count was actually an error_count, therefore we should
process RC input only when the error_count since the last packet is 0.

Also, this commit fixes the RSSI scaling for st24.
2016-10-19 09:22:57 +02:00
Lorenz Meier
ffe4c77dc9 vmount: Params do not need to be built 2016-10-18 20:50:09 +02:00
Carlo Wood
2c23aa4348 Avoid compile error for posix_rpi_common/native.
Fixes,
error: ignoring return value of ‘ssize_t write(int, const void*,
size_t)’, declared with attribute warn_unused_result
[-Werror=unused-result]
2016-10-18 20:47:59 +02:00
Roman
3faaeb06d1 attitude setpoint topic: cleanup of matrix class usage
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
Lorenz Meier
873ed17b14 VMount: Do not rely on euler angles 2016-10-18 20:46:08 +02:00
tumbili
5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
mantelt
8bbc1b8472 navio_sysfs_rc_in: Fixing logical expression
navio_sysfs_rc_in stop works now.
2016-10-14 15:38:36 +02:00
Daniel Agar
2771b92dc0 px4fmu trivial style fix 2016-10-09 23:47:09 -04:00
Lorenz Meier
ed62957474 Increase RC buffer size 2016-10-08 17:18:06 +02:00
Lorenz Meier
4cfd84b56a FMU driver: Ensure correct binding pulses for Spektrum, time out any receiver which has more than one second no signal. 2016-10-08 16:56:04 +02:00
Mark Whitehorn
a56d50599d subscribe to vehicle_command topic and implement RX_PAIR command
add spektrum satellite bind command to fmu

open fmu file descriptor to issue ioctl
2016-10-08 16:19:45 +02:00
David Sidrane
248cd45503 Added missig can_devinit prototype
The Nuttx CAN driver is not used with UAVCAN. However to
facilitate compilation to allow the Nuttx CAN Example to be
compiled and linked, the missing proto type was needed.

Futhermore to include the NuttX CAN eaxample the following changes
are needed:

1 ) In cmake/configs/<target>.cmake
Add can to config_extra_builtin_cmds as:

set(config_extra_builtin_cmds
        serdis
        sercon
        can
        )

Add:
add_custom_target(can)
set_target_properties(can PROPERTIES
       PRIORITY "SCHED_PRIORITY_DEFAULT"
       MAIN "can" STACK_MAIN "2048"
       COMPILE_FLAGS "-Os")

2) Update the nuttx-configs/<target>/nsh/defconfig

Run make oldconfig and make menuconfig and set the follwoing:
CONFIG_CAN=y
CONFIG_STM32_CAN1=y or CONFIG_STM32_CAN2=y
CONFIG_CAN_EXTID=y
CONFIG_CAN1_BAUD=250000
CONFIG_CAN_FIFOSIZE=8
CONFIG_CAN_NPENDINGRTR=4
CONFIG_EXAMPLES_CAN=y
2016-10-06 19:02:51 +02:00
Gene
5cd85b98c2 Fixed app args buffer overrun in qurt px4_layer main.cpp and qshell.cpp 2016-10-06 11:06:57 +02:00
Beat Küng
bad107a374 navio_sysfs_pwm_out: avoid dynamic memory allocation & fix a memory leak
memory leak was in send_outputs_pwm()
2016-10-06 09:01:25 +02:00
Beat Küng
b864983c5e navio_sysfs_rc_in: avoid dynamic memory allocation for path 2016-10-06 09:01:25 +02:00
Beat Küng
a42f0f5a62 gps: fix code style 2016-10-06 09:00:09 +02:00
Beat Küng
6d0288d494 gps: update submodule 2016-10-06 09:00:09 +02:00