opencda.core.actuation package

Submodules

opencda.core.actuation.control_manager module

Controller interface

class opencda.core.actuation.control_manager.ControlManager(control_config)

Bases: object

Controller manager that is used to select and call different controller’s functions.

Parameters:

control_config (dict) – The configuration dictionary of the control manager module.

controller

The controller object of the OpenCDA framwork.

Type:

opencda object.

run_step(target_speed, waypoint)

Execute current controller step.

update_info(ego_pos, ego_speed)

Update ego vehicle information for controller.

opencda.core.actuation.pid_controller module

PID Control Class

class opencda.core.actuation.pid_controller.Controller(args)

Bases: object

PID Controller implementation.

Parameters:

args (dict) – The configuration dictionary parsed from yaml file.

_lon_ebuffer

A deque buffer that stores longitudinal control errors.

Type:

deque

_lat_ebuffer

A deque buffer that stores latitudinal control errors.

Type:

deque

current_transform

Current ego vehicle transformation in CARLA world.

Type:

carla.transform

current_speed

Current ego vehicle speed.

Type:

float

past_steering

Sterring angle from previous control step.

Type:

float

dynamic_pid()

Compute kp, kd, ki based on current speed.

lat_run_step(target_location)

Generate the throttle command based on current speed and target speed

Parameters:

target_location (carla.location) – Target location.

Returns:

  • current_steering (float)

  • Desired steering angle value for the current step to

  • achieve target location.

lon_run_step(target_speed)
Parameters:

target_speed (float) – Target speed of the ego vehicle.

Returns:

acceleration – Desired acceleration value for the current step to achieve target speed.

Return type:

float

run_step(target_speed, waypoint)

Execute one step of control invoking both lateral and longitudinal PID controllers to reach a target waypoint at a given target_speed.

Parameters:
  • target_speed (float) – Target speed of the ego vehicle.

  • waypoint (carla.loaction) – Target location.

Returns:

control – Desired vehicle control command for the current step.

Return type:

carla.VehicleControl

update_info(ego_pos, ego_spd)

Update ego position and speed to controller.

Parameters:
  • ego_pos (carla.location) – Position of the ego vehicle.

  • ego_spd (float) – Speed of the ego vehicle

Module contents