Move simulator
This endpoint moves a running simulator with the specified Id. The get the id you can list all the simulators first with the get-drones endpoint. The action request might take some seconds to be processed. We recommend to use the move endpoint to move the simulator if the drone is not correctly placed before to stop and star it in the correct location, moving the drone will be processed faster.
POST /api/1.0/simulator/{simulatord}/move
Body
lat: <Float> Latitude where to start the simulator,
lon: <Float> Longitude where to start the simulator,
alt: <Float> AMSL Absolute altitude where to start the simulator,
Response
Model: application/json
{
"status": <Boolean> True if the simulator start request is accepted,
}
Example
const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`/api/1.0/simulator/41/start`, {
mode: "cors",
method: "POST",
referrer: "no-referrer",
headers: {"authorization": "Bearer " + token}
body: JSON.stringify({
"lat": "46.58589776852092",
"lon":"6.550499126884768",
"alt":"506.2"
}),
})
if(!serverResponse.ok){
try {
switch (serverResponse.status){
case 400:
j = await serverResponse.json();
break;
case 403:
response = { message: "Forbidden access to data" };
case 404:
response = { message: "Address not found" };
default:
j = await serverResponse.json()
}
} catch (e) {
response = { message: "Error fetching data" };
}
}else{
j = await serverResponse.json()
}
response = { data:j };
const {data, message} = response
if(message) console.debug(message)
if(data) console.debug(data)
}
fetchData()
Answer:
{
"status: true,
}