Commit Graph

42 Commits

Author SHA1 Message Date
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
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
Lucas De Marchi d82e80c749 APM_OBC: replace header guard with pragma once 2016-03-16 18:40:42 +11:00
Caio Marcelo de Oliveira Filho b331ffdd91 APM_OBC: use millis/micros/panic functions 2015-11-20 12:28:28 +09:00
lvale 89b593b1f4 APM_OBC: status text severity to INFO or ERROR 2015-11-10 13:11:38 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Andrew Tridgell d7a7741d15 APM_OBC: added severities to send_statustext_all 2015-09-08 14:29:45 +10:00
Gustavo Jose de Sousa da6ee4f744 APM_OBC: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:41 +10:00
Andrew Tridgell 5eee51b5a4 APM_OBC: added heartbeat() method
this is used for when the plane is calibrating sensors, to ensure
heartbeat is continued to the failsafe board
2014-09-24 12:02:38 +10:00
Andrew Tridgell d8fe4f366d APM_OBC: added AFS_RC_FAIL_MS, AFS_MAX_GPS_LOSS and AFS_MAX_COM_LOSS 2014-08-17 18:06:42 +10:00
Andrew Tridgell 4e97c98fa1 APM_OBC: removed use of extern function 2014-08-17 09:13:29 +10:00
Andrew Tridgell 144dcb4552 APM_OBC: use send_statustext_all() 2014-08-08 13:54:21 +10:00
Andrew Tridgell a812bf621f APM_OBC: added AFS_ENABLE parameter
AFS system is disabled by default
2014-08-08 13:48:03 +10:00
Andrew Tridgell 49f93b91b2 APM_OBC: fixed formatting to match APM coding standard 2014-06-02 10:47:02 +10:00
Andrew Tridgell 0d83d4f4f5 APM_OBC: fix for HAL_GPIO_* 2014-06-02 10:42:36 +10:00
Andrew Tridgell 7d712f90bf APM_OBC: adjusted docs for FS_HB_PIN
thanks to Warren for the question
2014-05-21 12:45:25 +10:00
Andrew Tridgell be9d0c1c4d APM_OBC: setup termination values in PX4IO
this sets up the PX4IO board with failsafe values in case the FMU is
not running
2014-04-21 11:52:53 +10:00
Andrew Tridgell ad18019fb1 APM_OBC: added pressure altitude termination 2014-04-11 16:47:40 +10:00
Andrew Tridgell f4cbec0ce1 APM_OBC: removed unused example code 2014-04-07 11:55:46 +10:00
Andrew Tridgell 6f55dc1686 APM_OBC: update for AP_Mission and AP_GPS changes 2014-04-07 07:28:21 +10:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Andrew Tridgell 374af1cd14 build: change from Arduino.mk to apm.mk 2013-01-02 17:29:37 +11:00
Andrew Tridgell a1187519a8 AP_HAL: use AP_HAL_BOARD_DRIVER in remaining test sketches 2012-12-20 14:52:37 +11:00
Pat Hickey eb530b86e8 move Arduino.mk to /mk/Arduino.mk 2012-12-20 14:52:35 +11:00
Andrew Tridgell 7d27e420ae AP_HAL: remove unnecessary Arduino.h includes 2012-12-20 14:52:30 +11:00
Andrew Tridgell e45f32a4b6 APM_OBC: updates for new AP_Param API 2012-12-20 14:51:38 +11:00
Pat Hickey 475da4eca4 CONFIG_HAL_BOARD - test sketches fixed up, build all passes 2012-12-20 14:51:37 +11:00
Pat Hickey eefb0f4515 APM_OBC: translate to AP_HAL, make trivial test sketch to test build 2012-12-20 14:51:29 +11:00
Pat Hickey 3f1d9d7f69 AP_Param: #include <AP_Param.h> fixups for libraries & sketches
* I mostly went through with grep and added an #include <AP_Param.h> below
  every #include <AP_Common.h>. Not all of these example sketches might
  strictly need AP_Param.
2012-12-20 14:51:19 +11:00
Andrew Tridgell 471d672e54 examples: mark some examples as unable to build
some are not worth fixing. Some can't build on 1280/2560
2012-11-24 21:09:55 +11:00
Andrew Tridgell e8c4dedcd7 AP_OBC: fixed resume on GPS loss 2012-10-11 11:51:24 +11:00
Andrew Tridgell 8458607928 APM_OBC: changed termination servo values, and added loop counter 2012-09-08 11:37:00 +10:00
Andrew Tridgell fa84ba451a APM_OBM: Failsafe board sketch
this combines with the OBC failsafe module
2012-09-08 10:07:17 +10:00
Andrew Tridgell cca04d195a APM_OBC: handle separate terminate pin correctly 2012-09-08 10:07:14 +10:00
Andrew Tridgell 13145e4c01 OBC: added FS_TERM_PIN option
this sets a pin for flight termination
2012-09-08 10:07:08 +10:00
Andrew Tridgell e2b8817a89 APM: added the ability to forcibly crash the plane on OBC failsafe breach
this allows a user to setup the OBC failsafe system to forcibly crash
the plane (surfaces at limits, zero throttle) when the failsafe system
triggers. This is to allow APM to be used in the Outback Challenge. In
the OBC an external failsafe board also does this using the heartbeat
control pin, so this is an extra safety mechanism.

To prevent users accidentially triggering a crash, this code only
activates if FS_TERM_ACTION is set to to the magic value 42.
2012-08-28 20:18:24 +10:00
Andrew Tridgell 71500347ec APM_OBC: don't use _saved_wp when zero 2012-08-28 20:18:23 +10:00
Andrew Tridgell 747a926809 APM_OBC: ensure pins are setup as outputs
constructor is run before parameters are loaded
2012-08-25 17:49:26 +10:00
Andrew Tridgell 2865434d02 APM: added 'OBC' failsafe module for ArduPlane
this adds FS_* parameters for setting up APM to follow the outback
challenge failsafe rules.

This includes:

 - manual pin
 - heartbeat pin
 - waypoint for heartbeat failure
 - waypoint for GPS failure
2012-08-15 12:39:34 +10:00