SimpleEventHandler.h
Go to the documentation of this file.
1 #pragma once
2 
3 
7 
9 {
10 
12  virtual public EventSubscriptionInterface,
14  {
15 
16  public:
17  // EventSubscriptionInterface
18  void onGoalReached(const OnGoalReachedCallback& callback) override;
19  void onWaypointReached(const OnWaypointReachedCallback& callback) override;
20  void
22  void onSafetyStopTriggered(const OnSafetyStopTriggeredCallback& callback) override;
23  void onUserAbortTriggered(const OnUserAbortTriggeredCallback& callback) override;
24  void onInternalError(const OnInternalErrorCallback& callback) override;
25 
26  void onMovementStarted(const OnMovementStartedCallback& callback) override;
27  void onGlobalPlanningFailed(const GlobalPlanningFailedCallback& callback) override;
28  void onLocalPlanningFailed(const LocalPlanningFailedCallback& callback) override;
29 
30  void onGlobalTrajectoryUpdated(const GlobalTrajectoryUpdatedCallback& callback) override;
31  void onLocalTrajectoryUpdated(const LocalTrajectoryUpdatedCallback& callback) override;
32 
33  // EventPublishingInterface
34  void globalPlanningFailed(const core::GlobalPlanningFailedEvent& event) override;
35  void localPlanningFailed(const core::LocalPlanningFailedEvent& event) override;
36 
39 
40  void movementStarted(const core::MovementStartedEvent& event) override;
41  void goalReached(const core::GoalReachedEvent& event) override;
42  void waypointReached(const core::WaypointReachedEvent& event) override;
44  void safetyStopTriggered(const core::SafetyStopTriggeredEvent& event) override;
45  void userAbortTriggered(const core::UserAbortTriggeredEvent& event) override;
46  void internalError(const core::InternalErrorEvent& event) override;
47 
48  private:
49  struct
50  {
51  std::vector<GlobalTrajectoryUpdatedCallback> globalTrajectoryUpdatedCallbacks;
52  std::vector<LocalTrajectoryUpdatedCallback> localTrajectoryUpdatedCallbacks;
53  std::vector<TrajectoryControllerUpdatedCallback> trajectoryControllerUpdatedCallbacks;
54  std::vector<GlobalPlanningFailedCallback> globalPlanningFailedCallbacks;
55  std::vector<LocalPlanningFailedCallback> localPlanningFailedCallbacks;
56 
57  std::vector<OnMovementStartedCallback> movementStartedCallbacks;
58  std::vector<OnGoalReachedCallback> goalReachedCallbacks;
59  std::vector<OnWaypointReachedCallback> waypointReachedCallbacks;
60  std::vector<OnSafetyThrottlingTriggeredCallback> safetyThrottlingTriggeredCallbacks;
61  std::vector<OnSafetyStopTriggeredCallback> safetyStopTriggeredCallbacks;
62  std::vector<OnUserAbortTriggeredCallback> userAbortTriggeredCallbacks;
63  std::vector<OnInternalErrorCallback> internalErrorCallbacks;
64  } subscriptions;
65  };
66 
67 } // namespace armarx::navigation::client
armarx::navigation::client::SimpleEventHandler::localPlanningFailedCallbacks
std::vector< LocalPlanningFailedCallback > localPlanningFailedCallbacks
Definition: SimpleEventHandler.h:55
armarx::navigation::client::SimpleEventHandler::goalReachedCallbacks
std::vector< OnGoalReachedCallback > goalReachedCallbacks
Definition: SimpleEventHandler.h:58
armarx::navigation::client::SimpleEventHandler::safetyStopTriggered
void safetyStopTriggered(const core::SafetyStopTriggeredEvent &event) override
Will be called whenever a safety stop is triggered.
Definition: SimpleEventHandler.cpp:105
armarx::navigation::client::OnWaypointReachedCallback
std::function< void(const core::WaypointReachedEvent &)> OnWaypointReachedCallback
Definition: EventSubscriptionInterface.h:25
armarx::navigation::client::GlobalPlanningFailedCallback
std::function< void(const core::GlobalPlanningFailedEvent &)> GlobalPlanningFailedCallback
Definition: EventSubscriptionInterface.h:18
armarx::navigation::client::SimpleEventHandler::movementStarted
void movementStarted(const core::MovementStartedEvent &event) override
Definition: SimpleEventHandler.cpp:178
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:96
armarx::navigation::client::SimpleEventHandler
Definition: SimpleEventHandler.h:11
armarx::navigation::client::SimpleEventHandler::movementStartedCallbacks
std::vector< OnMovementStartedCallback > movementStartedCallbacks
Definition: SimpleEventHandler.h:57
armarx::navigation::core::InternalErrorEvent
Event describing the occurance of an internal unhandled error.
Definition: events.h:104
armarx::navigation::client::SimpleEventHandler::waypointReachedCallbacks
std::vector< OnWaypointReachedCallback > waypointReachedCallbacks
Definition: SimpleEventHandler.h:59
armarx::navigation::core::SafetyThrottlingTriggeredEvent
Event desciribing that a significant safety throttling factor was reached.
Definition: events.h:71
armarx::navigation::client::SimpleEventHandler::onSafetyThrottlingTriggered
void onSafetyThrottlingTriggered(const OnSafetyThrottlingTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:22
armarx::navigation::client::SimpleEventHandler::globalPlanningFailed
void globalPlanningFailed(const core::GlobalPlanningFailedEvent &event) override
Definition: SimpleEventHandler.cpp:160
armarx::navigation::client::SimpleEventHandler::internalError
void internalError(const core::InternalErrorEvent &event) override
Will be called whenever an internal error occurs.
Definition: SimpleEventHandler.cpp:123
armarx::navigation::client::SimpleEventHandler::trajectoryControllerUpdatedCallbacks
std::vector< TrajectoryControllerUpdatedCallback > trajectoryControllerUpdatedCallbacks
Definition: SimpleEventHandler.h:53
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:21
EventSubscriptionInterface.h
armarx::navigation::client::SimpleEventHandler::localTrajectoryUpdated
void localTrajectoryUpdated(const core::LocalTrajectoryUpdatedEvent &event) override
Definition: SimpleEventHandler.cpp:141
armarx::navigation::client::LocalPlanningFailedCallback
std::function< void(const core::LocalPlanningFailedEvent &)> LocalPlanningFailedCallback
Definition: EventSubscriptionInterface.h:20
armarx::navigation::client::GlobalTrajectoryUpdatedCallback
std::function< void(const core::GlobalTrajectoryUpdatedEvent &)> GlobalTrajectoryUpdatedCallback
Definition: EventSubscriptionInterface.h:12
armarx::navigation::client::SimpleEventHandler::localTrajectoryUpdatedCallbacks
std::vector< LocalTrajectoryUpdatedCallback > localTrajectoryUpdatedCallbacks
Definition: SimpleEventHandler.h:52
armarx::navigation::client::SimpleEventHandler::onMovementStarted
void onMovementStarted(const OnMovementStartedCallback &callback) override
events.h
armarx::navigation::client::SimpleEventHandler::localPlanningFailed
void localPlanningFailed(const core::LocalPlanningFailedEvent &event) override
Definition: SimpleEventHandler.cpp:169
armarx::navigation::client::SimpleEventHandler::onInternalError
void onInternalError(const OnInternalErrorCallback &callback) override
Definition: SimpleEventHandler.cpp:41
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:114
armarx::navigation::client::SimpleEventHandler::onGoalReached
void onGoalReached(const OnGoalReachedCallback &callback) override
Definition: SimpleEventHandler.cpp:10
armarx::navigation::core::SafetyStopTriggeredEvent
Event describing that for security reasons, the robot was stopped completely.
Definition: events.h:87
armarx::navigation::client::OnUserAbortTriggeredCallback
std::function< void(const core::UserAbortTriggeredEvent &)> OnUserAbortTriggeredCallback
Definition: EventSubscriptionInterface.h:30
armarx::navigation::client::OnSafetyThrottlingTriggeredCallback
std::function< void(const core::SafetyThrottlingTriggeredEvent &)> OnSafetyThrottlingTriggeredCallback
Definition: EventSubscriptionInterface.h:27
armarx::navigation::client::SimpleEventHandler::onWaypointReached
void onWaypointReached(const OnWaypointReachedCallback &callback) override
Definition: SimpleEventHandler.cpp:16
armarx::navigation::core::UserAbortTriggeredEvent
Event describing that the user aborted the current execution.
Definition: events.h:96
armarx::navigation::client::LocalTrajectoryUpdatedCallback
std::function< void(const core::LocalTrajectoryUpdatedEvent &)> LocalTrajectoryUpdatedCallback
Definition: EventSubscriptionInterface.h:14
armarx::navigation::client::SimpleEventHandler::globalTrajectoryUpdatedCallbacks
std::vector< GlobalTrajectoryUpdatedCallback > globalTrajectoryUpdatedCallbacks
Definition: SimpleEventHandler.h:51
armarx::navigation::core::LocalTrajectoryUpdatedEvent
Event describing that the local trajectory was updated.
Definition: events.h:121
armarx::navigation::client::SimpleEventHandler::userAbortTriggeredCallbacks
std::vector< OnUserAbortTriggeredCallback > userAbortTriggeredCallbacks
Definition: SimpleEventHandler.h:62
armarx::navigation::core::GlobalPlanningFailedEvent
Definition: events.h:34
armarx::navigation::client::SimpleEventHandler::onLocalTrajectoryUpdated
void onLocalTrajectoryUpdated(const LocalTrajectoryUpdatedCallback &callback) override
Definition: SimpleEventHandler.cpp:72
armarx::navigation::core::GoalReachedEvent
Event describing that the targeted goal was successfully reached.
Definition: events.h:52
armarx::navigation::client::SimpleEventHandler::onUserAbortTriggered
void onUserAbortTriggered(const OnUserAbortTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:35
armarx::navigation::client::SimpleEventHandler::onGlobalPlanningFailed
void onGlobalPlanningFailed(const GlobalPlanningFailedCallback &callback) override
Definition: SimpleEventHandler.cpp:54
armarx::navigation::client::SimpleEventHandler::onSafetyStopTriggered
void onSafetyStopTriggered(const OnSafetyStopTriggeredCallback &callback) override
Definition: SimpleEventHandler.cpp:29
EventPublishingInterface.h
armarx::navigation::client::SimpleEventHandler::goalReached
void goalReached(const core::GoalReachedEvent &event) override
Will be called whenever the navigator reached the goal.
Definition: SimpleEventHandler.cpp:78
armarx::navigation::client::SimpleEventHandler::safetyStopTriggeredCallbacks
std::vector< OnSafetyStopTriggeredCallback > safetyStopTriggeredCallbacks
Definition: SimpleEventHandler.h:61
armarx::navigation::client::OnMovementStartedCallback
std::function< void(const core::MovementStartedEvent &)> OnMovementStartedCallback
Definition: EventSubscriptionInterface.h:22
armarx::navigation::client::SimpleEventHandler::internalErrorCallbacks
std::vector< OnInternalErrorCallback > internalErrorCallbacks
Definition: SimpleEventHandler.h:63
armarx::navigation::core::GlobalTrajectoryUpdatedEvent
Event describing that the global trajectory was updated.
Definition: events.h:113
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:87
armarx::navigation::client::SimpleEventHandler::globalTrajectoryUpdated
void globalTrajectoryUpdated(const core::GlobalTrajectoryUpdatedEvent &event) override
Definition: SimpleEventHandler.cpp:132
armarx::navigation::client::EventSubscriptionInterface
Definition: EventSubscriptionInterface.h:33
armarx::navigation::core::WaypointReachedEvent
Event describing that a user-defined waypoint was successfully reached.
Definition: events.h:60
armarx::navigation::client::SimpleEventHandler::safetyThrottlingTriggeredCallbacks
std::vector< OnSafetyThrottlingTriggeredCallback > safetyThrottlingTriggeredCallbacks
Definition: SimpleEventHandler.h:60
armarx::navigation::client::OnInternalErrorCallback
std::function< void(const core::InternalErrorEvent &)> OnInternalErrorCallback
Definition: EventSubscriptionInterface.h:31
armarx::navigation::server::EventPublishingInterface
A publisher the server navigator will use to notify others about events.
Definition: EventPublishingInterface.h:12
armarx::navigation::client::OnSafetyStopTriggeredCallback
std::function< void(const core::SafetyStopTriggeredEvent &)> OnSafetyStopTriggeredCallback
Definition: EventSubscriptionInterface.h:29
armarx::navigation::core::LocalPlanningFailedEvent
Definition: events.h:39
armarx::navigation::client::SimpleEventHandler::onLocalPlanningFailed
void onLocalPlanningFailed(const LocalPlanningFailedCallback &callback) override
Definition: SimpleEventHandler.cpp:60
armarx::navigation::client::OnGoalReachedCallback
std::function< void(const core::GoalReachedEvent &)> OnGoalReachedCallback
Definition: EventSubscriptionInterface.h:24
armarx::navigation::core::MovementStartedEvent
Definition: events.h:44
armarx::navigation::client::SimpleEventHandler::globalPlanningFailedCallbacks
std::vector< GlobalPlanningFailedCallback > globalPlanningFailedCallbacks
Definition: SimpleEventHandler.h:54
armarx::navigation::client::SimpleEventHandler::onGlobalTrajectoryUpdated
void onGlobalTrajectoryUpdated(const GlobalTrajectoryUpdatedCallback &callback) override
Definition: SimpleEventHandler.cpp:66