CARLA
Loading...
Searching...
No Matches
Namespaces | Functions
Misc.cpp File Reference
#include "carla/agents/navigation/Misc.h"
#include "carla/client/Actor.h"
#include "carla/client/DebugHelper.h"
#include "carla/client/TrafficLight.h"
#include "carla/client/Waypoint.h"
#include "carla/client/World.h"
#include "carla/geom/BoundingBox.h"
#include "carla/geom/Location.h"
#include "carla/geom/Math.h"
#include "carla/geom/Transform.h"
#include "carla/geom/Vector3D.h"
#include <algorithm>
#include <cmath>
#include <limits>

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
 

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.
 
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.