Commit Graph

11354 Commits

Author SHA1 Message Date
Lucas De Marchi e40b88aa70 AP_Baro: BMP085: use DigitalSource interface in BMP085
Use the DigitalSource interface rather than going through the "static"
interface hal.gpio provides
2016-05-10 14:24:58 -03:00
Lucas De Marchi 56fa1b6214 AP_Baro: BMP085: change oversampling in BMP085 without EOC
If we don't have EOC pin and assuming the accumulate() function is
called at 50Hz (or higher) we would take very few samples to accumulate
before the update is called. That's because since we have to wait 26ms
to get a sample and we calling accumulate() every 20ms, half of the
times it will return without getting anything.  So we will
be using 2 or 3 samples only to average.

If we don't have EOC, use OVERSAMPLING=2 which gives us more noise, but
that we can filter out by using measurements to average. When we have
EOC we don't need it because most of the time the conversion will take
less than 20ms: I'm getting 16ms on most of them while bench-testing.
2016-05-10 14:24:58 -03:00
Lucas De Marchi 37e2f6c52e AP_Baro: BMP085: allow to easily change oversampling in BMP085
This way it's possible to easily change it if a board requires.
2016-05-10 14:24:58 -03:00
Lucas De Marchi bd6e268122 AP_Math: fix coding style
- cleanup whitespace
  - function reorder
  - fix brace position
2016-05-10 11:41:26 -03:00
Lucas De Marchi 6f87195eb7 AP_L1_Control: remove tabs and trailing whitespaces 2016-05-10 11:41:26 -03:00
Lucas De Marchi 1dbffef7ea AP_Math: remove trailing whitespace on headers 2016-05-10 11:41:26 -03:00
Lucas De Marchi ab1fa4b435 AP_Math: reorganize headers
Sort and add pragma once where needed.
2016-05-10 11:41:26 -03:00
dgrat 6d3b491c02 AP_Math: Replace is_equal with a type safe template function
It makes sense to consider also other floating point types.
2016-05-10 11:41:26 -03:00
dgrat 503867b7dc AP_Math: Replace safe_sqrt() by template function 2016-05-10 11:41:26 -03:00
dgrat 5deb0e8e03 AP_Math: Replace safe_asin() by template function 2016-05-10 11:41:26 -03:00
Lucas De Marchi 846b4927ec AP_Math: use if/else chain instead of 2 ternary operators 2016-05-10 11:41:26 -03:00
dgrat 174f899a29 AP_Math: Replace the constrain_* functions by a single template
Besides being simpler this reduces ~4k in the binary size for PX4.
2016-05-10 11:41:26 -03:00
Lucas De Marchi 348b07609c AP_Math: remove macros from unit tests
Avoid warnings like:

[2130/2168] Compiling libraries/AP_Math/tests/test_math.cpp
../../libraries/AP_Math/tests/test_math.cpp: In member function ‘virtual void MathTest_IsZero_Test::TestBody()’:
../../libraries/AP_Math/tests/test_math.cpp:73:196: warning: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]
../../libraries/AP_Math/tests/test_math.cpp:74:199: warning: converting ‘false’ to pointer type for argument 1 of ‘char
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Wconversion-null]

Use EXPECT_TRUE() and EXPECT_FALSE() from gtest instead.
2016-05-10 11:41:26 -03:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
Lucas De Marchi 880f130670 AP_Math: fix loss of precision on float addition
When using wrap_180_cd() we are adding a small float (180 * 100) to a
possibly big number. This may lose float precision as illustrated by the
unit test failing:

    OUT: ../../libraries/AP_Math/tests/test_math.cpp:195: Failure
    OUT: Value of: wrap_180_cd(-3600000000.f)
    OUT:   Actual: -80
    OUT: Expected: 0.f
    OUT: Which is: 0
2016-05-10 11:41:26 -03:00
dgrat 76362caee0 AP_Math: Replace wrap_* functions with template versions 2016-05-10 11:41:26 -03:00
dgrat 49cfd6fd9b AP_Math: Add gtest support for some functions
These functions (or variants thereof) now have unit tests:

  - is_zero()
  - is_equal()
  - sq()
  - pythagorous()
  - constrain()
  - wrap_180()
  - wrap_360()

Some tests in wrap_180_cd are failing: -180 should be wrapped to 180,
not -180.
2016-05-10 11:41:26 -03:00
Lucas De Marchi ceea7540fd AP_Math: rename test file
This will be reused for more math tests.
2016-05-10 11:41:26 -03:00
skyscraper c0c8f1a5cc RC_Channel: RC_Channel refactor
Fix up RC_Channel examples.

