1from typing
import NoReturn
2from numpy
import ndarray
3from .iCub_Interface
import ANNiCub_wrapper
9 def __init__(cls, *args, **kwargs) -> None: ...
11 def close(self, iCub: ANNiCub_wrapper) -> NoReturn:
12 """Close joint writer with cleanup
16 iCub : ANNiCub_wrapper
17 main interface wrapper
25 """Return number of controlled joints
33 int: return number of joints being controlled by the joint writer
38 """Return the limits of joint angles in degree
46 NDarray (vector[vector[double]]): return array, containing the limits of joint angles in degree (joint, (max, min))
51 """Return the upper limits of joint angles in degree
59 NDarray (vector[double]): return vector, containing the upper limits of joint angles in degree (joint, max)
64 """Return the lower limits of joint angles in degree
72 NDarray (vector[double]): return vector, containing the lower limits of joint angles in degree (joint, min)
77 """Return the resolution in degree of the populations encoding the joint angles
85 NDarray (vetor[double]): return vector, containing the resolution for every joints population codimg in degree
90 """Return the size of the populations encoding the joint angles
98 NDarray (vector[int]): return vector, containing the population size for every joint
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.
107 iCub : ANNiCub_wrapper
108 main interface wrapper
110 name for the joint writer module
112 string representing the robot part, has to match iCub part naming {left_(arm/leg), right_(arm/leg), head, torso}
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)
120 velocity for the joint movements. (Default value = 10.0)
122 Path to the "interface_param.ini"-file. (Default value = "../data/")
127 return True/False, indicating success/failure
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.
137 iCub : ANNiCub_wrapper
138 main interface wrapper
140 name for the joint writer module
142 string representing the robot part, has to match iCub part naming {left_(arm/leg), right_(arm/leg), head, torso}
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
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!!!
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)
159 velocity for the joint movements. (Default value = 10.0)
161 Path to the "interface_param.ini"-file. (Default value = "../data/")
163 gRPC server ip address. (Default value = "0.0.0.0")
165 gRPC server port. (Default value = 50010)
170 return True/False, indicating success/failure
175 """Retrieve all joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
179 """Retrieve all population encoded joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
183 """Retrieve multiple joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
187 """Retrieve multiple population encoded joint angles from specialized gRPC-connected ANNarchy-JointControl-Population."""
191 """Retrieve single joint angle from specialized gRPC-connected ANNarchy-JointControl-Population."""
195 """Retrieve single population encoded joint angle from specialized gRPC-connected ANNarchy-JointControl-Population."""
199 """Set joint acceleration.
204 acceleration value to be set
206 joint number of the robot part or -1 for all joints. (Default value = -1)
211 return True/False, indicating success/failure
216 """Set joint control mode
221 control mode for the joint. currently implemented are: "velocity" and "position"
223 joint number of the robot part or -1 for all joints. (Default value = -1)
228 return True/False, indicating success/failure
233 """Set joint velocity.
238 velocity value to be set
240 joint number of the robot part or -1 for all joints. (Default value = -1)
245 return True/False, indicating success/failure
250 """Write all joints with retrieved joint angles."""
254 """Write all joints with retrieved population encoded joint angles."""
258 """Write multiple joints with retrieved joint angles."""
262 """Write multiple joints with retrieved population encoded joint angles."""
266 """Write single joint with retrieved joint angle."""
270 """Write single joint with retrieved population encoded joint angle."""
274 """Move all joints to the given positiion (joint angles/velocities).
278 position : list/NDarray (vector[double])
279 joint angles/velocities to write to the robot joints
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!!!
286 if True, complete motion before continuation. (Default value = True)
288 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
293 return True/False, indicating success/failure
298 """Move multiple joints to the given positiion (joint angles/velocities).
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)
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!!!
312 if True, complete motion before continuation. (Default value = True)
314 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
319 return True/False, indicating success/failure
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).
329 joint angle/velocity to write to the robot joint
331 joint number of the robot part
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!!!
338 if True, complete motion before continuation. (Default value = True)
340 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
345 return True/False, indicating success/failure
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.
354 position_pops : NDarray (vector[vector[double]]
355 vector of populations, each encoding the angle/velocity for a single joint
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!!!
362 if True, complete motion before continuation. (Default value = True)
364 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
369 return True/False, indicating success/failure
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.
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)
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!!!
388 if True, complete motion before continuation. (Default value = True)
390 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
395 return True/False, indicating success/failure
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.
404 position_pop : NDarray (vector[double]
405 population encoding the joint angle/velocity
407 joint number of the robot part
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!!!
414 if True, complete motion before continuation. (Default value = True)
416 Timeout in seconds to stop the block mode. Set to 0 for not timeout. (Default value = 0)
421 return True/False, indicating success/failure
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=...)
None __init__(cls, *args, **kwargs)
NoReturn write_ANNarchy_input_single_enc(self)
NoReturn retrieve_ANNarchy_input_multi(self)
NoReturn retrieve_ANNarchy_input_all(self)
bool write_double_all(self, position, str mode, blocking=..., int timeout=...)
ndarray get_neurons_per_joint(self)
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=...)
int get_joint_count(self)
ndarray get_joint_limits_min(self)
NoReturn write_ANNarchy_input_single(self)
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=...)
NoReturn retrieve_ANNarchy_input_single(self)
NoReturn retrieve_ANNarchy_input_single_enc(self)
NoReturn write_ANNarchy_input_multi(self)
NoReturn retrieve_ANNarchy_input_multi_enc(self)
bool set_joint_velocity(self, float speed, int joint=...)
NoReturn write_ANNarchy_input_all(self)
NoReturn write_ANNarchy_input_all_enc(self)
bool write_pop_all(self, position_pops, str mode, blocking=..., int timeout=...)
NoReturn retrieve_ANNarchy_input_all_enc(self)
ndarray get_joint_limits(self)
ndarray get_joint_limits_max(self)
bool set_joint_acceleration(self, float acc, int joint=...)
ndarray get_joints_deg_res(self)
NoReturn write_ANNarchy_input_multi_enc(self)