Telenav / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
18 stars 7 forks source link

Oasis API design #128

Closed CodeBear801 closed 4 years ago

CodeBear801 commented 4 years ago

Subtask of #120. API design for POC. For deployment information, could go to here.

Oasis API expect user input orig point, destination point and vehicle information, it will select needed charge station to achieve the trip and return them as waypoints.

Input

The input contains information related with user's vehicle status, where to go and specific settings.

Option Values Descriptions Comments
max_range float(meters) Max range if fully charged
curr_range float(meters) Distance represent current electric level
prefer_level float(meters) Preferred charge buffer level more info
safe_level float(meters) Safe charge level more info
curve string TBD
http:127.0.0.1:8090/oasis/v1/earliest/-82.058695,35.036645;-81.89309,34.97914?max_range=500000.0&curr_range=160000.0

The unit is alined with OSRM, distance's unit is meter, time's unit is second

Response

Response contains information for charge station needed to complete the route.

[
{
  "distance": 90.0,
  "duration": 300.0,
  "estimate_remaining_range":100000.0,
  "weight": 300.0,
  "weight_name": "duration",
  "charge_stations": [
    {
      "address" : [
               {
                      "geo_coordinates": {
                                "latitude": 37.78509,  
                                 "longitude": -122.41988
                       },
                      "nav_coordinates": [
                                  {
                                           "latitude": 37.78509,
                                           "longitude": -122.41988
                                  }
                       ]
               }
       ],
      "wait_time" : 30.0,
      "charge_time": 100.0,
      "charge_range": 100.0,
       "detail_url":"url from search component which could retrieve charge station's information"
    },
    {
      "address" : [
               {
                      "geo_coordinates": {
                                "latitude": 13.40677,  
                                 "longitude": 52.53333
                       },
                      "nav_coordinates": [
                                  {
                                           "latitude": 13.40677,
                                           "longitude": 52.53333
                                  }
                       ]
               }
       ],
      "wait_time": 100.0,
      "charge_time": 100.0,
      "charge_range": 100.0,
      "detail_url":"url from search component which could retrieve charge station's information"
    },
  ]
}

]

Reference

CodeBear801 commented 4 years ago

Initial fake response: For any input, will generate one way_points as

location = (orig + dest) / 2

and with fixed value for other parameters

wangyoucao577 commented 4 years ago
CodeBear801 commented 4 years ago
  • Suggset to unify names with http.md, i.e. way_points --> waypoints.
  • Does the curve means vehicle's energy consumption curve? You could take the HERE's energy consumption model as reference.

Yes, thanks for the suggestions :)

CodeBear801 commented 4 years ago

[outdated] image

CodeBear801 commented 4 years ago

image

Adjust:

CodeBear801 commented 4 years ago

Update

Due to new information found in:https://github.com/Telenav/osrm-backend/issues/132#issuecomment-575747820 Modify Oasis API

- Add

ChargeStation [ { Address { geo_coordinates { lat lon } nav_coordinates[ { lat, lon } ] } "detail_url": "xxxxx" }]

image

CodeBear801 commented 4 years ago

To do: