mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
SITL: FlightAxis: add position reset option
This commit is contained in:
parent
9fdd0a4e84
commit
49bbb2c923
@ -40,10 +40,11 @@ const AP_Param::GroupInfo FlightAxis::var_info[] = {
|
|||||||
// @Param: OPTS
|
// @Param: OPTS
|
||||||
// @DisplayName: FlightAxis options
|
// @DisplayName: FlightAxis options
|
||||||
// @Description: Bitmask of FlightAxis options
|
// @Description: Bitmask of FlightAxis options
|
||||||
|
// @Bitmask: 0: Reset position on startup
|
||||||
// @Bitmask: 1: Swap first 4 and last 4 servos (for quadplane testing)
|
// @Bitmask: 1: Swap first 4 and last 4 servos (for quadplane testing)
|
||||||
// @Bitmask: 2: Demix heli servos and send roll/pitch/collective/yaw
|
// @Bitmask: 2: Demix heli servos and send roll/pitch/collective/yaw
|
||||||
// @User: Advanced
|
// @User: Advanced
|
||||||
AP_GROUPINFO("OPTS", 1, FlightAxis, _options, 0),
|
AP_GROUPINFO("OPTS", 1, FlightAxis, _options, uint32_t(Option::ResetPosition)),
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -303,6 +304,15 @@ void FlightAxis::exchange_data(const struct sitl_input &input)
|
|||||||
</soap:Body>
|
</soap:Body>
|
||||||
</soap:Envelope>)");
|
</soap:Envelope>)");
|
||||||
soap_request_end(1000);
|
soap_request_end(1000);
|
||||||
|
if(option_is_set(Option::ResetPosition)) {
|
||||||
|
soap_request_start("ResetAircraft", R"(<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
||||||
|
<soap:Body>
|
||||||
|
<ResetAircraft><a>1</a><b>2</b></ResetAircraft>
|
||||||
|
</soap:Body>
|
||||||
|
</soap:Envelope>)");
|
||||||
|
soap_request_end(1000);
|
||||||
|
}
|
||||||
soap_request_start("InjectUAVControllerInterface", R"(<?xml version='1.0' encoding='UTF-8'?>
|
soap_request_start("InjectUAVControllerInterface", R"(<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
||||||
<soap:Body>
|
<soap:Body>
|
||||||
|
@ -177,6 +177,7 @@ private:
|
|||||||
AP_Int32 _options;
|
AP_Int32 _options;
|
||||||
|
|
||||||
enum class Option : uint32_t{
|
enum class Option : uint32_t{
|
||||||
|
ResetPosition = (1U<<0),
|
||||||
Rev4Servos = (1U<<1),
|
Rev4Servos = (1U<<1),
|
||||||
HeliDemix = (1U<<2),
|
HeliDemix = (1U<<2),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user