src.Basic package

Submodules

src.Basic.Vehicle module

class src.Basic.Vehicle.AgentClass[source]

Bases: object

CAR = 2
MOTORCYCLE = 1
PEDESTRIAN = 4
TRUCK = 3
class src.Basic.Vehicle.Frenet(roadind: src.Roadway.roadway.RoadIndex = None, s: float = None, t: float = None, phi: float = None)[source]

Bases: object

the relative position of a global point

set(posG: src.Vec.VecSE2.VecSE2, roadWay: src.Roadway.roadway.Roadway)[source]
Parameters
  • posG – the position, a VecSE2 object

  • roadWay – roadway information

Returns

set the Frenet by projecting posG on the roadway

class src.Basic.Vehicle.Vehicle(state_: src.Basic.Vehicle.VehicleState, def_: src.Basic.Vehicle.VehicleDef, id: int)[source]

Bases: object

property get_center
Returns

global position

property get_footpoint
Returns

get the global position of the rear of the vehicle

get_targetpoint_delta(part: str)[source]
Parameters

part – Front or Center or Rear

Returns

global position of Front or Center or Rear

class src.Basic.Vehicle.VehicleDef(class_: int = 2, length_: float = 4.0, width_: float = 1.8)[source]

Bases: object

write(fp)[source]
Parameters

fp – the file pointer to write

Returns

write Vehicle definition to file, no return

class src.Basic.Vehicle.VehicleState(posG: src.Vec.VecSE2.VecSE2 = None, posF: src.Basic.Vehicle.Frenet = None, v: float = None)[source]

Bases: object

set(posG: src.Vec.VecSE2.VecSE2, roadWay: src.Roadway.roadway.Roadway, v: float)[source]
Parameters
  • posG – global position

  • roadWay – roadway

  • v – velocity

Returns

set value, no return

write(fp)[source]
Parameters

fp – file pointer to wirte

Returns

write vehicle state to file

src.Basic.Vehicle.get_lane_width(veh: src.Basic.Vehicle.Vehicle, roadway_: src.Roadway.roadway.Roadway)[source]
Parameters
  • veh – Vehicle

  • roadway – roadway

Returns

get the lane width of where the current vehicle is

src.Basic.Vehicle.get_markerdist_left(veh: src.Basic.Vehicle.Vehicle, roadway_: src.Roadway.roadway.Roadway)[source]
Parameters
  • veh – Vehicle

  • roadway – Roadway

Returns

the distance between the vehicle and the left boundary of the lane

src.Basic.Vehicle.get_markerdist_right(veh: src.Basic.Vehicle.Vehicle, roadway_: src.Roadway.roadway.Roadway)[source]
Parameters
  • veh – Vehicle

  • roadway – Roadway

Returns

the distance between the vehicle and the right boundary of the lane

src.Basic.Vehicle.read_def(fp)[source]
Parameters

fp – the file pointer to read

Returns

the vehicle definition

src.Basic.Vehicle.read_state(fp)[source]
Parameters

fp – file pointer to read

Returns

VehicleState object

Module contents