Single udp socket
Only create one socket for sending and receiving, instead of two where you use one only to send and the other only to receive.
There should be no reason/need to create two separate ones...
Also add udp_socket.[ch] to make it easier to use only the UDP sockets without the UART like mcu_periph/udp interface around it.
Provides the functions:
- udp_socket_create
- udp_socket_send
- udp_socket_recv
- udp_socket_recv_dontwait
GPS accuracy speech less verbose
Addresses #1046
GPS accuracy is considered ok if better than 10m, very bad if worse than 20m and simply low in between.
Now only if the accuracy falls into a different range than previously reported.
Since using SIGALRM to call the sys_tick_handler (via setitimer) can cause problems like interrupting some other syscalls
(i.e. read,write, ioctl), setup a separate thread and use timer_fd instead.
That is a Linux-specific set of functions that presents POSIX timers as file descriptors rather than signals.
If the thread runs with a normal priority it can happen that some timer events are missed (and hence sys_time not updated in time).
So added a function to set a higher prio for that thread (needs root rights or properly set up limits for the user).
In some simple tests no events were missed when running with prio 29 via SCHED_FIFO, even if events would be missed,
the sys_tick_handler is called the appropriate number of times (so that the time is correct again after)...
After these changes also fix some bugs discovered in the ardrone navdata reading.
Reading is now done in a separate thread which waits on a condition variable until the navdata_update event loop has copied the buffer.
[conf] remove AHRS_x_FREQUENCY defaults from imu/ahrs makefiles
As the dt is calculated from the actual timestamps by default now, and it doesn't really make that much sense to have global flags for the frequencies, simply remove the defaults....
add $(PAPARAZZI_SRC)/sw/simulator to VPATH, so that makes adds that to the search path.
This makes it possible to add NPS sources as nps/foo.c to $(TARGET).srcs,
and the object and dependency files will correctly be put into $(PAPARAZZI_HOME)/var/aircrafts/<ac>/nps/<src file>
So e.g. /home/<user>/paparazzi/var/aircrafts/Quad_LisaM_2/nps/nps/nps_main.o
While here, also generate the .d dependency files during the compilation run instead of a separate run.
fixes#798
AHRS API/Interface refactor
- each AHRS implementation has it's own function names, to basically make it possible to run multiple at the same time
- input data passed as pointer arguments
- wrappers that subscribe to ABI messages (gyro, accel, mag) which call the actual implementation
- makes it easier to run the actual algorithm e.g. for testing without ABI
- body_to_imu quaternion is also set via ABI
- IMU measurements are published via ABI from the gyro/accel/mag callbacks from main for now
- each ahrs implementation has an `is_aligned` bool for now...
- MLKF: function to only update heading from mag (default now, define AHRS_MAG_UPDATE_ALL_AXES to update all axes as previously)
Merging now as it is already useful.
Still TODO:
- publish GPS via ABI as well (and get rid of global ahrs_update_gps)
- update all IMU implementations to publish ABI messages directly
- pimp or get rid of ahrs_register_impl (to actually handle multiple AHRS at the same time)