CARLA
 
载入中...
搜索中...
未找到
WalkerEvent.h
浏览该文件的文档.
1// Copyright (c) 2019 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#ifdef _MSC_VER
10#pragma warning(push)
11#pragma warning(disable:4583)
12#pragma warning(disable:4582)
13#include <boost/variant2/variant.hpp>
14#pragma warning(pop)
15#else
16#include <boost/variant2/variant.hpp>
17#endif
18
19#include "carla/rpc/ActorId.h"
20
21namespace carla {
22namespace nav {
23
24 class Navigation;
25 class WalkerManager;
26
27 /// result of an event
28 enum class EventResult : uint8_t {
30 End,
32 };
33
34 /// empty event that just ignores
36 };
37
38 /// event to wait for a while
40 double time;
41 WalkerEventWait(double duration) : time(duration) {};
42 };
43
44 /// event to pause and check for near vehicles
53
54 /// walker event variant
55 using WalkerEvent = boost::variant2::variant<WalkerEventIgnore, WalkerEventWait, WalkerEventStopAndCheck>;
56
57 /// visitor class
59 public:
60 WalkerEventVisitor(WalkerManager *manager, ActorId id, double delta) : _manager(manager), _id(id), _delta(delta) {};
64 private:
65 WalkerManager *_manager { nullptr };
66 ActorId _id { 0 };
67 double _delta { 0 };
68 };
69
70} // namespace nav
71} // namespace carla
WalkerEventVisitor(WalkerManager *manager, ActorId id, double delta)
Definition WalkerEvent.h:60
EventResult operator()(WalkerEventIgnore &event)
EventResult
result of an event
Definition WalkerEvent.h:28
boost::variant2::variant< WalkerEventIgnore, WalkerEventWait, WalkerEventStopAndCheck > WalkerEvent
walker event variant
Definition WalkerEvent.h:55
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
empty event that just ignores
Definition WalkerEvent.h:35
event to pause and check for near vehicles
Definition WalkerEvent.h:45
WalkerEventStopAndCheck(double duration)
Definition WalkerEvent.h:49
SharedPtr< carla::client::TrafficLight > actor
Definition WalkerEvent.h:48
event to wait for a while
Definition WalkerEvent.h:39
WalkerEventWait(double duration)
Definition WalkerEvent.h:41