naoqidriver
diagnostics.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef DIAGNOSTICS_CONVERTER_HPP
19 #define DIAGNOSTICS_CONVERTER_HPP
20 
21 /*
22 * LOCAL includes
23 */
24 #include "converter_base.hpp"
26 
27 /*
28 * ROS includes
29 */
30 #include <diagnostic_msgs/DiagnosticArray.h>
31 
32 namespace naoqi
33 {
34 namespace converter
35 {
36 
42 class DiagnosticsConverter : public BaseConverter<DiagnosticsConverter>
43 {
44 
45  typedef boost::function<void(diagnostic_msgs::DiagnosticArray&) > Callback_t;
46 
47 public:
48  DiagnosticsConverter(const std::string& name, float frequency, const qi::SessionPtr &session );
49 
50  void reset();
51 
52  void callAll( const std::vector<message_actions::MessageAction>& actions );
53 
54  void registerCallback( const message_actions::MessageAction action, Callback_t cb );
55 
56 private:
58  std::vector<std::string> joint_names_;
60  std::vector<std::string> all_keys_;
62  std::vector<std::string> battery_status_keys_;
63 
65  qi::AnyObject p_memory_;
67  qi::AnyObject p_body_temperature_;
68 
71 
73  std::map<message_actions::MessageAction, Callback_t> callbacks_;
74 };
75 
76 } //converter
77 } // naoqi
78 
79 #endif
std::string name() const
Definition: converter_base.hpp:54
float frequency() const
Definition: converter_base.hpp:59
float temperature_warn_level_
Definition: diagnostics.hpp:69
std::map< message_actions::MessageAction, Callback_t > callbacks_
Definition: diagnostics.hpp:73
MessageAction
Definition: message_actions.h:9
Definition: audio.cpp:29
std::vector< std::string > joint_names_
Definition: diagnostics.hpp:58
void registerCallback(const message_actions::MessageAction action, Callback_t cb)
Definition: diagnostics.cpp:272
float temperature_error_level_
Definition: diagnostics.hpp:70
std::vector< std::string > all_keys_
Definition: diagnostics.hpp:60
This class defines a Diagnostic converter It does not use the DiagnostricsUpdater for optimization...
Definition: diagnostics.hpp:42
DiagnosticsConverter(const std::string &name, float frequency, const qi::SessionPtr &session)
Definition: diagnostics.cpp:54
boost::function< void(diagnostic_msgs::DiagnosticArray &) > Callback_t
Definition: diagnostics.hpp:45
Definition: converter_base.hpp:40
void reset()
Definition: diagnostics.cpp:268
qi::AnyObject p_memory_
Definition: diagnostics.hpp:65
void callAll(const std::vector< message_actions::MessageAction > &actions)
Definition: diagnostics.cpp:89
std::vector< std::string > battery_status_keys_
Definition: diagnostics.hpp:62
qi::AnyObject p_body_temperature_
Definition: diagnostics.hpp:67