I am using following code on the .net SDK, trying to send the Phantom 3 simulator to a home point of lat/long/alt {0.0,0.0,0.0} before flying a mission.
Unfortunately, the UGCS emulator has a bug and will not return telemetry on Ubuntu when flying, and hence I have purchased a physical DJI drone to use its simulator instead.
The SDK documentation is unclear on what commands/parameter are available, and their structure, and hence I am guessing what I should be using. Will it be possible to publish a list of SDK commands/parameters, please, as they seem to be similar, but not identical to standard MAVLINK commands?
Until that is available, could you please advise on how to reset and fly to a new home location using the simulator, please.
Thanks.
var sendCommandRequest = new SendCommandRequest
{
ClientId = clientId,
Command = new UGCS.Sdk.Protocol.Encoding.Command
{
Code = "set_home",
Subsystem = Subsystem.S_FLIGHT_CONTROLLER
}
};
sendCommandRequest.Command.Arguments.AddRange(new CommandArgument[] {
new CommandArgument { Code = "latitude", Value = new Value { DoubleValue = 0.0 }},
new CommandArgument { Code = "longitude", Value = new Value { DoubleValue = 0.0 }},
new CommandArgument { Code = "altitude", Value = new Value { DoubleValue = 0.0 }}
});
sendCommandRequest.Vehicles.Add(new Vehicle { Id = vehicle.Id });
var sendCommandResponse = messageExecutor.Submit<SendCommandResponse>(sendCommandRequest);
sendCommandResponse.Wait();
SendCommandRequest request = new SendCommandRequest
{
ClientId = clientId,
Command = new UGCS.Sdk.Protocol.Encoding.Command
{
Code = "return_to_launch",
Subsystem = Subsystem.S_FLIGHT_CONTROLLER,
}
};
request.Vehicles.Add(new Vehicle() { Id = vehicle.Id });
var rtlResponse = messageExecutor.Submit<SendCommandResponse>(request);
rtlResponse.Wait()
Replies
Hello,
In UgCS you can provide a new vehicle's home location only as part of a route.
route.HomeLocationSource = HomeLocationSource.HLS_EXPLICIT;