Go to the documentation of this file.
17 #include <armarx/navigation/core/aron/Events.aron.generated.h>
26 callerId(callerId), memoryNameSystem(mns), lastMemoryPoll(
armem::
Time::Now())
33 ARMARX_INFO <<
"MemorySubscriber: will handle all events newer than " << lastMemoryPoll
48 ARMARX_VERBOSE <<
"Received " << snapshotIDs.size() <<
" events from memory";
61 template <
typename AronEventT,
typename EventT>
71 const auto dto = AronEventT::FromAron(dataDict);
83 std::lock_guard g{eventHandlingMtx};
88 ARMARX_INFO <<
"Handling event `" << eventName <<
"`";
94 fromAron<core::arondto::GlobalPlanningFailedEvent>(memoryEntity, evt);
101 fromAron<core::arondto::MovementStartedEvent>(memoryEntity, evt);
108 fromAron<core::arondto::GoalReachedEvent>(memoryEntity, evt);
115 fromAron<core::arondto::WaypointReachedEvent>(memoryEntity, evt);
122 fromAron<core::arondto::SafetyThrottlingTriggeredEvent>(memoryEntity, evt);
129 fromAron<core::arondto::SafetyStopTriggeredEvent>(memoryEntity, evt);
136 fromAron<core::arondto::UserAbortTriggeredEvent>(memoryEntity, evt);
143 fromAron<core::arondto::InternalErrorEvent>(memoryEntity, evt);
171 .getCoreSegment(
"Events");
174 std::vector<armem::wm::EntityInstance> events;
177 { events.push_back(instance); });
185 return a.id().timestamp < b.id().timestamp;
188 std::sort(events.begin(), events.end(), sortByTimestampAsc);
190 std::for_each(events.begin(), events.end(), [&](
const auto& event) { handleEvent(event); });
~MemorySubscriber() override
wm::Memory memory
The slice of the memory that matched the query.
void safetyStopTriggered(const core::SafetyStopTriggeredEvent &event) override
Will be called whenever a safety stop is triggered.
const std::string MovementStarted
std::string providerSegmentName
void movementStarted(const core::MovementStartedEvent &event) override
Client-side working entity instance.
void safetyThrottlingTriggered(const core::SafetyThrottlingTriggeredEvent &event) override
Will be called whenever safety throttling is triggered to a certain degree (configurable).
void fromAron(const arondto::GlobalTrajectoryPoint &dto, GlobalTrajectoryPoint &bo)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
void handleEvent(const armem::wm::EntityInstance &memoryEntity)
Event describing the occurance of an internal unhandled error.
Event desciribing that a significant safety throttling factor was reached.
const std::string UserAbortTriggered
void globalPlanningFailed(const core::GlobalPlanningFailedEvent &event) override
MemorySubscriber(const std::string &callerId, armem::client::MemoryNameSystem &mns)
void internalError(const core::InternalErrorEvent &event) override
Will be called whenever an internal error occurs.
const std::string WaypointReached
This file is part of ArmarX.
static PointerType DynamicCastAndCheck(const VariantPtr &n)
Brief description of class memory.
std::string coreSegmentName
auto fromAron(const armem::wm::EntityInstance &entity, EventT &bo)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
const std::string SafetyStopTriggered
QueryResult queryMemoryIDs(const std::vector< MemoryID > &ids, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Query a specific set of memory IDs.
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
const std::string SafetyThrottlingTriggered
double a(double t, double a0, double j)
std::shared_ptr< Value > value()
const std::string GlobalPlanningFailed
void userAbortTriggered(const core::UserAbortTriggeredEvent &event) override
Will be called whenever the user aborts the current navigation.
void onEntityUpdate(const std::vector< armem::MemoryID > &snapshotIDs)
Event describing that for security reasons, the robot was stopped completely.
Client-side working memory core segment.
Client-side working memory.
Event describing that the user aborted the current execution.
SubscriptionHandle subscribe(const MemoryID &subscriptionID, Callback Callback)
armarx::core::time::DateTime Time
Event describing that the targeted goal was successfully reached.
const std::string GoalReached
const std::string InternalError
bool hasEntityName() const
void goalReached(const core::GoalReachedEvent &event) override
Will be called whenever the navigator reached the goal.
const std::string memoryName
bool forEachInstance(InstanceFunctionT &&func)
void waypointReached(const core::WaypointReachedEvent &event) override
Will be called whenever the navigator reached a user-defined waypoint.
The memory name system (MNS) client.
Event describing that a user-defined waypoint was successfully reached.
void handleEvents(const armem::wm::Memory &memory)
Reader getReader(const MemoryID &memoryID)
Get a reader to the given memory name.
const DataT & data() const
const std::optional< BoT > & bo