Closed dfarrell07 closed 11 years ago
Yeah, seeing this on the bot as well.
That's expected if there is a mismatch between the object you're providing via sensorData and the dict I'm using with the fake IPC channel. If you give me an example of what to expect from sensorData, I can make them consistent. You may want to switch to DumbLocalizer if you don't see a quick fix before I get to it.
The shared Google doc "Serial communication API (text)" should contain the most updated (and final) dict format for sensor data returned (among other things). Look for getAllSensorData() in High-level methods column. Assuming @dfarrell07 preserves this structure when converting sensor values to appropriate units, this is what you should expect.
Sorry, meant to respond to this earlier. I referenced the document @napratin linked to above, so unless it changed or I made a mistake, it should be the same. Here's an example of the sensor data dict (you can get this by running nav via test cases or controller and then inspecting the log).
2013-04-02 16:46:41,854 | INFO | nav.py | getSensorData | 540 | Sensor data from comm: {'accel': {'x': 0, 'y': 0, 'z': 980},
'heading': 0,
'id': 0,
'msg': 'This is fake',
'result': True,
'ultrasonic': {'back': 100, 'front': 100, 'left': 100, 'right': 100}}
2013-04-02 16:46:41,855 | INFO | nav.py | getSensorData | 544 | Converted sensor data: {'accel': {'x': 0, 'y': 0, 'z': 980},
'heading': 0.0,
'id': 0,
'msg': 'This is fake',
'result': True,
'ultrasonic': {'back': 1.3385833999999999,
'front': 1.3385833999999999,
'left': 1.3385833999999999,
'right': 1.3385833999999999}}
@napratin -- thank you for the (now, in hindsight, obvious) pointers to the documentation. I should have looked there right away.
@dfarrell07 -- I'll fix this right now so that it (at least) works with the sample data you provided. I'll update here when it's pushed.
Quick fix pushed in SHA: e563a6af7e02f5986557ff02cfe832106468abe5
Please confirm that the new SensorData handling works on your end.
Seems to work.
I'm seeing the following error in localizer, both running from comm and controller.
@napratin and I are working with the bot right now, so I haven't looked into this in detail. At first glance I guess it's a problem indexing into the sensor data, maybe caused by the fact that's front is in a nested dict. Just a guess, haven't even looked at the code.