Skip to content
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: sensors aren't filled #33721

Open
sshane opened this issue Oct 3, 2024 · 2 comments · May be fixed by #33836
Open

simulator: sensors aren't filled #33721

sshane opened this issue Oct 3, 2024 · 2 comments · May be fixed by #33836
Labels
bug good first issue Feasible for new contributers simulation running openpilot in environments like CARLA

Comments

@sshane
Copy link
Contributor

sshane commented Oct 3, 2024

The IMUState is never updated, so locationd is getting 0s for the sensor data, and then paramsd learns a bad offset, preventing from merging a fix to the steering angle: #33718

class IMUState:
def __init__(self):
self.accelerometer: vec3 = vec3(0,0,0)
self.gyroscope: vec3 = vec3(0,0,0)
self.bearing: float = 0

We may be able to fake these sensors with the vehicle state:

metadrive_vehicle_state(velocity=vec3(x=3.250601291656494, y=10.504247665405273, z=0), position=(217.0621795654297, 82.05776977539062), bearing=72.51176834106445, steering_angle=7.866117000579834)

@sshane sshane added enhancement bug simulation running openpilot in environments like CARLA good first issue Feasible for new contributers and removed enhancement labels Oct 3, 2024
@schmxtz
Copy link

schmxtz commented Oct 15, 2024

I'm wondering what to do with the gyroscope value for IMUState. Metadrive does neither offer a simulated value for gyroscope nor for direction. We can just get the bearing value in this function and store it in the state.imu.bearing variable. I guess the acceleration can also be calculated based on the last timestamp and last stored velocity and current velocity. But the gyroscope has to be kinda hacked, to be calculated based on the acceleration and direction the car is heading and even then it is really inaccurate. Or is it just that the value should stay zero?

@sambhavnoobcoder
Copy link

hey @sshane , i would like to take up this issue . i think i have a code in line with @schmxtz 's suggestion that would solve this issue . if your okay with it , i'd like to work on this and resolve it asap .

@sambhavnoobcoder sambhavnoobcoder linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Feasible for new contributers simulation running openpilot in environments like CARLA
Projects
Status: Open
Development

Successfully merging a pull request may close this issue.

3 participants