SimpleEventHandler.cpp
Go to the documentation of this file.
2
5
7{
8
9 void
11 {
12 subscriptions.goalReachedCallbacks.push_back(callback);
13 }
14
15 void
17 {
18 subscriptions.waypointReachedCallbacks.push_back(callback);
19 }
20
21 void
24 {
25 subscriptions.safetyThrottlingTriggeredCallbacks.push_back(callback);
26 }
27
28 void
30 {
31 subscriptions.safetyStopTriggeredCallbacks.push_back(callback);
32 }
33
34 void
36 {
37 subscriptions.userAbortTriggeredCallbacks.push_back(callback);
38 }
39
40 void
42 {
43 subscriptions.internalErrorCallbacks.push_back(callback);
44 }
45
46 void
48 {
49 subscriptions.movementStartedCallbacks.push_back(callback);
50 }
51
52 void
54 {
55 subscriptions.globalTrajectoryUpdatedCallbacks.push_back(callback);
56 }
57
58 void
60 {
61 subscriptions.globalPlanningFailedCallbacks.push_back(callback);
62 }
63
64 void
66 {
67 subscriptions.localPlanningFailedCallbacks.push_back(callback);
68 }
69
70 void
72 {
73 subscriptions.globalTrajectoryUpdatedCallbacks.push_back(callback);
74 }
75
76 void
78 {
79 subscriptions.localTrajectoryUpdatedCallbacks.push_back(callback);
80 }
81
82 void
84 {
85 for (const auto& callback : subscriptions.goalReachedCallbacks)
86 {
87 callback(event);
88 }
89 }
90
91 void
93 {
94 for (const auto& callback : subscriptions.waypointReachedCallbacks)
95 {
96 callback(event);
97 }
98 }
99
100 void
102 {
103 for (const auto& callback : subscriptions.safetyThrottlingTriggeredCallbacks)
104 {
105 callback(event);
106 }
107 }
108
109 void
111 {
112 for (const auto& callback : subscriptions.safetyStopTriggeredCallbacks)
113 {
114 callback(event);
115 }
116 }
117
118 void
120 {
121 for (const auto& callback : subscriptions.userAbortTriggeredCallbacks)
122 {
123 callback(event);
124 }
125 }
126
127 void
129 {
130 for (const auto& callback : subscriptions.internalErrorCallbacks)
131 {
132 callback(event);
133 }
134 }
135
136 void
138 {
139 for (const auto& callback : subscriptions.globalTrajectoryUpdatedCallbacks)
140 {
141 callback(event);
142 }
143 }
144
145 void
147 {
148 for (const auto& callback : subscriptions.localTrajectoryUpdatedCallbacks)
149 {
150 callback(event);
151 }
152 }
153
154 // void
155 // SimpleEventHandler::trajectoryControllerUpdated(
156 // const traj_ctrl::local::TrajectoryControllerResult& event)
157 // {
158 // for (const auto& callback : subscriptions.trajectoryControllerUpdatedCallbacks)
159 // {
160 // callback(event);
161 // }
162 // }
163
164 void
166 {
167 for (const auto& callback : subscriptions.globalPlanningFailedCallbacks)
168 {
169 callback(event);
170 }
171 }
172
173 void
175 {
176 for (const auto& callback : subscriptions.localPlanningFailedCallbacks)
177 {
178 callback(event);
179 }
180 }
181
182 void
184 {
185 for (const auto& callback : subscriptions.movementStartedCallbacks)
186 {
187 callback(event);
188 }
189 }
190
191
192} // namespace armarx::navigation::client
void onUserAbortTriggered(const OnUserAbortTriggeredCallback &callback) override
void onSafetyStopTriggered(const OnSafetyStopTriggeredCallback &callback) override
void globalTrajectoryUpdated(const core::GlobalTrajectoryUpdatedEvent &event) override
void onWaypointReached(const OnWaypointReachedCallback &callback) override
void onMovementStarted(const OnMovementStartedCallback &callback) override
void onLocalPlanningFailed(const LocalPlanningFailedCallback &callback) override
void safetyThrottlingTriggered(const core::SafetyThrottlingTriggeredEvent &event) override
Will be called whenever safety throttling is triggered to a certain degree (configurable).
void onLocalTrajectoryUpdated(const LocalTrajectoryUpdatedCallback &callback) override
void movementStarted(const core::MovementStartedEvent &event) override
void localTrajectoryUpdated(const core::LocalTrajectoryUpdatedEvent &event) override
void onGoalReached(const OnGoalReachedCallback &callback) override
void onInternalError(const OnInternalErrorCallback &callback) override
void safetyStopTriggered(const core::SafetyStopTriggeredEvent &event) override
Will be called whenever a safety stop is triggered.
void onSafetyThrottlingTriggered(const OnSafetyThrottlingTriggeredCallback &callback) override
void onGlobalTrajectoryUpdated(const GlobalTrajectoryUpdatedCallback &callback) override
void localPlanningFailed(const core::LocalPlanningFailedEvent &event) override
void onGlobalPlanningUpdated(const GlobalTrajectoryUpdatedCallback &callback) override
void waypointReached(const core::WaypointReachedEvent &event) override
Will be called whenever the navigator reached a user-defined waypoint.
void globalPlanningFailed(const core::GlobalPlanningFailedEvent &event) override
void userAbortTriggered(const core::UserAbortTriggeredEvent &event) override
Will be called whenever the user aborts the current navigation.
void internalError(const core::InternalErrorEvent &event) override
Will be called whenever an internal error occurs.
void onGlobalPlanningFailed(const GlobalPlanningFailedCallback &callback) override
void goalReached(const core::GoalReachedEvent &event) override
Will be called whenever the navigator reached the goal.
This file is part of ArmarX.
std::function< void(const core::LocalPlanningFailedEvent &)> LocalPlanningFailedCallback
std::function< void(const core::GoalReachedEvent &)> OnGoalReachedCallback
std::function< void(const core::UserAbortTriggeredEvent &)> OnUserAbortTriggeredCallback
std::function< void(const core::SafetyStopTriggeredEvent &)> OnSafetyStopTriggeredCallback
std::function< void(const core::InternalErrorEvent &)> OnInternalErrorCallback
std::function< void(const core::GlobalTrajectoryUpdatedEvent &)> GlobalTrajectoryUpdatedCallback
std::function< void(const core::LocalTrajectoryUpdatedEvent &)> LocalTrajectoryUpdatedCallback
std::function< void(const core::MovementStartedEvent &)> OnMovementStartedCallback
std::function< void(const core::WaypointReachedEvent &)> OnWaypointReachedCallback
std::function< void(const core::GlobalPlanningFailedEvent &)> GlobalPlanningFailedCallback
std::function< void(const core::SafetyThrottlingTriggeredEvent &)> OnSafetyThrottlingTriggeredCallback
Event describing that the global trajectory was updated.
Definition events.h:114
Event describing that the targeted goal was successfully reached.
Definition events.h:53
Event describing the occurance of an internal unhandled error.
Definition events.h:105
Event describing that the local trajectory was updated.
Definition events.h:122
Event describing that for security reasons, the robot was stopped completely.
Definition events.h:88
Event desciribing that a significant safety throttling factor was reached.
Definition events.h:72
Event describing that the user aborted the current execution.
Definition events.h:97
Event describing that a user-defined waypoint was successfully reached.
Definition events.h:61