profile
viewpoint
Buzz davidbuzz Brisbane, Australia

davidbuzz/BuzzsArduinoCode 27

Buzzs collection of Arduino "Scripts", code, samples, and stuff.

davidbuzz/esp8266_wifi_tx 10

Make two ESP8266 wifi modules into a RC Transmitter and RC Reciever!

davidbuzz/ardupilot 2

APM Plane, APM Copter, APM Rover source

davidbuzz/ardupilot-mega-buzz 2

A clone of ardupilot-mega from google code , with a number of personal additions of dubious quality

davidbuzz/openscad 1

OpenSCAD - The Programmers Solid 3D CAD Modeller

davidbuzz/APWeb 0

ArduPilot web server interface

davidbuzz/avocentpdu 0

A python module that allows switching outlets on/off on an Avocent PDU (PM3012V, may work with others)

davidbuzz/Bootloader 0

PX4 Bootloader for PX4FMU, PX4IO and PX4FLOW

davidbuzz/ChibiOS-Contrib 0

Community contributed code (ports, drivers, etc).

issue commentcython/cython

please create a real-time chat for users to discuss amongst themselves.

.. It might as well be in the dark web or on the moon if its not published in the cython docs and/or github, If that's the only choice, then please document it here... also irc is so 20 years ago.

davidbuzz

comment created time in a day

issue openedcython/cython

please create a real-time chat for users to discuss amongst themselves.

i suggest https://gitter.im/cython/cython but as an outside i'm not allowed to make it. alternatively a Cython-Users facebook group, or a 'discord' channel would be nice, or all of them. at least one anyway. cython-users email list is so 20 years ago, and non-real-time.

created time in 2 days

PR opened prfraanje/quadcopter_sim

Update README.md
+7 -0

0 comment

1 changed file

pr created time in 4 days

push eventdavidbuzz/quadcopter_sim

Buzz

commit sha 54f9ef8692c7c245ba9c5dddf7dbfd57cfd094ca

Update README.md

view details

push time in 4 days

PR opened prfraanje/quadcopter_sim

Update quadcopter_sim.py
+1 -1

0 comment

1 changed file

pr created time in 4 days

push eventdavidbuzz/quadcopter_sim

Buzz

commit sha 139b66da85f871d4ba504cbc8a44e58ab1265e82

Update quadcopter_sim.py

view details

push time in 4 days

fork davidbuzz/quadcopter_sim

simulation of quadcopter using pybullet (calculations) and pyqtgraph (visualisation)

fork in 4 days

push eventHSBNE/atmega-18650-discharger

Buzz

commit sha da5cdb56bf5e64accb9129d1542648f12c074db1

added buzzs original file/s for laser-cut, based on .scad file

view details

push time in 7 days

push eventHSBNE/atmega-18650-discharger

Buzz

commit sha 65a708074fd69cdf10c45e82d8a4716ce52a5332

Original code by Buzz.

view details

Lucas Oldfield

commit sha 022e0368b080827be4011ee1191bc2942f8ec149

Heavily expanded version by @ArakniD, using esp32 , node-red , barcodes, etc. *Self-calibrating Vcc Vref via A15 2.5v reference *Pulsed current to measure cell voltage without mV drop from leaf sprung sockets *External RTC (8,192Hz) clock to sync both atmega and integrate from better time-base than CPU_CLOCK *Node-red + Influx DB web-ui with barcode scanner for tracing battery results and curves (done, needs isolation to check in) *ESP32 WiFi Client/AP with Android App for socket adjustments and seeing live results

view details

push time in 7 days

pull request commentUAVCAN/gui_tool

We struggled to get a windows .exe to build from the uavcan 'develop' branch....

Existing cx_freeze solution did not work for us, at all.

davidbuzz

comment created time in 11 days

push eventRFDesign/gui_tool

Buzz

commit sha 7fe1905e9a452442377be29d29ea1431f209c2a9

built exe from the uavcan 'develop' branch. now we can reliably build an exe bundle

view details

Buzz

commit sha dc0a02a786b767eb28bfd4ef36f2e220a51b7a30

Merge branch 'make_windows_exe' into develop-rfd

view details

push time in 12 days

PR opened UAVCAN/gui_tool

We struggled to get a windows .exe to build from the uavcan 'develop' branch....

You'll need to edit 'paths' in make_exe3.bat , uavcan_gui_tool.spec.good and UAVCAN GUI Tool2.nsi to match the full-path/s that you are using, but this worked for me.
I now have a windows .exe that works with WPython64-3760 and is built with 'pyinstaller' and the .spec file and then assembled into an 'installer' with NSIS 3.05 from https://nsis.sourceforge.io/Download and the .nsi file

+211 -1

0 comment

5 changed files

pr created time in 12 days

push eventRFDesign/gui_tool

Buzz

commit sha 7fe1905e9a452442377be29d29ea1431f209c2a9

built exe from the uavcan 'develop' branch. now we can reliably build an exe bundle

view details

push time in 12 days

create barnchRFDesign/gui_tool

branch : make_windows_exe

created branch time in 12 days

push eventRFDesign/gui_tool

Buzz

commit sha b9cb3e2ec99e5e2d3b2c99f8a85679d98f61c772

buzz buiilt exe from the uavcan 'develop' branch. now we can reliably build an exe bundle thats not 'huge'

view details

push time in 12 days

push eventRFDesign/gui_tool

Buzz

commit sha 9061dcfad9d531f443bbfa5781830be66761c1aa

buzz buiilt exe from the uavcan 'develop' branch. now we can reliably build an exe bundle thats not 'huge'

view details

push time in 12 days

create barnchRFDesign/gui_tool

branch : develop-rfd

created branch time in 12 days

push eventdavidbuzz/ardupilot

Buzz

commit sha c354ac6813fc718ab22ace90d88a590369b25978

AP_Landing: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

push time in 13 days

delete branch davidbuzz/ardupilot

delete branch : plane4.0-RFDesign-rebase1

delete time in 13 days

create barnchdavidbuzz/ardupilot

branch : plane4.0-RFDesign-rebase1

created branch time in 13 days

issue commentArduPilot/ardupilot

Using ArduPilot on ESP32 (with Xtensa LX6 Dual Core) based new designed Autopilot Hardware (Sigma2 Autopilot)

Can you conected esp32 Lora with pixhawk like a Telemetry?

Im sorry, but i don't understand your question.... Lora is a Radio technology, and has nothing to do with esp32. i don't think this issue is the right place for your question.

meminyanik

comment created time in 14 days

push eventdavidbuzz/ardupilot

Buzz

commit sha a27f4e98fd6bafcdbf2b0334e3c429e09337a146

ArduPlane: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

push time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 const AP_Param::GroupInfo AP_Landing::var_info[] = {     // @Group: DS_     // @Path: AP_Landing_Deepstall.cpp     AP_SUBGROUPINFO(deepstall, "DS_", 15, AP_Landing, AP_Landing_Deepstall),-    ++    // @Param: _OPTIONS

... so close.

davidbuzz

comment created time in 15 days

pull request commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

needs split to 2 commits

done.

davidbuzz

comment created time in 15 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 0af3fb456a3aa0ec6982e300d24950eddcf10562

AP_Landing: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

Buzz

commit sha 4ceee26dfe97aac581d3b7e2a76a52328d0c3cea

ArduPlane: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

push time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 void Plane::set_servos_controlled(void)             SRV_Channels::set_output_scaled(SRV_Channel::k_throttleRight, 0);         }     } else if (suppress_throttle()) {-        // throttle is suppressed in auto mode-        SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0);+        SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0 ); // default+        // throttle is suppressed (above) to zero in final flare in auto mode, but we allow instead thr_min if user prefers, eg turbines:+        if (landing.is_flaring() && landing.use_thr_min_during_flare() )  SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, aparm.throttle_min.get());

fixed in latest push

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 bool AP_Landing::is_throttle_suppressed(void) const     } } +//defaults to false, but _options bit zero enables it.+bool AP_Landing::use_thr_min_during_flare(void){ 

