SVHController.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of the SCHUNK SVH Driver suite.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2014 SCHUNK Mobile Greifsysteme GmbH, Lauffen/Neckar Germany
12 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany
13 //
14 // -- END LICENSE BLOCK ------------------------------------------------
15 
16 //----------------------------------------------------------------------
38 //----------------------------------------------------------------------
39 #ifndef DRIVER_SVH_SVH_CONTROLLER_H_INCLUDED
40 #define DRIVER_SVH_SVH_CONTROLLER_H_INCLUDED
41 
52 
53 namespace driver_svh {
54 
56 enum{
57  eSVH_ALL = -1, // this should be used with care as not all functions support it yet
68 } typedef SVHChannel;
69 
78 {
79 public:
81  SVHController();
82 
86  ~SVHController();
87 
93  bool connect(const std::string &dev_name);
94 
96  void disconnect();
97 
103  void setControllerTarget(const SVHChannel& channel, const int32_t &position);
104 
109  void setControllerTargetAllChannels(const std::vector<int32_t>& positions);
110 
111 
112  // Access functions
117  void enableChannel(const SVHChannel& channel);
118 
123  void disableChannel(const SVHChannel& channel);
124 
126  void requestControllerState();
127 
132  void requestControllerFeedback(const SVHChannel& channel);
133 
138  void requestPositionSettings(const SVHChannel& channel);
139 
145  void setPositionSettings(const SVHChannel& channel,const SVHPositionSettings& position_settings);
146 
151  void requestCurrentSettings(const SVHChannel& channel);
152 
158  void setCurrentSettings(const SVHChannel& channel,const SVHCurrentSettings& current_settings);
159 
163  void requestEncoderValues();
164 
169  void setEncoderValues(const SVHEncoderSettings& encoder_settings);
170 
171 
175  void requestFirmwareInfo();
176 
182  void receivedPacketCallback(const SVHSerialPacket& packet, unsigned int packet_count);
183 
195  bool getControllerFeedback(const SVHChannel &channel,SVHControllerFeedback& controller_feedback);
196 
203  bool getPositionSettings(const SVHChannel &channel,SVHPositionSettings& position_settings);
204 
211  bool getCurrentSettings(const SVHChannel &channel,SVHCurrentSettings& current_settings);
212 
217  SVHFirmwareInfo getFirmwareInfo();
218 
223  unsigned int getSentPackageCount();
224 
229  unsigned int getReceivedPackageCount();
230 
234  void resetPackageCounts();
235 
241  bool isEnabled(const SVHChannel &channel);
242 
244  static const char * m_channel_description[];
245 
247  static const float channel_effort_constants[9];
248 
250  void getControllerFeedbackAllChannels(SVHControllerFeedbackAllChannels &controller_feedback);
251 private:
252 
253  // Data Structures for holding configurations and feedback of the Controller
254 
256  std::vector<SVHCurrentSettings> m_current_settings;
257 
259  std::vector<SVHPositionSettings> m_position_settings;
260 
262  std::vector<SVHControllerFeedback> m_controller_feedback;
263 
266 
269 
272 
273  // Hardware control
274 
277 
280 
283 
284 
285 
286 
287 };
288 
289 }
290 
291 #endif
signed int int32_t
SVHFirmwareInfo m_firmware_info
Latest firmware info.
std::vector< SVHCurrentSettings > m_current_settings
vector of current controller parameters for each finger
SVHEncoderSettings m_encoder_settings
Currently active encoder settings.
The SVHCurrentSettings save the current controller paramters for a single motor.
#define DRIVER_SVH_IMPORT_EXPORT
Definition: ImportExport.h:43
unsigned int m_received_package_count
store how many packages where actually received. Updated every time the receivepacket callback is cal...
std::vector< SVHControllerFeedback > m_controller_feedback
ControllerFeedback indicates current position and current per finger.
The SVHFirmwareInfo holds the data of a firmware response from the hardware.
The SVHControllerFeedback saves the feedback of a single motor.
std::vector< SVHPositionSettings > m_position_settings
vector of position controller parameters for each finger
This class controls the the SCHUNK five finger hand.
Definition: SVHController.h:77
SVHControllerState m_controller_state
Currently active controllerstate on the HW Controller (indicates if PWM active etc.)
The SVHPositionSettings save the position controller paramters for a single motor.
SVHSerialInterface * m_serial_interface
Serial interface for transmission and reveibing of data packets.
The SVHControllerState indicates the current state of the MeCoVis controller IC which is used in the ...
uint16_t m_enable_mask
Bitmask to tell which fingers are enabled.
The SVHControllerFeedbackAllChannes saves the feedback of a all motors.
Basic communication handler for the SCHUNK five finger hand.
unsigned short uint16_t
The SVHEncoderSettings hold the settings for the encoder scaling of each channel. ...
SVHChannel
Channel indicates which motor to use in command calls. WARNING: DO NOT CHANGE THE ORDER OF THESE as i...
Definition: SVHController.h:56
The SerialPacket holds the (non generated) header and data of one message to the SVH-Hardware.


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Mon Jun 10 2019 15:04:59