Fix up some python to get run working in vs code.
Also allowed running with python -m car
This commit is contained in:
21
.vscode/launch.json
vendored
Normal file
21
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: Module",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "car"
|
||||
},
|
||||
{
|
||||
"name": "Python: Current File",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${file}",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
car/src/car/__main__.py
Normal file
4
car/src/car/__main__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import controller
|
||||
|
||||
if __name__ == '__main__':
|
||||
controller.main()
|
||||
@@ -55,10 +55,12 @@ class CarServer():
|
||||
|
||||
return grpc.ssl_server_credentials([[pvtKeyBytes, pvtCertBytes]])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
server = CarServer(vehicle_factory.get_vehicle())
|
||||
|
||||
# Can't remember why I do this, is it even needed?
|
||||
service_thread = Thread(target=server.start_server)
|
||||
service_thread.start()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -14,7 +14,7 @@ def get_lidar(device=None, connection='/dev/ttyUSB0'):
|
||||
print(
|
||||
'No lidar device specified and the CAR_LIDAR environment variable is not set.')
|
||||
if actual_device == MOCK_DEVICE:
|
||||
return MockLidar(loader.load_scans_bytes_file("car/tracking/out.pickle"))
|
||||
return MockLidar(loader.load_scans_bytes_file("car/src/car/tracking/out.pickle"))
|
||||
elif actual_device == RPLIDAR:
|
||||
try:
|
||||
from rplidar import RPLidar
|
||||
|
||||
Reference in New Issue
Block a user