fixed in latest push

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 bool AP_Landing::is_throttle_suppressed(void) const     } } +//defaults to false, but _options bit zero enables it.+bool AP_Landing::use_thr_min_during_flare(void){ +    return OptionsMask::ON_LANDING_FLARE_USE_THR_MIN & _options;

fixed in latest push

davidbuzz

comment created time in 15 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 1ebcc12cb2c9cab657d9fb01c3013ad2a74bb0c2

AP_Landing: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

push time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 class AP_Landing {     bool is_ground_steering_allowed(void) const;     bool is_throttle_suppressed(void) const;     bool is_flying_forward(void) const;+    bool use_thr_min_during_flare(void); //defaults to false, but _options bit zero enables it.

fixed in latest push

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

AP_Landing: option to keep landing throttle at thr_min during flare

 class AP_Landing {         bool in_progress:1;     } flags; +    AP_Int32 _options;    // user-configurable bitmask options, via a parameter, for landing

fixed in latest push

davidbuzz

comment created time in 15 days

push eventdavidbuzz/ardupilot

Buzz

commit sha f1769eb2ae57c4b8d490a5137f624739cca177ab

AP_Landing: option to keep landing throttle at thr_min during flare and touchdown, not zero.

view details

push time in 15 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::Log_Write_Vehicle_Startup_Messages()     gps.Write_AP_Logger_Log_Startup_messages(); } +/*+  log a COMMAND_INT message+ */+void Plane::Log_Write_MavCmdI(const mavlink_command_int_t &mav_cmd)

discussed this with tridge, the idea of logging COMMAND_INT in AP_Vehicle instead of here, and he said he's ok with it going in the way it is for the moment, as doing AP_Vehicle is a much larger change that's not immediately in-scope for changes to a guided-slew-mode pr like this one. possible future enhancement.

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        float new_target_heading = radians(wrap_180(packet.param2));++        // reject duplicate heading requests if our target-heading has been set to anything except it's default value of -1+        if (( plane.guided_state.target_heading > -0.001f ) && (fabsf(new_target_heading - plane.guided_state.target_heading)<0.001f)) { // compare two floats as near-enough+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // course over ground+        if ( int(packet.param1) == HEADING_TYPE_COURSE_OVER_GROUND) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_COG;+            plane.prev_WP_loc = plane.current_loc;+        // normal vehicle heading+        } else if (int(packet.param1) == HEADING_TYPE_HEADING) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_HEADING;+        } else {+            // unknown heading track type+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        plane.g2.guidedHeading.reset_I();

i have resolved this by accepting duplicates without any 'rejection' flag, as suggesed in a voice chat

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 const struct LogStructure Plane::log_structure[] = { // @Field: Flap: Pre-mixer value for flaps output (between -4500 to 4500)     { LOG_AETR_MSG, sizeof(log_AETR),       "AETR", "Qhhhhh",  "TimeUS,Ail,Elev,Thr,Rudd,Flap", "s-----", "F-----" },++// @LoggerMessage: OFG+// @Description: OFfboard-Guided - an advanced version of GUIDED for companion computers that includes rate/s.  +// @Field: TimeUS: Time since system startup+// @Field: Arsp:  target airspeed cm+// @Field: ArspA:  target airspeed accel+// @Field: Alt:  target alt+// @Field: AltA: target alt accel+// @Field: AltF: target alt frame+// @Field: Hdg:  target heading+// @Field: HdgA: target heading lim+    { LOG_OFG_MSG, sizeof(log_OFG_Guided),     +      "OFG", "QffffBff",    "TimeUS,Arsp,ArspA,Alt,AltA,AltF,Hdg,HdgA", "s-------", "F-------" }, ++// @LoggerMessage: CMDI+// @Description: Generic CommandInt message logger(CMDI) +// @Field: TimeUS: Time since system startup+// @Field: CId:  command id+// @Field: TSys: target system+// @Field: TCmp: target component+// @Field: cur:  current+// @Field: cont: autocontinue+// @Field: Prm1: parameter 1+// @Field: Prm2: parameter 2+// @Field: Prm3: parameter 3+// @Field: Prm4: parameter 4+// @Field: Lat: target latitude+// @Field: Lng: target longitude+// @Field: Alt: target altitude+// @Field: F:   frame+    { LOG_CMDI_MSG, sizeof(log_CMDI),     +      "CMDI", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, 

resolved.

davidbuzz

comment created time in 15 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 const struct LogStructure Plane::log_structure[] = { // @Field: Flap: Pre-mixer value for flaps output (between -4500 to 4500)     { LOG_AETR_MSG, sizeof(log_AETR),       "AETR", "Qhhhhh",  "TimeUS,Ail,Elev,Thr,Rudd,Flap", "s-----", "F-----" },++// @LoggerMessage: OFG+// @Description: OFfboard-Guided - an advanced version of GUIDED for companion computers that includes rate/s.  +// @Field: TimeUS: Time since system startup+// @Field: Arsp:  target airspeed cm+// @Field: ArspA:  target airspeed accel+// @Field: Alt:  target alt+// @Field: AltA: target alt accel+// @Field: AltF: target alt frame+// @Field: Hdg:  target heading+// @Field: HdgA: target heading lim+    { LOG_OFG_MSG, sizeof(log_OFG_Guided),     +      "OFG", "QffffBff",    "TimeUS,Arsp,ArspA,Alt,AltA,AltF,Hdg,HdgA", "s-------", "F-------" }, ++// @LoggerMessage: CMDI+// @Description: Generic CommandInt message logger(CMDI) +// @Field: TimeUS: Time since system startup+// @Field: CId:  command id+// @Field: TSys: target system+// @Field: TCmp: target component+// @Field: cur:  current+// @Field: cont: autocontinue+// @Field: Prm1: parameter 1+// @Field: Prm2: parameter 2+// @Field: Prm3: parameter 3+// @Field: Prm4: parameter 4+// @Field: Lat: target latitude+// @Field: Lng: target longitude+// @Field: Alt: target altitude+// @Field: F:   frame+    { LOG_CMDI_MSG, sizeof(log_CMDI),     +      "CMDI", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, 

done

davidbuzz

comment created time in 17 days

push eventdavidbuzz/ardupilot

Buzz

commit sha b45682f59abb949ac8a69963ba4aa3c7171dfb4a

ArduPlane: Support a set of offboard MAVLink guided controls with rates + 3 rounds of fixes

view details

Buzz

commit sha 66b044da2be8bf8825a12593ea18c9857883a877

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 17 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 2f0f98b300f49a71de48c84c6879872a79322b10

ArduPlane: Support a set of offboard MAVLink guided controls with rates + 2 rounds of fixes

view details

Buzz

commit sha 3cecf1d3781df641159f81640cecc62170ecdd2b

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 17 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;

fixed

davidbuzz

comment created time in 17 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;

fixed.

davidbuzz

comment created time in 17 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 9bf26a8f39d9f333e0614bef9a3868b5b9c59f2f

ArduPlane: Support a set of offboard MAVLink guided controls with rates + 2 rounds of fixes

view details

Buzz

commit sha 029da9f5452f956d459aa9026669e5d55919d804

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 17 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 503be049a0a9e697858796e488782d5226aa7880

wip

view details

push time in 18 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 37ffdd88f8b06900f1e3b8d457a72ca290c115df

wip

view details

push time in 18 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 71a4ff8bee78eab8f98092f2fea03d340c8d238f

wip

view details

push time in 18 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 132510d49d7963c57c98ad813d42aa795aee12c5

ArduPlane: Support a set of offboard MAVLink guided controls with rates +fixes

view details

Buzz

commit sha 132733395d94559e8f5a14451174507d25c4125d

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough

willdo

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  

will fix, to both... although '-1' is an int not a float so won't work exactly as u typed, needs -1.0f

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'

will do.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 bool Plane::set_mode(Mode &new_mode, const ModeReason reason)     Mode &old_mode = *control_mode;     const ModeReason previous_mode_reason_backup = previous_mode_reason; +    // cancel inverted flight+    auto_state.inverted_flight = false;++    // don't cross-track when starting a mission+    auto_state.next_wp_crosstrack = false;++    // reset landing check+    auto_state.checked_for_autoland = false;

willdo.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 bool Plane::set_mode(Mode &new_mode, const ModeReason reason)     Mode &old_mode = *control_mode;     const ModeReason previous_mode_reason_backup = previous_mode_reason; +    // cancel inverted flight+    auto_state.inverted_flight = false;++    // don't cross-track when starting a mission+    auto_state.next_wp_crosstrack = false;

again, wasn't me who wrote this line of code, will remove.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 bool Plane::set_mode(Mode &new_mode, const ModeReason reason)     Mode &old_mode = *control_mode;     const ModeReason previous_mode_reason_backup = previous_mode_reason; +    // cancel inverted flight+    auto_state.inverted_flight = false;

i didn't write this line, but happy to remove it.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::calc_airspeed_errors()         }     } +    // when using the special GUIDED mode features for slew control, don't allow airspeed nudging as it doesn't play nicely.+#if OFFBOARD_GUIDED == ENABLED+    if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm) && (airspeed_nudge_cm != 0)) {+        gcs().send_text(MAV_SEVERITY_INFO,"airspeed_nudge_cm forced to zero");

will fix

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::calc_airspeed_errors()             target_airspeed_cm = ((int32_t)(aparm.airspeed_max - aparm.airspeed_min) *                                   get_throttle_input()) + ((int32_t)aparm.airspeed_min * 100);         }+#if OFFBOARD_GUIDED == ENABLED+    } else if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm)) {+        // offboard airspeed demanded+        uint32_t now = AP_HAL::millis();+        float delta = 1e-3f * (now - guided_state.target_airspeed_time_ms);+        guided_state.target_airspeed_time_ms = now;+        float delta_amt = 100 * delta * guided_state.target_airspeed_accel;+        target_airspeed_cm += delta_amt;+        if (is_positive(guided_state.target_airspeed_accel)) {+            target_airspeed_cm = MIN(guided_state.target_airspeed_cm, target_airspeed_cm);+        } else {+            target_airspeed_cm = MAX(guided_state.target_airspeed_cm, target_airspeed_cm);+        } +        // precautionary clamp/s to limits, with gcs warning+        if (  target_airspeed_cm < ( aparm.airspeed_min * 100) ) { 

will fix

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::calc_airspeed_errors()             target_airspeed_cm = ((int32_t)(aparm.airspeed_max - aparm.airspeed_min) *                                   get_throttle_input()) + ((int32_t)aparm.airspeed_min * 100);         }+#if OFFBOARD_GUIDED == ENABLED+    } else if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm)) {+        // offboard airspeed demanded+        uint32_t now = AP_HAL::millis();+        float delta = 1e-3f * (now - guided_state.target_airspeed_time_ms);+        guided_state.target_airspeed_time_ms = now;+        float delta_amt = 100 * delta * guided_state.target_airspeed_accel;+        target_airspeed_cm += delta_amt;+        if (is_positive(guided_state.target_airspeed_accel)) {+            target_airspeed_cm = MIN(guided_state.target_airspeed_cm, target_airspeed_cm);+        } else {+            target_airspeed_cm = MAX(guided_state.target_airspeed_cm, target_airspeed_cm);+        } +        // precautionary clamp/s to limits, with gcs warning+        if (  target_airspeed_cm < ( aparm.airspeed_min * 100) ) { +            gcs().send_text(MAV_SEVERITY_INFO,"target_airspeed_cm clamped to MIN airspeed");+            target_airspeed_cm = aparm.airspeed_min *100;+        }+        if (  target_airspeed_cm > ( aparm.airspeed_max * 100)  ) { +            gcs().send_text(MAV_SEVERITY_INFO,"target_airspeed_cm clamped to MAX airspeed");