Change direct access to data members
to access via member functions
2016-05-10 16:21:17 +10:00
skyscraper de5130fa13 AP_Motors: RC_Channel refactor
More fixing up of RC_Channel change access to
data members to functions
2016-05-10 16:21:16 +10:00
skyscraper 12cf65baed AP_Tuning: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:16 +10:00
skyscraper c4aa55a6d9 AP_ServoRelayEvents: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
skyscraper 8b9c96814b AP_Mount: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
skyscraper daec4ea10e AP_Motors: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
skyscraper ba9462d13d APM_OBC: Fix up after RC_Channels refactor
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, change reads and writes to the public members
to calls to  get and set functionsss

old public member(int16_t)   get function -> int16_t     set function (int16_t)
(expression where c is an object of type RC_Channel)
c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);

c.min_max_configured() // return true if min and max are configured

Because data members of RC_Channels are now private and so cannot be written directly
 some overloads are provided in the Plane classes to provide the old functionality

new overload Plane::stick_mix_channel(RC_Channel *channel)
which forwards to the previously existing
void stick_mix_channel(RC_Channel *channel, int16_t &servo_out);

new overload Plane::channel_output_mixer(Rc_Channel* , RC_Channel*)const
which forwards to
(uint8_t mixing_type, int16_t & chan1, int16_t & chan2)const;

Rename functions

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
skyscraper d16659331f RC_Channel_aux: Rename static member functions
Further to refactor of RC_Channel class which included
adding get_xx set_xx methods, some methods names are now
in conflict with those in the derived RC_Channel_aux class.
To keep a uniform naming convention in RC_Channel where
functions are most used and most numerous, the offending
functions in RC_Channel__aux are renamed as follows

 RC_Channel_aux::set_radio_trim(Aux_servo_function_t function)
    to RC_Channel_aux::set_trim_to_radio_in_for(Aux_servo_function_t function)

 RC_Channel_aux::set_servo_out(Aux_servo_function_t function, int16_t value)
    to RC_Channel_aux::set_servo_out_for(Aux_servo_function_t function, int16_t value)

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)
2016-05-10 16:21:15 +10:00
skyscraper d9ab3baf84 RC_Channel: Refactor to make data members private
rename all public data members of RC_Channnels with
leading underscore and make all data members private.
Provide get_xx and set_xx methods for access

 Rationale:

        RC_Channel is a complicated class, which combines
        several functionalities dealing with stick inputs
        in pwm and logical units, logical and actual actuator
        outputs, unit conversion etc, etc
        The intent of this PR is to clarify existing use of
        the class. At the basic level it should now be possible
        to grep all places where private variable is set by
        searching for the set_xx function.

        (The wider purpose is to provide a more generic and
        logically simpler method of output mixing. This is a small step)

add function to save radio trim
(expression where c is an object of type RC_Channel)
old public member(int16_t)   get function -> int16_t     set function (int16_t)

(expression where c is an object of type RC_Channel)

