CARLA
 
载入中...
搜索中...
未找到
LocalizationUtils.h
浏览该文件的文档.
1// Copyright (c) 2020 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
12#include "carla/client/World.h"
13#include "carla/geom/Location.h"
15#include "carla/rpc/ActorId.h"
16
20
21namespace carla {
22namespace traffic_manager {
23
24 namespace cc = carla::client;
25 namespace cg = carla::geom;
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>;
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
int32_t JuncId
Definition RoadTypes.h:17
void PopWaypoint(ActorId actor_id, TrackTraffic &track_traffic, Buffer &buffer, bool front_or_back)
carla::SharedPtr< cc::Actor > Actor
std::deque< std::shared_ptr< SimpleWaypoint > > Buffer
void PushWaypoint(ActorId actor_id, TrackTraffic &track_traffic, Buffer &buffer, SimpleWaypointPtr &waypoint)
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...
std::shared_ptr< SimpleWaypoint > SimpleWaypointPtr
TargetWPInfo GetTargetWaypoint(const Buffer &waypoint_buffer, const float &target_point_distance)
std::unordered_set< ActorId > ActorIdSet
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...
std::pair< SimpleWaypointPtr, uint64_t > TargetWPInfo
Method to return the wayPoints from the waypoint Buffer by using target point distance
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Definition Memory.h:20
rpc::ActorId ActorId
Definition ActorId.h:18