ANNarchy iCub Interface 1.1.1
Loading...
Searching...
No Matches
Joint_Writer.pyi
1from typing import NoReturn
2from numpy import ndarray
3from .iCub_Interface import ANNiCub_wrapper
4
5
7 """ """
8 @classmethod
9 def __init__(cls, *args, **kwargs) -> None: ...
10
11 def close(self, iCub: ANNiCub_wrapper) -> NoReturn:
12 """Close joint writer with cleanup
13
14 Parameters
15 ----------
16 iCub : ANNiCub_wrapper
17 main interface wrapper
18
19 Returns
20 -------
21 """
22 ...
23
24 def get_joint_count(self) -> int:
25 """Return number of controlled joints
26
27 Parameters
28 ----------
29
30 Returns
31 -------
32 type
33 int: return number of joints being controlled by the joint writer
34 """
35 ...
36
37 def get_joint_limits(self) -> ndarray:
38 """Return the limits of joint angles in degree
39
40 Parameters
41 ----------
42
43 Returns
44 -------
45 type
46 NDarray (vector[vector[double]]): return array, containing the limits of joint angles in degree (joint, (max, min))
47 """
48 ...
49
50 def get_joint_limits_max(self) -> ndarray:
51 """Return the upper limits of joint angles in degree
52
53 Parameters
54 ----------
55
56 Returns
57 -------
58 type
59 NDarray (vector[double]): return vector, containing the upper limits of joint angles in degree (joint, max)
60 """
61 ...
62
63 def get_joint_limits_min(self) -> ndarray:
64 """Return the lower limits of joint angles in degree
65
66 Parameters
67 ----------
68
69 Returns
70 -------
71 type
72 NDarray (vector[double]): return vector, containing the lower limits of joint angles in degree (joint, min)
73 """
74 ...
75
76 def get_joints_deg_res(self) -> ndarray:
77 """Return the resolution in degree of the populations encoding the joint angles
78
79 Parameters
80 ----------
81
82 Returns
83 -------
84 type
85 NDarray (vetor[double]): return vector, containing the resolution for every joints population codimg in degree
86 """
87 ...
88
89 def get_neurons_per_joint(self) -> ndarray:
90 """Return the size of the populations encoding the joint angles
91
92 Parameters
93 ----------
94
95 Returns
96 -------
97 type
98 NDarray (vector[int]): return vector, containing the population size for every joint
99 """
100 ...
101
102 def init(self, iCub: ANNiCub_wrapper, name: str, part: str, n_pop: int, degr_per_neuron: float = ..., speed: float = ..., ini_path: str = ...) -> bool:
103 """Initialize the joint writer with given parameters.
104
105 Parameters
106 ----------
107 iCub : ANNiCub_wrapper
108 main interface wrapper
109 name : str
110 name for the joint writer module
111 part : str
112 string representing the robot part, has to match iCub part naming {left_(arm/leg), right_(arm/leg), head, torso}
113 n_pop : unsigned int
114 number of neurons per population, encoding each one joint angle;
115 only works if parameter "deg_per_neuron" is not set
116 degr_per_neuron : double
117 degree per neuron in the populationencoding the joints angles;
118 if set: population size depends on joint working range. (Default value = 0.0)
119 speed : double
120 velocity for the joint movements. (Default value = 10.0)
121 ini_path : str
122 Path to the "interface_param.ini"-file. (Default value = "../data/")
123
124 Returns
125 -------
126 bool
127 return True/False, indicating success/failure
128 """
129 ...
130
131 def init_grpc(self, iCub: ANNiCub_wrapper, name: str, part: str, n_pop: int, joints, mode: str, blocking=..., degr_per_neuron: float = ..., speed: float = ...,
132 ini_path: str = ..., ip_address: str = ..., port: int = ...) -> bool:
133 """Initialize the joint writer with given parameters, including the gRPC based connection.
134
135 Parameters
136 ----------
137 iCub : ANNiCub_wrapper
138 main interface wrapper
139 name : str
140 name for the joint writer module
141 part : str
142 string representing the robot part, has to match iCub part naming {left_(arm/leg), right_(arm/leg), head, torso}
143 n_pop : unsigned int
144 number of neurons per population, encoding each one joint angle;
145 only works if parameter "deg_per_neuron" is not set
146 joints : list (vector[int]
147 joint selection for grpc -> empty vector for all joints
148 mode : str
149 string to select the motion mode:
150 'abs' for absolute joint angle positions;
151 'rel' for relative joint angles;
152 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
153 blocking : bool
154 if True, complete motion before continuation. (Default value = True)
155 degr_per_neuron : double
156 degree per neuron in the populationencoding the joints angles;
157 if set: population size depends on joint working range. (Default value = 0.0)
158 speed : double
159 velocity for the joint movements. (Default value = 10.0)
160 ini_path : str
161 Path to the "interface_param.ini"-file. (Default value = "../data/")
162 ip_address : str
163 gRPC server ip address. (Default value = "0.0.0.0")
164 port : unsigned int
165 gRPC server port. (Default value = 50010)
166
167 Returns
168 -------
169 bool
170 return True/False, indicating success/failure
171 """
172 ...
173
174 def retrieve_ANNarchy_input_all(self) -> NoReturn:
175 """Retrieve all joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
176 ...
177
178 def retrieve_ANNarchy_input_all_enc(self) -> NoReturn:
179 """Retrieve all population encoded joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
180 ...
181
182 def retrieve_ANNarchy_input_multi(self) -> NoReturn:
183 """Retrieve multiple joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
184 ...
185
187 """Retrieve multiple population encoded joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
188 ...
189
190 def retrieve_ANNarchy_input_single(self) -> NoReturn:
191 """Retrieve single joint angle from specialized gRPC-connected ANNarchy-JointControl-Population."""
192 ...
193
195 """Retrieve single population encoded joint angle from specialized gRPC-connected ANNarchy-JointControl-Population."""
196 ...
197
198 def set_joint_acceleration(self, acc: float, joint: int = ...) -> bool:
199 """Set joint acceleration.
200
201 Parameters
202 ----------
203 acc : double
204 acceleration value to be set
205 joint : int
206 joint number of the robot part or -1 for all joints. (Default value = -1)
207
208 Returns
209 -------
210 bool
211 return True/False, indicating success/failure
212 """
213 ...
214
215 def set_joint_controlmode(self, control_mode: str, joint: int = ...) -> bool:
216 """Set joint control mode
217
218 Parameters
219 ----------
220 control_mode : str
221 control mode for the joint. currently implemented are: "velocity" and "position"
222 joint : int
223 joint number of the robot part or -1 for all joints. (Default value = -1)
224
225 Returns
226 -------
227 bool
228 return True/False, indicating success/failure
229 """
230 ...
231
232 def set_joint_velocity(self, speed: float, joint: int = ...) -> bool:
233 """Set joint velocity.
234
235 Parameters
236 ----------
237 speed : float
238 velocity value to be set
239 joint : int
240 joint number of the robot part or -1 for all joints. (Default value = -1)
241
242 Returns
243 -------
244 bool
245 return True/False, indicating success/failure
246 """
247 ...
248
249 def write_ANNarchy_input_all(self) -> NoReturn:
250 """Write all joints with retrieved joint angles."""
251 ...
252
253 def write_ANNarchy_input_all_enc(self) -> NoReturn:
254 """Write all joints with retrieved population encoded joint angles."""
255 ...
256
257 def write_ANNarchy_input_multi(self) -> NoReturn:
258 """Write multiple joints with retrieved joint angles."""
259 ...
260
261 def write_ANNarchy_input_multi_enc(self) -> NoReturn:
262 """Write multiple joints with retrieved population encoded joint angles."""
263 ...
264
265 def write_ANNarchy_input_single(self) -> NoReturn:
266 """Write single joint with retrieved joint angle."""
267 ...
268
269 def write_ANNarchy_input_single_enc(self) -> NoReturn:
270 """Write single joint with retrieved population encoded joint angle."""
271 ...
272
273 def write_double_all(self, position, mode: str, blocking=..., timeout: int=...) -> bool:
274 """Move all joints to the given positiion (joint angles/velocities).
275
276 Parameters
277 ----------
278 position : list/NDarray (vector[double])
279 joint angles/velocities to write to the robot joints
280 mode : str
281 string to select the motion mode:
282 'abs' for absolute joint angle positions;
283 'rel' for relative joint angles;
284 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
285 blocking : bool
286 if True, complete motion before continuation. (Default value = True)
287 timeout : int
288 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
289
290 Returns
291 -------
292 bool
293 return True/False, indicating success/failure
294 """
295 ...
296
297 def write_double_multiple(self, position, joints, mode: str, blocking=..., timeout: int=...) -> bool:
298 """Move multiple joints to the given positiion (joint angles/velocities).
299
300 Parameters
301 ----------
302 position : list/NDarray (vector[double]
303 joint angles/velocities to write to the robot joints
304 joints : list/NDarray (vector[int]
305 joint indizes of the joints, which should be moved (e.g. head: [3, 4, 5] -> all eye movements)
306 mode : str
307 string to select the motion mode:
308 'abs' for absolute joint angle positions;
309 'rel' for relative joint angles;
310 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
311 blocking : bool
312 if True, complete motion before continuation. (Default value = True)
313 timeout : int
314 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
315
316 Returns
317 -------
318 bool
319 return True/False, indicating success/failure
320 """
321 ...
322
323 def write_double_one(self, position: float, joint: int, mode: str, blocking=..., timeout: int=...) -> bool:
324 """Move single joint to the given positiion (joint angle/velocity).
325
326 Parameters
327 ----------
328 position : float
329 joint angle/velocity to write to the robot joint
330 joint : int
331 joint number of the robot part
332 mode : str
333 string to select the motion mode:
334 'abs' for absolute joint angle positions;
335 'rel' for relative joint angles;
336 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
337 blocking : bool
338 if True, complete motion before continuation. (Default value = True)
339 timeout : int
340 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
341
342 Returns
343 -------
344 bool
345 return True/False, indicating success/failure
346 """
347 ...
348
349 def write_pop_all(self, position_pops, mode: str, blocking=..., timeout: int=...) -> bool:
350 """Move all joints to the joint angles/velocities encoded in the given vector of populations.
351
352 Parameters
353 ----------
354 position_pops : NDarray (vector[vector[double]]
355 vector of populations, each encoding the angle/velocity for a single joint
356 mode : str
357 string to select the motion mode:
358 'abs' for absolute joint angle positions;
359 'rel' for relative joint angles;
360 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
361 blocking : bool
362 if True, complete motion before continuation. (Default value = True)
363 timeout : int
364 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
365
366 Returns
367 -------
368 bool
369 return True/False, indicating success/failure
370 """
371 ...
372
373 def write_pop_multiple(self, position_pops, joints, mode: str, blocking=..., timeout: int=...) -> bool:
374 """Move multiple joints to the joint angles/velocities encoded in the given vector of populations.
375
376 Parameters
377 ----------
378 position_pops : NDarray (vector[vector[double]]
379 vector of populations, each encoding the angle/velocity for a single joint
380 joints : list/NDarray (vector[int]
381 Joint indizes of the joints, which should be moved (head: [3, 4, 5] -> all eye movements)
382 mode : str
383 string to select the motion mode:
384 'abs' for absolute joint angle positions;
385 'rel' for relative joint angles;
386 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
387 blocking : bool
388 if True, complete motion before continuation. (Default value = True)
389 timeout : int
390 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
391
392 Returns
393 -------
394 bool
395 return True/False, indicating success/failure
396 """
397 ...
398
399 def write_pop_one(self, position_pop, joint: int, mode: str, blocking=..., timeout: int=...) -> bool:
400 """Move a single joint to the joint angle/velocity encoded in the given population.
401
402 Parameters
403 ----------
404 position_pop : NDarray (vector[double]
405 population encoding the joint angle/velocity
406 joint : int
407 joint number of the robot part
408 mode : str
409 string to select the motion mode:
410 'abs' for absolute joint angle positions;
411 'rel' for relative joint angles;
412 'vel' for velocity values: DO NOT USE "VEL" AS BLOCKING MOTION!!!
413 blocking : bool
414 if True, complete motion before continuation. (Default value = True)
415 timeout : int
416 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
417
418 Returns
419 -------
420 bool
421 return True/False, indicating success/failure
422 """
423 ...
bool init(self, ANNiCub_wrapper iCub, str name, str part, int n_pop, float degr_per_neuron=..., float speed=..., str ini_path=...)
bool write_double_multiple(self, position, joints, str mode, blocking=..., int timeout=...)
bool write_double_all(self, position, str mode, blocking=..., int timeout=...)
bool init_grpc(self, ANNiCub_wrapper iCub, str name, str part, int n_pop, joints, str mode, blocking=..., float degr_per_neuron=..., float speed=..., str ini_path=..., str ip_address=..., int port=...)
bool write_pop_one(self, position_pop, int joint, str mode, blocking=..., int timeout=...)
NoReturn close(self, ANNiCub_wrapper iCub)
bool write_pop_multiple(self, position_pops, joints, str mode, blocking=..., int timeout=...)
bool write_double_one(self, float position, int joint, str mode, blocking=..., int timeout=...)
bool set_joint_controlmode(self, str control_mode, int joint=...)
bool set_joint_velocity(self, float speed, int joint=...)
bool write_pop_all(self, position_pops, str mode, blocking=..., int timeout=...)
bool set_joint_acceleration(self, float acc, int joint=...)