da-luce / cornell-autobike

Codebase of the Cornell Autonomous Bicycle Team
https://www.cuautobike.org/
1 stars 1 forks source link

Translating Coordinate Frames #33

Open AriMirsky opened 1 year ago

AriMirsky commented 1 year ago

Building off of #26, we need to be able to decide what our internal representation of the state space should be (what dimensions are we using for the qmatrix, and how much resolution in each dimension), and also how to translate between that representation and geocoordinates. The first part of this problem requires testing what resolutions give us enough detail to avoid obstacles, while not having too many states to slow down evaluation. The second part of the problem is linear algebra: given a basis for our internal representation of our state space, how do you translate back and forth from geocoordinates to points in our space.

AriMirsky commented 1 year ago

More details on what to actually make:

We want to make two functions: one from global geocoordinates to our state space's position coordinates, and one from our state space's position coordinates to global geocoordinates. This will be done by homogenous change of basis transformations.

We will assume that we are given coordinates of the origin of our state space's position coordinates, and basis vectors for our state space's position coordinates.

Our first function takes geocoordinates and our state space's basis and returns the corresponding location coordinates in our state space.

The second function takes position coordinates in our state space and the basis of our state space and returns the corresponding geocoordinates.

These functions should be part of the bikeQAgent class in src/qlearning/bikeQAgent.py

AriMirsky commented 11 months ago

to_state_coordinates(origin=(0, 0), state_basis=((0.0002, 0), (0, 0.0001)), geocoordinates=(0.001, 0.0003)) = (5, 3) to_state_coordinates(origin=(42.445725, -76.478241), state_basis=((0.0002, 0.0001), (-0.0001, 0.0002)), geocoordinates=(42.445925, -76.476641)) = (4, 6)

to_geocoordinates(origin=(0, 0), state_basis=((0.0002, 0), (0, 0.0001)), state=(7, 8)) = (0.0014, 0.0008) to_geocoordinates(origin=(42.444584, -76.483495), state_basis=((0.0002, 0.0001), (-0.0001, 0.0002)), state=(3, 4)) = (42.444784, -76.482395)