will fix

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::calc_airspeed_errors()             target_airspeed_cm = ((int32_t)(aparm.airspeed_max - aparm.airspeed_min) *                                   get_throttle_input()) + ((int32_t)aparm.airspeed_min * 100);         }+#if OFFBOARD_GUIDED == ENABLED+    } else if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm)) {+        // offboard airspeed demanded+        uint32_t now = AP_HAL::millis();+        float delta = 1e-3f * (now - guided_state.target_airspeed_time_ms);+        guided_state.target_airspeed_time_ms = now;+        float delta_amt = 100 * delta * guided_state.target_airspeed_accel;+        target_airspeed_cm += delta_amt;+        if (is_positive(guided_state.target_airspeed_accel)) {+            target_airspeed_cm = MIN(guided_state.target_airspeed_cm, target_airspeed_cm);+        } else {+            target_airspeed_cm = MAX(guided_state.target_airspeed_cm, target_airspeed_cm);+        } +        // precautionary clamp/s to limits, with gcs warning+        if (  target_airspeed_cm < ( aparm.airspeed_min * 100) ) { 

yep, will do.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::calc_airspeed_errors()             target_airspeed_cm = ((int32_t)(aparm.airspeed_max - aparm.airspeed_min) *                                   get_throttle_input()) + ((int32_t)aparm.airspeed_min * 100);         }+#if OFFBOARD_GUIDED == ENABLED+    } else if (control_mode == &mode_guided && !is_zero(guided_state.target_airspeed_cm)) {+        // offboard airspeed demanded+        uint32_t now = AP_HAL::millis();+        float delta = 1e-3f * (now - guided_state.target_airspeed_time_ms);+        guided_state.target_airspeed_time_ms = now;+        float delta_amt = 100 * delta * guided_state.target_airspeed_accel;+        target_airspeed_cm += delta_amt;+        if (is_positive(guided_state.target_airspeed_accel)) {+            target_airspeed_cm = MIN(guided_state.target_airspeed_cm, target_airspeed_cm);+        } else {+            target_airspeed_cm = MAX(guided_state.target_airspeed_cm, target_airspeed_cm);+        } +        // precautionary clamp/s to limits, with gcs warning+        if (  target_airspeed_cm < ( aparm.airspeed_min * 100) ) { +            gcs().send_text(MAV_SEVERITY_INFO,"target_airspeed_cm clamped to MIN airspeed");

