CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
trafficmanager
LocalizationUtils.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/client/Actor.h
"
10
#include "
carla/client/ActorList.h
"
11
#include "
carla/client/Vehicle.h
"
12
#include "
carla/client/World.h
"
13
#include "
carla/geom/Location.h
"
14
#include "
carla/road/RoadTypes.h
"
15
#include "
carla/rpc/ActorId.h
"
16
17
#include "
carla/trafficmanager/Constants.h
"
18
#include "
carla/trafficmanager/SimpleWaypoint.h
"
19
#include "
carla/trafficmanager/TrackTraffic.h
"
20
21
namespace
carla
{
22
namespace
traffic_manager
{
23
24
namespace
cc
= carla::client;
25
namespace
cg
= carla::geom;
26
using
Actor
=
carla::SharedPtr<cc::Actor>
;
27
using
ActorId
=
carla::ActorId
;
28
using
ActorIdSet
= std::unordered_set<ActorId>;
29
using
SimpleWaypointPtr
= std::shared_ptr<SimpleWaypoint>;
30
using
Buffer
= std::deque<SimpleWaypointPtr>;
31
using
GeoGridId
=
carla::road::JuncId
;
32
using
constants::Map::MAP_RESOLUTION;
33
using
constants::Map::INV_MAP_RESOLUTION;
34
35
/// Returns the cross product (z component value) between the vehicle's
36
/// heading vector and the vector along the direction to the next
37
/// target waypoint on the horizon.
38
float
DeviationCrossProduct
(
const
cg::Location
&reference_location,
39
const
cg::Vector3D
&heading_vector,
40
const
cg::Location
&target_location);
41
/// Returns the dot product between the vehicle's heading vector and
42
/// the vector along the direction to the next target waypoint on the horizon.
43
float
DeviationDotProduct
(
const
cg::Location
&reference_location,
44
const
cg::Vector3D
&heading_vector,
45
const
cg::Location
&target_location);
46
47
// Function to add a waypoint to a path buffer and update waypoint tracking.
48
void
PushWaypoint
(
ActorId
actor_id,
TrackTraffic
& track_traffic,
49
Buffer
& buffer,
SimpleWaypointPtr
& waypoint);
50
51
// Function to remove a waypoint from a path buffer and update waypoint tracking.
52
void
PopWaypoint
(
ActorId
actor_id,
TrackTraffic
& track_traffic,
53
Buffer
& buffer,
bool
front_or_back=
true
);
54
55
/// Method to return the wayPoints from the waypoint Buffer by using target point distance
56
using
TargetWPInfo
= std::pair<SimpleWaypointPtr,uint64_t>;
57
TargetWPInfo
GetTargetWaypoint
(
const
Buffer
& waypoint_buffer,
const
float
& target_point_distance);
58
59
}
// namespace traffic_manager
60
}
// namespace carla
ActorId.h
ActorList.h
Constants.h
RoadTypes.h
SimpleWaypoint.h
TrackTraffic.h
Vehicle.h
World.h
carla::traffic_manager::TrackTraffic
Definition
TrackTraffic.h:19
Actor.h
Location.h
carla::client
Definition
BasicAgent.h:24
carla::geom
Definition
Misc.h:24
carla::road::JuncId
int32_t JuncId
Definition
RoadTypes.h:17
carla::traffic_manager
Definition
Vehicle.h:25
carla::traffic_manager::PopWaypoint
void PopWaypoint(ActorId actor_id, TrackTraffic &track_traffic, Buffer &buffer, bool front_or_back)
Definition
LocalizationUtils.cpp:46
carla::traffic_manager::ActorId
carla::ActorId ActorId
Definition
AtomicActorSet.h:21
carla::traffic_manager::Actor
carla::SharedPtr< cc::Actor > Actor
Definition
LocalizationUtils.h:26
carla::traffic_manager::Buffer
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
Definition
CollisionStage.h:44
carla::traffic_manager::PushWaypoint
void PushWaypoint(ActorId actor_id, TrackTraffic &track_traffic, Buffer &buffer, SimpleWaypointPtr &waypoint)
Definition
LocalizationUtils.cpp:38
carla::traffic_manager::DeviationCrossProduct
float DeviationCrossProduct(const cg::Location &reference_location, const cg::Vector3D &heading_vector, const cg::Location &target_location)
Returns the cross product (z component value) between the vehicle's heading vector and the vector alo...
Definition
LocalizationUtils.cpp:16
carla::traffic_manager::GeoGridId
crd::JuncId GeoGridId
Definition
InMemoryMap.h:48
carla::traffic_manager::SimpleWaypointPtr
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
Definition
CachedSimpleWaypoint.cpp:12
carla::traffic_manager::GetTargetWaypoint
TargetWPInfo GetTargetWaypoint(const Buffer &waypoint_buffer, const float &target_point_distance)
Definition
LocalizationUtils.cpp:59
carla::traffic_manager::ActorIdSet
std::unordered_set< ActorId > ActorIdSet
Definition
LocalizationUtils.h:28
carla::traffic_manager::DeviationDotProduct
float DeviationDotProduct(const cg::Location &reference_location, const cg::Vector3D &heading_vector, const cg::Location &target_location)
Returns the dot product between the vehicle's heading vector and the vector along the direction to th...
Definition
LocalizationUtils.cpp:25
carla::traffic_manager::TargetWPInfo
std::pair< SimpleWaypointPtr, uint64_t > TargetWPInfo
Method to return the wayPoints from the waypoint Buffer by using target point distance.
Definition
LocalizationUtils.h:56
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::SharedPtr
std::shared_ptr< T > SharedPtr
Definition
Memory.h:15
carla::ActorId
rpc::ActorId ActorId
Definition
ActorId.h:18
carla::geom::Location
Definition
geom/Location.h:23
carla::geom::Vector3D
Definition
geom/Vector3D.h:17
Generated by
1.18.0