Skip to content

Commit 83c8eaa

Browse files
Change API to use UTM Easting with 500000 as center meridian
1 parent 56a25ba commit 83c8eaa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lgsvl/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def map_from_gps_batch(self, coords):
181181
if not isinstance(c["northing"], numtype): raise TypeError("Argument 'northing' should have '{}' type".format(numtype))
182182
if not isinstance(c["easting"], numtype): raise TypeError("Argument 'easting' should have '{}' type".format(numtype))
183183
if c["northing"] < 0 or c["northing"] > 10000000: raise ValueError("Northing is out of range")
184-
if c["easting"] < -340000 or c["easting"] > 334000 : raise ValueError("Easting is out of range")
184+
if c["easting"] < 160000 or c["easting"] > 834000 : raise ValueError("Easting is out of range")
185185
j["northing"] = c["northing"]
186186
j["easting"] = c["easting"]
187187
else:

tests/test_simulator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ def test_get_gps(self): # Checks that GPS reports the correct values
215215
self.assertAlmostEqual(gps.latitude, 37.4173601699318)
216216
self.assertAlmostEqual(gps.longitude, -122.016132757826)
217217
self.assertAlmostEqual(gps.northing, 4141627.34000015)
218-
self.assertAlmostEqual(gps.easting, 87060.970000267)
218+
self.assertAlmostEqual(gps.easting, 587060.970000267)
219219
self.assertAlmostEqual(gps.altitude, -1.03600001335144)
220220
self.assertAlmostEqual(gps.orientation, -194.823394775391)
221221

222222
def test_from_northing(self): # Check that position vectors are correctly generated given northing and easting
223223
with SimConnection() as sim:
224224
spawn = sim.get_spawn()[0]
225-
location = sim.map_from_gps(northing=4141627.34000015, easting=87060.970000267)
225+
location = sim.map_from_gps(northing=4141627.34000015, easting=587060.970000267)
226226
self.assertAlmostEqual(spawn.position.x, location.position.x, places=1)
227227
self.assertAlmostEqual(spawn.position.z, location.position.z, places=1)
228228

@@ -236,7 +236,7 @@ def test_from_latlong(self): # Check that position vectors are correctly generat
236236
def test_from_alt_orient(self): # Check that position vectors are correctly generated with altitude and orientation
237237
with SimConnection() as sim:
238238
spawn = sim.get_spawn()[0]
239-
location = sim.map_from_gps(northing=4141627.34000015, easting=87060.970000267, altitude=-1.03600001335144, orientation=-194.823394775391)
239+
location = sim.map_from_gps(northing=4141627.34000015, easting=587060.970000267, altitude=-1.03600001335144, orientation=-194.823394775391)
240240
self.assertAlmostEqual(spawn.position.y, location.position.y, places=1)
241241
self.assertAlmostEqual(spawn.rotation.y, location.rotation.y, places=1)
242242

0 commit comments

Comments
 (0)