Git Product home page Git Product logo

Comments (13)

nonsingularmatrix avatar nonsingularmatrix commented on May 11, 2024 3

@WenchaoDing
Indeed the orientation of the lanes is encoded in the third value (second index) of the RGB-value.
You can observe this, when you pick this value of a specific point of a turn in the road (e.g. "Town01Lanes.png") and perform a small variation.

from carla.

felipecode avatar felipecode commented on May 11, 2024 2

@yanii That is not currently available. However on the next release we will give users access to a map. That will allow you to get the car position within the lane. This is probably helpful for your needs. To get access early watch the "new_client_api" branch. It will be there by today or tommorrow.

@xl-sr We try to provide only primary measurements. You could program the IsThereAnObstacleAhead function by getting the player's position and orientation and comparing with the position of all agents in the simulator.

from carla.

Dhagash4 avatar Dhagash4 commented on May 11, 2024 1

@FitashUlHaq You can get all the waypoints at the center using this so what I do is save the waypoints of the whole map in a text file and query from that text file the nearest waypoint from the car center

world.get_map().get_waypoint_xodr(road_id,lane_id,s).next_until_lane_end(1.0)

This will give waypoint till the lane end 1m apart from each other. For further info do check carla.Map

Hope this helps

from carla.

xl-sr avatar xl-sr commented on May 11, 2024

Yes, I am interested in this too.
Other measurements would be helpful as well, e.g. the output from the AI controller function IsThereAnObstacleAhead()

from carla.

nsubiron avatar nsubiron commented on May 11, 2024

@xl-sr IsThereAnObstacleAhead() is an internal function fine-tuned for the current autopilot and its results may not be very intuitive. Like there are several magic numbers that just work with the current autopilot, only detects dynamic obstacles, and detects pedestrians way before they are on the road.

from carla.

xl-sr avatar xl-sr commented on May 11, 2024

ok thanks. I think the approach of comparing the agents positions will give me what I want to achieve.

from carla.

WenchaoDing avatar WenchaoDing commented on May 11, 2024

Hi @felipecode ,

I am writing some function to calculate the distance to the lane left boundary and the right boundary, and I notice your implementation:

ori = self.map_image_lanes[int(pixel[1]), int(pixel[0]), 2]

ori = ((float(ori) / 255.0)) * 2 * math.pi

return (-math.cos(ori), -math.sin(ori))

I am confused about why you can obtain the lane orientation by reading from one channel of the image. Is there any format encoded? Could you please provide any hint on how to implement my function efficiently? Thanks in advance.

from carla.

nsubiron avatar nsubiron commented on May 11, 2024

Yes, the image has encoded the information of the road

FColor FRoadMapPixelData::EncodeAsColor() const
{
if (!IsRoad()) {
return FColor(0u, 0u, 0u, 255u);
} else if (!HasDirection()) {
return FColor(255u, 255u, 255u, 255u);
} else {
auto ToColor = [](float X){
return FMath::FloorToInt(256.0 * (X + PI) / (2.0f * PI)) % 256;
};
const float Azimuth = GetDirectionAzimuthalAngle();
return FColor(0u, 255u, ToColor(Azimuth), 255u);
}
}

I was printing this for debugging purposes then @felipecode started using it in his planner 😀, just keep in mind that in the conversion to PNG may be some losses so the info won't be 100% accurate.

@felipecode Also, the image inside the planner is an old one, we improved the precision of turns an intersections.

from carla.

hs105 avatar hs105 commented on May 11, 2024

I thinks "Distance from Centre of Lane" is available in the latest release (0.8)?

from carla.

errorJY avatar errorJY commented on May 11, 2024

Hi,@WenchaoDing
How did you get the Distance from Centre of Lane.I want to get it but i don't know how to get it.

from carla.

errorJY avatar errorJY commented on May 11, 2024

Hello,@nsubiron Nice to meet u again.
I have a problem that if I want to print the orientation of the lanes at screen(Fcolor[2]).How should i do?

from carla.

stale avatar stale commented on May 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from carla.

FitashUlHaq avatar FitashUlHaq commented on May 11, 2024

Hi, is there any update on this? I tried getting the distance between ego vehicle and way-point at the center of the road but no success

from carla.

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.