qbsofthand_research_api.cpp
Go to the documentation of this file.
1 /***
2  * Software License Agreement: BSD 3-Clause License
3  *
4  * Copyright (c) 2015-2021, qbrobotics®
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
8  * following conditions are met:
9  *
10  * * Redistributions of source code must retain the above copyright notice, this list of conditions and the
11  * following disclaimer.
12  *
13  * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
29 
30 using namespace qbrobotics_research_api;
31 
32 void qbSoftHandResearch::Params::initParams(const std::vector<int8_t> &param_buffer) {
33  Device::Params::initParams(param_buffer);
34  getParameter<uint8_t>(14, param_buffer, use_emg_calibration);
35  getParameter<uint16_t>(15, param_buffer, emg_thresholds);
36  getParameter<uint32_t>(16, param_buffer, emg_max_value);
37  getParameter<uint8_t>(17, param_buffer, emg_speed);
38  getParameter<uint8_t>(18, param_buffer, use_double_encoder);
39  getParameter<int8_t>(19, param_buffer, handle_ratio);
40  getParameter<uint8_t>(20, param_buffer, use_pwm_rescaling);
41  getParameter<float>(21, param_buffer, current_lookup_table);
42  getParameter<uint8_t>(22, param_buffer, rate_limiter);
43 }
44 
45 qbSoftHandResearch::qbSoftHandResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id)
46  : Device(std::move(communication), std::move(name), std::move(serial_port), id, true, std::make_unique<qbSoftHandResearch::Params>()) {}
47 
48 qbSoftHandResearch::qbSoftHandResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params)
49  : Device(std::move(communication), std::move(name), std::move(serial_port), id, init_params, std::make_unique<qbSoftHandResearch::Params>()) {}
50 
51 qbSoftHandResearch::qbSoftHandResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params, std::unique_ptr<Device::Params> params)
52  : Device(std::move(communication), std::move(name), std::move(serial_port), id, init_params, std::move(params)) {}
53 
54 int qbSoftHandResearch::openCloseCycles(uint16_t speed, uint16_t cycles) {
55  std::vector<int8_t> data_in;
56  const std::vector<int8_t> data_out = Communication::vectorSwapAndCast<int8_t, uint16_t>({speed, cycles});
57  if (communication_->sendCommandAndParse(serial_port_, params_->id, CMD_HAND_CALIBRATE, data_out, data_in) < 0) {
58  return -1;
59  }
60  return 0;
61 }
62 
63 int qbSoftHandResearch::getEMGs(std::vector<int16_t> &emg_values) {
64  std::vector<int8_t> data_in;
65  if (communication_->sendCommandAndParse(serial_port_, params_->id, CMD_GET_EMG, data_in) < 0) {
66  return -1;
67  }
68  emg_values = Communication::vectorCastAndSwap<int16_t>(data_in);
69  return 0;
70 }
71 
72 int qbSoftHandResearch::getJoystick(std::vector<int16_t> &joystick_values) {
73  std::vector<int8_t> data_in;
74  if (communication_->sendCommandAndParse(serial_port_, params_->id, CMD_GET_JOYSTICK, data_in) < 0) {
75  return -1;
76  }
77  joystick_values = Communication::vectorCastAndSwap<int16_t>(data_in);
78  return 0;
79 }
80 
82  return getParamUseEMGCalibration(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_emg_calibration);
83 }
84 
85 int qbSoftHandResearch::getParamUseEMGCalibration(uint8_t &use_emg_calibration) {
86  std::vector<int8_t> param_buffer;
87  if (getParameters(param_buffer) != 0) {
88  return -1;
89  }
90  Params::getParameter<uint8_t>(14, param_buffer, use_emg_calibration);
91  return 0;
92 }
93 
95  return getParamEMGThresholds(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_thresholds);
96 }
97 
98 int qbSoftHandResearch::getParamEMGThresholds(std::vector<uint16_t> &emg_thresholds) {
99  std::vector<int8_t> param_buffer;
100  if (getParameters(param_buffer) != 0) {
101  return -1;
102  }
103  Params::getParameter<uint16_t>(15, param_buffer, emg_thresholds);
104  return 0;
105 }
106 
108  return getParamEMGMaxValues(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_max_value);
109 }
110 
111 int qbSoftHandResearch::getParamEMGMaxValues(std::vector<uint32_t> &emg_max_value) {
112  std::vector<int8_t> param_buffer;
113  if (getParameters(param_buffer) != 0) {
114  return -1;
115  }
116  Params::getParameter<uint32_t>(16, param_buffer, emg_max_value);
117  return 0;
118 }
119 
121  return getParamEMGSpeed(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_speed);
122 }
123 
124 int qbSoftHandResearch::getParamEMGSpeed(uint8_t &emg_speed) {
125  std::vector<int8_t> param_buffer;
126  if (getParameters(param_buffer) != 0) {
127  return -1;
128  }
129  Params::getParameter<uint8_t>(17, param_buffer, emg_speed);
130  return 0;
131 }
132 
134  return getParamUseDoubleEncoder(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_double_encoder);
135 }
136 
137 int qbSoftHandResearch::getParamUseDoubleEncoder(uint8_t &use_double_encoder) {
138  std::vector<int8_t> param_buffer;
139  if (getParameters(param_buffer) != 0) {
140  return -1;
141  }
142  Params::getParameter<uint8_t>(18, param_buffer, use_double_encoder);
143  return 0;
144 }
145 
147  return getParamHandleRatio(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->handle_ratio);
148 }
149 
150 int qbSoftHandResearch::getParamHandleRatio(int8_t &handle_ratio) {
151  std::vector<int8_t> param_buffer;
152  if (getParameters(param_buffer) != 0) {
153  return -1;
154  }
155  Params::getParameter<int8_t>(19, param_buffer, handle_ratio);
156  return 0;
157 }
158 
160  return getParamUsePWMRescaling(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_pwm_rescaling);
161 }
162 
163 int qbSoftHandResearch::getParamUsePWMRescaling(uint8_t &use_pwm_rescaling) {
164  std::vector<int8_t> param_buffer;
165  if (getParameters(param_buffer) != 0) {
166  return -1;
167  }
168  Params::getParameter<uint8_t>(20, param_buffer, use_pwm_rescaling);
169  return 0;
170 }
171 
173  return getParamCurrentLookupTable(std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->current_lookup_table);
174 }
175 
176 int qbSoftHandResearch::getParamCurrentLookupTable(std::vector<float> &current_lookup_table) {
177  std::vector<int8_t> param_buffer;
178  if (getParameters(param_buffer) != 0) {
179  return -1;
180  }
181  Params::getParameter<float>(21, param_buffer, current_lookup_table);
182  return 0;
183 }
184 
186  return getParamRateLimiter(params_->rate_limiter);
187 }
188 
189 int qbSoftHandResearch::getParamRateLimiter(uint8_t &rate_limiter) {
190  std::vector<int8_t> param_buffer;
191  if (getParameters(param_buffer) != 0) {
192  return -1;
193  }
194  Params::getParameter<uint8_t>(22, param_buffer, rate_limiter);
195  return 0;
196 }
197 
198 int qbSoftHandResearch::setParamUseEMGCalibration(uint8_t use_emg_calibration) {
199  int set_fail = setParameter(14, Communication::vectorSwapAndCast<int8_t, uint8_t>({use_emg_calibration}));
200  if (!set_fail) {
201  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_emg_calibration = use_emg_calibration;
202  }
203  return set_fail;
204 }
205 
206 int qbSoftHandResearch::setParamEMGThresholds(const std::vector<uint16_t> &emg_thresholds) {
207  int set_fail = setParameter(15, Communication::vectorSwapAndCast<int8_t, uint16_t>(emg_thresholds));
208  if (!set_fail) {
209  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_thresholds = emg_thresholds;
210  }
211  return set_fail;
212 }
213 
214 int qbSoftHandResearch::setParamEMGMaxValues(const std::vector<uint32_t> &emg_max_value) {
215  int set_fail = setParameter(16, Communication::vectorSwapAndCast<int8_t, uint32_t>(emg_max_value));
216  if (!set_fail) {
217  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_max_value = emg_max_value;
218  }
219  return set_fail;
220 }
221 
222 int qbSoftHandResearch::setParamEMGSpeed(uint8_t emg_speed) {
223  int set_fail = setParameter(17, Communication::vectorSwapAndCast<int8_t, uint8_t>({emg_speed}));
224  if (!set_fail) {
225  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->emg_speed = emg_speed;
226  }
227  return set_fail;
228 }
229 
230 int qbSoftHandResearch::setParamUseDoubleEncoder(uint8_t use_double_encoder) {
231  int set_fail = setParameter(18, Communication::vectorSwapAndCast<int8_t, uint8_t>({use_double_encoder}));
232  if (!set_fail) {
233  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_double_encoder = use_double_encoder;
234  }
235  return set_fail;
236 }
237 
238 int qbSoftHandResearch::setParamHandleRatio(int8_t handle_ratio) {
239  int set_fail = setParameter(19, Communication::vectorSwapAndCast<int8_t, int8_t>({handle_ratio}));
240  if (!set_fail) {
241  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->handle_ratio = handle_ratio;
242  }
243  return set_fail;
244 }
245 
246 int qbSoftHandResearch::setParamUsePWMRescaling(uint8_t use_pwm_rescaling) {
247  int set_fail = setParameter(20, Communication::vectorSwapAndCast<int8_t, uint8_t>({use_pwm_rescaling}));
248  if (!set_fail) {
249  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->use_pwm_rescaling = use_pwm_rescaling;
250  }
251  return set_fail;
252 }
253 
254 int qbSoftHandResearch::setParamCurrentLookupTable(const std::vector<float> &current_lookup_table) {
255  int set_fail = setParameter(21, Communication::vectorSwapAndCast<int8_t, float>(current_lookup_table));
256  if (!set_fail) {
257  std::dynamic_pointer_cast<qbrobotics_research_api::qbSoftHandResearch::Params>(params_)->current_lookup_table = current_lookup_table;
258  }
259  return set_fail;
260 }
261 
262 int qbSoftHandResearch::setParamRateLimiter(uint8_t rate_limiter) {
263  int set_fail = setParameter(22, Communication::vectorSwapAndCast<int8_t, uint8_t>({rate_limiter}));
264  if (!set_fail) {
265  params_->rate_limiter = rate_limiter;
266  }
267  return set_fail;
268 }
269 
270 
271 // ----------------------------------------------------------------
272 
273 
274 qbSoftHandLegacyResearch::qbSoftHandLegacyResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id)
275  : qbSoftHandResearch(std::move(communication), std::move(name), std::move(serial_port), id, true, std::make_unique<qbSoftHandLegacyResearch::Params>()) {}
276 
277 qbSoftHandLegacyResearch::qbSoftHandLegacyResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params)
278  : qbSoftHandResearch(std::move(communication), std::move(name), std::move(serial_port), id, init_params, std::make_unique<qbSoftHandLegacyResearch::Params>()) {}
279 
280 qbSoftHandLegacyResearch::qbSoftHandLegacyResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params, std::unique_ptr<Device::Params> params)
281  : qbSoftHandResearch(std::move(communication), std::move(name), std::move(serial_port), id, init_params, std::move(params)) {}
282 
284  int set_fail = qbSoftHandResearch::setMotorStates(motor_state);
285  std::this_thread::sleep_for(std::chrono::milliseconds(1));
286  return set_fail;
287 }
288 
289 int qbSoftHandLegacyResearch::setParameter(uint16_t param_type, const std::vector<int8_t> &param_data) {
290  int set_fail = qbSoftHandResearch::setParameter(param_type, param_data);
291  if (!set_fail && param_type != 1) { // WARN: the storeUserDataMemory for ID change is called by the specific method
292  set_fail = qbSoftHandResearch::storeUserDataMemory(); // WARN: a store user memory is required on legacy devices!
293  }
294  return set_fail;
295 }
296 
297 int qbSoftHandLegacyResearch::setParamId(uint8_t id) { // old method only for legacy devices
298  uint8_t previous_id = params_->id;
299  int set_fail = qbSoftHandResearch::setParamId(id);
300  if (!set_fail) {
301  params_->id = previous_id; // WARN: need to send the command to the previous ID on legacy devices!
302  set_fail = qbSoftHandResearch::storeUserDataMemory(); // WARN: a store user memory is required on legacy devices!
303  params_->id = id;
304  }
305  return set_fail;
306 }
307 
308 int qbSoftHandLegacyResearch::setParamZeros() { // old method only for legacy devices
309  std::vector<int16_t> positions;
310  if (getPositions(positions)) {
311  return -1;
312  }
313  std::vector<int16_t> offsets;
314  if (getParamEncoderOffsets(offsets)) {
315  return -1;
316  }
317  std::transform(offsets.begin(), offsets.end(), positions.begin(), offsets.begin(), std::minus<int16_t>());
318  return setParamEncoderOffsets(offsets);
319 }
qbrobotics_research_api::Device::setParameter
virtual int setParameter(uint16_t param_type, const std::vector< int8_t > &param_data)
Set the Parameter specified by param_type with the values stored in param_data.
Definition: qbrobotics_research_api.cpp:941
qbrobotics_research_api::Device::getParameters
virtual int getParameters(std::vector< int8_t > &param_buffer)
Get the parameters from the device.
Definition: qbrobotics_research_api.cpp:759
qbrobotics_research_api::qbSoftHandResearch::getParamRateLimiter
int getParamRateLimiter()
Definition: qbsofthand_research_api.cpp:185
qbrobotics_research_api::qbSoftHandResearch::Params::use_pwm_rescaling
uint8_t use_pwm_rescaling
Definition: qbsofthand_research_api.h:125
qbrobotics_research_api::qbSoftHandResearch::Params::current_lookup_table
std::vector< float > current_lookup_table
Definition: qbsofthand_research_api.h:126
qbrobotics_research_api::Device::params_
std::shared_ptr< Params > params_
Definition: qbrobotics_research_api.h:852
qbrobotics_research_api::qbSoftHandResearch::getParamCurrentLookupTable
int getParamCurrentLookupTable()
Definition: qbsofthand_research_api.cpp:172
qbrobotics_research_api::qbSoftHandResearch::getJoystick
int getJoystick(std::vector< int16_t > &joystick_values)
Definition: qbsofthand_research_api.cpp:72
qbrobotics_research_api::qbSoftHandResearch::Params::emg_max_value
std::vector< uint32_t > emg_max_value
Definition: qbsofthand_research_api.h:121
qbrobotics_research_api::qbSoftHandResearch::Params::handle_ratio
int8_t handle_ratio
Definition: qbsofthand_research_api.h:124
qbrobotics_research_api::qbSoftHandLegacyResearch::setParameter
int setParameter(uint16_t param_type, const std::vector< int8_t > &param_data) override
Set the Parameter specified by param_type with the values stored in param_data.
Definition: qbsofthand_research_api.cpp:289
qbrobotics_research_api::qbSoftHandResearch::Params
Definition: qbsofthand_research_api.h:87
CMD_HAND_CALIBRATE
@ CMD_HAND_CALIBRATE
Starts a series of opening and closures of the hand.
Definition: qbrobotics_research_commands.h:61
qbrobotics_research_api::qbSoftHandResearch
Definition: qbsofthand_research_api.h:60
qbrobotics_research_api::Device::setParamEncoderOffsets
virtual int setParamEncoderOffsets(const std::vector< int16_t > &encoder_offsets)
Set the encoder offsets parameters of the device.
Definition: qbrobotics_research_api.cpp:1015
qbrobotics_research_api::qbSoftHandResearch::setParamUseDoubleEncoder
int setParamUseDoubleEncoder(uint8_t use_double_encoder)
Definition: qbsofthand_research_api.cpp:230
qbrobotics_research_api
Definition: qbmove_research_api.h:33
qbrobotics_research_api::Device::setMotorStates
virtual int setMotorStates(bool motor_state)
Activate or deactivate the motor(s)
Definition: qbrobotics_research_api.cpp:737
qbrobotics_research_api::Device::storeUserDataMemory
virtual int storeUserDataMemory()
Store the changed parameters on 7.X.X firmware devices in user memory.
Definition: qbrobotics_research_api.cpp:1124
qbrobotics_research_api::qbSoftHandLegacyResearch::setParamZeros
int setParamZeros() override
Set motor(s) zero(s) to actual encoder reading.
Definition: qbsofthand_research_api.cpp:308
qbrobotics_research_api::Device::serial_port_
std::string serial_port_
Definition: qbrobotics_research_api.h:851
qbrobotics_research_api::qbSoftHandResearch::setParamEMGThresholds
int setParamEMGThresholds(const std::vector< uint16_t > &emg_thresholds)
Definition: qbsofthand_research_api.cpp:206
qbrobotics_research_api::qbSoftHandResearch::getParamUsePWMRescaling
int getParamUsePWMRescaling()
Definition: qbsofthand_research_api.cpp:159
qbrobotics_research_api::Device::getParamEncoderOffsets
virtual int getParamEncoderOffsets()
Update the device encoder offsets in the class variable param_.
Definition: qbrobotics_research_api.cpp:863
qbrobotics_research_api::Device
General class that allow to get/set parameters from/to qbrobotics devices.
Definition: qbrobotics_research_api.h:268
qbrobotics_research_api::qbSoftHandResearch::setParamEMGMaxValues
int setParamEMGMaxValues(const std::vector< uint32_t > &emg_max_value)
Definition: qbsofthand_research_api.cpp:214
qbrobotics_research_api::Device::communication_
std::shared_ptr< Communication > communication_
Definition: qbrobotics_research_api.h:853
qbrobotics_research_api::qbSoftHandResearch::getEMGs
int getEMGs(std::vector< int16_t > &emg_values)
Definition: qbsofthand_research_api.cpp:63
qbrobotics_research_api::qbSoftHandResearch::getParamEMGThresholds
int getParamEMGThresholds()
Definition: qbsofthand_research_api.cpp:94
qbrobotics_research_api::Device::Params::rate_limiter
uint8_t rate_limiter
Definition: qbrobotics_research_api.h:312
qbrobotics_research_api::qbSoftHandResearch::Params::emg_speed
uint8_t emg_speed
Definition: qbsofthand_research_api.h:122
qbrobotics_research_api::qbSoftHandResearch::getParamEMGMaxValues
int getParamEMGMaxValues()
Definition: qbsofthand_research_api.cpp:107
qbrobotics_research_api::qbSoftHandResearch::getParamUseDoubleEncoder
int getParamUseDoubleEncoder()
Definition: qbsofthand_research_api.cpp:133
qbrobotics_research_api::qbSoftHandResearch::getParamHandleRatio
int getParamHandleRatio()
Definition: qbsofthand_research_api.cpp:146
qbrobotics_research_api::Device::setParamId
virtual int setParamId(uint8_t id)
Set the ID of the device.
Definition: qbrobotics_research_api.cpp:959
CMD_GET_JOYSTICK
@ CMD_GET_JOYSTICK
Command to get the joystick measurements (only for devices driven by a joystick)
Definition: qbrobotics_research_commands.h:83
qbsofthand_research_api.h
qbrobotics_research_api::qbSoftHandResearch::Params::use_emg_calibration
uint8_t use_emg_calibration
Definition: qbsofthand_research_api.h:119
qbrobotics_research_api::qbSoftHandResearch::Params::emg_thresholds
std::vector< uint16_t > emg_thresholds
Definition: qbsofthand_research_api.h:120
qbrobotics_research_api::qbSoftHandResearch::setParamUsePWMRescaling
int setParamUsePWMRescaling(uint8_t use_pwm_rescaling)
Definition: qbsofthand_research_api.cpp:246
qbrobotics_research_api::qbSoftHandResearch::getParamEMGSpeed
int getParamEMGSpeed()
Definition: qbsofthand_research_api.cpp:120
qbrobotics_research_api::qbSoftHandResearch::qbSoftHandResearch
qbSoftHandResearch(std::shared_ptr< Communication > communication, std::string name, std::string serial_port, uint8_t id)
Definition: qbsofthand_research_api.cpp:45
CMD_GET_EMG
@ CMD_GET_EMG
Command for asking device's emg sensors measurements.
Definition: qbrobotics_research_commands.h:71
qbrobotics_research_api::qbSoftHandResearch::setParamCurrentLookupTable
int setParamCurrentLookupTable(const std::vector< float > &current_lookup_table)
Definition: qbsofthand_research_api.cpp:254
qbrobotics_research_api::Device::Params::initParams
virtual void initParams(const std::vector< int8_t > &param_buffer)
Definition: qbrobotics_research_api.cpp:1079
std
qbrobotics_research_api::Device::getPositions
virtual int getPositions(std::vector< int16_t > &positions)
Get the Positions given by the encoders mounted on the device.
Definition: qbrobotics_research_api.cpp:669
qbrobotics_research_api::qbSoftHandResearch::setParamRateLimiter
int setParamRateLimiter(uint8_t rate_limiter)
Definition: qbsofthand_research_api.cpp:262
qbrobotics_research_api::qbSoftHandResearch::Params::use_double_encoder
uint8_t use_double_encoder
Definition: qbsofthand_research_api.h:123
qbrobotics_research_api::qbSoftHandLegacyResearch::Params
Definition: qbsofthand_research_api.h:120
qbrobotics_research_api::qbSoftHandLegacyResearch::setMotorStates
int setMotorStates(bool motor_state) override
Activate or deactivate the motor(s)
Definition: qbsofthand_research_api.cpp:283
qbrobotics_research_api::qbSoftHandResearch::setParamHandleRatio
int setParamHandleRatio(int8_t handle_ratio)
Definition: qbsofthand_research_api.cpp:238
qbrobotics_research_api::qbSoftHandResearch::getParamUseEMGCalibration
int getParamUseEMGCalibration()
Definition: qbsofthand_research_api.cpp:81
qbrobotics_research_api::qbSoftHandResearch::openCloseCycles
int openCloseCycles(uint16_t speed, uint16_t cycles)
Definition: qbsofthand_research_api.cpp:54
qbrobotics_research_api::qbSoftHandLegacyResearch::qbSoftHandLegacyResearch
qbSoftHandLegacyResearch(std::shared_ptr< Communication > communication, std::string name, std::string serial_port, uint8_t id)
Definition: qbsofthand_research_api.cpp:274
qbrobotics_research_api::qbSoftHandLegacyResearch::setParamId
int setParamId(uint8_t id) override
Set the ID of the device.
Definition: qbsofthand_research_api.cpp:297
qbrobotics_research_api::qbSoftHandResearch::setParamUseEMGCalibration
int setParamUseEMGCalibration(uint8_t use_emg_calibration)
Definition: qbsofthand_research_api.cpp:198
qbrobotics_research_api::qbSoftHandResearch::Params::initParams
void initParams(const std::vector< int8_t > &param_buffer) override
Definition: qbsofthand_research_api.cpp:32
qbrobotics_research_api::qbSoftHandResearch::setParamEMGSpeed
int setParamEMGSpeed(uint8_t emg_speed)
Definition: qbsofthand_research_api.cpp:222
qbrobotics_research_api::qbSoftHandLegacyResearch
Definition: qbsofthand_research_api.h:118


qb_device_driver
Author(s): qbrobotics®
autogenerated on Thu Apr 27 2023 02:36:32