Start simulator
This endpoint starts a simulator with the specified Id. The get the id you can list all the simulators first with the get-drones endpoint. Once started the simulator will start sending telemetry to the corresponding topic. The simulator will be stopped automatically after 3 hours. We recommend to stop the simulator after use.
POST /api/1.0/simulator/{simulatord}/start
Body
The speed parameter is optional
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,
speed: <Integer> Integer value between 1-5,
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",
"speed":"1",
}),
})
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,
}