00001 /********************************************************************* 00002 * Software License Agreement (CC BY-NC-SA 4.0 License) 00003 * 00004 * Copyright (c) 2014, PAL Robotics, S.L. 00005 * All rights reserved. 00006 * 00007 * This work is licensed under the Creative Commons 00008 * Attribution-NonCommercial-ShareAlike 4.0 International License. 00009 * 00010 * To view a copy of this license, visit 00011 * http://creativecommons.org/licenses/by-nc-sa/4.0/ 00012 * or send a letter to 00013 * Creative Commons, 444 Castro Street, Suite 900, 00014 * Mountain View, California, 94041, USA. 00015 *********************************************************************/ 00016 00017 /* 00018 * @author Enrique Fernandez 00019 */ 00020 00021 #ifndef TWIST_MUX_DIAGNOSTICS_H 00022 #define TWIST_MUX_DIAGNOSTICS_H 00023 00024 #include <twist_mux/twist_mux_diagnostics_status.h> 00025 00026 #include <diagnostic_updater/diagnostic_updater.h> 00027 #include <ros/ros.h> 00028 00029 #include <boost/shared_ptr.hpp> 00030 00031 namespace twist_mux 00032 { 00033 00034 class TwistMuxDiagnostics 00035 { 00036 public: 00037 typedef TwistMuxDiagnosticsStatus status_type; 00038 00039 TwistMuxDiagnostics(); 00040 virtual ~TwistMuxDiagnostics(); 00041 00042 void diagnostics(diagnostic_updater::DiagnosticStatusWrapper& stat); 00043 00044 void update(const bool force_update = false); 00045 00046 void updateStatus(const status_type::ConstPtr& status); 00047 00048 private: 00049 00053 enum 00054 { 00055 OK = diagnostic_msgs::DiagnosticStatus::OK, 00056 WARN = diagnostic_msgs::DiagnosticStatus::WARN, 00057 ERROR = diagnostic_msgs::DiagnosticStatus::ERROR 00058 }; 00059 00060 diagnostic_updater::Updater diagnostic_; 00061 status_type status_; 00062 }; 00063 00064 } // namespace twist_mux 00065 00066 #endif // TWIST_MUX_DIAGNOSTICS_H