Commit Graph

106 Commits

Author SHA1 Message Date
Andrew Tridgell 835c0b1759 HAL_SITL: follow sqrt law to 60m for wind
this makes testing wind in landings more useful
2016-04-20 17:26:16 +10:00
Andrew Tridgell 4ef977c68b HAL_SITL: fixed initial path for uartF 2016-04-20 10:08:35 +10:00
Andrew Tridgell 0d27409511 HAL_SITL: added uartF 2016-04-20 09:39:49 +10:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Andrew Tridgell 4d01cb1716 HAL_SITL: fixed SITL engine mul error
expression without get() was treated as int
2016-03-26 14:17:12 +11:00
Andrew Tridgell 5c92adddf9 HAL_SITL: allow examples to run under SITL 2016-03-25 21:35:16 +11:00
Lucas De Marchi e6059f5197 AP_Compass: rename files to follow other libraries
AP_Compass.h is the main header to be exported and AP_Compass.cpp its
implementation. There's no need for an additional header.
2016-03-23 17:50:38 -03:00
Lucas De Marchi bcdc3336de AP_HAL_SITL: replace header guard with pragma once 2016-03-16 18:40:41 +11:00
Will Sackfield 0a60d713af AP HAL SITL: Use fully qualified SITL namespace
* using namespace SITL caused ambiguities due to
both SITL and HAL SITL using the same namespace
2016-02-29 14:14:37 +11:00
Michael du Breuil 287a3367ad AP_HAL_SITL: Force the simulated gps time to be on valid intervals for u-blox hardware 2016-02-26 09:57:03 +11:00
Lucas De Marchi c3d8ba3ea5 AP_HAL_SITL: use empty I2CDevice 2016-02-16 19:49:09 -02:00
Lucas De Marchi 9aa49cda93 Global: remove system_initializing() from scheduler
This is not used anymore.
2016-02-12 23:42:34 -02:00
Andrew Tridgell cb60384dc4 AP_HAL_SITL: allow auto-baudrate detection in GPS driver in SITL
this is useful when testing a real GPS in SITL
2016-02-11 18:46:01 +11:00
Tom Pittenger f695f37ca3 AP_HAL_SITL: handle negative throttle
- negative throttle was causing negative voltage offsets
2016-02-09 14:18:01 +11:00
Lucas De Marchi 0e09975fa6 AP_HAL_SITL: fix typo 2016-02-01 14:18:51 -02:00
Andrew Tridgell 097c2011e1 HAL_SITL: prevent abort on select with -1 fd 2016-01-10 21:26:35 +11:00
Andrew Tridgell deb0b9c197 HAL_SITL: read in larger chunks 2016-01-10 17:43:01 +11:00
Andrew Tridgell 655f57ad01 HAL_SITL: cleanup class names
remove SITL prefix
2016-01-10 17:43:01 +11:00
Andrew Tridgell 492c733750 HAL_SITL: added RingBuffers to UART driver
makes for faster log download
2016-01-10 17:43:01 +11:00
Andrew Tridgell 22e25cc792 HAL_SITL: added Flightaxis support 2016-01-09 07:38:51 +11:00
Andrew Tridgell b4cc3d9668 HAL_SITL: implement get_custom_defaults_file() 2016-01-07 09:09:40 +11:00
Andrew Tridgell 6c064ae8bd HAL_SITL: flow control is enabled on SITL
faster parameter download
2016-01-06 19:16:08 +11:00
Andrew Tridgell dd07ffce08 HAL_SITL: enable debug of rcoutput channel enable and frequency 2016-01-05 09:47:55 +11:00
Andrew Tridgell 2dd8a0af74 HAL_SITL: allow visualisation of quad motor speeds in flightgear 2016-01-04 11:09:27 +11:00
Andrew Tridgell 1450f33b51 HAL_SITL: support 16 RC input channels in SITL 2016-01-04 08:22:02 +11:00
Andrew Tridgell 83c8505b3c HAL_SITL: send state to flightgear viewer 2016-01-04 08:02:37 +11:00
Andrew Tridgell e6555aae6d HAL_SITL: added quadplane model 2016-01-01 14:35:15 +11:00
Andrew Tridgell d0896a1fb2 HAL_SITL: fixed init of channel 8 out in plane and rover
should be low
2016-01-01 14:35:15 +11:00
Andrew Tridgell c6b6d7137d HAL_SITL: added plane simulator 2016-01-01 12:41:06 +11:00
Andrew Tridgell 05e04ee1a7 HAL_SITL: added semaphore support 2015-12-21 07:38:30 +11:00
Julien BERAUD d8bcb36530 AP_HAL_SITL: add empty optical flow
No embedded optical flow on sitl
2015-12-18 17:56:04 +11:00
Tom Pittenger 48ae0d645d AP_HAL_SITL: compiler warning: float to double promotion
- replace atof() with strtof() for the correct return time
2015-12-08 14:54:43 +09:00
Lucas De Marchi c72f812944 AP_HAL_SITL: rename AP_HAL_Empty instances 2015-12-08 11:12:14 +11:00
Lucas De Marchi 4c82c535cc AP_HAL_SITL: use init() method without arguments
Override the init() method from parent class that doesn't have a
parameter since it's not used here.
2015-12-02 14:49:11 -02:00
Tom Pittenger bb4f0783ad AP_HAL_SITL: created ADS-B simulator to generate additional ghost aircraft within SITL
- The values are very aggressive, you'll come into contact with another aircraft very soon
- Credit goes to Tridge for this work
- This also allows hardware attached via UART to feed real aircraft into the simulator

