Updating a navigation session
Once a navigation session has been created and a subscription is running, more data can be provided to update the navigation session. Based on locations and telemetry data, Chargetrip optimizes the route.
Mutation
To update a navigation session an id and array of location_data need to be provided. The telemetry input is optional but including it will result in better consumption predictions and more accurate routing. If the mutation executed successfully, OK will be returned on the data object. The update itself will be reflected on the navigation query. When using the query, please be aware that changes can take a little while to process.
Locations data heartbeat
The location_data array requires at least one location. Alternatively, locations can be stored every 5 or 10 seconds, depending on the vehicle speed, and sent as a batch.
Sending the vehicle location at least every 5 minutes is recommended.
Telemetry data
Next to location data, telemetry data is accepted. This is real-time data coming directly from the vehicle. Obtaining this data can be done via the Connect platform as described here.
Telemetry data might include the current heading of the vehicle, state_of_charge, tire_pressure or is_charging state of the vehicle. The state_of_charge can be used for sending a new state of charge value after charging at the station or to confirm rolling predictions by sending intermittent state of charge values. Tire pressure can be used to more accurately do range predictions and by using the charging state of the vehicle, visual updates can be presented.
An overview of accepted / recommended telemetry fields is displayed here. Chargetrip can easily add additional custom telemetry inputs such as; heat pumps, active weight, refrigeration, PV etc. To learn more, contact sales@chargetrip.com or your customer success representative.
Arguments
input • NavigationUpdateInput
• Required
Navigation update input
Response
A response can either contain a data or an
errors object. The response header will always return
200 as a status code.
Data object
When successful, a data object will be returned with the
requested fields. If there are no fields present the
data object will return the operation name with the
appropriate return type. If the operation was a query, this output
will be an object of the schema’s query root type; if the operation
was a mutation, this output will be an object of the schema’s mutation
root type.
Error object
If unsuccessful, an errors object will be returned with
more details in the extensions object. The error object
can contain any of the following objects.
Error
EMPTY_ARRAY_NOT_ALLOWED
Array $NAME should have at least one value.
Error
INVALID_COORDINATES
Coordinates provided for $LOCATION are not valid.
Error
INVALID_UNIT
Provided unit type $TYPE for $LOCATION is not valid.
Error
INVALID_VALUE
Provided value $VALUE for $LOCATION is not valid. Expected value of type $EXPECTEDTYPE.
Error
NAVIGATION_HEADING_INVALID
Heading should be a value between 0 and 360.
Error
NAVIGATION_LOCATIONS_MINIMUM_LENGTH
You should send us at least one location.
Error
NAVIGATION_ROUTE_LEG_INVALID
One or more locations sent have their route leg index out of order or greater than the number of legs of the navigation session route.
Error
NAVIGATION_TELEMETRY_INVALID
Field $TELEMETRYTYPE cannot be negative.
Error
NAVIGATION_TIMESTAMP_INVALID
One or more locations sent have a timestamp that is older than the start of the navigation session or the latest known timestamp.
Error
NEGATIVE_VALUE_NOT_ALLOWED
Negative value for $LOCATION is not allowed.
Error
OCCUPANTS_BELOW_ALLOWED
Provided number of occupants for $LOCATION is not valid. The value must be at least 1.
Error
OPERATION_NOT_ALLOWED
You are not allowed to execute this operation. Enable it for the current application in the dashboard or reach out to customer support.
Error
TIRE_PRESSURE_BELOW_ALLOWED
Provided tire pressure is not valid. The value must be at least 1.
Error
ZERO_OR_NEGATIVE_VALUE_NOT_ALLOWED
Zero or negative value for $LOCATION is not allowed.