Page 1 of 1

Boundaries of a road

Posted: 12 Jul 2017, 11:28
by IRIIWU
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?

Re: Boundaries of a road

Posted: 13 Jul 2017, 12:51
by coppelia
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

Re: Boundaries of a road

Posted: 19 Jul 2017, 18:42
by IRIIWU
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

Re: Boundaries of a road

Posted: 20 Jul 2017, 10:54
by coppelia
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

Re: Boundaries of a road

Posted: 26 Jul 2017, 07:43
by IRIIWU
Hey Coppelia,
Thanks for the clarification. How would we get the map data and then how do we use the map data to differentiate.

Re: Boundaries of a road

Posted: 26 Jul 2017, 09:17
by IRIIWU
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

Re: Boundaries of a road

Posted: 28 Jul 2017, 06:56
by coppelia
Yes. The solution is basically the example file I mentioned in my previous post.

Cheers

Re: Boundaries of a road

Posted: 19 Aug 2017, 16:59
by IRIIWU
Hey , Coppelia I wanted to know how you were able to get the object position wrt to the image generated by the vision sensor

Re: Boundaries of a road

Posted: 22 Aug 2017, 08:16
by coppelia
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