Open khancyr opened 9 years ago
This is really a dev question so it probably belongs on drones-discuss@googlegroups.com.
The issue is really that the mavlink change to the meaning of param3 hasn't been done officially by submitting a patch to the mavlink repo. The definition of param3 is "1" if the autopilot must control the horizontal position during take-off or "0" if the pilot will control it.
Ok I understand ! So currently it is not possible to use autotakeoff with Alt_Hold and Sport mode ?
@khancyr, Actually it should work in those modes as well as long as the GCS sets param3 to "0" if the vehicle is in AltHold or Sport at that moment. Basically setting that to "0" means that the pilot will control the vehicle's horizontal position. It's a safety check.
Humm... It doesn't work for me. I am using BBB+PXF cape with diydrone repo and use mavros with rcoverride. I do :
--> mavlink send back takeoff failed
With other modes it works as intend.
Is my reasoning wrong ?
If we send param3 = 0
==> is_zero(packet.param3) == True
==> must_navigate == True
==> current_mode_has_user_takeoff(must_navigate) == false
So we need :
bool Copter::current_mode_has_user_takeoff(bool must_navigate)
{
switch (control_mode) {
case GUIDED:
case LOITER:
case POSHOLD:
return true;
case ALT_HOLD:
case SPORT:
return must_navigate;
default:
return false;
}
}
instead of
return !must_navigate;
No ?
Please provide a reason for closing.
@magicrub you are right, after reading again I should stay open as docs on mavlink parameter hasn't been done yet .
I wasn't saying anything right or wrong, I just wanted to know why it closed.
@khancyr Do you want to do a PR to MAVLink repo to add the description for param3?
We still haven't documented param3....
Looks like we only support this "user-takeoff" in alt hold, flow hold and sport. I'm not sure what it does exactly. I wonder if we should just remove the ability. @rmackay9 ?
@IamPete1,
I guess this was added for Solo or skyviper to support a takeoff button on the transmitter. This was probably "necessary" because a significant number of new users don't takeoff assertively enough which leads to the vehicle being "not landed" even though its legs are still on the ground and then the vehicle can flip when the GPS position moves.
Sadly we seem to have two solutions to the same problem, the other being the PILOT_TKOFF_ALT parameter which forces an assertive takeoff.
I don't personally like either feature because it leads to a kind of out-of-control takeoff from the pilot's point of view but I'm not sure we can really remove it.
Hi all,
I try to use new takeoff function in takeoff.pde wih alt_hold mode.
But I don't understand the parameter : must_navigate . It is describe as must_nagivate is true if mode must also control horizontal position
This parameter come from (float takeoff_alt_cm, bool must_navigate) which is called in GCS_Mavlink.pde in response of MAV_CMD_NAV_TAKEOFF // param3 : horizontal navigation by pilot acceptable do_user_takeoff(takeoff_alt, is_zero(packet.param3))
In mode Alt_hold, when land, if I request a takeoff with apmplanner2 or mavros , it doesn't takeoff...
By looking at Mavlink definition :
Param 3 is empty. In mavros it's always 0 . I find two takeoff definitions in apmplanner2 and both set param3 to 0
I made some test by setting
And I achieved good takeoff (with 100% reliability and repetability) in alt_hold mode with or without GPS and no sonar. I use git branch https://github.com/diydrones/ardupilot/tree/411a96b4b3cefdb4277b48b8df38d212efbb1f92 on erlebrain (linux + pxf cape). By the way, apm works well with g++ 4.8.2