SimpleEventHandler.h
Go to the documentation of this file.
1 #pragma once
2 
3 
7 
8 
10 {
11 
13  virtual public EventSubscriptionInterface,
15  {
16 
17  public:
18 
19  // EventSubscriptionInterface
20  void onGoalReached(const OnGoalReachedCallback& callback) override;
21  void onWaypointReached(const OnWaypointReachedCallback& callback) override;
22  void
24  void onSafetyStopTriggered(const OnSafetyStopTriggeredCallback& callback) override;
25  void onUserAbortTriggered(const OnUserAbortTriggeredCallback& callback) override;
26  void onInternalError(const OnInternalErrorCallback& callback) override;
27 
28  void onMovementStarted(const OnMovementStartedCallback& callback) override;
29  void onGlobalPlanningFailed(const GlobalPlanningFailedCallback& callback) override;
30  void onLocalPlanningFailed(const LocalPlanningFailedCallback& callback) override;
31 
32  // EventPublishingInterface
35  // void trajectoryControllerUpdated(const traj_ctrl::local::TrajectoryControllerResult& event) override;
36  void globalPlanningFailed(const core::GlobalPlanningFailedEvent& event) override;
37  void localPlanningFailed(const core::LocalPlanningFailedEvent& event) override;
38 
39  void movementStarted(const core::MovementStartedEvent& event) override;
40  void goalReached(const core::GoalReachedEvent& event) override;
41  void waypointReached(const core::WaypointReachedEvent& event) override;
43  void safetyStopTriggered(const core::SafetyStopTriggeredEvent& event) override;
44  void userAbortTriggered(const core::UserAbortTriggeredEvent& event) override;
45  void internalError(const core::InternalErrorEvent& event) override;
46 
47  private:
48  struct
49  {
50  std::vector<GlobalTrajectoryUpdatedCallback> globalTrajectoryUpdatedCallbacks;
51  std::vector<LocalTrajectoryUpdatedCallback> localTrajectoryUpdatedCallbacks;
52  std::vector<TrajectoryControllerUpdatedCallback> trajectoryControllerUpdatedCallbacks;
53  std::vector<GlobalPlanningFailedCallback> globalPlanningFailedCallbacks;
54  std::vector<LocalPlanningFailedCallback> localPlanningFailedCallbacks;
55 
56  std::vector<OnMovementStartedCallback> movementStartedCallbacks;
57  std::vector<OnGoalReachedCallback> goalReachedCallbacks;
58  std::vector<OnWaypointReachedCallback> waypointReachedCallbacks;
59  std::vector<OnSafetyThrottlingTriggeredCallback> safetyThrottlingTriggeredCallbacks;
60  std::vector<OnSafetyStopTriggeredCallback> safetyStopTriggeredCallbacks;
61  std::vector<OnUserAbortTriggeredCallback> userAbortTriggeredCallbacks;
62  std::vector<OnInternalErrorCallback> internalErrorCallbacks;
63  } subscriptions;
64  };
65 
66 } // namespace armarx::navigation::client
armarx::navigation::client::SimpleEventHandler::localPlanningFailedCallbacks
std::vector< LocalPlanningFailedCallback > localPlanningFailedCallbacks
Definition: SimpleEventHandler.h:54
armarx::navigation::client::SimpleEventHandler::goalReachedCallbacks
std::vector< OnGoalReachedCallback > goalReachedCallbacks
Definition: SimpleEventHandler.h:57
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::client::SimpleEventHandler
Definition: SimpleEventHandler.h:12
armarx::navigation::client::SimpleEventHandler::movementStartedCallbacks
std::vector< OnMovementStartedCallback > movementStartedCallbacks
Definition: SimpleEventHandler.h:56
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::client::SimpleEventHandler::waypointReachedCallbacks
std::vector< OnWaypointReachedCallback > waypointReachedCallbacks
Definition: SimpleEventHandler.h:58
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::SimpleEventHandler::trajectoryControllerUpdatedCallbacks
std::vector< TrajectoryControllerUpdatedCallback > trajectoryControllerUpdatedCallbacks
Definition: SimpleEventHandler.h:52
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:20
EventSubscriptionInterface.h
armarx::navigation::client::LocalPlanningFailedCallback
std::function< void(const core::LocalPlanningFailedEvent &)> LocalPlanningFailedCallback
Definition: EventSubscriptionInterface.h:23
armarx::navigation::client::SimpleEventHandler::localTrajectoryUpdatedCallbacks
std::vector< LocalTrajectoryUpdatedCallback > localTrajectoryUpdatedCallbacks
Definition: SimpleEventHandler.h:51
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: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
armarx::navigation::client::SimpleEventHandler::globalTrajectoryUpdatedCallbacks
std::vector< GlobalTrajectoryUpdatedCallback > globalTrajectoryUpdatedCallbacks
Definition: SimpleEventHandler.h:50
armarx::navigation::client::SimpleEventHandler::userAbortTriggeredCallbacks
std::vector< OnUserAbortTriggeredCallback > userAbortTriggeredCallbacks
Definition: SimpleEventHandler.h:61
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
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:72
armarx::navigation::client::SimpleEventHandler::safetyStopTriggeredCallbacks
std::vector< OnSafetyStopTriggeredCallback > safetyStopTriggeredCallbacks
Definition: SimpleEventHandler.h:60
armarx::navigation::client::OnMovementStartedCallback
std::function< void(const core::MovementStartedEvent &)> OnMovementStartedCallback
Definition: EventSubscriptionInterface.h:25
armarx::navigation::client::SimpleEventHandler::internalErrorCallbacks
std::vector< OnInternalErrorCallback > internalErrorCallbacks
Definition: SimpleEventHandler.h:62
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::client::EventSubscriptionInterface
Definition: EventSubscriptionInterface.h:36
armarx::navigation::core::WaypointReachedEvent
Event describing that a user-defined waypoint was successfully reached.
Definition: events.h:57
armarx::navigation::client::SimpleEventHandler::safetyThrottlingTriggeredCallbacks
std::vector< OnSafetyThrottlingTriggeredCallback > safetyThrottlingTriggeredCallbacks
Definition: SimpleEventHandler.h:59
armarx::navigation::client::OnInternalErrorCallback
std::function< void(const core::InternalErrorEvent &)> OnInternalErrorCallback
Definition: EventSubscriptionInterface.h:34
armarx::navigation::server::EventPublishingInterface
A publisher the server navigator will use to notify others about events.
Definition: EventPublishingInterface.h:16
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
armarx::navigation::client::SimpleEventHandler::globalPlanningFailedCallbacks
std::vector< GlobalPlanningFailedCallback > globalPlanningFailedCallbacks
Definition: SimpleEventHandler.h:53