Code Monkey home page Code Monkey logo

Comments (4)

deepcs233 avatar deepcs233 commented on July 27, 2024 2

Hi!
These specific coordinates are manually annotated by the authors :)

If you also need to obtain these values, I could give you some suggestions:

  1. generate the corresponding .xodr map file by the Carla Python API
  2. open the website: https://odrviewer.io/ , and upload the .xodr map file to this website. This website can help you visualize the Carla map
  3. find the coordinates that you need. Some coordinate transforms may need to be applied. I remember that the y-axis value should multiply -1 when used in the Carla simulator.

from lmdrive.

kevinchiu19 avatar kevinchiu19 commented on July 27, 2024

Thank you for your detailed reply. I have studied and tried it based on it these days, and I think I understand it.

In addition, I found a problem. In the town map used in the currently provided project(Town01, Town10HD...), in the ''geoReference'' field of the a file, the displacements of ''lat_0=0 +lon_0=0'' are all 0, but in the town13 used in Leaderboard2.0, ''lat_0=41.09374957104912 + lon_0=-81.59374804575259'', which will cause some problems:

In calculations involving "gps to location", such as those used in the following two files, I think the mean and scale used in different towns will change with lat_ref and lon_ref:
1. leaderboard/team_code/lmdriver_agent.py
2. leaderboard/team_code/planner.py
self.mean = np.array([0.0, 0.0]) # for carla 9.10
self.scale = np.array([111324.60662786, 111319.490945]) # for carla 9.10

I referred to the code in leaderboard (leaderboard/leaderboard/utils/route_manipulation.py -> _location_to_gps), I learned from it and worked backwards, and got what I think is the correct conversion method:

`
def _gps_to_location(lat_ref, lon_ref, lat, lon, z):
"""
参考自 leaderboard/leaderboard/utils/route_manipulation.py -> _location_to_gps
"""

EARTH_RADIUS_EQUA = 6378137.0   # pylint: disable=invalid-name
scale = math.cos(lat_ref * math.pi / 180.0)
mx = scale * lon_ref * math.pi * EARTH_RADIUS_EQUA / 180.0
my = scale * EARTH_RADIUS_EQUA * math.log(math.tan((90.0 + lat_ref) * math.pi / 360.0))

mx_ = lon / 180.0 * (math.pi * EARTH_RADIUS_EQUA * scale)
my_ = math.log(math.tan((lat + 90.0) * math.pi / 360.0)) * (EARTH_RADIUS_EQUA * scale)
location_z = z

location_x = mx_ - mx
location_y = -my_ + my

return {'x': location_x, 'y': location_y, 'z': location_z}

`

from lmdrive.

deepcs233 avatar deepcs233 commented on July 27, 2024

Hi!
Sorry! I'm not familiar with the leaderboard 2.0. I remembered that the coordinate system is a little special(The GPS value was corrupted by noise. If the AV didn't move, the GPS of it was still changing?).

I think the best way is to check your config file by running it in the simulator.

from lmdrive.

kevinchiu19 avatar kevinchiu19 commented on July 27, 2024

Thanks!

from lmdrive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.