I am using the SDK to implement a full mission, including uploading a new route. The attached code Program.cs is heavily based on the Console example in the SDK. however, when I try to upload the new route, I get the exception "Action requires exclusive vehicle control." even when I acquire a lock before hand. What do I need to change to get this working?
Here's the most relevant section of code from the attached file:
AcquireLockRequest acquireLockRequest = new AcquireLockRequest
{
ClientId = clientId,
ObjectType = "Route",
ObjectId = updateRouteTask.Value.Object.Route.Id,
};
MessageFuture<AcquireLockResponse> acquireLockTask = messageExecutor.Submit<AcquireLockResponse>(acquireLockRequest);
acquireLockTask.Wait();
System.Console.WriteLine("Lock Acquired");
UploadRouteRequest uploadRequest = new UploadRouteRequest
{
ClientId = clientId,
ProcessedRoute = processedRoute,
Vehicle = vehicle,
};
MessageFuture<UploadRouteResponse> uploadTask = messageExecutor.Submit<UploadRouteResponse>(uploadRequest);
uploadTask.Wait();
System.Console.WriteLine("Route uploaded");
Thanks,
David
Replies
Stevod said:
Program.cs
That's great, thanks. Nir - that was the problem. I now have a fully operational mission at the console using EMU-COPTER. Stage 1 accomplished :)
Hi David,
Do you see something like "lock acquired by <User> admin" in your ucs.log?
If not, instead of updateRouteTask.Value.Object.Route.Id try to use the vehicle ID. This worked for me: