48 std::optional<std::pair<float, float>> angle_interval = std::nullopt);
55 float orientation_deg);
74 inline float Positive(
float v) {
return v > 0.0f ? v : 0.0f; }
bool IsWithinDistance(const geom::Transform &target, const geom::Transform &reference, float max_distance, std::optional< std::pair< float, float > > angle_interval)
Returns true when target is within max_distance of reference.
float ComputeDistance(const geom::Location &a, const geom::Location &b)
Euclidean distance between two locations (matches numpy's regularised version that adds an epsilon to...
void DrawWaypoints(SharedPtr< client::World > world, const std::vector< SharedPtr< client::Waypoint > > &waypoints, float z)
Draw the supplied waypoints in the world for a fixed lifetime.
geom::Location GetTrafficLightTriggerLocation(SharedPtr< client::TrafficLight > traffic_light)
Compute the world-space trigger location of a traffic light, mirroring the helper in agents....
float Positive(float v)
Clamp v at zero. Inline because it's tiny.
float GetSpeed(SharedPtr< client::Actor > actor)
Compute speed of an actor in km/h.
std::pair< float, float > ComputeMagnitudeAngle(const geom::Location &target, const geom::Location ¤t, float orientation_deg)
Returns the (distance, angle in degrees) from current to target relative to a forward orientation ori...
float DistanceVehicle(SharedPtr< client::Waypoint > waypoint, const geom::Transform &vehicle_transform)
2-D distance between a waypoint and a vehicle transform.
std::array< float, 3 > UnitVector(const geom::Location &a, const geom::Location &b)
Unit vector going from a to b, including the z component.
carla::SharedPtr< cc::Actor > Actor
This file contains definitions of common data structures used in traffic manager.
std::shared_ptr< T > SharedPtr