The commander module now compiles for Linux.
state_machine_helper_linux.cpp iterates over the virtual devices vs
all devices under /dev as per NuttX when disabling publishing.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The name of the app was adc but should have been adcsim.
Added a barometer simulator.
This will allow ms56711_linux to depend on real devices and not
simulation.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This is a bug and is unsafe. I am not going to change the code but
it needs to be changed to a cast to int or a <= as it is unsafe to
check for equality with 0.0F.
Disabled warning for GCC 4.9 for now.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The getopt command uses global variables and is not thread safe.
Created a minimal px4_getopt version that supports options with
or without an arg, and random placement of options on the command line.
This version modifies the order of the args in argv as does the
POSIX version of getopt.
This assumes that argv[0] is the program name. Nuttx may not support
that properly in task_spawn.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The simulator satisfies the dependencies for an accelerometer
being present.
The accel code compiles but is not fully functional.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The build will now fail if clang is not found. To force the use
of GCC, use:
make USE_GCC=1
The toolchain makefile was modified so it no longer checks for
various versions of clang if USE_GCC=1 is passed.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Disabled gcc warnings that are tripped by Eigen.
Removed signal code that is not needed in Linux port and was
causing gcc warnings.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
PX4 uses NuttX data structures throughout so those data structures
were preserved and used to implement high and low priority queues.
A unit test for the work queues was added.
The polling rate of the queues are set in px4_config.h in
CONFIG_SCHED_WORKPERIOD. The units are milliseconds.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Now run:
make PX4_TARGET_OS=nuttx
or
make PX4_TARGET_OS=linux
To test the linux build and make sure that the required directories
exist, run:
make linuxrun
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Added linker script to resolve __param_start and __param_end.
Added mc_att_control to list of supported builtins.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
if termios.h is included before mathlib.h then BO is undefined.
Since mathlib.h is not needed it was removed but I still don't
know why this error occurs.
Also added -lrt to link flags for clock_gettime
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Added more queue support to linux/px4_layer.
Use virt char devices for ms5611, and mavlink.
Added more HRT functionality. uORB latency test
now fails. Likely due to bad HRT impl for Linux.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The dataman module now works under linux using /tmp/dataman as the
file path. Two files from NuttX were added to the Linux impl for
single linked queue handling.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Modified uint32_t casts of pointers to unsigned long for portability.
It otherwise breaks on x86_64.
Added _PX4_IOC to handle the conflice between _IOC on Linux and NuttX.
Removed use of px4::ok() because it cannot be used in a thread based
implementation. Changed to use px4::AppMgr which uses ok() on ROS.
Removed up_cxxinitialize.c from Linux build.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The following libs can now be built under Linux:
lib/mathlib
lib/geo
lib/geo_lookup
The constants used for ROS are now shared with Linux in
px4_defines.h
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Moved checksubmodules target back to Makefile.
NuttX download still done for Linux as it would require
too much surgery to remove it.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Uncomment the following line in setup.mk and comment out the line above
to enable the Linux build.
export PX4_TARGET_OS = linux
The build uses the clang compiler by default. The final bundled executable
is mainapp located in:
Build/linux_default.build/mainapp
When you run mainapp it will provide a list of the built-in apps. You can
type in the commands to run such as:
hello_main start
Because the Linux build is threaded and does not support tasks or processes,
it cannot call errx, exit() _exit(), etc. It also requires unique scoped
variables to test if a thread is running or if an application should exit.
The px4::AppMgr class was added in px4_app.h for this purpose. The
hello sample app demonstrates how this is used.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Moved the NuttX specific board files to makefiles/nuttx and added
a makfiles/linux directory with sample config and board files.
Created a makefiles/toolchain_native.mk file for building for Linux
with the native system compiler. GCC or clang can be used by setting
a flag in the file.
The Linux build creates an archive file and will build the tasks as
threads. Other code changes are required to support both task based
and thread based builds.
The NuttX source should not be required for the Linux build. The
target OS (NuttX or Linux) is selected by commenting out the desired
line in setup.mk
Signed-off-by: Mark Charlebois <charlebm@gmail.com>