CARLA
Loading...
Searching...
No Matches
Namespaces | Functions
Misc.h File Reference
#include "carla/Memory.h"
#include <array>
#include <optional>
#include <utility>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  carla
 This file contains definitions of common data structures used in traffic manager.
 
namespace  carla::agents
 
namespace  carla::agents::navigation
 
namespace  carla::client
 
namespace  carla::geom
 

Functions

float carla::agents::navigation::ComputeDistance (const geom::Location &a, const geom::Location &b)
 Euclidean distance between two locations (matches numpy's regularised version that adds an epsilon to avoid 0).
 
std::pair< float, float > carla::agents::navigation::ComputeMagnitudeAngle (const geom::Location &target, const geom::Location &current, float orientation_deg)
 Returns the (distance, angle in degrees) from current to target relative to a forward orientation orientation_deg in degrees.
 
float carla::agents::navigation::DistanceVehicle (SharedPtr< client::Waypoint > waypoint, const geom::Transform &vehicle_transform)
 2-D distance between a waypoint and a vehicle transform.
 
void carla::agents::navigation::DrawWaypoints (SharedPtr< client::World > world, const std::vector< SharedPtr< client::Waypoint > > &waypoints, float z=0.5f)
 Draw the supplied waypoints in the world for a fixed lifetime.
 
float carla::agents::navigation::GetSpeed (SharedPtr< client::Actor > actor)
 Compute speed of an actor in km/h.
 
geom::Location carla::agents::navigation::GetTrafficLightTriggerLocation (SharedPtr< client::TrafficLight > traffic_light)
 Compute the world-space trigger location of a traffic light, mirroring the helper in agents.tools.misc.get_trafficlight_trigger_location.
 
bool carla::agents::navigation::IsWithinDistance (const geom::Transform &target, const geom::Transform &reference, float max_distance, std::optional< std::pair< float, float > > angle_interval=std::nullopt)
 Returns true when target is within max_distance of reference.
 
float carla::agents::navigation::Positive (float v)
 Clamp v at zero. Inline because it's tiny.
 
std::array< float, 3 > carla::agents::navigation::UnitVector (const geom::Location &a, const geom::Location &b)
 Unit vector going from a to b, including the z component.