openpilot v0.9.6 release
date: 2024-01-12T10:13:37 master commit: ba792d576a49a0899b88a753fa1c52956bedf9e6
This commit is contained in:
33
selfdrive/navd/set_destination.py
Executable file
33
selfdrive/navd/set_destination.py
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import sys
|
||||
|
||||
from openpilot.common.params import Params
|
||||
|
||||
if __name__ == "__main__":
|
||||
params = Params()
|
||||
|
||||
# set from google maps url
|
||||
if len(sys.argv) > 1:
|
||||
coords = sys.argv[1].split("/@")[-1].split("/")[0].split(",")
|
||||
dest = {
|
||||
"latitude": float(coords[0]),
|
||||
"longitude": float(coords[1])
|
||||
}
|
||||
params.put("NavDestination", json.dumps(dest))
|
||||
params.remove("NavDestinationWaypoints")
|
||||
else:
|
||||
print("Setting to Taco Bell")
|
||||
dest = {
|
||||
"latitude": 32.71160109904473,
|
||||
"longitude": -117.12556569985693,
|
||||
}
|
||||
params.put("NavDestination", json.dumps(dest))
|
||||
|
||||
waypoints = [
|
||||
(-117.16020713111648, 32.71997612490662),
|
||||
]
|
||||
params.put("NavDestinationWaypoints", json.dumps(waypoints))
|
||||
|
||||
print(dest)
|
||||
print(waypoints)
|
||||
Reference in New Issue
Block a user