frk2 / opencaret

An open-source/open-data L3 highway autopilot system for modern cars. Initially being perfected on the Kia Soul EV
MIT License
58 stars 22 forks source link

Makes the radar use a valid counter #23

Closed frk2 closed 6 years ago

J-Rojas commented 6 years ago

@frk2 I'm only seeing invalid tracks with the CAN dump data. Did you intend to record valid track data to test this?

stamp:
  sec: 0
  nanosec: 0
radar_tracks:
- track_id: 0
  counter: 136
  lat_dist: -0.20000000298023224
  lng_dist: 0.8799999952316284
  new_track: false
  rel_speed: -0.02500000037252903
  valid_count: 100
  valid: false
- track_id: 10
  counter: 195
  lat_dist: 0.11999999731779099
  lng_dist: 1.0
  new_track: false
  rel_speed: 0.0
  valid_count: 100
  valid: false
- track_id: 8
  counter: 230
  lat_dist: -0.3199999928474426
  lng_dist: 1.0
  new_track: false
  rel_speed: 0.0
  valid_count: 100
  valid: false
- track_id: 9
  counter: 210
  lat_dist: 0.47999998927116394
  lng_dist: 0.9200000166893005
  new_track: false
  rel_speed: 0.0
  valid_count: 100
  valid: false
radar_accels:
- track_id: 8
  counter: 226
  rel_accel: 0.0
- track_id: 9
  counter: 93
  rel_accel: 0.0
- track_id: 0
  counter: 217
  rel_accel: 0.0
- track_id: 10
  counter: 234
  rel_accel: 0.0
J-Rojas commented 6 years ago

There's a few things here that I don't agree with that maybe were not clear in the previous branch.

1) the 'valid' field from the radar is not being used. This is the source of truth about track validity and should be passed along.

2) Tracks shouldn't be filtered by valid_count > 0. They should be passed through as well. I made comments about this in the source code and kept some filtering code commented out for the time being. It would be useful to study invalid tracks and filtering them out at this level prevents further analysis downstream.

3) The use of the dictionary places the track ids out of order, which makes it somewhat challenging to follow if you are using rostopic echo for analysis.

I'm going to take some of your code and adjust to similar to how I had it in the previous commit. Thanks for the help.

I'm also going to revert the python-can update - that should be figured out independently. That is causing other problems for me as well after some restarts of the radar. Reinstalling to 2.1.0 removed the error.

cantools.database.errors.Error: The signals SET_ME_X00 and SET_ME_X00 are overlapping in message STEERING_IPAS_COMMA.