seems fair, willdo.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 const struct LogStructure Plane::log_structure[] = { // @Field: Flap: Pre-mixer value for flaps output (between -4500 to 4500)     { LOG_AETR_MSG, sizeof(log_AETR),       "AETR", "Qhhhhh",  "TimeUS,Ail,Elev,Thr,Rudd,Flap", "s-----", "F-----" },++// @LoggerMessage: OFG+// @Description: OFfboard-Guided - an advanced version of GUIDED for companion computers that includes rate/s.  +// @Field: TimeUS: Time since system startup+// @Field: Arsp:  target airspeed cm+// @Field: ArspA:  target airspeed accel+// @Field: Alt:  target alt+// @Field: AltA: target alt accel+// @Field: AltF: target alt frame+// @Field: Hdg:  target heading+// @Field: HdgA: target heading lim+    { LOG_OFG_MSG, sizeof(log_OFG_Guided),     +      "OFG", "QffffBff",    "TimeUS,Arsp,ArspA,Alt,AltA,AltF,Hdg,HdgA", "s-------", "F-------" }, ++// @LoggerMessage: CMDI+// @Description: Generic CommandInt message logger(CMDI) +// @Field: TimeUS: Time since system startup+// @Field: CId:  command id+// @Field: TSys: target system+// @Field: TCmp: target component+// @Field: cur:  current+// @Field: cont: autocontinue+// @Field: Prm1: parameter 1+// @Field: Prm2: parameter 2+// @Field: Prm3: parameter 3+// @Field: Prm4: parameter 4+// @Field: Lat: target latitude+// @Field: Lng: target longitude+// @Field: Alt: target altitude+// @Field: F:   frame+    { LOG_CMDI_MSG, sizeof(log_CMDI),     +      "CMDI", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, +// these next three are same format as log_CMDI just each a different name for Heading,Speed and Alt COMMAND_INTs+    { LOG_CMDS_MSG, sizeof(log_CMDI),     +      "CMDS", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, +    { LOG_CMDA_MSG, sizeof(log_CMDI),     +      "CMDA", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, +    { LOG_CMDH_MSG, sizeof(log_CMDI),     +      "CMDH", "QHBBBBffffiifB",    "TimeUS,CId,TSys,TCmp,cur,cont,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,F", "s-------------", "F-------------" }, + }; ++// Write a COMMAND INT packet.+void Plane::Log_Write_MavCmdI(const mavlink_command_int_t &mav_cmd)+{+    struct log_CMDI pkt = {+        LOG_PACKET_HEADER_INIT(LOG_CMDI_MSG),+        TimeUS:AP_HAL::micros64(),+        CId:   mav_cmd.command,+        TSys:  mav_cmd.target_system,+        TCmp:  mav_cmd.target_component,+        cur:   mav_cmd.current,+        cont:  mav_cmd.autocontinue,+        Prm1:  mav_cmd.param1,+        Prm2:  mav_cmd.param2,+        Prm3:  mav_cmd.param3,+        Prm4:  mav_cmd.param4,+        Lat:   mav_cmd.x,+        Lng:   mav_cmd.y,+        Alt:   mav_cmd.z,+        F:     mav_cmd.frame+};++// rather than have 4 different functions for these similar outputs, we just create it as a CMDI and rename it here+#if OFFBOARD_GUIDED == ENABLED+    if (mav_cmd.command == MAV_CMD_GUIDED_CHANGE_SPEED) {+        pkt.msgid = LOG_CMDS_MSG;+    } else if (mav_cmd.command == MAV_CMD_GUIDED_CHANGE_ALTITUDE) {+        pkt.msgid = LOG_CMDA_MSG;+    } else if (mav_cmd.command == MAV_CMD_GUIDED_CHANGE_HEADING) {+        pkt.msgid = LOG_CMDH_MSG;+    }+    logger.WriteBlock(&pkt, sizeof(pkt));+#endif+    //normally pkt.msgid = LOG_CMDI_MSG+    logger.WriteBlock(&pkt, sizeof(pkt));

erm, yes, that second one should have been in an #else, will fix.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 void Plane::Log_Write_RC(void)     Log_Write_AETR(); } +void Plane::Log_Write_Guided(void)+{+#if OFFBOARD_GUIDED == ENABLED+    if (control_mode != &mode_guided) {+        return;+    }++    if (guided_state.target_heading_time_ms != 0) {+        logger.Write_PID(LOG_PIDG_MSG, g2.guidedHeading.get_pid_info());+    }++    if (guided_state.target_alt > 0.0f || (guided_state.target_airspeed_cm > 0.001f )) {

yep, will fix.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        float new_target_heading = radians(wrap_180(packet.param2));++        // reject duplicate heading requests if our target-heading has been set to anything except it's default value of -1+        if (( plane.guided_state.target_heading > -0.001f ) && (fabsf(new_target_heading - plane.guided_state.target_heading)<0.001f)) { // compare two floats as near-enough+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // course over ground+        if ( int(packet.param1) == HEADING_TYPE_COURSE_OVER_GROUND) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_COG;+            plane.prev_WP_loc = plane.current_loc;+        // normal vehicle heading+        } else if (int(packet.param1) == HEADING_TYPE_HEADING) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_HEADING;+        } else {+            // unknown heading track type+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        plane.g2.guidedHeading.reset_I();

it's not really about "rejecting small changes" as it is about rejecting outright duplicates.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        float new_target_heading = radians(wrap_180(packet.param2));++        // reject duplicate heading requests if our target-heading has been set to anything except it's default value of -1+        if (( plane.guided_state.target_heading > -0.001f ) && (fabsf(new_target_heading - plane.guided_state.target_heading)<0.001f)) { // compare two floats as near-enough+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // course over ground+        if ( int(packet.param1) == HEADING_TYPE_COURSE_OVER_GROUND) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_COG;+            plane.prev_WP_loc = plane.current_loc;+        // normal vehicle heading+        } else if (int(packet.param1) == HEADING_TYPE_HEADING) { // compare as nearest int+            plane.guided_state.target_heading_type = GUIDED_HEADING_HEADING;+        } else {+            // unknown heading track type

sure, no problem, will change it. i'm not sure the difference between MAV_RESULT_DENIED and MAV_RESULT_TEMPORARILY_REJECTED matters, but happy to do this to keep u happy.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        float new_target_heading = radians(wrap_180(packet.param2));++        // reject duplicate heading requests if our target-heading has been set to anything except it's default value of -1+        if (( plane.guided_state.target_heading > -0.001f ) && (fabsf(new_target_heading - plane.guided_state.target_heading)<0.001f)) { // compare two floats as near-enough+            return MAV_RESULT_TEMPORARILY_REJECTED;

same answer as above, we don't want to handle the 'repeated' packet any further, and we don't want to reset the internal deltas() that have already started to accumulate.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100;+                break;+            }+            default:+                // this wasn't a mission_item, so no forms of frame nacks are supported, MAV_RESULT_UNSUPPORED is the best we can do+                return MAV_RESULT_UNSUPPORTED;+        }++        plane.guided_state.target_alt_frame = packet.frame;+        plane.guided_state.last_target_alt = plane.current_loc.alt; // FIXME: Reference frame is not corrected for here+        plane.guided_state.target_alt_time_ms = AP_HAL::millis();++        if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_alt_accel = 1000.0;+        } else {+            plane.guided_state.target_alt_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_alt < plane.current_loc.alt) {+            plane.guided_state.target_alt_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_HEADING: {++        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // don't accept packets outside of [0-360] degree range+        if (packet.param2 < 0.0f || packet.param2 >= 360.0f) {+            return MAV_RESULT_TEMPORARILY_REJECTED;

in this case, the range of valid headings really is 0-360, so allowing users to type in or mistakenly send 3600 or 360000 really isn't a feature. maybe i could understand the desire to pass negative headings up to -360, but that's not how it documented in the protocol so shouldn't be used that way... sure it's being accepting of the data that got sent, but why would u want to accept potentially bad data?

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;+                break;+            }+            case MAV_FRAME_GLOBAL: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt)<0.001f ) {  // compare two floats as near-enough

yep, ok, willfix.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+        plane.guided_state.target_airspeed_cm = new_target_airspeed_cm;+        plane.guided_state.target_airspeed_time_ms = AP_HAL::millis();++         if (is_zero(packet.param3)) {+            // the user wanted /maximum acceleration, pick a large value as close enough+            plane.guided_state.target_airspeed_accel = 1000.0f;+        } else {+            plane.guided_state.target_airspeed_accel = fabsf(packet.param3);+        }++         // assign an acceleration direction+        if (plane.guided_state.target_airspeed_cm < plane.target_airspeed_cm) {+            plane.guided_state.target_airspeed_accel *= -1.0f;+        }+        return MAV_RESULT_ACCEPTED;+    }++     case MAV_CMD_GUIDED_CHANGE_ALTITUDE: {+        // command is only valid in guided+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++        // command is only valid if alt is not at it's default value of -1. this is a float, so the use of is_zero(x-1)  +        if (  is_zero(packet.z-1) ) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }+         // the requested alt data might be relative or absolute+        float new_target_alt = packet.z * 100;+        float new_target_alt_rel = packet.z * 100 + plane.home.alt;++         // only global/relative/terrain frames are supported+        switch(packet.frame) {+            case MAV_FRAME_GLOBAL_RELATIVE_ALT: {+                if   (fabsf(plane.guided_state.target_alt - new_target_alt_rel)<0.001f ) { // compare two floats as near-enough+                    // reject duplicate altitude change requests+                    return MAV_RESULT_TEMPORARILY_REJECTED;+                }+                plane.guided_state.target_alt = packet.z * 100 + plane.home.alt;

yep, ok, willfix.

davidbuzz

comment created time in 18 days

Pull request review commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

 MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_do_reposition(const mavlink_com     return MAV_RESULT_FAILED; } +// these are GUIDED mode commands that are RATE or slew enabled, so you can have more powerful control than default controls.+MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet)+{+  switch(packet.command) {+    +#if OFFBOARD_GUIDED == ENABLED+    case MAV_CMD_GUIDED_CHANGE_SPEED: {+        // command is only valid in guided mode+        if (plane.control_mode != &plane.mode_guided) {+            return MAV_RESULT_TEMPORARILY_REJECTED;+        }++         // only airspeed commands are supported right now...+        if (int(packet.param1) != SPEED_TYPE_AIRSPEED) {  // since SPEED_TYPE is int in range 0-1 and packet.param1 is a *float* this works.+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject airspeeds that are outside of the tuning envelope+        if (packet.param2 > plane.aparm.airspeed_max || packet.param2 < plane.aparm.airspeed_min) {+            return MAV_RESULT_UNSUPPORTED;+        }++         // reject duplicate airspeeds+        float new_target_airspeed_cm = packet.param2 * 100;+//        if (new_target_airspeed_cm == plane.guided_state.target_airspeed_cm) {+        if ( fabsf(new_target_airspeed_cm - plane.guided_state.target_airspeed_cm)<0.001f) { // compare if two floats are 'the same'+            return MAV_RESULT_TEMPORARILY_REJECTED;

If the vehicle is commanded to the same target [one of speed,alt,direction] repeatedly, as happens often when a companion computer is streaming these packets 'repeatedly' into the autopilot, then the control subsystem has already begun heading toward that target, and is doing so with a controlled rate, so re-requesting the same target it's already going toward is both unnecessary and can change the way the algorithm performs, such as resetting deltas. This code is basically just preventing unnecessary handing of duplicate msgs as early as possible and telling the companion computer via MAV_RESULT_TEMPORARILY_REJECTED. if u think this particular choice of response in this case is incorrct, i'm happy to change the response to anything that means 'we heard you, and understand u, but sorry we're not doing it" - MAV_RESULT_ACCEPTED and MAV_RESULT_UNSUPPORTED are clearly not the right response in this case so i chose MAV_RESULT_TEMPORARILY_REJECTED as it seemed appropriate.

davidbuzz

comment created time in 18 days

create barnchdavidbuzz/ardupilot

branch : make-CI-faster-wip

created branch time in 18 days

issue commentWilliangalvani/UAVLogViewer

We need different 3d models for different aircraft

cesium supports .gltf or .glb format as it's preferred format for this sort of thing.... theres a few gltf models of larger aircraft at: https://github.com/Ysurac/FlightAirMap-3dmodels but there's also instructions on how to take something from blender and convert it to gltf

Williangalvani

comment created time in 19 days

issue commentWilliangalvani/UAVLogViewer

Rename the project!

ArduVis3D ?

Williangalvani

comment created time in 19 days

issue commentWilliangalvani/UAVLogViewer

Rename the project!

more keywords: logger, 3D, share, plotting, drone, graph, visualiser

Williangalvani

comment created time in 19 days

issue commentWilliangalvani/UAVLogViewer

support streaming data

http://smoothiecharts.org/builder/ is also cool as a live-streaming graph.

Williangalvani

comment created time in 19 days

fork davidbuzz/ChRt

ChibiOS/RT for Arduino AVR, SAMD, Due, Teensy 3.x, Teensy 4.0.

fork in 19 days

pull request commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

Latest version makes logging more consistent with existing layouts, and fixes a bug i briefly had that crashed sitl due to it doing extra checks on the formatting layout/s of packets, and it now passes test.QuadPlane.LoggerDocumentation CI test.

davidbuzz

comment created time in 19 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 6026eeb0765246b0001a444b4b255df06dfeb5f4

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 6b9c4da846de38db301dc9c4f5ebea5cf80edbe0

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 19 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 9517aa6fcf4e32b2b83242e0529d978585c4be42

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 47bd71e9fba3ae5f036b4daf18020dc548fba15f

modules: Support a set of offboard MAVLink guided controls with rates modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 19 days

push eventdavidbuzz/ardupilot

Paul Riseborough

commit sha c94de61e2957820a6e30297142fce7e548353343

AP_NavEKF2: Don't perform emergency yaw reset unless commanded externally This limits the use of the reset to situations where it is a last ditch resort before a lane switch and failsafe. This will limit false positives for general deployment, but still provide protection from fly-aways at the cost of some increase in reaction time.

view details

Paul Riseborough

commit sha 318811210feaa51c5d9b97dda519f20e268a69ac

AP_NavEKF3: Don't perform emergency yaw reset unless commanded externally This limits the use of the reset to situations where it is a last ditch resort before a lane switch and failsafe. This will limit false positives for general deployment, but still provide protection from fly-aways at the cost of some increase in reaction time.

view details

Paul Riseborough

commit sha 40cc5a500604fefe8f4020bb44ed5957b0e9e008

ArduPlane: Improve EKF failsafe in VTOL modes Replicates Copter behaviour with a three step process if the EKF sustains a loss of navigation as detected by high GPS innovation test ratios: 1) Attempts a yaw reset using the GSF estimate if available 2) Attempts a lane switch 3) Falls back to a non-position mode

