First Steps
This guide will help you make your first API calls to control the Polymath Autonomous Vehicle.
We will use curl in these examples, but you are free to use any tool or library that suits your development needs.
Ensure that your device is connected to the internet before proceeding.
Prerequisites
Get your BEARER_TOKEN as shown in Authentication
Testing connection
Let's check that you're able to access the vehicle:
curl "https://polyglot.polymathrobotics.dev/api/synapse/$DEVICE_ID/v2/health" \
--header "Authorization: Bearer $BEARER_TOKEN"
Getting feedback: vehicle location
Now that you've gotten a response from the vehicle, let's get some more information.
We will query the vehicle's current GPS location and bearing, which is accessible in the /v2/polymath-feedback response at data.polymath_feedback.current_pose.pose.
curl "https://polyglot.polymathrobotics.dev/api/synapse/$DEVICE_ID/v2/polymath-feedback" \
--header "Authorization: Bearer $BEARER_TOKEN" \
| jq '.data.polymath_feedback.current_pose.pose'
You should receive a JSON response containing the current state of the vehicle:
{
"position": {
"latitude": 40.634180274928184,
"longitude": -96.16258620804851,
"altitude": 0
},
"orientation": {
"x": 0,
"y": 0,
"z": 0.3013746455741215,
"w": 0.9535058064873398
}
}
In most use cases, you'll issue a GET request to this endpoint at a regular interval so your application is kept up to date with the vehicle state.
Next Steps
Once you have successfully made these requests, explore the API Reference for the full list of available endpoints.