Commit Graph

61 Commits

Author SHA1 Message Date
Randy Mackay ddbc52d2db AP_Mount: support gimbal-manager-information requests 2023-04-25 15:07:35 +10:00
Asif Khan 47ad614e8e AP_Mount: Add MNTx_SYSID_DFLT param to easily target another vehicle 2023-04-24 13:34:20 +10:00
Nick Exton 5d39dd45be AP_Mount: Add clear_roi_target() function 2023-04-11 09:11:08 +10:00
Peter Barker d6b5dc206e AP_Mount: make get_attitude_euler non-virtual
If a backend ever needs to override this method then we can make it virtual, in the meantime we can save flash by re-using the quaternion getter in the frontend
2023-02-17 10:04:49 +11:00
Randy Mackay e9b92da241 AP_Mount: add get_attitude_euler
this allows external callers including Lua to retrieve the gimbal mount's current attitude
2022-09-28 17:09:31 +10:00
Peter Barker 3d099b0d2f AP_Mount: include required GCS.h header 2022-09-27 09:26:45 +10:00
Randy Mackay c20ec27c54 AP_Mount: parameter angles in degrees
Also MNTx_RC_RATE param per backend
2022-09-06 13:53:25 +09:00
Randy Mackay ac769baa3c AP_Mount: Servo mount's STAB params replaced by BrushlessPWM type 2022-09-06 13:53:25 +09:00
Randy Mackay 0d9526f1c5 AP_Mount: replace RC input params with RC options 2022-09-06 13:53:25 +09:00
Randy Mackay 83c9a76260 AP_Mount: send warning to GCS on invalid GPS or angle targets
This hopefully will help catch cases where the GCS relied on a bug in 4.2 (and earlier's) handling of MAV_CMD_DO_MOUNT_CONTROL
2022-08-25 20:28:06 -04:00
Randy Mackay 022d610519 AP_Mount: separate handling of mount-control and do-mount-control 2022-08-25 20:28:06 -04:00
Randy Mackay 119c8b7363 AP_Mount: get_angle_target_to_location checks for valid location 2022-08-24 18:07:08 +10:00
Randy Mackay b4979e2cfa AP_Mount: replace send-mount-status with send-gimbal-device-attitude-status 2022-08-15 20:29:25 -04:00
Iampete1 47105f0b03 AP_Mount: params always use set method 2022-08-03 13:43:48 +01:00
Randy Mackay 0d60e47c68 AP_Mount: backend restructure and support for ef/bf angle and rate 2022-06-29 10:56:48 +09:00
Randy Mackay 33a4efa936 AP_Mount: move mode, yaw_lock, roi_target and sysid target to backend 2022-06-29 10:56:48 +09:00
Randy Mackay ec07c15e1e AP_Mount: set_roi_target and set_target_sysid lose struct and const before args 2022-06-29 10:56:48 +09:00
Randy Mackay f426711177 AP_Mount: backend calc_angle_to_xxx requires relative_pan argument 2022-06-29 10:56:48 +09:00
Randy Mackay 3711c362ce AP_Mount: update_rate_and_angle_from_rc fix arg name to match units 2022-06-29 10:56:48 +09:00
Randy Mackay 10da8a42bd AP_Mount: replace JSTICK_SPD with RC_RATE 2022-06-21 13:37:11 +09:00
Randy Mackay 8092697c1a AP_Mount: backend record RC rate targets 2022-06-15 09:07:14 +09:00
Randy Mackay 29a1aed1e3 AP_Mount: backend gets minor comment fix 2022-06-03 19:43:54 +09:00
Randy Mackay 9e8f000ac2 AP_Mount: minor spelling fix 2022-06-03 11:56:18 +09:00
Peter Barker fcd8d1b5eb AP_Mount: rename AP_AHRS::get_position to get_location 2022-01-25 10:47:22 +11:00
olliw42 312604f577 AP_Mount: add handle_global_position_int() method to backend and use it + little spelling 2021-10-08 14:22:43 +11:00
Andrew Tridgell f12a7dd04b AP_Mount: fixed longitude subtraction 2021-06-25 15:33:55 +10:00
Peter Barker 7b9fbe3b30 AP_Mount: support MAV_MOUNT_MODE_HOME_LOCATION to point at HOME 2020-12-25 12:17:27 +11:00
Andy Piper f7f5880179 AP_Mount: make mount/gimbal inclusion configurable per-board and disable Solo gimbal on all 1MB boards 2020-08-04 09:18:14 +10:00
Randy Mackay 8ad9a49900 AP_Mount: ignore rc trim when calculating desired mount angles 2020-02-25 17:38:24 +09:00
Peter Barker 7b32f2876e AP_Mount: change type of roi_target_set to boolean 2019-11-12 07:52:22 +08:00
Peter Barker c649fd1468 AP_Mount: support sysid targetting 2019-11-12 07:52:22 +08:00
Peter Barker 7139c1121f AP_Mount: correct use of disparate altitude frames in AP_Mount 2019-11-05 19:55:45 +11:00
Peter Barker 47ad331135 AP_Mount: use AHRS singleton to get current position 2019-11-05 19:55:45 +11:00
Michael du Breuil 2d161e3594 AP_Mount: Remove unneeded headers 2019-04-05 20:12:53 +11:00
Peter Barker bdcb48d835 AP_Mount: use enum class for AltFrame enumeration 2019-03-19 10:31:18 +11:00
Peter Barker 2f3237143f AP_Mount: adjust for Location_Class and Location unification 2019-01-16 11:45:29 +11:00
Peter Barker 828317860a AP_Mount: adjust for location flags being moved out of union 2019-01-16 11:45:29 +11:00
Randy Mackay 9767c74311 AP_Mount: angle_input uses norm_input 2018-12-06 08:00:18 +09:00
Randy Mackay 5046c7fb91 AP_Mount: fix gimbal move to extreme before TX turned on 2018-12-06 08:00:18 +09:00
Andrew Tridgell 8f709b7a34 AP_Mount: fixed build warning 2018-11-11 07:08:59 +11:00
Peter Barker 178d26f8e3 AP_Mount: add general function for handling mavlink messages
AP_Mount: const parameters, add overrides, remove bad virtual declarations

AP_Mount: use AHRS singleton

AP_Mount: make status_msg pure-virtual and add override keyword

AP_Mount: handle deprecated mavlink control and configure msgs

AP_Mount: handle MAV_CMD_DO_MOUNT_CONFIGURE

AP_Mount: rename status_msg method to send_mount_status
2018-10-30 17:19:14 +11:00
Peter Barker c73beffe1b AP_Mount: factor out a rate_input_rad, const various functions 2018-10-30 11:07:53 +11:00
Peter Barker 2489234fcf AP_Mount: use rc() method to get rc singleton 2018-08-01 12:11:30 +09:00
Andrew Tridgell 4173432542 AP_Mount: adapt to new RC_Channel API 2017-01-12 17:39:37 +11:00
Przemek Lekston 6d65b351cd AP_Mount: allow computation of gps point target in earth fixed frame 2016-12-01 18:42:48 +09:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02: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
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
Randy Mackay fa0aa6f5c9 Mount: remove support for do-mount-configure as command long
Also fix bug in do-mount-control so that do-mount-control can switch mount into retract mode

Also removes ability to set which axis are stabilized through
ardupilotmega mount_configure message
2015-09-06 16:01:18 +09:00
squilter cc58ec917c Mount: add support for do_mount_control via command_long 2015-09-06 16:01:12 +09:00