view details

Paul Riseborough

commit sha cd5714d059ed13c9e3eed72524a5ce1cfc7ea430

ArduPlane: Allow EKF dead reckoning to continue after loss of GPS

view details

Paul Riseborough

commit sha 5b312e9f09e46d69682e83497b9f36cfab130991

ArduPlane: Fix logic error

view details

Paul Riseborough

commit sha 70a02f31ab6fe9447adfb55c9ed57db44a61985a

ArduPlane: More efficient type use

view details

Paul Riseborough

commit sha 3a10838c65380cf1ce1193607ff999ccc4eabc89

ArduPlane: Don't check variances if not available

view details

Paul Riseborough

commit sha 85e53d53e1cbe5ec76b35b25d711295a9e4415c7

ArduPlane: Don't use optical flow health when assessing EKF nav health Plane currently doesn't use optical flow for navigation - it is used fo terrain height estimation.

view details

Paul Riseborough

commit sha 0c9433873c177d1bdfa48c568a744d0e8ed1f4a9

ArduPlane: Modify ekf failsafe checks Restore velocity check and make the logic closer to what ArduCopter does. Remove unnecessary initialisation.

view details

Buzz

commit sha fe00b38231aa382f3257e65c908d6a8a39e6bbdd

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 0fe072e0dd12e8a3dfa186aa3528ef9decd05279

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 19 days