This feature is enabled with the following command:
sim_vehicle -A --adsb
2015-11-23 19:45:40 +11:00
Andrew Tridgell 7a5c4ec65d HAL_SITL: use battery info from FDM if available 2015-11-23 13:31:29 +11:00
Andrew Tridgell a6ef064950 HAL_SITL: removed support for the old FDM protocol
we are now fully converted to the new C++ based SITL system
2015-11-23 13:21:33 +11:00
Caio Marcelo de Oliveira Filho bb165d8a4c AP_HAL_SITL: Remove unused extern declaration for HALs 2015-11-20 16:32:45 +09:00
Caio Marcelo de Oliveira Filho 783db23a0f AP_HAL_SITL: remove unused functions 2015-11-20 12:36:42 +09:00
Caio Marcelo de Oliveira Filho 85d12efbef AP_HAL_SITL: use millis/micros/panic functions 2015-11-20 12:31:20 +09:00
Caio Marcelo de Oliveira Filho 3ef77617fd AP_HAL_SITL: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

The '_sketch_start_time' was renamed and moved as a detail of
implementation of the functions code. It allows the code to return time
starting from zero.

The 'stopped_clock_usec' was renamed to follow convention in the file
and add a getter so that AP_HAL functions can reach it. It's not a
problem this getter is public because in practice, regular code
shouldn't even access the SITLScheduler directly -- only code that
should is from SITL itself.
2015-11-20 12:25:38 +09:00
Caio Marcelo de Oliveira Filho efbc7648b1 AP_HAL: create AP_HAL namespace and use for some HAL functionality
For certain basic functionality, there aren't much benefit to be able to
vary the implementation easily at runtime. So instead of using virtual
functions, use regular functions that are "resolved" at link time. The
implementation of such functions is provided per board/platform.

Examples of functions that fit this include: getting the current
time (since boot), panic'ing, getting system information, rebooting.

These functions are less likely to benefit from the indirection provided
by virtual interfaces. For more complex hardware access APIs the
indirection makes more sense and ease the testing (when we have it!).

The idea is that instead of calling

    hal.scheduler->panic("on the streets of london");

now use

    AP_HAL::panic("on the streets of london");

A less important side-effect is that call-site code gets
smaller. Currently the compiler needs to get the hal, get the scheduler
pointer, get the right function pointer in the vtable for that
scheduler. And the call must include an extra parameter ("this"). Now it
will be just a function call, with the address resolved at link time.

This patch introduces the first functions that will be in the namespace,
further patches will implementations for each board and then switch the
call-sites. The extra init() function allow any initial setup needed for
the functions to work.
2015-11-20 12:25:24 +09:00
Andrew Tridgell 95ca0b39a8 HAL_SITL: moved virtual INS sensor to AP_InertialSensor_SITL 2015-11-16 17:57:35 +11:00
Andrew Tridgell 2675edcb96 HAL_SITL: removed unused variables 2015-11-16 17:57:35 +11:00
Andrew Tridgell 81e34006a5 HAL_SITL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
Andrew Tridgell 75d2aed6e1 HAL_SITL: added help for uart command line checks 2015-11-04 14:26:55 +11:00
Lucas De Marchi cf8203c08b AP_HAL_SITL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00
Andrew Tridgell a5a1680fb3 HAL_SITL: added support for real UART devices
This allows use of real UART devices in the simulator. Useful for GPS
driver work or other MAVLink peripherals
2015-11-04 11:29:04 +11:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00