Placing objects either left or right

Hi, for our (rail) scenarios, we want to place objects close to the (ego) track. Based on examples in the Scenic repo I came up with (simplified):

ego = new Train

spot = new OrientedPoint following ego_track for Range(100, 200)

person_on_track = new Person right of spot by Range(3, 6)

This is easy to read. However, we also want to place objects on the left side of the track.

Question: how can I place objects on either the left or right side of the ego track within the same scenario. Is that possible?

Hi Arjan,

I think what you want could be best accomplished using the relative to operator for OrientedPoint as follows:

ego = new Train
spot = new OrientedPoint following ego_track for Range(100, 200)
person_offset = (Uniform(-1,1)*Range(3,6),0,0)
person_pos =  person_offset relative to spot
person_on_track = new Person at person_pos

Hope this helps and please let me know if there are any issues!

Thanks @EricVin, Sorry I missed that. Now the scenarios look better.