Commit Graph

93 Commits

Author SHA1 Message Date
Andrew Tridgell 9f47e6417b Plane: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell eee06da1b5 Plane: use HAVE_PAYLOAD_SPACE() 2016-05-21 15:25:14 +10:00
Andrew Tridgell a103e70460 ArduPlane: handle SETUP_SIGNING message 2016-05-21 15:25:13 +10:00
Don Gagne 151686ce9d ArduPlane: SET_SENSORS_OFFSETS support for third compass 2016-05-19 18:51:17 -03:00
Andrew Tridgell e3b2e90a27 Plane: cleanup unnecessarily complex gcs[] usage 2016-05-17 08:27:39 +10:00
Tom Pittenger 8a58f5a5eb Plane: convert airspeed_error_cmd to airspeed_error (in meters) 2016-05-13 17:21:59 -07:00
skyscraper 7f29903287 ArduPlane: Fix up after refactoring RC_Channel class
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
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 3853aa0fe3 Plane: fix for changed API 2016-05-07 18:27:22 +10:00
Michael Day b096e1404d Plane: Add MAVLink message handler for CMD_DO_CHANGE_SPEED 2016-05-06 11:59:45 -07:00
Lucas De Marchi baa287e5e5 ArduPlane: use separate header for version macro
Having the version macro in the config.h and consequently in the main
vehicle header means that whenever the version changes we need to
compiler the whole vehicle again. This would not be so bad if we weren't
also appending the git hash in the version. In this case, whenever we
commit to the repository we would need to recompile everything.

