SimpleEventHandler.cpp
Go to the documentation of this file.
2 
3 
4 void
6 {
7  subscriptions.goalReachedCallbacks.push_back(callback);
8 }
9 
10 
11 void
13  const OnWaypointReachedCallback& callback)
14 {
15  subscriptions.waypointReachedCallbacks.push_back(callback);
16 }
17 
18 
19 void
22 {
23  subscriptions.safetyThrottlingTriggeredCallbacks.push_back(callback);
24 }
25 
26 
27 void
29  const OnSafetyStopTriggeredCallback& callback)
30 {
31  subscriptions.safetyStopTriggeredCallbacks.push_back(callback);
32 }
33 
34 
35 void
37  const OnUserAbortTriggeredCallback& callback)
38 {
39  subscriptions.userAbortTriggeredCallbacks.push_back(callback);
40 }
41 
42 
43 void
45  const OnInternalErrorCallback& callback)
46 {
47  subscriptions.internalErrorCallbacks.push_back(callback);
48 }
49 
50 void
51 armarx::navigation::client::SimpleEventHandler::SimpleEventHandler::onMovementStarted(
52  const OnMovementStartedCallback& callback)
53 {
54  subscriptions.movementStartedCallbacks.push_back(callback);
55 }
56 
57 void
59  const GlobalPlanningFailedCallback& callback)
60 {
61  subscriptions.globalPlanningFailedCallbacks.push_back(callback);
62 }
63 
64 void
66  const LocalPlanningFailedCallback& callback)
67 {
68  subscriptions.localPlanningFailedCallbacks.push_back(callback);
69 }
70 
71 void
73 {
74  for (const auto& callback : subscriptions.goalReachedCallbacks)
75  {
76  callback(event);
77  }
78 }
79 
80 
81 void
83  const core::WaypointReachedEvent& event)
84 {
85  for (const auto& callback : subscriptions.waypointReachedCallbacks)
86  {
87  callback(event);
88  }
89 }
90 
91 
92 void
95 {
96  for (const auto& callback : subscriptions.safetyThrottlingTriggeredCallbacks)
97  {
98  callback(event);
99  }
100 }
101 
102 
103 void
105  const core::SafetyStopTriggeredEvent& event)
106 {
107  for (const auto& callback : subscriptions.safetyStopTriggeredCallbacks)
108  {
109  callback(event);
110  }
111 }
112 
113 
114 void
116  const core::UserAbortTriggeredEvent& event)
117 {
118  for (const auto& callback : subscriptions.userAbortTriggeredCallbacks)
119  {
120  callback(event);
121  }
122 }
123 
124 
125 void
127 {
128  for (const auto& callback : subscriptions.internalErrorCallbacks)
129  {
130  callback(event);
131  }
132 }
133 
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 } // namespace armarx::navigation::client
armarx::navigation::client::SimpleEventHandler::safetyStopTriggered
void safetyStopTriggered(const core::SafetyStopTriggeredEvent &event) override
Will be called whenever a safety stop is triggered.
Definition: SimpleEventHandler.cpp:104
armarx::navigation::client::OnWaypointReachedCallback
std::function< void(const core::WaypointReachedEvent &)> OnWaypointReachedCallback
Definition: EventSubscriptionInterface.h:28
armarx::navigation::client::GlobalPlanningFailedCallback
std::function< void(const core::GlobalPlanningFailedEvent &)> GlobalPlanningFailedCallback
Definition: EventSubscriptionInterface.h:21
armarx::navigation::local_planning::LocalPlannerResult
Definition: LocalPlanner.h:40
armarx::navigation::client::SimpleEventHandler::movementStarted
void movementStarted(const core::MovementStartedEvent &event) override
Definition: SimpleEventHandler.cpp:183
armarx::navigation::client::SimpleEventHandler::safetyThrottlingTriggered
void safetyThrottlingTriggered(const core::SafetyThrottlingTriggeredEvent &event) override
Will be called whenever safety throttling is triggered to a certain degree (configurable).
Definition: SimpleEventHandler.cpp:93
armarx::navigation::core::InternalErrorEvent
Event describing the occurance of an internal unhandled error.
Definition: events.h:101
armarx::navigation::client::SimpleEventHandler::localTrajectoryUpdated
void localTrajectoryUpdated(const local_planning::LocalPlannerResult &event) override
Definition: SimpleEventHandler.cpp:146
armarx::navigation::core::SafetyThrottlingTriggeredEvent
Event desciribing that a significant safety throttling factor was reached.
Definition: events.h:68
armarx::navigation::client::SimpleEventHandler::onSafetyThrottlingTriggered
void onSafetyThrottlingTriggered(const OnSafetyThrottlingTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:20
armarx::navigation::client::SimpleEventHandler::globalPlanningFailed
void globalPlanningFailed(const core::GlobalPlanningFailedEvent &event) override
Definition: SimpleEventHandler.cpp:165
armarx::navigation::client::SimpleEventHandler::internalError
void internalError(const core::InternalErrorEvent &event) override
Will be called whenever an internal error occurs.
Definition: SimpleEventHandler.cpp:126
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:20
armarx::navigation::client::LocalPlanningFailedCallback
std::function< void(const core::LocalPlanningFailedEvent &)> LocalPlanningFailedCallback
Definition: EventSubscriptionInterface.h:23
armarx::navigation::client::SimpleEventHandler::localPlanningFailed
void localPlanningFailed(const core::LocalPlanningFailedEvent &event) override
Definition: SimpleEventHandler.cpp:174
armarx::navigation::client::SimpleEventHandler::onInternalError
void onInternalError(const OnInternalErrorCallback &callback) override
Definition: SimpleEventHandler.cpp:44
armarx::navigation::client::SimpleEventHandler::userAbortTriggered
void userAbortTriggered(const core::UserAbortTriggeredEvent &event) override
Will be called whenever the user aborts the current navigation.
Definition: SimpleEventHandler.cpp:115
armarx::navigation::client::SimpleEventHandler::onGoalReached
void onGoalReached(const OnGoalReachedCallback &callback) override
Definition: SimpleEventHandler.cpp:5
armarx::navigation::core::SafetyStopTriggeredEvent
Event describing that for security reasons, the robot was stopped completely.
Definition: events.h:84
armarx::navigation::client::OnUserAbortTriggeredCallback
std::function< void(const core::UserAbortTriggeredEvent &)> OnUserAbortTriggeredCallback
Definition: EventSubscriptionInterface.h:33
armarx::navigation::client::OnSafetyThrottlingTriggeredCallback
std::function< void(const core::SafetyThrottlingTriggeredEvent &)> OnSafetyThrottlingTriggeredCallback
Definition: EventSubscriptionInterface.h:30
armarx::navigation::client::SimpleEventHandler::onWaypointReached
void onWaypointReached(const OnWaypointReachedCallback &callback) override
Definition: SimpleEventHandler.cpp:12
armarx::navigation::core::UserAbortTriggeredEvent
Event describing that the user aborted the current execution.
Definition: events.h:93
SimpleEventHandler.h
armarx::navigation::global_planning::GlobalPlannerResult
Definition: GlobalPlanner.h:38
armarx::navigation::core::GlobalPlanningFailedEvent
Definition: events.h:31
armarx::navigation::core::GoalReachedEvent
Event describing that the targeted goal was successfully reached.
Definition: events.h:49
armarx::navigation::client::SimpleEventHandler::onUserAbortTriggered
void onUserAbortTriggered(const OnUserAbortTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:36
armarx::navigation::client::SimpleEventHandler::onGlobalPlanningFailed
void onGlobalPlanningFailed(const GlobalPlanningFailedCallback &callback) override
Definition: SimpleEventHandler.cpp:58
armarx::navigation::client::SimpleEventHandler::onSafetyStopTriggered
void onSafetyStopTriggered(const OnSafetyStopTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:28
armarx::navigation::client::SimpleEventHandler::goalReached
void goalReached(const core::GoalReachedEvent &event) override
Will be called whenever the navigator reached the goal.
Definition: SimpleEventHandler.cpp:72
armarx::navigation::client::OnMovementStartedCallback
std::function< void(const core::MovementStartedEvent &)> OnMovementStartedCallback
Definition: EventSubscriptionInterface.h:25
armarx::navigation::client::SimpleEventHandler::waypointReached
void waypointReached(const core::WaypointReachedEvent &event) override
Will be called whenever the navigator reached a user-defined waypoint.
Definition: SimpleEventHandler.cpp:82
armarx::navigation::core::WaypointReachedEvent
Event describing that a user-defined waypoint was successfully reached.
Definition: events.h:57
armarx::navigation::client::OnInternalErrorCallback
std::function< void(const core::InternalErrorEvent &)> OnInternalErrorCallback
Definition: EventSubscriptionInterface.h:34
armarx::navigation::client::OnSafetyStopTriggeredCallback
std::function< void(const core::SafetyStopTriggeredEvent &)> OnSafetyStopTriggeredCallback
Definition: EventSubscriptionInterface.h:32
armarx::navigation::client::SimpleEventHandler::globalTrajectoryUpdated
void globalTrajectoryUpdated(const global_planning::GlobalPlannerResult &event) override
Definition: SimpleEventHandler.cpp:137
armarx::navigation::core::LocalPlanningFailedEvent
Definition: events.h:36
armarx::navigation::client::SimpleEventHandler::onLocalPlanningFailed
void onLocalPlanningFailed(const LocalPlanningFailedCallback &callback) override
Definition: SimpleEventHandler.cpp:65
armarx::navigation::client::OnGoalReachedCallback
std::function< void(const core::GoalReachedEvent &)> OnGoalReachedCallback
Definition: EventSubscriptionInterface.h:27
armarx::navigation::core::MovementStartedEvent
Definition: events.h:41