-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi,
I noticed a discrepancy between the get_worldgrid_from_pos function and the instructions provided in the README regarding how positionID should be converted to world coordinates.
Current Implementation:
def get_worldgrid_from_pos(self, pos):
grid_y = pos % 480
grid_x = pos // 480
return np.array([grid_x, grid_y], dtype=int)
In this implementation:
grid_y is calculated using pos % 480.
grid_x is calculated using pos // 480.
According to the README:
The README indicates that the position ID should be interpreted on a 480x1440 grid with X-first indexing, and the formula for converting positionID to world coordinates is:
X = -3.0 + 0.025 * (ID % 480)
Y = -9.0 + 0.025 * (ID // 480)
Discrepancy:
The current implementation appears to be interpreting the grid in a Y-first manner (i.e., grid_y calculated first, then grid_x).
According to the README, the position ID should be interpreted as X-first, meaning the formula should first calculate X (which corresponds to grid_x in the code) using ID % 480 and then calculate Y (which corresponds to grid_y) using ID // 480.
This could lead to incorrect conversions between positionID and grid/world coordinates.
Suggested Fix:
To align with the README, the implementation could be updated to:
def get_worldgrid_from_pos(self, pos):
grid_x = pos % 480 # This corresponds to X in the README
grid_y = pos // 480 # This corresponds to Y in the README
return np.array([grid_x, grid_y], dtype=int)
This should ensure that the conversion between positionID and world/grid coordinates matches the intended X-first indexing described in the README.
Let me know if this makes sense or if there are any other considerations I might have missed.
Thanks!