|
NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
|
Go to the documentation of this file.
19 #ifndef SYS_MONITOR_SYS_MONITOR_H_
20 #define SYS_MONITOR_SYS_MONITOR_H_
22 #include <nodelet/NodeletLoad.h>
23 #include <nodelet/NodeletUnload.h>
24 #include <pluginlib/class_list_macros.h>
26 #include <ros/package.h>
29 #include <ff_msgs/CommandConstants.h>
30 #include <ff_msgs/CommandStamped.h>
31 #include <ff_msgs/Heartbeat.h>
32 #include <ff_msgs/Fault.h>
33 #include <ff_msgs/FaultConfig.h>
34 #include <ff_msgs/FaultInfo.h>
35 #include <ff_msgs/FaultState.h>
36 #include <ff_msgs/TimeSyncStamped.h>
37 #include <ff_msgs/UnloadLoadNodelet.h>
47 using ff_msgs::CommandArg;
61 void AddFault(
unsigned int fault_id, std::string
const& fault_msg =
"",
62 ros::Time time_occurred = ros::Time::now());
64 void AddFault(ff_msgs::Fault
const& fault,
bool check_added =
false);
74 std::string
const& node_name,
75 ros::Duration
const& timeout,
76 uint
const allowed_misses,
101 uint
const misses_allowed_;
102 uint
const fault_id_;
103 bool hb_fault_occurring_;
104 bool heartbeat_started_;
106 std::string nodelet_manager_;
107 std::string nodelet_name_;
108 std::string nodelet_type_;
109 ff_msgs::HeartbeatConstPtr previous_hb_;
114 Fault(std::string
const& node_name_in,
115 bool const blocking_in,
116 bool const warning_in,
117 ff_msgs::CommandStampedPtr response_in);
131 void AddWatchDog(ros::Duration
const& timeout, std::string
const& node_name,
132 uint
const allowed_misses, uint
const fault_id);
134 void SetFaultState(
unsigned int fault_id,
bool adding_fault);
143 std::string
const& message,
144 ros::Time time_fault_occurred = ros::Time::now());
152 void PublishCmd(ff_msgs::CommandStampedPtr cmd);
181 ff_msgs::CommandStampedPtr cmd);
184 ff_msgs::UnloadLoadNodelet::Response &res);
185 int LoadNodelet(ff_msgs::UnloadLoadNodelet::Request &req);
186 int UnloadNodelet(std::string
const& nodelet, std::string
const& manager);
224 #endif // SYS_MONITOR_SYS_MONITOR_H_
config_reader::ConfigReader config_params_
Definition: sys_monitor.h:213
void TimerCallBack(ros::TimerEvent const &te)
Definition: sys_monitor.cc:1220
unsigned int heartbeat_pub_rate_
Definition: sys_monitor.h:219
Definition: sys_monitor.h:113
bool log_time_llp_
Definition: sys_monitor.h:216
int sub_queue_size_
Definition: sys_monitor.h:217
const bool warning
Definition: sys_monitor.h:120
ros::Timer heartbeat_timer_
Definition: sys_monitor.h:200
std::string nodelet_type()
Definition: sys_monitor.cc:1178
void ReloadNodeletTimerCallback(ros::TimerEvent const &te)
Definition: sys_monitor.cc:616
virtual void Initialize(ros::NodeHandle *nh)
Definition: sys_monitor.cc:331
float time_drift_thres_sec_
Definition: sys_monitor.h:220
std::vector< std::string > unwatched_heartbeats_
Definition: sys_monitor.h:208
void PublishFaultState()
Definition: sys_monitor.cc:500
bool time_diff_fault_triggered_
Definition: sys_monitor.h:215
ff_msgs::Heartbeat heartbeat_
Definition: sys_monitor.h:190
uint misses_allowed()
Definition: sys_monitor.cc:1150
unsigned int startup_time_
Definition: sys_monitor.h:219
void PublishFaultConfig()
Definition: sys_monitor.cc:495
std::string nodelet_manager()
Definition: sys_monitor.cc:1170
ros::Publisher pub_heartbeat_
Definition: sys_monitor.h:196
ff_msgs::HeartbeatConstPtr previous_hb()
Definition: sys_monitor.cc:1154
std::map< unsigned int, std::shared_ptr< Fault > > all_faults_
Definition: sys_monitor.h:204
void SetFaultState(unsigned int fault_id, bool adding_fault)
Definition: sys_monitor.cc:128
int num_current_blocking_fault_
Definition: sys_monitor.h:218
bool NodeletService(ff_msgs::UnloadLoadNodelet::Request &req, ff_msgs::UnloadLoadNodelet::Response &res)
Definition: sys_monitor.cc:1022
std::shared_ptr< Watchdog > WatchdogPtr
Definition: sys_monitor.h:111
bool log_time_hlp_
Definition: sys_monitor.h:216
const std::string node_name
Definition: sys_monitor.h:118
void PublishCmd(ff_msgs::CommandStampedPtr cmd)
Definition: sys_monitor.cc:490
void OutputFaultTables()
Definition: sys_monitor.cc:440
int UnloadNodelet(std::string const &nodelet, std::string const &manager)
Definition: sys_monitor.cc:1085
ros::Timer reload_nodelet_timer_
Definition: sys_monitor.h:199
Definition: sys_monitor.h:49
unsigned int reload_nodelet_timeout_
Definition: sys_monitor.h:219
void PublishFaultResponse(unsigned int fault_id)
Definition: sys_monitor.cc:505
ros::Timer reload_params_timer_
Definition: sys_monitor.h:199
const bool blocking
Definition: sys_monitor.h:119
void AddWatchDog(ros::Duration const &timeout, std::string const &node_name, uint const allowed_misses, uint const fault_id)
Definition: sys_monitor.cc:111
bool unloaded()
Definition: sys_monitor.cc:1166
ros::Subscriber sub_hb_
Definition: sys_monitor.h:202
std::string name
Definition: eps_simulator.cc:48
ros::Publisher pub_cmd_
Definition: sys_monitor.h:196
bool heartbeat_started()
Definition: sys_monitor.cc:1162
void ResetTimer()
Definition: sys_monitor.cc:1202
Definition: ff_nodelet.h:57
~SysMonitor()
Definition: sys_monitor.cc:33
void PublishHeartbeatCallback(ros::TimerEvent const &te)
Definition: sys_monitor.cc:531
void ChangeFaultErrMsg(unsigned int fault_id, std::string err_msg)
Definition: sys_monitor.cc:89
std::string nodelet_name()
Definition: sys_monitor.cc:1174
Definition: config_reader.h:48
void PublishHeartbeat(bool initialization_fault=false)
Definition: sys_monitor.cc:535
bool ReadCommand(config_reader::ConfigReader::Table *entry, ff_msgs::CommandStampedPtr cmd)
Definition: sys_monitor.cc:886
ff_msgs::FaultState fault_state_
Definition: sys_monitor.h:188
std::vector< std::string > reloaded_nodelets_
Definition: sys_monitor.h:209
bool ReadParams()
Definition: sys_monitor.cc:646
ros::Publisher pub_fault_config_
Definition: sys_monitor.h:197
Definition: sys_monitor.h:71
nodelet::NodeletLoad load_service_
Definition: sys_monitor.h:192
int pub_queue_size_
Definition: sys_monitor.h:217
Definition: config_reader.h:54
ff_msgs::FaultConfig fault_config_
Definition: sys_monitor.h:189
int LoadNodelet(ff_msgs::UnloadLoadNodelet::Request &req)
Definition: sys_monitor.cc:1033
void StartupTimerCallback(ros::TimerEvent const &te)
Definition: sys_monitor.cc:560
bool hb_fault_occurring()
Definition: sys_monitor.cc:1158
void StopTimer()
Definition: sys_monitor.cc:1212
nodelet::NodeletUnload unload_service_
Definition: sys_monitor.h:193
std::string time_diff_node_
Definition: sys_monitor.h:211
SysMonitor()
Definition: sys_monitor.cc:22
ros::NodeHandle nh_
Definition: sys_monitor.h:195
void RemoveFault(unsigned int fault_id)
Definition: sys_monitor.cc:98
ros::Publisher pub_fault_state_
Definition: sys_monitor.h:197
ros::Publisher pub_time_sync_
Definition: sys_monitor.h:198
ros::ServiceServer unload_load_nodelet_service_
Definition: sys_monitor.h:201
void AddFault(unsigned int fault_id, std::string const &fault_msg="", ros::Time time_occurred=ros::Time::now())
Definition: sys_monitor.cc:38
Watchdog(SysMonitor *const sys_monitor, std::string const &node_name, ros::Duration const &timeout, uint const allowed_misses, uint const fault_id)
Definition: sys_monitor.cc:1126
void AssertFault(ff_util::FaultKeys enum_key, std::string const &message, ros::Time time_fault_occurred=ros::Time::now())
ff_msgs::CommandStampedPtr response
Definition: sys_monitor.h:121
void HeartbeatCallback(ff_msgs::HeartbeatConstPtr const &heartbeat)
Definition: sys_monitor.cc:164
double Time
Definition: time.h:23
uint fault_id()
Definition: sys_monitor.cc:1146
Definition: sys_monitor.h:50
void PublishTimeDiff(float time_diff_sec)
ros::Timer startup_timer_
Definition: sys_monitor.h:199
FaultKeys
Definition: ff_faults.h:28
void ClearFault(ff_util::FaultKeys enum_key)
std::map< std::string, WatchdogPtr > watch_dogs_
Definition: sys_monitor.h:205
Fault(std::string const &node_name_in, bool const blocking_in, bool const warning_in, ff_msgs::CommandStampedPtr response_in)
Definition: sys_monitor.cc:1232