umich_sim.sim_backend package#
Subpackages#
- umich_sim.sim_backend.carla_modules package
- Submodules
- umich_sim.sim_backend.carla_modules.camera_manager module
- umich_sim.sim_backend.carla_modules.collision_sensor module
- umich_sim.sim_backend.carla_modules.ego_vehicle module
EgoVehicle
EgoVehicle.change_steer()
EgoVehicle.change_throttle()
EgoVehicle.change_vehicle()
EgoVehicle.destroy()
EgoVehicle.get_control()
EgoVehicle.get_driver_name()
EgoVehicle.get_instance()
EgoVehicle.get_transform()
EgoVehicle.get_velocity()
EgoVehicle.kb_set_brake()
EgoVehicle.kb_set_steer()
EgoVehicle.lane_effect_update()
EgoVehicle.ldw_handler()
EgoVehicle.set_brake()
EgoVehicle.set_collision()
EgoVehicle.set_reverse()
EgoVehicle.set_steer()
EgoVehicle.set_throttle()
EgoVehicle.set_vehicle()
EgoVehicle.start()
EgoVehicle.start_rumble()
EgoVehicle.stop_rumble()
EgoVehicle.switch_driver()
EgoVehicle.toggle_ldw()
EgoVehicle.toggle_reverse()
EgoVehicle.update()
- umich_sim.sim_backend.carla_modules.gnss_sensor module
- umich_sim.sim_backend.carla_modules.hud module
- umich_sim.sim_backend.carla_modules.imu_sensor module
- umich_sim.sim_backend.carla_modules.lane_invasion_sensor module
- umich_sim.sim_backend.carla_modules.module_helper module
- umich_sim.sim_backend.carla_modules.vehicle module
Vehicle
Vehicle.advance_section()
Vehicle.apply_control()
Vehicle.check_vehicle_in_back()
Vehicle.check_vehicle_in_front()
Vehicle.check_vehicle_to_left()
Vehicle.check_vehicle_to_right()
Vehicle.draw_waypoints()
Vehicle.get_current_location()
Vehicle.get_current_rotation()
Vehicle.get_current_speed()
Vehicle.get_location_vector()
Vehicle.get_vehicle_size()
Vehicle.has_path()
Vehicle.id
Vehicle.move_vehicle_location()
Vehicle.set_active_sections()
Vehicle.toggle_left_blinker()
Vehicle.toggle_right_blinker()
Vehicle.update_other_vehicle_locations()
- umich_sim.sim_backend.carla_modules.world module
- Module contents
- umich_sim.sim_backend.experiments package
- Submodules
- umich_sim.sim_backend.experiments.experiment module
- umich_sim.sim_backend.experiments.freeway_experiment module
FreewayExperiment
FreewayExperiment.MAP
FreewayExperiment.ego_vehicle
FreewayExperiment.initialize_experiment()
FreewayExperiment.junctions
FreewayExperiment.map
FreewayExperiment.section_list
FreewayExperiment.server_initialized
FreewayExperiment.spawn_points
FreewayExperiment.spectator
FreewayExperiment.update_control()
FreewayExperiment.vehicle_list
FreewayExperiment.waypoints
- umich_sim.sim_backend.experiments.intersection_experiment module
IntersectionExperiment
IntersectionExperiment.MAP
IntersectionExperiment.ego_vehicle
IntersectionExperiment.initialize_experiment()
IntersectionExperiment.junctions
IntersectionExperiment.map
IntersectionExperiment.section_list
IntersectionExperiment.server_initialized
IntersectionExperiment.spawn_points
IntersectionExperiment.spectator
IntersectionExperiment.update_control()
IntersectionExperiment.vehicle_list
IntersectionExperiment.waypoints
- Module contents
- umich_sim.sim_backend.sections package
- umich_sim.sim_backend.vehicle_control package
Submodules#
umich_sim.sim_backend.helpers module#
Backend - Helpers Created on Tue February 15, 2022
- Summary: The Helpers file defines and implements various helper functions and classes that are needed
throughout the backend.
- class umich_sim.sim_backend.helpers.ExperimentType(value)#
Bases:
IntEnum
An enumeration.
- FREEWAY = 1#
- INTERSECTION = 0#
- class umich_sim.sim_backend.helpers.VehicleType(value)#
Bases:
IntEnum
An enumeration.
- EGO = 0#
- EGO_FULL_MANUAL = 2#
- EGO_MANUAL_STEER = 1#
- FOLLOWER = 4#
- GENERIC = 5#
- LEAD = 3#
- class umich_sim.sim_backend.helpers.WorldDirection(value)#
Bases:
IntEnum
An enumeration.
- BACKWARD = 1#
- FORWARD = 0#
- LEFT = 2#
- RIGHT = 3#
- umich_sim.sim_backend.helpers.angle_difference(first: float, second: float) float #
Calculates the difference between two angles in Degrees.
Accounts for the rollover from 359 degrees -> 0 degrees
- Parameters:
first – the first angle measurement in degrees
second – the second angle measurement in degrees
- Returns:
the angle difference in degrees
- umich_sim.sim_backend.helpers.config_world(world: World, synchrony: bool = True, delta_seconds: float = 0.02) None #
Configures the CARLA world to use certain synchrony and time step settings.
Carla Documentation: https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/
- Parameters:
world – a carla.World object representing the current simulation world
synchrony – a bool representing whether synchrony should be applied to the world
delta_seconds – a float representing the world’s time step
- Returns:
- umich_sim.sim_backend.helpers.logging_setup(directory_name: str = 'logs') None #
Configured the logging package to write out logs to the correct place under the correct filename.
- Parameters:
directory_name – the directory to which the logs will be written
- Returns:
None
- umich_sim.sim_backend.helpers.project_forward(transform: Transform, distance: float) Transform #
Projects a carla.Transform forward a given distance in the direction of the Transforms yaw
This function only calculates the projection in two dimension. Only yaw is used as the direction for the project, so there will be no changes to the Z axis. Pass in a negative distance to project backwards.
- Parameters:
transform – the carla.Transform to project forward
distance – the distance to project forward
- Returns:
a new carla.Transform that represents the transform projected forward
- umich_sim.sim_backend.helpers.rotate_vector(vector: array, degrees: float) array #
Rotates the provided vector around the z-axis by the specified number of degrees
- Parameters:
vector – a np.array representing the vector to rotate
degrees – a float representing the number of degrees to rotate by
- Returns:
a np.array containing the rotated vector
- umich_sim.sim_backend.helpers.smooth_path(current_path: List[Transform], num_passes=1) List[Transform] #
Function that smooths the provided path by adding intermediate points between all neighboring points.
- Parameters:
current_path – a List of carla.Transforms representing the path to be smoothed
num_passes – an int representing the number of smoothing passes to make
- Returns:
a List of carla.Transforms representing the newly smoothed path
- umich_sim.sim_backend.helpers.to_numpy_vector(carla_vector: Union[Vector3D, Vector2D], dims=3) array #
Converts a carla.Vector3d into a numpy.array with length three or two
- Parameters:
carla_vector – the carla.Vector3d to convert
- Returns:
a numpy.array representing the Carla vector