push eventdavidbuzz/ardupilot

Andy Piper

commit sha e9b939ccb539875bb24780ad733637f6911905fc

AP_Scripting: build fix for macOS

view details

Randy Mackay

commit sha 45e6896d954b8dcaa756563692c79da2fbe0a1e7

AP_NavEKF3: ensure extnav angle error is at least 5deg

view details

chobits

commit sha a7aa43f5d584dd19ed19d5a708e19bb323d8ebdc

AP_NavEKF2: ext nav will not reset yaw if compass is used

view details

Randy Mackay

commit sha 64360f263cc5dad5a3f992943d5b605fcadc7f40

Copter: land detector allows larger lean angle request in land mode

view details

Andrew Tridgell

commit sha fc28cd4fa23a73767abc043a4bcdb10ef6413c9f

GCS_MAVLink: fixed a ftp duplicate reply this fixes a bug in burst replies where the duplicate reply may have the wrong offset. This causes the "paramftp bad type" error

view details

Buzz

commit sha a86bbe9e7dc7d9a67209206949728ef1e9b994e9

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 434d717c277e15aee3a4bbf9e245c96f5923f148

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 19 days

push eventdavidbuzz/ardupilot

Buzz

commit sha f3e431db04e64e25d79f6bd62a8d506de03af359

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha d50a37963f7bff7c52a0d8e420411d3d76b640dd

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 20 days

pull request commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

latest push includes fixes so it builds under HAL_MINIMIZE_FEATURES, hopefully this will get CI to pass.

davidbuzz

comment created time in 21 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 7d6eb72de483a03f1769b582a570476a3a3cdeac

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 037bbbd150fcbfc8b7e9636ec16c72cd34f7696d

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 21 days

push eventRFDesign/mavlink

Buzz

commit sha c6fb878b175b7c983f8a01e3f7c5351beac55d03

bugfix in last commit, Scripting commands SCRIPTING_CMD are not part of MAV_CMD enum

view details

push time in 21 days

pull request commentArduPilot/ardupilot

Plane: Support a set of offboard MAVLink guided controls with rates

I've just finished flying this latest code around in the sim in GUIDED and sending it the appropriate MAV_CMD_GUIDED_CHANGE_SPEED , MAV_CMD_GUIDED_CHANGE_HEADING, and MAV_CMD_GUIDED_CHANGE_ALTITUDE, and entering/exiting from this with GUIDED and leaving GUIDED mode, and all the expected new behaviours for these are working.

davidbuzz

comment created time in 21 days

push eventdavidbuzz/ardupilot

Andrew Tridgell

commit sha 5c8e4a4d7b8b45978d487db972ff683bf05c1c40

AP_Scripting: removed old generated bindings

view details

Andrew Tridgell

commit sha 2c6fd13899dd8891583ba8fc2effbe05813ee4ba

AP_Scripting: auto-build the bindings

view details

Andrew Tridgell

commit sha 9cf464e570b334d481378545d22a8dc84c1960b1

AP_Scripting: removed the old Makefile

view details

Andrew Tridgell

commit sha be812f490f949f894f37e55881b2f619748d6fed

waf: added AP_LIB_EXTRA_SOURCES used to allow building of dynamically generated library components

view details

Andrew Tridgell

commit sha 4311385cb9f064cd3ffb8347189d8c65ba0ce7f7

waf: recurse into AP_Scripting for build

view details

Andrew Tridgell

commit sha 50db7f164842254ef6896d99fefd4c979b3dda30

AP_Scripting: update README.md

view details

Andrew Tridgell

commit sha 36869f668bcc613fc908b6da038ec66e9338389a

AP_Scripting: fixed build on cygwin with deep directories

view details

Buzz

commit sha 7a676290c05eed01220698722d86ecc9d3e96084

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha b70c32c5a2efcf83da43b3510fe46e6540277e1b

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 21 days

delete branch RFDesign/mavlink

delete branch : pr-guided-commands

delete time in 21 days

PR opened ArduPilot/mavlink

bugfix in last commit, Scripting commands SCRIPTING_CMD are not part …

…of MAV_CMD enum

+8 -8

0 comment

1 changed file

pr created time in 21 days

push eventRFDesign/mavlink

Andrew Tridgell

commit sha 20ebbabd9df18e6b5c6edfb6048958e6f5f7595b

ardupilotmega: added RPM message for RPM sensors used in gas helis

view details

Andrew Tridgell

commit sha 74c7c0f8a3aa975e9ec66182b9c09cb8f14a35d2

pymavlink: raise version

view details

Andreas Antener

commit sha a616555cf61148e27fa2b7e95aacc5274a8da855

added vtol transition command and vtol state message

view details

Executive

commit sha 87cdf9312948c5d0d6b7441a834110715e4a5f3e

Corrected situation where the messages' field description with a newline caused the generation of corrupt headers.

view details

squilter

commit sha 80b5c28bc6bc55a2f71f6341f87edf4bf146d5e1

Common: remove 21196

view details

Lorenz Meier

commit sha 78389263298c1e3ae0fd3df5f2c385b1fda8795d

Merge pull request #425 from squilter/remove_21196 Common: remove 21196

view details

philipoe

commit sha 2957e15603afd65393a9630b51174056173f3e87

Common: Add MAV_CMD_NAV_FOLLOW (vehicle following waypoint command)

view details

Lorenz Meier

commit sha 96589baa69422373b7dff63b0e906b3e767b3a1e

Merge pull request #424 from ptsneves/master Messages' field description with a newline corruption correction

view details

Lorenz Meier

commit sha 398bcd1a2c49ff7e8b6675d767a72b1cc6ca7777

Merge pull request #423 from UAVenture/vtol VTOL transition command and VTOL state message

view details

squilter

commit sha a6a2e3d9b94918910263ea680444b7b7aa981cb4

common: add firmware_release_type enum

view details

Randy Mackay

commit sha 797fc35f1ca3e4b8aee6a0882bdca1d49fdf3e3f

Common: rename FIRMWARE_VERSION_TYPE and fully qualify items

view details

Lorenz Meier

commit sha 47a6737054f3fd0a638c99b4ab5aebbd2b7ebf0a

Add UAVCAN config command

view details

Tim Ryan

commit sha 2240bc3438732dfc763a33f1c5c87a4b503a5bf1

Allows pymavlink to be run without numpy. Importing quaternion when numpy isn't installed throws an error. Since this is in "mavextra", it seems like we can ignore the message without much concern.

view details

Arnaud Degroote

commit sha bed8940b126b4379d1e8c811cad3c645394162b4

[python3] try to compute properly the crc for python3

view details

Andrew Tridgell

commit sha 2aeef06f1e53e054c0f4ea08610b57903a2c8b35

mavfft: added gyro fft

view details

Andrew Tridgell

commit sha efba48c698cd017ed05188eb48761523aaab0c78

pymavlink: added mavfft to install

view details

Andrew Tridgell

commit sha 158752f676fd4343e7810f93f7fe2613233a4ef6

mavgraph: added --timeshift option

view details

Lorenz Meier

commit sha 1e47af106e29897f88b3f09a035c05c331e7a14e

Merge pull request #436 from adegroote/python3 [python3] try to compute properly the crc for python3

view details

philipoe

commit sha 573ed41c9a44261b1f8e092720fd95a5e30632c3

ASLUAV: Add FW_SOARING_DATA message, which transports data for fixed-wing thermal-updraft seeking flight

view details

mantelt