Move to a separate header that is include only by its users. Then
instead of compiling everything we will compile just a few files.
2016-05-06 13:11:28 -03:00
Allan Matthew 25c8027606 Plane: handle new MAVLink rangefinder input 2016-05-04 08:40:34 -07:00
Michael du Breuil 0fcfcdc169 Plane: Broadcast POSITION_TARGET_GLOBAL_INT as part of the EXTENDED_STATUS stream 2016-05-01 07:38:23 +10:00
Michael Oborne cd56061b24 ArduPlane: support MAVLINK_MSG_ID_MISSION_ITEM_INT 2016-05-01 07:13:46 +10:00
Andrew Tridgell 4666b25258 Plane: initial implementation of QRTL for quadplane RTL 2016-04-30 14:34:47 +10:00
Niti Rohilla a03941ba02 ArduPlane : Updated handle_guided_request() to report error. 2016-04-29 12:39:28 -03:00
Andrew Tridgell 76400a9959 Plane: support DO_VTOL_TRANSITION as a mission item 2016-04-23 21:03:46 +10:00
James Stoyell 4e7e84fc99 Plane: Modified last_valid_rc_ms AFS failsafe input to work when standard failsafe is on
Ran into a bug on our physical plane where failsafe.last_valid_rc_ms was not recognizing that the transmitter had failed. This is likely due to how the standard failsafe works in receiving lower-than-possible throttle values. So in order to account for this, I added a new variable to the failsafe, AFS_last_valid_rc_ms, and I update it only if the ch3_failsafe (the throttle failsafe) is not on. If the throttle failsafe is on, that means that the plane has indeed lost transmitter input, so the AFS needs to recognize that.
2016-04-22 11:48:36 -07:00
Randy Mackay 4291139b6c Plane: ack DO_MOUNT_CONTROL messages 2016-04-22 21:30:51 +09:00
Andrew Tridgell 8683616d8c Plane: redo scheduler table and improve perf logging
The scheduler table was still setup for a worst case CPU of
AVR2560. Adjust times for the stm32 and improve perf logging
2016-04-21 16:45:02 +10:00
Lucas De Marchi 0095f6168e ArduPlane: fix handling of SET_HOME_POSITION
Location.altitude is stored in cm.
2016-04-18 13:07:45 +10:00
Michael du Breuil c17ea21a97 Plane: Add support for DO_REPOSITION via COMMAND_INT
also allows guided to change loiter directions
2016-04-17 19:00:03 -07:00
Randy Mackay 70f81ee338 Plane: remove multicopter PID parameters
These have been moved to the AC_AttitudeControl class
2016-04-01 11:59:30 +09:00
Andrew Tridgell f73c8ab8ed Plane: allow testing of all motors in sequence
this makes for an easier startup test for a quadplane, allowing a
single MAVLink command to test that all motors are working correctly
in the right sequence
2016-04-01 11:09:51 +11:00
Michael du Breuil 35bb6a634e Plane: Make base_mode armed status depend upon the arming library, not soft armed 2016-03-17 15:16:17 +11:00
Andrew Tridgell 89970e4eaa Plane: support motor_test for quadplanes 2016-03-13 10:05:10 +11:00
Michael du Breuil f60b3fd6c7 Plane: remove "Command recieved" statustext 2016-03-10 15:36:05 +11:00
Andrew Tridgell f4ccf94dfc Plane: added QLAND mode
for VTOL landing. Use for failsafe as well
2016-03-09 18:20:41 +11:00
Andrew Tridgell 968f07f583 Plane: allow live quadplane PID tuning 2016-02-29 14:10:32 +11:00
Tom Pittenger 6399d00950 Plane: convert to using static send_statustext
- no more MSG_STATUSTEXT
- TODO: replace calls to gcs_send_text and gcs_send_text_fmt to GCS_MAVLINK::send_statustext()
2016-02-24 09:18:06 +11:00
Tom Pittenger d04b5e735f Plane: add SYS_STATUS reverse_motor
- helpful to tell GCS to interpret VFR_HUD as negative when bit is enabled
- throttle is sent as abs()
2016-02-11 18:46:01 +11:00
Tom Pittenger b8d5369ebd Plane: add flight stage LAND_PREFLARE 2016-02-09 14:18:02 +11:00
Andrew Tridgell 8dba91658c ArduPlane: log a picture if AP_Camera::control() returns true 2016-01-29 10:01:51 +11:00
Andrew Tridgell 0d6b353bcb Plane: added quad assistance and auto support for quadplane 2016-01-09 07:38:52 +11:00
Andrew Tridgell 2983576067 Plane: added QLOITER mode
quadplane loiter
2016-01-09 07:38:52 +11:00
Andrew Tridgell ca85c332d6 Plane: separate QSTABILIZE and QHOVER modes 2016-01-09 07:38:52 +11:00
Andrew Tridgell 6468fc6d93 Plane: Initial implementation of quadplane
adds "HOVER" mode
2016-01-09 07:38:52 +11:00
Tom Pittenger 0bfe235d6b Plane: use abort landing logic with mavlink GO_AROUND cmd
- also enabled use of CMD_DO_GO_AROUND altitude param
2015-12-31 15:34:41 +11:00
Siddharth Bharat Purohit 78566bda36 Plane: wire up accel calibrator for plane 2015-12-29 10:46:35 -08:00
DonLakeFlyer 7479bc5734 Plane: return success or failure of get home position 2015-12-07 12:33:23 +09:00
Peter Barker 84b53e58d5 Plane: DataFlash-over-MAVLink support 2015-12-03 13:21:52 +11:00
Luis Vale Gonçalves 4722a388b9 Plane: Text revisions
text revisions
2015-11-27 18:54:30 +11:00
Luis Vale Gonçalves b7f3782e4e Plane: Text revisions
text revisions
2015-11-26 07:56:52 +11:00
Tom Pittenger eaad72c192 Plane: Add support for handing ADS-B traffic
- parse MAVLINK_MSG_ADSB_VEHICLE msg
- new 1Hz adsb_update task to compare list against for threat detection
- perform object avoidance via loiter or loiter_and_descend. More methods are welcome!
2015-11-23 19:45:40 +11:00
Caio Marcelo de Oliveira Filho c8888329e1 Plane: use millis/micros/panic functions 2015-11-20 12:26:40 +09:00
lvale e18181e5c2 Plane: Uniformization of severities
Plane uniformization of severities
2015-11-09 09:38:25 +11:00
Lucas De Marchi c55c07eaf6 ArduPlane: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:15 +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 4ab9821624 Replace use of Log_Write_Message_P() with Log_Write_Message() 2015-10-30 14:35:28 +09:00
Lucas De Marchi 89fc4f4b62 Replace use of send_text_P() with send_text() 2015-10-30 14:35:17 +09:00