- this is one of the last pieces of the system that still depend on DriverFramework
- add new SIM_GPS_NOISE_X parameter for optionally increasing the GPS noise multiplier (was previously a gpssim command line option)
- add SIM_x_BLOCK parameters to block sensor publication
- SIM_GPS_BLOCK
- SIM_ACCEL_BLOCK
- SIM_GYRO_BLOCK
- SIM_MAG_BLOCK
- SIM_BARO_BLOCK
- SIM_DPRES_BLOCK
- deprecate DriverFramework bmp280 driver (df_bmp280_wrapper)
- update beaglebone blue and snapdragon flight eagle boards to use in tree bmp280
- update posix (really just linux) and qurt I2C wrappers
- tested on beaglebone blue
Unfortunately this commit contains two things:
1. Some cleanup and renaiming.
2. An additional wait until lockstep has been initialized.
By waiting until HIL_SENSOR messages arrive including timestamps we
stop the startup script and prevent other modules from running until
time is set up. This should resolve some busy waiting by various
modules and prevent races on initialization (e.g. the landing state
being subscribed by mavlink before being published by the land
detector).
The previous boot configuration took at minimum one second to boot. This is in particular significant in tests when the system is often started and stopped
and remove the px4_ prefix, except for px4_config.h.
command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done
Transitional headers for submodules are added (px4_{defines,log,time}.h)
It turns out that `sendto` does not work for TCP on Cygwin-Windows,
instead we need to use `send`. This required some refactoring since we
need to have the internet protocol and the port stored as a member
variable.
This should fix that lockstep SITL simulation was not working on
Windows.
This adds the option to connect over UDP or TCP for mavlink to the
SITL simulator.
Also, this includes a bunch of general cleanup and refactoring of the
simulator interface code. For instance sending of mavlink messages was
put into separate functions and unneccessary comments were removed.
Also, this now sets the timestamp sent by the SITL simulator in the
HIL_SENSOR message in order to enable lockstep.
Removed the re-definitions of the usage method in the posix/main.cpp file.
Added qurt_external_hook interface to call externally linked module.
Fixed code format to comply with PX4 style.
Added usage information to main app and handled cases for unknown arguments.
Fixed the orb_priority interface to use int32_t instead of int.
Fixes to get hil working with led changes.
Added the config_eagle_adsp.mk file and update the make files to to use new
include/lib paths
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The simulator was changed to publish the sensor data that is read
by the sensors module when the -p flag is passed.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Since the PX4 code uses both px4_task and pthread APIs,
px4_getpid() must be save to call from either context.
On posix, this means we have to always return the pthread ID.
Reverted simulator change of pthread to px4_task
There may have been side effects if this was build for a target that
has process/task scoped file descriptors. It is now safe to call
px4_getpid() from this pthread context with this change for the
posix build for px4_getpid().
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The simulator was using pthread APIs directly so calls to px4_getpid()
would fail since the task ID was not known. Changed simulator to use
px4_task_spawn_cmd.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
- wait for first message from jMAVSim
before sending data
- publish raw rc data coming from PIXHAWK (temporary)
- send some interesting messages to jMAVSim
- prepare sensor data for sim drivers to read
Gyrosim would call measure continuously because the write_checked_reg
was failing. There is no need to check faked reg writes in the
simulator so that code was removed.
The delay that was added to the simulator to pace the gyrosim reads
was also removed now that the source of the problem was determined.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
There were an insufficient number of devmap entries allocated and
when they ran out, new orb_advertise requests would fail.
Also added a new logging macro for the Linux build to show the
calling pthread if enabled.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The warnx and warn calls map to PX4_WARN.
Calls to errx or err genrtate a compile error.
The px4_log.h file implements a new log format:
For DEBUG and INFO:
<level> <msg>
For ERROR and WARN:
<level> <msg> (file filepath line linenum)
The verbosity can be changed by setting the macro to use
either linux_log or linux_log_verbose in px4_log.h
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
QuRT does not support UDP so moved the mavlink specific code
to a new file that is not built for the qurt target
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
GCC was more picky about prototypes for inlines being required.
The generate_listener.py script used incorrect printf formats and
was casting %f params to float, but printf casts all %f params to
double per the spec.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
There were some missed calls to open and ioctl that need to be
px4_open and px4_ioctl.
QuRT also does not provide usleep() so px4_time.h has to be included
in files calling usleep.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Simulator can work as before with -s flag or with Roman's additions to
publish the sensors combined topic using -p flag.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>