commit sha f6bac2fa9afa2f07be25a51b616ab2e30e9e03f9

ASLUAV: add new MAV_CMD and SENSORPOD_STATUS message - [x] new MAV_CMD to remotely control payload via px4 - [x] message to monitor the status of the payload (sensorpod)

view details

push time in 21 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 34b05ab35b5eca1679c176183dfb36e43840d476

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 21 days

push eventdavidbuzz/ardupilot

Buzz

commit sha 5094a387e278d1676a40713b95c04b48eed487ca

ArduPlane: Support a set of offboard MAVLink guided controls with rates

view details

Buzz

commit sha 2451d498aa4ee62e7598be016c267b3fcfa24a2f

modules: Support a set of offboard MAVLink guided controls with rates

view details

push time in 21 days

push eventdavidbuzz/ardupilot

Randy Mackay

commit sha e8699ab9feb0aefa75b202f24f1dad175b740386

AP_Scripting: add Location.alt to bindings

view details

Randy Mackay

commit sha 989241a6bda88d3f8b785f3b1ff5bbb81f080142

AP_Scripting: fix limits on Location alt field binding

view details

Randy Mackay

commit sha ae8c8b71b2495282727de2bb05e9898065fba9c4

AP_Scripting: make bindings

view details

Randy Mackay

commit sha 2526aaeb748a8a12b9e1f8cd311c7bcd6e0de0cd

AP_Scripting: set-target-location example script

view details

Randy Mackay

commit sha 8d12c25555ec46d3b43b974a665e62cc0ea73275

AP_Vehicle: formatting fixes

view details

Randy Mackay

commit sha 148642158167bab5ae0704d0a250d2ab744a7c92

AP_Scripting: rename arming-check-batt-temp example script

view details

Peter Barker

commit sha c517124c72c16615e3a484dc20a629bd29cfe200

Tools: correct path separator in PYTHONPATH

view details

Andrew Tridgell

commit sha 44bf05ab291b2267c213cee97c9bd64f48bd7f40

AP_Periph: added Hobbywing ESC telemetry support useful to add UAVCAN ESC status for UART based telemetry for Hobbywing ESCs

view details

Andrew Tridgell

commit sha bca1bd2c722120fa2ca64bf0a3ef6cde169ca3e5

HAL_ChibiOS: added f303-HWESC firmware

view details

Andrew Tridgell

commit sha 5462c468cd17d8499d320767c835f43e063d4712

AP_Periph: fixed current decoding for HWESC

view details

Andrew Tridgell

commit sha 16f34778fc32fa59920609bd7a8e1c25d63adb57

HAL_ChibiOS: added f103-HWESC target

view details

Randy Mackay

commit sha 8514cb3246dd0aa891795570df7853fc0887f933

Rover: version to 4.1.0-dev

view details

Peter Barker

commit sha 67a3610f54aa7b1fad3a931f351dcd84c59f17c6

autotest: correct dangling path separator issue in PYTHONPATH

view details

Peter Barker

commit sha 4c964dd89feba684129efd0ba39a9e6e87dc8460

autotest: param_parse.py: allow cr to exist on empty lines in prog_param This should fix parameter building on the Windows CI autotest. We allow empty lines between @Param blocks and the parameter (and, in fact, require it before multi-entry @GROUPINFOs like vectors). The regex wasn't taking into account Windows will have \r\n on that empty line rather than just \n

view details

gokul

commit sha cb37f664144d68963de463a151380c2c374a43be

Tools: Added name(Gokul) to GIT_Success.txt

view details

Andy Piper

commit sha eb0923a0181c011d1cd224f348a0d89d7e240970

autotest: separate out harmonic matching test

view details

Andy Piper

commit sha de55e4dcc26b9016fce3fcce784f0c36c1c7a6d6

autotest: disable harmonic matching test

view details

Peter Barker

commit sha c7aff4eb114fae4aae98186e56a2c6898f0c9007

autotest: fixes for quadplane fft test recv_match's result is not iterable; it just gives you a single message. printing the stacktrace when assigning to ex is tradition - we tend to lose the stack traces otherwise rebooting sitl is usually required if the context we've just popped had a reboot in it (usually indicating a reboot-required parameter was set). So I added a reboot after the context pop.

view details

Peter Barker

commit sha dc8e1bd4a488428c6fb4f2c88c9c2ab00c18282b

autotest: flake8 fixes

view details

Peter Barker

commit sha d464db9c700dbfc4990b86558cff28788a8867d8

Tools: create log of build_binaries.py builds

view details

push time in 21 days

pull request commentArduPilot/ardupilot

Copter: convert to using AP_Tuning library

I mentioned this old PR to @tridge briefly today and he said that maybe @rmackay9 would be more open to this one now that he was in the past ( had reservations), particularly as it as allows leanard's tuning process to be done entirely from the transmitter.

tridge

comment created time in 21 days

PR closed ArduPilot/ardupilot

Plane: basic automatic emergency parachute release at critical altitude error in AUTO. NeedRework Plane

This is essentially an implementation of what is described in https://github.com/diydrones/ardupilot/issues/2553#issuecomment-187773710.

+133 -5

38 comments

5 changed files

naktinis

pr closed time in 21 days

pull request commentArduPilot/ardupilot

Plane: basic automatic emergency parachute release at critical altitude error in AUTO.

I think this could be closed now, and maybe if there's anything in thats 'special' it could use scripting. discussed briefly with tridge and he agreed.

naktinis

comment created time in 21 days

push eventRFDesign/mavlink

Buzz

commit sha 1ac9e106da0e999ea36414eb34ee2d25a9608406

Improve description/s of the MAV_CMD_GUIDED_* commands. MAV_CMD_GUIDED_* , Add all the new units=, enum= and label= goodness as requested by @peterbarker , and @amilcarlucas , and ardupilot: guided commands from RFDesign - amilcar's requested fixes. fixes as requested by amilcar

view details

push time in 21 days

Pull request review commentArduPilot/mavlink

ardupilot: guided commands from RFDesign

       <entry value="1" name="SCRIPTING_CMD_REPL_STOP">         <description>End a REPL session.</description>       </entry>+      <entry value="43000" name="MAV_CMD_GUIDED_CHANGE_SPEED">+        <description>Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1" label="speed type" enum="SPEED_TYPE">Airspeed or groundspeed.</param>+        <param index="2" label="speed target" units="m/s">Target Speed</param>+        <param index="3" label="speed rate-of-change" units="m/s/s">Acceleration rate, 0 to take effect instantly</param>+        <param index="4">Empty</param>+        <param index="5">Empty</param>+        <param index="6">Empty</param>+        <param index="7">Empty</param>+      </entry>+      <entry value="43001" name="MAV_CMD_GUIDED_CHANGE_ALTITUDE">+        <description>Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1">Empty</param>+        <param index="2">Empty</param>+        <param index="3" label="alt rate-of-change" units="m/s/s" minValue="0">Rate of change, toward new altitude. 0 for maximum rate change. Positive numbers only, as negative numbers will not converge on the new target alt.</param>+        <param index="4">Empty</param>+        <param index="5">Empty</param>+        <param index="6">Empty</param>+        <param index="7" label="target alt" units="m">Target Altitude</param>+      </entry>+      <entry value="43002" name="MAV_CMD_GUIDED_CHANGE_HEADING">+        <description>Change to target heading at a given rate, overriding previous heading/s. This slews the vehicle at a controllable rate between it's previous heading and the new one. (affects GUIDED only. Exiting GUIDED returns aircraft to normal behaviour defined elsewhere. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1" label="heading type" enum="HEADING_TYPE">course-over-ground or raw vehicle heading.</param>+        <param index="2" label="heading target" units="deg" minValue="0" maxValue="359" increment="1">Target heading.</param>