c.radio_in                     c.get_radio_in()           c.set_radio_in(v)
c.control_in                   c.get_control_in()         c.set_control_in(v)
c.servo_out                    c.get_servo_out()          c.set_servo_out(v)
c.pwm_out                      c.get_pwm_out()            // use existing
c.radio_out                    c.get_radio_out()          c.set_radio_out(v)
c.radio_max                    c.get_radio_max()          c.set_radio_max(v)
c.radio_min                    c.get_radio_min()          c.set_radio_min(v)
c.radio_trim                   c.get_radio_trim()         c.set_radio_trim(v);
// other
c.min_max_configured() // return true if min and max are configured
c.save_radio_trim()    // save radio trim to eeprom
2016-05-10 16:21:15 +10:00
Gustavo Jose de Sousa b594b5a08b AP_Math: matrix_alg: disable FE_OVERFLOW in inverse4x4() for SITL
There are occasional overflows on the determinant calculation in inverse4x4()
when using calibration SITL model.
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa a7543d369f AP_Math: matrix_alg: protect inverseixi() against overflow
Fail on inverse3x3() and inverse4x4() if there's float overflow during the
determinant calculation.
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa 39f72610e2 AP_Math: quaternion: fix style
Remove trailing spaces and run astyle.
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa 8c4c9ccfa6 AP_HAL_SITL: add calibration model 2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa 9fa85d9bcf SITL: add SIM_Calibration
That model can be used to run compass and accelerometer calibration by rotating
the vehicle through the servos channels.
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa 45754ef37c SITL: Multicopter: remove leftover comment
That went unnoticed by 8a98ce4 ("SITL: moved to common code for attitude/pos
update")
2016-05-10 16:16:37 +10:00
Gustavo Jose de Sousa ce8766e1cd SITL: remove set_yaw_degrees()
That function isn't being used anywhere.
2016-05-10 16:16:37 +10:00
Andrew Tridgell 50908edc91 RC_Channel: added parameter docs for missing RCn_FUNCTION values 2016-05-09 17:33:21 +10:00
Andrew Tridgell 31ed1eabfb AP_Tuning: use better tones for next parameter 2016-05-09 17:24:56 +10:00
Andrew Tridgell 3e75fc4f3d AP_Notify: improved tones for AP_Tuning 2016-05-09 17:24:38 +10:00
Andrew Tridgell ea508f1b80 AP_NavEKF2: use LOG_REPLAY and EK2_LOG_MASK parameters 2016-05-09 12:26:57 +10:00
Andrew Tridgell 202eb3af35 DataFlash: added imu_mask to Log_Write_IMUDT 2016-05-09 12:26:30 +10:00
Andrew Tridgell 8ca6ed54c5 DataFlash: added LOG_REPLAY and LOG_DISARMED parameters 2016-05-09 12:00:55 +10:00
Andrew Tridgell 5398283c9b DataFlash: fixed BAR2 and BAR3 log formats 2016-05-09 11:09:44 +10:00
Andrew Tridgell 25c7b43628 AP_Tuning: removed chans 1 to 4 from TUNE_CHAN choices 2016-05-08 21:06:56 +10:00
Andrew Tridgell 2a2abb8be6 GCS_MAVLink: log parameter changes to DataFlash
this means param notifies also get logged in the DF log
2016-05-08 19:12:09 +10:00
Andrew Tridgell d72df80968 AP_Tuning: added a small dead-zone on mid-point detection
thanks to Leonard for the suggestion
2016-05-08 18:35:26 +10:00
Andrew Tridgell aa38539ecb AP_Tuning: move to using a nested parameter set for AP_Tuning
this allows the list of tunable parameters in the auto-docs to be
separated out
2016-05-08 18:35:26 +10:00
Andrew Tridgell 8a65481551 AP_Tuning: allow for tuning with no selector switch
this makes tuning with a single parameter possible
2016-05-08 14:47:51 +10:00
Andrew Tridgell f69806deff AP_Tuning: detect change to TUNE_PARMSET while tuning 2016-05-08 14:36:30 +10:00
Andrew Tridgell 6d1c7c9082 AP_Tuning: make it possible to tune a single parameter 2016-05-08 14:36:30 +10:00
Leandro Pereira f23bd7e09d GCS_MAVLink: Use a single stream_trigger() implementation
This has no side effects, but since all implementations were basically
the same, move the implementation to GCS_Common and the only part that
adjusts the rate based on which which stream to each individual
GCS_MAVLINK implementation.
2016-05-07 23:49:35 -03:00
Andrew Tridgell 9cd4f8a856 AP_Notify: added tones for tuning stages 2016-05-07 18:34:13 +10:00
Andrew Tridgell ebee79fb3a AP_Tuning: added transmitter tuning library
needs to be subclassed in vehicle code
2016-05-07 18:34:08 +10:00
Andrew Tridgell a9f1b608ed APM_Control: expose parameters as AP_Float 2016-05-07 18:34:06 +10:00
Andrew Tridgell 412dc10353 AC_PID: expose parameters as AP_Float
this enables full tuning capability
2016-05-07 18:34:03 +10:00
Andrew Tridgell 5ddb872b79 AP_GPS: allow Replay to set last sample time 2016-05-07 18:27:23 +10:00
Andrew Tridgell 2f4f38b85f DataFlash: log the last message sample time for GPS 2016-05-07 18:27:23 +10:00
Andrew Tridgell 428923b4b1 AP_GPS: use 3D velocity for uBlox
this makes uBlox use the 3D velocity for ground course and speed,
ensuring we use a consistent value everywhere (so same vector in EKF
as in navigation)
2016-05-07 18:27:23 +10:00
Andrew Tridgell 679b43efc9 DataFlash: make timestamps in EKF messages all match 2016-05-07 18:27:22 +10:00
Andrew Tridgell 32af886ba9 AP_NavEKF2: use consistent logging timestamps for sensors 2016-05-07 18:27:22 +10:00
Andrew Tridgell 35c3adb1ad DataFlash: use caller supplied timestamps for sensor logging
used to support EK2_LOGGING=1
2016-05-07 18:27:22 +10:00
Andrew Tridgell 6aa02f06a9 DataFlash: use INS_USE to prevent logging of unused IMUs 2016-05-07 18:27:22 +10:00
Andrew Tridgell d24bbcd1ff AP_GPS: convert vdop to cm 2016-05-07 18:27:22 +10:00
Andrew Tridgell b424c49bc7 AP_GPS: change ground course to be in degrees
more accuracy for replay
2016-05-07 18:27:21 +10:00
Andrew Tridgell e8142b0b5b AP_Math: added wrap_360() 2016-05-07 18:27:21 +10:00
Andrew Tridgell 9300092840 DataFlash: changed GPS ground course to float and add VV for GPA
more accurate replay
2016-05-07 18:27:21 +10:00
Andrew Tridgell 8b7bf5cf7a AP_Baro: allow setHIL to set last update time 2016-05-07 18:27:21 +10:00
Andrew Tridgell 1bf057be45 DataFlash: log last update time in BARO msg 2016-05-07 18:27:21 +10:00
Andrew Tridgell d61ba14037 DataFlash: switched to float for GPS ground speed
same size and more precision
2016-05-07 18:27:21 +10:00
Andrew Tridgell 0b71652afc AP_Baro; allow for exact replay of baro data 2016-05-07 18:27:20 +10:00
Andrew Tridgell d97074dc9d DataFlash: round baro temp to nearest centi-degree
makes replay logs a tiny bit closer
2016-05-07 18:27:20 +10:00
Andrew Tridgell 73d3797a7e AP_AHRS: finish implementing have_ekf_logging() 2016-05-07 18:27:20 +10:00
Andrew Tridgell 4e4c575f16 AP_NavEKF2: added have_ekf_logging() 2016-05-07 18:27:20 +10:00
Andrew Tridgell b7ba0fa458 AP_NavEKF2: added ad-hoc logging example to EKF2 2016-05-07 18:27:20 +10:00
Andrew Tridgell 4e5f1374da AP_GPS: added setHil_Accuracy() 2016-05-07 18:27:19 +10:00
Andrew Tridgell 88a1ebaf0e AP_Compass: allow setting of exact timestamp in HIL compass 2016-05-07 18:27:19 +10:00
Andrew Tridgell 4318fd0ab8 HAL_SITL: update for changed API 2016-05-07 18:27:19 +10:00
Andrew Tridgell 61da827c16 DataFlash: added sample timestamp to mag messages
allows for exact mag timings in replay
2016-05-07 18:27:19 +10:00
Andrew Tridgell 795080742e AP_AHRS: added have_ekf_logging() API 2016-05-07 18:27:19 +10:00
Andrew Tridgell 7ab1367ec4 DataFlash: removed logging of relative alt in GPS messages
not related to GPS and makes it impossible to do bit-identical replay
2016-05-07 18:27:18 +10:00
Andrew Tridgell 223c512188 AP_NavEKF2: added logging of sensor data in EKF2 2016-05-07 18:27:18 +10:00
Andrew Tridgell 2718b0649b HAL_SITL: fixed GPS rate in SITL when speedup used 2016-05-07 18:27:18 +10:00
Andrew Tridgell 8a987bf67d AP_Baro: removed filtering of baro data in HIL/SITL
this was just causing lag in replay and doesn't actually help in SITL
2016-05-07 18:27:18 +10:00
Andrew Tridgell c85607b80c AP_GPS: added time_epoch_convert() function
used by replay to get identical timestamps
2016-05-07 18:27:18 +10:00
Andrew Tridgell 07060051cf AP_AHRS: added API for forcing EKF to start
used by Replay to sync start times
2016-05-07 18:27:18 +10:00
Andrew Tridgell f92279f436 AP_NavEKF2: allow logging of IMT data from inside EKF2 2016-05-07 18:27:17 +10:00
Andrew Tridgell 2965e67d5d HAL_Linux: cope with non-root for Replay 2016-05-07 18:27:17 +10:00
Randy Mackay 4a06ca4be2 AC_AttControl: remove unused call to motors.set_stabilizing
Also minor change to order of a call to motors library to make stabilizing
and non-stabilizing calls consistent.

Non functional change
2016-05-07 10:08:38 +09:00
Randy Mackay e41f798ba1 AP_Motors: remove unused set_stabilizing 2016-05-07 10:08:36 +09:00
Andrew Tridgell ab0b76764f RC_Channel: added set_servo_failsafe_pwm() 2016-05-07 07:25:27 +10:00
Andrew Tridgell 46f257fd9b DataFlash: convert Log_Write() to use a linked list
this saves some memory and means we don't need to know how many we
will need in advance
2016-05-07 07:21:16 +10:00
Andrew Tridgell 9a1cbff850 DataFlash: allow access to DataFlash instance as a static singleton 2016-05-07 07:21:16 +10:00
Peter Barker 11dd254498 DataFlash: Log_Write optimisations 2016-05-07 07:21:16 +10:00
Peter Barker cf15bb5f6e DataFlash: AllTypes example also covers Log_Write 2016-05-07 07:21:16 +10:00
Peter Barker b273514cf9 DataFlash: create example outputting all field types 2016-05-07 07:21:16 +10:00
Peter Barker 518fabe035 DataFlash: StopLogging method, virtual stop_logging on backends 2016-05-07 07:21:16 +10:00
Peter Barker 77dd170e03 DataFlash: Log_Write support
A generic logging method to avoid the need to set up a format and structures etc
2016-05-07 07:21:16 +10:00
Peter Barker 334af1ecd7 DataFlash: base class method for resetting state on log open 2016-05-07 07:21:16 +10:00
Peter Barker eea2d5dcb5 DataFlash_File: avoid integer wrap when checking minimum time 2016-05-07 07:21:15 +10:00
Michael Day 62a7074dd7 AP_Mission: Added mavlink_cmd_long_to_mission_cmd method. 2016-05-06 11:59:44 -07:00
Lucas De Marchi fea084a596 Global: use ap_version.h
This header is used by waf to contain the generated version macros,
particularly using the git hash. For waf it's better to be in a separate
header since it then can keep track of changes on it a trigger
recompilation.

For the make build system, a dummy ap_version.h file has been added in
the missing/ folder so both implementations can co-exist.
2016-05-06 13:11:28 -03:00
Lucas De Marchi 1238c872a9 AP_Common: remove unused Arduino.h header 2016-05-06 13:11:27 -03:00
Allan Matthew d01db0edd6 AC_PrecLand: remove PI controller, speed limits as they are unused 2016-05-06 11:04:12 +09:00
skyscraper 134ea338da RC_Channel: remove unused control_mix method 2016-05-05 18:58:17 -03:00
Andrew Tridgell 9c4dd024bf AP_NavEKF2: auto change EK2_GPS_TYPE for NMEA
this fixes a problem where users of NMEA GPS receivers could not arm
with default EK2 parameters.
2016-05-05 19:46:33 +10:00
Andrew Tridgell 826cb0887a AP_SerialManager: changed default for SERIAL4_PROTOCOL to 5
this makes it a documented protocol number. No functionality change
2016-05-05 08:08:30 +10:00
Lucas De Marchi cf11776150 AP_HAL: fix signed and unsigned comparison warning
../../libraries/AP_HAL/examples/Printf/Printf.cpp:63:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (ret != strlen(float_tests[i].result)) {
                 ^
...

ardupilot/modules/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (expected == actual) {
                ^
And similar ones.
2016-05-04 08:58:37 -03:00
Lucas De Marchi 9ac63d7128 AP_HAL: examples: fix coding style 2016-05-04 08:58:37 -03:00
Lucas De Marchi b5d3094738 AP_ADC: fix warning on printf
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp: In function ‘void show_timing()’:
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
     hal.console->printf("timing: mint=%lu maxt=%lu avg=%lu\n", mint, maxt, totalt/count);
                                                                                        ^
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
../../libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.cpp:61:88: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t {aka unsigned int}’ [-Wformat=]
2016-05-04 08:58:37 -03:00
Randy Mackay 53785d1f72 AP_RangeFinder: add Bebop and MAVLink types
Thanks OXINARF!
2016-05-04 15:00:48 +09:00
Randy Mackay 96f665061e AP_RangeFinder: call handle_msg for all backends 2016-05-04 12:10:58 +09:00
Randy Mackay 9b940687c1 AP_RangeFinder: rename CompanionComputer files to MAVLink 2016-05-04 12:10:58 +09:00
Randy Mackay c541cb27f8 AP_RangeFinder: rename CompanionComputer to MAVLink 2016-05-04 12:10:58 +09:00
Allan Matthew d3831e4a5d RangeFinder: add MAVLink rangefinder 2016-05-04 12:10:58 +09:00
Andrew Tridgell 7cdab2a6c9 SITL: FlightAxis can support 8 channels 2016-05-04 13:05:43 +10:00
Andrew Tridgell 9081310ff1 HAL_SITL: support simulator RC input 2016-05-04 12:51:28 +10:00
Andrew Tridgell 3b0cd9f101 SITL: added RC input from FlightAxis
use the interlink controller for input for 6 channels
2016-05-04 12:51:27 +10:00
Julien Beraud 33a699f29c AP_RangeFinder: Add support for bebop Rangefinder
This rangefinder uses an spi device to send pulses and an iio driver
in buffer mode to get data
The data is then analyzed and the maximum pulse received is considered to
represent the echo of the pulses that have been sent. The distance in time
between the pulse that is sent and the pulse with the maximum amplitude
is used to calculate the altitude based on the speed of sound.

There is a dependency with libiio, and in order to build, there is a need
to provide a rootfs that includes libiio.a.
The other solution is to build dynamically after having updated the rootfs
to use on compiled with a more recent toolchain and include libiio
2016-05-03 16:43:39 -03:00
Julien Beraud c22d791bfc AP_HAL_Linux: Add SPI driver for bebop 2016-05-03 16:43:39 -03:00
Julien Beraud d0114eac05 AP_HAL: Add bebop SPI Device to spi devices
Added to namespace
2016-05-03 16:43:39 -03:00
Julien Beraud 738096b3ae AP_HAL_Linux: Add support for Sonar GPIO 2016-05-03 16:43:39 -03:00
Andrew Tridgell 664ce5c16e AP_AHRS: don't use disabled gyro in rate controllers
obey INS_USE* parameters in gyro estimate
2016-05-01 22:16:06 +10:00
Andrew Tridgell 0e32c047c3 AP_Compass: allow for COMPASS_EXTERNAL=2 for forced external
this allows users with unusual compass bus connections to force the
compass to external
2016-05-01 10:54:46 +10:00
Michael du Breuil a17ea5c121 GCS_MAVLink: Add POSITION_TARGET_GLOBAL_INT to the list of messages 2016-05-01 07:38:23 +10:00
Michael Oborne 848fa27d1c GCS_MAVLink: support MAVLINK_MSG_ID_MISSION_ITEM_INT 2016-05-01 07:13:45 +10:00
Michael Oborne fb3fc118f1 AP_Mission: support MAVLINK_MSG_ID_MISSION_ITEM_INT 2016-05-01 07:13:23 +10:00
Andrew Tridgell ed999a283f AP_Compass: added get_learn_type() API
this allows caller to determine if EKF offsets should be saved
2016-04-30 16:43:14 +10:00
Michael du Breuil fff21a1db9 Mission: Remove support for CONDITION_CHANGE_ALT 2016-04-30 10:56:09 +09:00
Randy Mackay 85963cecb4 Location: add additional comments 2016-04-30 10:33:01 +09:00
Randy Mackay 5161d63f8b Location: operator= uses const reference 2016-04-30 10:33:01 +09:00
Randy Mackay d6309a3a1a Location: remove unused methods 2016-04-30 10:33:01 +09:00
Randy Mackay 1bfb565e18 Location: rename set_alt to set_alt_cm 2016-04-30 10:33:01 +09:00
Randy Mackay 3d646a26e2 AP_HAL_SITL: calls to terrain:height_amsl provide extrapolate and corrected params 2016-04-30 10:33:01 +09:00
Randy Mackay 1c4b2be16a AC_WPNav: simplify use of terrain to just current location 2016-04-30 10:33:01 +09:00
Randy Mackay c5a3781507 AC_WPNav: accept terrain library reference 2016-04-30 10:33:01 +09:00
Randy Mackay e23c869c5d AC_WPNav: fix reporting of set_wp_destination failure 2016-04-30 10:33:01 +09:00
Randy Mackay 9fbfea951a AC_WPNav: spline handles terrain altitudes 2016-04-30 10:33:01 +09:00
Randy Mackay 8b2c479d62 AC_WPNav: straight line waypoints accept terrain 2016-04-30 10:33:01 +09:00
Randy Mackay cd999a2091 Location: initial class implementation 2016-04-30 10:33:01 +09:00
Randy Mackay 83922f9b65 AP_Terrain: update comments for height_terrain_difference_home 2016-04-30 10:33:01 +09:00
Randy Mackay d84321be2e AP_Terrain: height_amsl can correct for non-zero terrain alt at home position 2016-04-30 10:33:01 +09:00
Randy Mackay 7474e827ce AP_Terrain: get_statistics made public 2016-04-30 10:33:01 +09:00
AndersonRayner 74b9f624a3 Added temperature to the Airspeed.cpp example script
Fixed the formatting of the output data
2016-04-29 17:59:11 -03:00
Niti Rohilla 8fcf5cf0c1 Changed the prototype of handle_guided_request() to report error
while setting guided points.
2016-04-29 12:39:28 -03:00
Lucas De Marchi 6839ee4f37 AP_OpticalFlow: remove trailing whitespaces 2016-04-29 12:10:52 -03:00
Lucas De Marchi 5a52533084 AP_OpticalFlow: move bus definition to AP_HAL header 2016-04-29 12:10:21 -03:00
Ricardo de Almeida Gonzaga 46fb57fcf1 AP_OpticalFlow: use I2CDevice interface 2016-04-29 12:01:04 -03:00
Andrew Tridgell 68e17af070 SITL: allow for changing FlightAxis controller IP 2016-04-29 09:03:48 +10:00
Andrew Tridgell e428d1e72d SITL: support tricopter quadplanes 2016-04-28 22:36:53 +10:00
Andrew Tridgell ff96085bd3 AP_Motors: allow arbitrary motor mapping with tricopters 2016-04-28 22:36:41 +10:00
Andrew Tridgell 4908350ccb AC_WPNav: limit WPNAV_ACCEL to that implied by ANGLE_MAX
this prevents an overshoot and backtracking in the navigation code
when WPNAV_ACCEL is unachievable due to an angle limit
2016-04-28 17:47:50 +10:00
Andrew Tridgell c7664291f9 AC_AttitudeControl: fixed comment on function 2016-04-28 17:46:58 +10:00
Andrew Tridgell 23a64e1227 AC_AttitudeControl: fixed accel limit trigonometry
Leonard had mentioned the limit should be tan(angle) not sin(angle). I
noticed this one was wrong.
2016-04-28 16:15:15 +10:00
Andrew Tridgell 9e01d7de6c SITL: added support for "quad-fast" frame
much more powerful copter for testing nav at high speed
2016-04-28 10:05:04 +10:00
Staroselskii Georgii 60426faa52 AP_HAL_Linux: changed ADC logic a bit for Navio 2
- make voltage_average_ratiometric() the same as voltage_average()
- make read_latest() the same as voltage_average()

wip
2016-04-27 17:14:21 +03:00
Staroselskii Georgii 3feade792a AP_Airspeed: changed default pin for Navio boards
Use channel 5 (i.e. /sys/kernel/adc/ch5) for Airspeed sensors instead of virtual 65 that doesn't
make sense on these boards.
2016-04-27 15:37:34 +03:00
Peter Barker e83b10cbc5 AP_HAL: move definition of callbacks structure out of C linkage
This fixes all the examples which use the AP_HAL_MAIN macro.
2016-04-27 14:21:28 +10:00
Rustom Jehangir 4a10156b13 AP_HAL_Linux: Fix RCInput::read from stopping at any zero channel
This bug led to issues for us so it may help others to resolve it.
Currently, the AP_HAL_Linux RCInput::read(uint16_t*,uint8_t) function
only returns the first x nonzero channels. Once it hits a channel that
is set to zero, it stops and all remaining channels are returned as
zero, even if they are set. This causes discrepancies between the raw RC
input sent to the GCS and the RC input that is actually used on the
vehicle.

The fixes this issue and makes it behave exactly as it does on the
PX4_HAL code. We ran into this issue when sending rc_override messages
in which there were some channels set to zero.
2016-04-26 22:32:07 -03:00
Andrew Tridgell 197e72acc0 GCS_MAVLink: fixed null termination bug
found with ASAN
2016-04-26 18:20:49 +10:00
Andrew Tridgell 69e233a39d AP_GPS: fixed init string for SBF GPS
coverity #125042
2016-04-26 16:51:29 +10:00
Andrew Tridgell 785ad0614a SITL: fixed coverity 125055 2016-04-26 16:46:06 +10:00
Andrew Tridgell ed4e8b635a SITL: fixed fd leak
coverity #125056
2016-04-26 16:43:54 +10:00
Andrew Tridgell 97d27ce58f AP_Math: fixed memory leak
found by coverity
2016-04-26 16:41:44 +10:00
Andrew Tridgell 847483d744 SITL: fixed coverity warning 2016-04-26 16:37:17 +10:00
Andrew Tridgell be41d402b5 AP_InertialSensor: added set of delta angle time for replay 2016-04-26 15:50:46 +10:00
Andrew Tridgell bcefb45e0a DataFlash: added DelaT to delta-angle logs 2016-04-26 15:50:29 +10:00
Andrew Tridgell 4401cbec72 AP_InertialSensor: cope with zero delta angle time from Replay 2016-04-26 15:37:11 +10:00
Michael du Breuil 831ae72908 AP_Mission: Remove DO_SET_PARAMETER 2016-04-25 09:59:59 +09:00
mirkix 6e546ba181 AP_HAL_Linux: Fix compiler warning unused hal 2016-04-24 11:09:55 -03:00
mirkix b381045d5e AP_HAL: BBBmini rework for dual MPU9250 and external HMC5843 compass 2016-04-24 10:57:57 -03:00
mirkix c3a6a56ebb AP_InertialSensor: Add second MPU9250 autodetection to BBBmini 2016-04-24 10:57:57 -03:00
mirkix 3df5a02448 AP_Compass: Add HMC5843 and second AK8963 autodetection to BBBmini 2016-04-24 10:57:57 -03:00
mirkix 2aba5a4643 AP_HAL_Linux: BBBmini add second MPU9250 2016-04-24 10:57:57 -03:00
Randy Mackay f70072c54b AP_AccelCal: check return of get_calibrator
resolves compiler warning
2016-04-23 23:06:27 -07:00
Randy Mackay 39560f9af8 DataFlash: remove unused num_format_types and _structures
resolves compiler warning
2016-04-23 23:06:26 -07:00
Randy Mackay 6ef735c41e AP_RSSI: use fabsf instead of abs
resolves compiler warning
2016-04-23 23:06:26 -07:00
Randy Mackay 7af9892bd1 AP_MotorsMatrix: make const a float
resolves compiler warning
2016-04-23 23:06:25 -07:00
Randy Mackay a50f5bfaf8 AP_L1_Control: replace fabsf with labs
resolves a compiler warning
2016-04-23 23:06:25 -07:00
Randy Mackay b2153fb97f AP_L1_Control: remove unused _xtrackVelPos 2016-04-23 23:06:24 -07:00
Randy Mackay 58e65c836f HAL_Linux: remove unused pru_chan_map from RCOutput 2016-04-23 23:06:24 -07:00
Randy Mackay d6d5bac419 RCInput_UART: remove unused _count, _direction
resolves a compiler warning
2016-04-23 23:06:23 -07:00
Randy Mackay 3c7b2232b0 AP_GPS_GSOF: remove unused last_hdop
resolves a compiler warning
2016-04-23 23:06:22 -07:00
Randy Mackay ea3c44f9fa AP_Frsky_Telem: remove unnecessary abs
resolves a compiler warning
2016-04-23 23:06:22 -07:00
Randy Mackay 4aba25d2ef AP_Compass_AK8963: remove unused _bus_sem, _last_accum_time
Resolves a compiler warning
2016-04-23 23:06:21 -07:00
Randy Mackay 04b2e65627 AP_Airspeed: remove unused _last_pin
Resolves a compiler warning
2016-04-23 23:06:21 -07:00
Randy Mackay 722095e56d APM_Control: remove unused _last_error member
Resolves a compiler warning
2016-04-23 23:06:20 -07:00
Luis Vale Gonçalves b64d28b825 Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:45 -07:00
Luis Vale Gonçalves 5b60d1514f Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:41 -07:00
Luis Vale Gonçalves bbbb3047fa Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:40 -07:00
Luis Vale Gonçalves 4e70665f17 Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:39 -07:00
Luis Vale Gonçalves 0d9ea7597c Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:38 -07:00
Luis Vale Gonçalves a16e9b3606 Revising ardupilot.com to .org
Revising ardupilot.com to .org
2016-04-23 22:49:36 -07:00
Randy Mackay 72a7f674ec AP_Motors: protect against out-of-bounds memory access
resolves a compiler warning
2016-04-23 21:06:18 +10:00
Andrew Tridgell 54f7aeed83 RC_Channel: extend channel mapping to 16 channels
this gives more flexibility, no reason to limit it to 8
2016-04-23 21:03:46 +10:00
Andrew Tridgell 3a5e4c80ca AP_Mission: support DO_VTOL_TRANSITION command
first 16 bit command ID
2016-04-23 21:03:46 +10:00
Andrew Tridgell 09c3c36c00 AP_Mission: allow for 16 bit command IDs
this uses command ID 0 to allow for 16 bit command IDs. When used it
limits the content to just 10 bytes.
2016-04-23 21:03:45 +10:00
Tom Pittenger bcc2838a37 APM_OBC: changed param RC_FAIL_MS to RC_FAIL_TIME in float seconds 2016-04-22 16:05:07 -07:00
Tom Pittenger f2d744b7c9 APM_OBC: non-functional change - cleaned up logic 2016-04-22 16:05:02 -07:00
James Stoyell 48a7363608 APM_OBC: Added params for AUVSI student competition 2016-04-22 11:48:31 -07:00
Francisco Ferreira af6d8e3c36 AP_Param: explicitly cast to float to avoid Clang warning
/home/travis/build/ArduPilot/ardupilot/libraries/AP_Param/AP_Param.h:542:22: warning: using floating point absolute value function 'fabsf' when argument is of integer type [-Wabsolute-value]
        bool force = fabsf(_value - v) < FLT_EPSILON;
2016-04-22 17:33:06 +01:00
Randy Mackay 71692044f8 AP_Parachute: resolve compile warning re init order 2016-04-22 21:32:35 +09:00
Tom Pittenger 431b3c7160 AP-TECS: constrain proportion to 0-1 for spdweight scale so it doesn't grow backup after land point 2016-04-21 21:31:02 -07:00