Boundaries of a road

Typically: "How do I... ", "How can I... " questions
IRIIWU
Posts: 9
Joined: 11 Jul 2017, 21:53

Boundaries of a road

Postby IRIIWU » 12 Jul 2017, 11:28

Hey,
I have imported a road into vrep and now i want define boundaries so that I can tell a car that it is meant to remain on the road . What would be the best approach for this?

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: Boundaries of a road

Postby coppelia » 13 Jul 2017, 12:51

Hello,

you could mount various type of sensors to your car (e.g. vision or proximity). Another option would be build a 2D map of the scene, which indicates where the boundaries are. But in order to build that map, you would also need some sort of sensor.

Have a look at this example scene for instance.

Cheers

IRIIWU
Posts: 9
Joined: 11 Jul 2017, 21:53

Re: Boundaries of a road

Postby IRIIWU » 19 Jul 2017, 18:42

Hey Coppelia,
thanks for the suggestion but i was looking for something where I could just define the road as a valid region and everything else as and invalid region. any suggestions and directions as to how to go about it?

Thanks

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: Boundaries of a road

Postby coppelia » 20 Jul 2017, 10:54

That was my suggestion by using a map (the map will tell you what region is valid, and what region is invalid). But someone needs to create that map. Once you have the map, your vehicle can check its position relative to that map and try to avoid forbidden regions.

Cheers

IRIIWU
Posts: 9
Joined: 11 Jul 2017, 21:53

Re: Boundaries of a road

Postby IRIIWU » 26 Jul 2017, 07:43

Hey Coppelia,
Thanks for the clarification. How would we get the map data and then how do we use the map data to differentiate.

IRIIWU
Posts: 9
Joined: 11 Jul 2017, 21:53

Re: Boundaries of a road

Postby IRIIWU » 26 Jul 2017, 09:17

since the vision sensor gives us an image would the solution to basically indicate based on the colors in the map? ie black and white

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: Boundaries of a road

Postby coppelia » 28 Jul 2017, 06:56

Yes. The solution is basically the example file I mentioned in my previous post.

Cheers

IRIIWU
Posts: 9
Joined: 11 Jul 2017, 21:53

Re: Boundaries of a road

Postby IRIIWU » 19 Aug 2017, 16:59

Hey , Coppelia I wanted to know how you were able to get the object position wrt to the image generated by the vision sensor

coppelia
Site Admin
Posts: 6058
Joined: 14 Dec 2012, 00:25

Re: Boundaries of a road

Postby coppelia » 22 Aug 2017, 08:16

You would do something like:

Code: Select all

local absolutePosition={1,1,1}
local m=simGetObjectMatrix(visionSensorHandle,-1)
local mi=simInvertMatrix(m)
local relativePosition=simMultiplyVector(mi,absolutePosition)


Cheers


Return to “General questions”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot], rose and 20 guests