14 #include <unordered_map> 17 #include <std_msgs/Bool.h> 18 #include <topic_tools/shape_shifter.h> 25 namespace priority_mux
54 void onInit()
override;
56 virtual void cb(const ::ros::MessageEvent<::topic_tools::ShapeShifter const>& event, const ::std::string&
inTopic);
57 virtual void lockCb(const ::std::string& topic, const ::std_msgs::BoolConstPtr&
msg);
58 virtual void updatePriorities(
int newPriority, const ::std::string& newTopic);
60 void publishPriorityChange(
int newPriority, const ::ros::Duration&
timeout);
61 void publishSelectedTopicChange(const ::std::string&
outTopic, const ::std::string& newTopic,
62 const ::ros::Duration& timeout);
63 void onPriorityTimeout(const ::ros::TimerEvent&);
64 void onSelectedTopicTimeout(const ::std::string& outTopic, const ::ros::TimerEvent&);
65 void onLockTimeout(const ::std::string& topic, const ::ros::TimerEvent&);
68 ::std::unordered_map<::std::string, ::ros::Publisher>
publishers;
77 ::std::unordered_map<::std::string, ::cras::priority_mux::TopicConfig>
topicConfigs;
78 ::std::unordered_map<::std::string, ::cras::priority_mux::LockConfig>
lockConfigs;
83 size_t outQueueSize {10u};
85 int lastActivePriority {0};
::std::unordered_map<::std::string, ::ros::Publisher > lockedPublishers
::ros::Timer priorityBackToNoneTimer
::std::unordered_map<::std::string, ::ros::Publisher > publishers
::std::map<::std::pair< int, ::std::string >, ::ros::Time > lastLockStamps
::ros::Publisher activePriorityPub
::std::map<::std::pair< int, ::std::string >, ::ros::Time > lastReceiveStamps
::std::list<::ros::Subscriber > subscribers
::std::unordered_map<::std::string, ::cras::priority_mux::TopicConfig > topicConfigs
::std::unordered_map<::std::string, ::std::string > lastSelectedTopics
::std::unordered_map<::std::string, ::ros::Timer > selectedBackToNoneTimers
::std::unordered_map<::std::string, ::ros::Publisher > selectedPublishers
::std::unordered_map<::std::string, ::ros::Timer > lockTimeoutTimers
::std::unordered_map<::std::string, ::cras::priority_mux::LockConfig > lockConfigs
static const ::std::string NONE_TOPIC