|
CARLA
|
Functions | |
| float | RelativeVelocityDeviation (const float reference_velocity, const float vehicle_speed, const float target_velocity) |
| The target is exactly zero behind a stopped vehicle; the floor avoids a 0/0 NaN that the derivative term would turn into a NaN steering command. | |
| ActuationSignal | RunStep (StateEntry present_state, StateEntry previous_state, const std::vector< float > &longitudinal_parameters, const std::vector< float > &lateral_parameters, const float vehicle_speed, const float control_dt=DT, const float lateral_pursuit_steer=0.0f, const float lateral_damping_scale=1.0f, const float steer_authority_correction=1.0f) |
| This function calculates the actuation signals based on the resent state change of the vehicle to minimize PID error. | |
| float | ShapeReferenceVelocity (const float previous_reference, const float vehicle_speed, const float target_velocity, const float control_dt, const bool emergency_stop) |
| Reference speed that closes on target_velocity at COMFORT_ACCELERATION instead of stepping to it. | |
| void | SmoothActuation (const StateEntry &previous_state, const float control_dt, const float vehicle_speed, ActuationSignal &actuation_signal) |
| A zero pedal demand bypasses the deadband, so pedals rest exactly at zero and nothing here delays a deceleration. | |
|
inlinenodiscard |
The target is exactly zero behind a stopped vehicle; the floor avoids a 0/0 NaN that the derivative term would turn into a NaN steering command.
Definition at line 50 of file trafficmanager/PIDController.h.
References RelativeVelocityDeviation().
Referenced by RelativeVelocityDeviation(), and carla::traffic_manager::MotionPlanStage::Update().
|
inline |
This function calculates the actuation signals based on the resent state change of the vehicle to minimize PID error.
control_dt is the measured simulation-time period between the two states. The gains are tuned at the nominal DT (sync-mode 0.05 s); in asynchronous mode the real period is one server frame, which under render load (e.g. a path-traced rt_lens sensor) stretches to 2-4x nominal. Left uncompensated that halves the loop's phase margin and the lateral PID goes from damped to divergent weaving (measured on Town12: steer_std 0.11 at 19 fps -> 0.71 with full-lock swings at 11 fps), which then trips the stuck/K-turn recovery into alternating full-lock "jerking". lateral_pursuit_steer replaces the linearized proportional term of the lateral loop: the caller computes the geometric pure-pursuit command atan(wheelbase * margin * 2 sin(alpha) / d) / wheel_lock from the vehicle's own steering geometry, which is exact for every wheelbase and lock where a fixed linear gain is only correct for the car-class fleet it was tuned on. The integral term keeps its original form and units. lateral_damping_scale rescales the derivative term with the loop bandwidth (pursuit-distance schedule x steering-authority correction). steer_authority_correction (>= 1) scales the STEER_LIMIT_GAIN envelope: the envelope is a physical curvature/lateral-acceleration guard, so it must cap curvature, not raw normalized command.
Definition at line 113 of file trafficmanager/PIDController.h.
References carla::traffic_manager::StateEntry::angular_deviation, RunStep(), carla::traffic_manager::StateEntry::steer, and carla::traffic_manager::StateEntry::velocity_deviation.
Referenced by RunStep(), and carla::traffic_manager::MotionPlanStage::Update().
|
inlinenodiscard |
Reference speed that closes on target_velocity at COMFORT_ACCELERATION instead of stepping to it.
After an emergency stop the previous reference is meaningless, so it restarts from the vehicle speed.
Definition at line 29 of file trafficmanager/PIDController.h.
References ShapeReferenceVelocity().
Referenced by ShapeReferenceVelocity(), and carla::traffic_manager::MotionPlanStage::Update().
|
inline |
A zero pedal demand bypasses the deadband, so pedals rest exactly at zero and nothing here delays a deceleration.
Definition at line 61 of file trafficmanager/PIDController.h.
References carla::traffic_manager::ActuationSignal::brake, carla::traffic_manager::StateEntry::brake, SmoothActuation(), carla::traffic_manager::ActuationSignal::steer, carla::traffic_manager::StateEntry::steer, carla::traffic_manager::ActuationSignal::throttle, and carla::traffic_manager::StateEntry::throttle.
Referenced by SmoothActuation(), and carla::traffic_manager::MotionPlanStage::Update().