Julien, SandroT,
I’ve reworked Hybrid mode and I was wondering if you could have a look at it and give it the “ok” (or “no way!”) before I push to master?
https://github.com/rmackay9/rmackay9-ardupilot/tree/hybrid3
I’ve tested it in the simulator and on an Iris/Pixhawk and it seems to work. It should be nearly identical to your original code but I changed the structure quite a bit. The changes are:
· Split the roll/pitch modes into 6 states (previously there were 3). I personally think this makes it clearer what state the roll and pitch modes are in.
PILOT_OVERRIDE
BRAKE
BRAKE_READY_TO_LOITER
BRAKE_TO_LOITER
LOITER
LOITER_TO_PILOT_OVERRIDE
One bit that is confusing is that BRAKE_TO_LOITER and LOITER are combined roll-pitch modes. I.e roll and pitch must both be in the mode at the same time. This means that there end up being 3 big switch statements in control_hybrid.pde. One for the roll-mode, one for the pitch-mode and one for the combined roll+pitch when we’re dealing with BRAKE_TO_LOITER and LOITER.
· Moved some code out of hybrid_run() and into separate functions at the bottom (i.e. “hybrid_mix_controls()” and “hybrid_update_wind_comp_estimate”).
· Setup #defines for 100hz and 400hz update rates
There were some parts which didn’t fit in with the ardupilot coding standards. These standards are undocumented but they will appear on the wiki soon. In order to contribute that wiki page here are the issues that came up:
· Don’t cast to (long) or (int) but instead cast to (int32_t) or (int16_t) because “long” and “int” are different sizes on different platforms. The only time that (long) or (int) should be used is within printf statements because in those cases the print_f is implemented by that platform so it needs the variable to be of the type that matches the %ld or %d that appears in the printf’s format string
· Some #defines and parameters were in the WPNav library but they were used only in the control_hybrid.pde file. I’ve moved these to the main vehicle’s parameter list. I do think we should move hybrid and Loiter into a new library eventually though.
· Be sure to rebase on master
· Commenting is great but it’s best not to include large blocks of commented out code because it makes the code harder to read
· Use 4 spaces instead of tab
-Randy
Julien,
Sorry, I haven’t completed reviewing the fixes you’ve made to the post-onion-hybrid in my branch. Hopefully tomorrow.
Peter,
I don’t think testing Hybrid with EKF=ON is a good idea. There could be a lot of differences between DCM and EKF and it will complicate the testing.
Thanks for all the testing and reviewing.
-Randy
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I’ve reworked Hybrid mode...
Agreed. For as descriptive as HYBRID is, we may as well call it “GENERIC” or “FLIGHT_MODE.” HYBRID in this case will create a lot of support questions around its capabilities and intent, and I think it best to do clear that up before the rush starts. Case in point, look at Marco’s post on DIYD.. the conversation went quickly from “Wow that’s cool” to “Let’s name it this” and “let’s name it that..”
I personally don’t have a strong opinion on what the name should be, other than it shouldn’t be called HYBRID and should somewhat describe the actual flight mode.
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Andrew Chapman
Sent: Tuesday, April 22, 2014 2:39 PM
To: drones-...@googlegroups.com
Subject: [drones-discuss] Re: Hybrid ready for review by Julien, SandroT before being pushed to master
Did we get any closer to resolving the name?
--
Julien,
Ok, great news. I’ve merged it all into master.
I did some minor cleanup of comments and also I changed how the reset_I stuff was working. I moved the flag down to the position controller level and also made it automatically reset by to the default (which is “true”). I tested it and I don’t think I introduced any bugs as part of the merge but to err is human so if you see anything….
By the way, we’ve run out of Flash space on the APM1/2. I’ve at least temporarily disabled the optical flow sensor to make room for Hybrid.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Julien Dubois
Sent: April 23, 2014 6:08 AM
To: drones-...@googlegroups.com
Subject: [drones-discuss] Re: Hybrid ready for review by Julien, SandroT before being pushed to master
Randy,
--
I would vote for:
Loiter -> Position Hold
Hybrid -> Position Hold2
I think eventually we will merge them together or replace regular Loiter with Hybrid.
-Randy
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Marco Robustini
Sent: April 23, 2014 4:01 PM
To: drones-...@googlegroups.com
Subject: [drones-discuss] Re: Hybrid ready for review by Julien, SandroT before being pushed to master
I agree with Andrew.
--
For me GPS position hold should be an addition to any other manual/semimanual flight mode in the same way as "simple" is.
Understanding this option as a gps position hold when user has sticks centered/released.
It would be a great addition to stabilize, to althold (the becoming hybrid), to drift etc etc. The pilot will always be sure that once he release the sticks the copter will stick to that position (if he has enabled the option).
--
You received this message because you are subscribed to a topic in the Google Groups "drones-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/drones-discuss/WEjetP2Iq58/unsubscribe.
To unsubscribe from this group and all its topics, send an email to drones-discus...@googlegroups.com.
--
Julien,
I think this is a pretty good idea. The Guided mode twitch was basically the same issue but in the horizontal plane. Again it was using the ‘stopping-point’ function instead of the existing position target.
The only thing is we probably need to be careful that the position controller is active, so we may need an active() method which returns true if the position controller has been controlling the horizontal or vertical position within the past 0.2 seconds (or whatever timeframe works).
We should probably go through and check all the other places we use get-stopping-point and see if we can replace them too.
-Randy
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.