I’m currently hacking away at the Quadplane code to make it do a bi-copter with independently tilting wing and rotors and I would like to add an extra parameter to specify the tilt limits for pitch control in the same way that is done for vectored yaw.
The parameter setup in Quadplane looks quite different to that described in the Copter add parameter notes which I’ve read up on but I’m having some difficulties getting functional code to compile when I add a parameter in quadplane.cpp (in the second group) The code will actually compile but it won’t run and connect to X-plane, so it’s probably getting hung up somewhere because of this additional parameter.
Could some kind soul point out the relevant Quadplane equivalents of the four-step Copter process?
(currently I’m working in SITL but will migrate to the real world when something works)
Hi there Andrew, are you looking to add a parameter below this one?
// @Param: TRANS_DECEL
// @DisplayName: Transition deceleration
// @Description: This is deceleration rate that will be used in calculating the stopping distance when transitioning from fixed wing flight to multicopter flight.
// @Units: m/s/s
// @Increment: 0.1
// @Range: 0.2 5
// @User: Standard
AP_GROUPINFO("TRANS_DECEL", 1, QuadPlane, transition_decel, 2.0),
just below that, but above AP_GROUPEND should do the trick. Could you paste a code snippet of how you tried to add the param here if you’re still stuck?
// second table of user settable parameters for quadplanes, this
// allows us to go beyond the 64 parameter limit
const AP_Param::GroupInfo QuadPlane::var_info2[] = {
// @Param: TRANS_DECEL
// @DisplayName: Transition deceleration
// @Description: This is deceleration rate that will be used in calculating the stopping distance when transitioning from fixed wing flight to multicopter flight.
// @Units: m/s/s
// @Increment: 0.1
// @Range: 0.2 5
// @User: Standard
AP_GROUPINFO(“TRANS_DECEL”, 1, QuadPlane, transition_decel, 2.0),
// @Param: TILT_PITCH_ANGLE
// @DisplayName: Tilt pitch control angle semi-limit
// @Description: This is the (half) angle of the wing tilt to be used for pitch control when in VTOL mode.
// @Range: 0 15
AP_GROUPINFO("TILT_PITCH_ANGLE", 2, QuadPlane, tilt.tilt_pitch_angle, 0),
AP_GROUPEND
};
(Arggh! I don’t know why it’s formatted like that!)
Interestingly, I swapped the positions in the definition section of code for TILT_PITCH_ANGLE and TILT_YAW_ANGLE and, with or without the extra parameter in the second group (YAW this time) it won’t communicate, despite compiling without error. so clearly something is wrong with my implementation of tilt.tilt_pitch_angle. Hmmm…
Is this a problem with communication with X-Plane alone? Or does the basic SITL instance itself not even run - can you connect to it with Mission Planner for e.g.?
It fires up and allows MAVproxy to run but sits there “waiting for a heartbeat” because SITL is waiting to hear from X-plane and X-plane is waiting to hear from SITL to set the correct data parameters in X-plane. In any case, if I delete this parameter, all is well - no other changes.
I get this error when I run my SITL file manually:
check_group_info:194: suffix is too long in TILT_PITCH_ANGLE
Bad parameter table
I’ve found out that you can just change your parameter name from TILT_PITCH_ANGLE to TILT_PITCH_ANG and the problem disappears - looks like your parameter name was just a bit too long.
@Andrew_Rabbitt If you run sim_vehicle.py with -D and -G switches, you’ll get a gdb terminal window which should tell you about errors such as parameter names that are too long.
Thanks for the tips and all the help! I’ll give that a try, Mark. You can tell I’m a code novice with huge ambition and no clue! Your patience and guidance is seriously appreciated