Skip to content

Handling vehicle section transfers #7

@CarlinLiao

Description

@CarlinLiao

https://github.com/spartalab/aimsim/blob/56e9beaeb158b0c045f117e3b44f2c7421879659/aimsim/endpoints/remover.py#L55-L58

From #2 (comment)

@ribsthakkar

How are you going to handle if the section is not the center, do you just reject the transfer. I am not sure I am understanding this segementation of vehicles just yet.

@CarlinLiao

The remover ignores the transfer if it's the front of the vehicle.
The remover returns the vehicle to the simulator if it's the center, since it can't update the position. (On the road, when it passes a vehicle center to a remover, it deletes the vehicle from its own scope even though it hasn't passed the rear on yet. This is kind of hacky but vehicles' positions are updated by their centers but the remover doesn't have a trajectory to use for this, so whatever.)
The remover should never see a vehicle rear.

@ribsthakkar

I am still not sure if I am understanding. The three cases you said make it seem like the remover does nothing with any section of the vehicle.

@CarlinLiao

The remover doesn't actually do any removing... (maybe this is a bad name). The road removes the vehicle from its internal list itself once a vehicle's center section exits the road (because vehicle positions are based on its center).

When a vehicle section exits a road, the road passes the section to the remover. The remover reports that the vehicle exited to the parent simulator iff the section it gets is the center, and the simulator logs the vehicle's time in the sim.

I can see how this is confusing. Will have to think more about it. The general idea is that the road notices when a vehicle or vehicle section has left its domain and transfers it to the downstream object, which has to figure out what to do with it. In the the Remover's case, it decides whether to report the vehicle as "exited" to the parent simulator.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions