-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator: cleanup in preparation for metadrive #29903
Conversation
bc072e3
to
60138e7
Compare
selfdrive/controls/controlsd.py
Outdated
@@ -339,7 +339,7 @@ def update_events(self, CS): | |||
self.events.add(EventName.cameraMalfunction) | |||
elif not self.sm.all_freq_ok(self.camera_packets): | |||
self.events.add(EventName.cameraFrameRate) | |||
if not REPLAY and self.rk.lagging: | |||
if not REPLAY and not SIMULATION and self.rk.lagging: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be ignored. openpilot doesn't need much to run realtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@adeebshihadeh this is all the cleanup stuff for carla, which will allow metadrive to be a drop in replacement |
tools/sim/bridge/carla.py
Outdated
self.num_selected_spawn_point = arguments.num_selected_spawn_point | ||
|
||
def spawn_world(self): | ||
import carla # pylint: disable=import-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the pylint suppression needed?
tools/sim/bridge/carla.py
Outdated
world = client.load_world(self.town) | ||
|
||
settings = world.get_settings() | ||
#settings.synchronous_mode = True # Enables synchronous mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this dead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs much better without it, removed the commented line
tools/sim/bridge/carla.py
Outdated
def close(self): | ||
super().close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just don't override it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meant to call world.close, done
tools/sim/bridge/carla.py
Outdated
|
||
def spawn_world(self): | ||
import carla # pylint: disable=import-error | ||
def connect_carla_client(host: str, port: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -0,0 +1,171 @@ | |||
import numpy as np | |||
from openpilot.common.params import Params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breakup the openpilot imports with a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
With the goal of adding metadrive as another simulator. Mostly taken from #27373