SVHDiagnostics.h
Go to the documentation of this file.
1 //
3 // © Copyright 2022 SCHUNK Mobile Greifsysteme GmbH, Lauffen/Neckar Germany
4 // © Copyright 2022 FZI Forschungszentrum Informatik, Karlsruhe, Germany
5 //
6 // This file is part of the Schunk SVH Driver.
7 //
8 // The Schunk SVH Driver is free software: you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or (at your
11 // option) any later version.
12 //
13 // The Schunk SVH Driver is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 // Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License along with
19 // the Schunk SVH Driver. If not, see <https://www.gnu.org/licenses/>.
20 //
22 
23 //----------------------------------------------------------------------
31 //----------------------------------------------------------------------
32 
33 #ifndef S5FH_DIAGNOSTICS_H
34 #define S5FH_DIAGNOSTICS_H
35 
36 // ROS includes.
38 #include <ros/ros.h>
39 
40 #include <functional>
41 #include <memory>
42 #include <stdint.h>
43 #include <string>
44 
45 // Date
46 #include <ctime>
47 #include <fstream>
48 #include <iostream>
49 
50 // Messages
51 #include "std_msgs/Float64MultiArray.h"
52 #include "std_msgs/MultiArrayDimension.h"
53 #include "std_msgs/MultiArrayLayout.h"
54 #include <sensor_msgs/JointState.h>
55 #include <std_msgs/Bool.h>
56 #include <std_msgs/Empty.h>
57 #include <std_msgs/Int8.h>
58 #include <std_msgs/String.h>
59 
60 // FZI includes
61 #include "schunk_svh_msgs/SVHDiagnosticsAction.h"
62 #include "schunk_svh_msgs/SVHDiagnosticsToProtocol.h"
63 
64 // Driver Specific things
69 
71 {
72 public:
82  std::shared_ptr<driver_svh::SVHFingerManager>& finger_manager,
83  std::function<void(bool)> enable_ros_contol_loop,
84  std::function<void(uint16_t, uint16_t)> init_controller_parameters,
85  std::string name);
86 
89 
92  void basicTestCallback(const schunk_svh_msgs::SVHDiagnosticsGoalConstPtr& goal);
93 
95  void testCallback(const std_msgs::String&);
96 
97 
98 private:
103 
107  void resetDiagnosticStatus();
108 
112  void debugOuput();
113 
118  schunk_svh_msgs::SVHDiagnosticsResult evaluateBasicTest();
119 
124 
129 
133  void initTest();
134 
136  std::shared_ptr<driver_svh::SVHFingerManager> m_finger_manager;
137 
141  std::function<void(bool)> m_enable_ros_contol_loop;
142 
147  std::function<void(uint16_t, uint16_t)> m_init_controller_parameters;
148 
150  std::string m_serial_device_name;
151 
155 
158  std::string name_prefix;
159 
161  sensor_msgs::JointState channel_pos_;
162 
164  std_msgs::Float64MultiArray channel_currents;
165 
167  std::vector<bool> reset_success;
168 
170  std::string m_serial_no;
171 
173  std::string m_assembly_of;
174 
178 
181 
184 
187 
189  schunk_svh_msgs::SVHDiagnosticsToProtocol m_msg_protocol_variable;
190 
193 
194  // Action Feedback
195  schunk_svh_msgs::SVHDiagnosticsFeedback m_action_feedback;
196 
198  schunk_svh_msgs::SVHDiagnosticsResult m_action_result;
199 
200  // Action server name
201  std::string m_action_name;
202 
204  {
218  };
219 };
220 
221 #endif // S5FH_CONTROLLER_H
SVHDiagnostics::initTest
void initTest()
initialize the protocol variables
Definition: SVHDiagnostics.cpp:68
SVHPositionSettings.h
SVHDiagnostics::m_pub_protocol_variables
ros::Publisher m_pub_protocol_variables
publisher to the protocol variables
Definition: SVHDiagnostics.h:186
ros::Publisher
SVHDiagnostics
Definition: SVHDiagnostics.h:70
SVHDiagnostics::m_init_controller_parameters
std::function< void(uint16_t, uint16_t)> m_init_controller_parameters
Definition: SVHDiagnostics.h:147
SVHDiagnostics::diag_information
diag_information
Definition: SVHDiagnostics.h:203
SVHDiagnostics::m_msg_protocol_variable
schunk_svh_msgs::SVHDiagnosticsToProtocol m_msg_protocol_variable
Message for the Protocol variable.
Definition: SVHDiagnostics.h:189
SVHDiagnostics::board_two
@ board_two
Definition: SVHDiagnostics.h:207
ros.h
SVHDiagnostics::m_assembly_of
std::string m_assembly_of
Name of the testing person.
Definition: SVHDiagnostics.h:173
SVHDiagnostics::~SVHDiagnostics
~SVHDiagnostics()
Default DTOR.
Definition: SVHDiagnostics.cpp:63
SVHDiagnostics::m_enable_ros_contol_loop
std::function< void(bool)> m_enable_ros_contol_loop
Definition: SVHDiagnostics.h:141
simple_action_server.h
SVHDiagnostics::m_serial_device_name
std::string m_serial_device_name
Serial device to use for communication with hardware.
Definition: SVHDiagnostics.h:150
SVHDiagnostics::encoder_motor
@ encoder_motor
Definition: SVHDiagnostics.h:212
SVHDiagnostics::position_range
@ position_range
Definition: SVHDiagnostics.h:216
SVHDiagnostics::board_one_encoder
@ board_one_encoder
Definition: SVHDiagnostics.h:208
SVHDiagnostics::m_execution_L
bool m_execution_L
Definition: SVHDiagnostics.h:177
SVHDiagnostics::m_connect_retry_count
int m_connect_retry_count
Definition: SVHDiagnostics.h:154
SVHDiagnostics::m_execution_R
bool m_execution_R
Type of the Hand, No/ L / R.
Definition: SVHDiagnostics.h:176
SVHDiagnostics::channel_currents
std_msgs::Float64MultiArray channel_currents
Current Value message template.
Definition: SVHDiagnostics.h:164
SVHDiagnostics::debugOuput
void debugOuput()
debugOutput prints the diagnostic data of all finger
Definition: SVHDiagnostics.cpp:401
SVHDiagnostics::zero_defect
@ zero_defect
Definition: SVHDiagnostics.h:205
SVHDiagnostics::board_one_motor
@ board_one_motor
Definition: SVHDiagnostics.h:209
SVHDiagnostics::diag_information_dimension
@ diag_information_dimension
Definition: SVHDiagnostics.h:217
SVHDiagnostics::SVHDiagnostics
SVHDiagnostics(const ros::NodeHandle &nh, std::shared_ptr< driver_svh::SVHFingerManager > &finger_manager, std::function< void(bool)> enable_ros_contol_loop, std::function< void(uint16_t, uint16_t)> init_controller_parameters, std::string name)
SVHDiagnostics constructs a new node object that handles most of the functionality.
Definition: SVHDiagnostics.cpp:35
SVHCurrentSettings.h
SVHDiagnostics::initializeProtocolMessage
void initializeProtocolMessage()
initialize the protocol variables
Definition: SVHDiagnostics.cpp:473
SVHDiagnostics::m_action_feedback
schunk_svh_msgs::SVHDiagnosticsFeedback m_action_feedback
Definition: SVHDiagnostics.h:195
SVHDiagnostics::channel_pos_
sensor_msgs::JointState channel_pos_
joint state message template
Definition: SVHDiagnostics.h:161
SVHFingerManager.h
SVHDiagnostics::m_diagnostics_action_server
actionlib::SimpleActionServer< schunk_svh_msgs::SVHDiagnosticsAction > m_diagnostics_action_server
Action Server.
Definition: SVHDiagnostics.h:192
SVHDiagnostics::m_serial_no
std::string m_serial_no
Serial No of the tested Hand.
Definition: SVHDiagnostics.h:170
SVHDiagnostics::resetDiagnosticStatus
void resetDiagnosticStatus()
resetDiagnosticStatus resets the finger vector with the diagnostic data
Definition: SVHDiagnostics.cpp:386
SVHDiagnostics::m_action_name
std::string m_action_name
Definition: SVHDiagnostics.h:201
SVHDiagnostics::m_priv_nh
ros::NodeHandle m_priv_nh
private node handle
Definition: SVHDiagnostics.h:102
SVHDiagnostics::qualityProtocolWritting
void qualityProtocolWritting()
set the protocol variables
Definition: SVHDiagnostics.cpp:445
actionlib::SimpleActionServer< schunk_svh_msgs::SVHDiagnosticsAction >
SVHDiagnostics::board_two_encoder
@ board_two_encoder
Definition: SVHDiagnostics.h:210
SVHDiagnostics::reset_success
std::vector< bool > reset_success
Reset successed vector.
Definition: SVHDiagnostics.h:167
SVHDiagnostics::current_range
@ current_range
Definition: SVHDiagnostics.h:215
SVHDiagnostics::board_one
@ board_one
Definition: SVHDiagnostics.h:206
SVHDiagnostics::board_two_motor
@ board_two_motor
Definition: SVHDiagnostics.h:211
SVHDiagnostics::m_action_result
schunk_svh_msgs::SVHDiagnosticsResult m_action_result
Action result.
Definition: SVHDiagnostics.h:198
SVHDiagnostics::m_basic_test_running
bool m_basic_test_running
To catch multiple bastic test starts.
Definition: SVHDiagnostics.h:183
SVHDiagnostics::testCallback
void testCallback(const std_msgs::String &)
Callback function to test the subfunctions of SVHDiagnostics.
SVHDiagnostics::m_communication
bool m_communication
Type of onnection.
Definition: SVHDiagnostics.h:180
SVHDiagnostics::basicTestCallback
void basicTestCallback(const schunk_svh_msgs::SVHDiagnosticsGoalConstPtr &goal)
Definition: SVHDiagnostics.cpp:115
SVHDiagnostics::name_prefix
std::string name_prefix
Definition: SVHDiagnostics.h:158
SVHDiagnostics::encoder
@ encoder
Definition: SVHDiagnostics.h:213
ros::NodeHandle
SVHFirmwareInfo.h
SVHDiagnostics::evaluateBasicTest
schunk_svh_msgs::SVHDiagnosticsResult evaluateBasicTest()
evaluateBasicTest evaluates the diagnostics status of the basic test to send the hint informations to...
Definition: SVHDiagnostics.cpp:230
SVHDiagnostics::m_finger_manager
std::shared_ptr< driver_svh::SVHFingerManager > m_finger_manager
Handle to the SVH finger manager for library access.
Definition: SVHDiagnostics.h:136
SVHDiagnostics::motor
@ motor
Definition: SVHDiagnostics.h:214


schunk_svh_driver
Author(s): Georg Heppner , Felix Exner , Pascal Becker , Johannes Mangler
autogenerated on Sat Apr 15 2023 02:24:55