fixed in next push....

davidbuzz

comment created time in 21 days

delete branch RFDesign/mavlink

delete branch : pr-guiided-commands

delete time in 21 days

Pull request review commentArduPilot/mavlink

ardupilot: guided commands from RFDesign

       <entry value="1" name="SCRIPTING_CMD_REPL_STOP">         <description>End a REPL session.</description>       </entry>+      <entry value="43000" name="MAV_CMD_GUIDED_CHANGE_SPEED">+        <description>Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1" label="speed type" enum="SPEED_TYPE">Airspeed or groundspeed.</param>+        <param index="2" label="speed target" units="m/s">Target Speed</param>+        <param index="3" label="speed rate-of-change" units="m/s/s">Acceleration rate, 0 to take effect instantly</param>+        <param index="4">Empty</param>+        <param index="5">Empty</param>+        <param index="6">Empty</param>+        <param index="7">Empty</param>+      </entry>+      <entry value="43001" name="MAV_CMD_GUIDED_CHANGE_ALTITUDE">+        <description>Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1">Empty</param>+        <param index="2">Empty</param>+        <param index="3" label="alt rate-of-change" units="m/s/s">Rate of change, toward new altitude. 0 for maximum rate change. Positive numbers only, as negative numbers will not converge on the new target alt.</param>

fixed

davidbuzz

comment created time in 21 days

Pull request review commentArduPilot/mavlink

ardupilot: guided commands from RFDesign

       <entry value="1" name="SCRIPTING_CMD_REPL_STOP">         <description>End a REPL session.</description>       </entry>+      <entry value="43000" name="MAV_CMD_GUIDED_CHANGE_SPEED">+        <description>Change flight speed at a given rate. This slews the vehicle at a controllable rate between it's previous speed and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1" label="speed type" enum="SPEED_TYPE">Airspeed or groundspeed.</param>+        <param index="2" label="speed target" units="m/s">Target Speed</param>+        <param index="3" label="speed rate-of-change" units="m/s/s">Acceleration rate, 0 to take effect instantly</param>+        <param index="4">Empty</param>+        <param index="5">Empty</param>+        <param index="6">Empty</param>+        <param index="7">Empty</param>+      </entry>+      <entry value="43001" name="MAV_CMD_GUIDED_CHANGE_ALTITUDE">+        <description>Change target altitude at a given rate. This slews the vehicle at a controllable rate between it's previous altitude and the new one. (affects GUIDED only. Outside GUIDED, aircraft ignores these commands. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1">Empty</param>+        <param index="2">Empty</param>+        <param index="3" label="alt rate-of-change" units="m/s/s">Rate of change, toward new altitude. 0 for maximum rate change. Positive numbers only, as negative numbers will not converge on the new target alt.</param>+        <param index="4">Empty</param>+        <param index="5">Empty</param>+        <param index="6">Empty</param>+        <param index="7" label="target alt" units="m">Target Altitude</param>+      </entry>+      <entry value="43002" name="MAV_CMD_GUIDED_CHANGE_HEADING">+        <description>Change to target heading at a given rate, overriding previous heading/s. This slews the vehicle at a controllable rate between it's previous heading and the new one. (affects GUIDED only. Exiting GUIDED returns aircraft to normal behaviour defined elsewhere. Designed for onboard companion-computer command-and-control, not normally operator/GCS control.)</description>+        <param index="1" label="heading type" enum="HEADING_TYPE">Either 0 = course-over-ground or 1 = raw vehicle heading</param>

done

davidbuzz

comment created time in 21 days

push eventRFDesign/mavlink

Buzz

commit sha 8ce574d80ea99fd4480a4dbedfd600389e623ec7

Improve description/s of the MAV_CMD_GUIDED_* commands. MAV_CMD_GUIDED_* , Add all the new units=, enum= and label= goodness as requested by @peterbarker , and @amilcarlucas , and ardupilot: guided commands from RFDesign - amilcar's requested fixes. fixes as requested by amilcar

view details

push time in 21 days

push eventRFDesign/mavlink

Hamish Willee

commit sha 5136d81107e12504bab7688818fe0da828f52287

Add Actuator output message (#1148)

view details

Hamish Willee

commit sha d4d398f8ce42b5fda97e092294ac5a33d2e58414

Common.xml: Clarify MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES

view details

Florian Achermann

commit sha 557224a62b769f3bc435534bac27acae4ae52c41

Rename SATCOM_LINK_STATUS to ISBD_LINK_STATUS and move to common

view details

Florian Achermann

commit sha 6d3a9bff72d02ebd9722780e12c5f11319bfa345

Update the description of the ISBD_LINK_STATUS message

view details

Paul Klapperich

commit sha adfe965bc8c278c5460ecfc135710666fabddb50

Fixes #519. PX4 and Arducopter support disarm in flight with magic number in param 2

view details

Julian Oes

commit sha 1255c63fdf02abca07519c2692a48804ea18d0fd

common: improve label description for arm in-air

view details

Morten Fyhn Amundsen

commit sha 1e00e1aebba4d80dbd76515bd2d7167a9710024a

common.xml: Fix typo in MAV_CMD_DO_FOLLOW description (#1163)

view details

Hamish Willee

commit sha 69c71e89aac0a3842e6805079a2d546d2f95bd09

Move FENCE_STATUS to common

view details

Hamish Willee

commit sha 7ea85e4c2e209751455d9547a607b25005c1d733

Sync minimal.xml to changes in common - docs only (#1177)

view details

Hamish Willee

commit sha 5d01ea446afd1773ca305ba7a8ba45d422bf458e

Add PROTOCOL_VERSION and friends to minimal.xml (#1178)

view details

Robin Hilliard

commit sha b1178440ea387b3cbcbdf9551cf2b202395ef783

common.xml camera_information flags: display=bitmask

view details

Hamish Willee

commit sha b943ff0da94fa1dcbc2a2ea26ee1e225ef6db61a

common.xml: Set MAV_AUTOPILOT_INVALID for non-autopilots (#1193)

view details

Hamish Willee

commit sha fd90664329d4eb5ba9e3b8ecbbbfc683dfee724a

MAV_CMDs - put param labels next to index (#1192)

view details

olliw42

commit sha a1b1d602e15a74f8471b81b13a7b47589b0a95c6

MESSAGE_INTERVAL interface, improve description of its usage (#1196)

view details

Hamish Willee

commit sha b3654ded094ea6168d27d88e05efdd69dfbaf2c9

Add private component ID range (#1184)

view details

Hamish Willee

commit sha 65a858388fcf36d34f4988f3ae11b01dabe87187

SCALED_IMUn: x,y,zmag units from mT to mgauss

view details

Hamish Willee

commit sha 8c00b163b0dc0f5a3a64a0234f2e9b429cb9520e

OPTICAL_FLOW.flow_comp_m_(x/y) units to m/s (#1189) As stated by @jlecoeur the OPTICAL_FLOW.flow_comp_m_x and flow_comp_m_y must either be velocity units or an integration time unit is required so that flow can be determined from these. Given there is no such integration unit it is very likely that people are assuming m/s OR that it is not being used. Either way, the "best" fix is to clarify m/s.

view details

Hamish Willee

commit sha 4f32f71cc6f78684481d4b9fec5de7a8f64a5259

Add highlighting of item type

view details

Hamish Willee

commit sha fb89e321eb94239a2fb09bac3923059e633027b1

Clarify MAV_TYPE usage (#1188)

view details

Hamish Willee

commit sha d2afc3720864ba88cc0274f24eba4776e1e5340e

RAW_IMU/HIGHRES_IMU : Add id extension to support multiple IMU (#1200)

view details

push time in 21 days

more