controller_base
BaseController
Bases: Serializable
, Registerable
, Recreatable
An abstract class with interface for mapping specific types of commands to deployable control signals.
Source code in omnigibson/controllers/controller_base.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
|
command_dim
property
Returns:
Name | Type | Description |
---|---|---|
int | Expected size of inputted commands |
command_input_limits
property
Returns:
Type | Description |
---|---|
None or 2-tuple: If specified, returns (min, max) command input limits for this controller, where @min and @max are numpy float arrays of length self.command_dim. Otherwise, returns None |
command_output_limits
property
Returns:
Type | Description |
---|---|
None or 2-tuple: If specified, returns (min, max) command output limits for this controller, where @min and @max are numpy float arrays of length self.command_dim. Otherwise, returns None |
control
property
Returns:
Type | Description |
---|---|
n-array: Array of most recent controls deployed by this controller |
control_dim
property
Returns:
Name | Type | Description |
---|---|---|
int | Expected size of outputted controls |
control_freq
property
Returns:
Name | Type | Description |
---|---|---|
float | Control frequency (Hz) of this controller |
control_type
property
Returns:
Name | Type | Description |
---|---|---|
ControlType | Type of control returned by this controller |
dof_idx
property
Returns:
Type | Description |
---|---|
Array[int]: DOF indices corresponding to the specific DOFs being controlled by this robot |
__init__(control_freq, control_limits, dof_idx, command_input_limits='default', command_output_limits='default')
Parameters:
Name | Type | Description | Default |
---|---|---|---|
control_freq |
int
|
controller loop frequency |
required |
control_limits |
Dict[str, Tuple[Array[float], Array[float]]]
|
The min/max limits to the outputted control signal. Should specify per-dof type limits, i.e.: "position": [[min], [max]] "velocity": [[min], [max]] "effort": [[min], [max]] "has_limit": [...bool...] Values outside of this range will be clipped, if the corresponding joint index in has_limit is True. |
required |
dof_idx |
Array[int]
|
specific dof indices controlled by this robot. Used for inferring controller-relevant values during control computations |
required |
command_input_limits |
None or "default" or Tuple[float, float] or Tuple[Array[float], Array[float]]
|
if set, is the min/max acceptable inputted command. Values outside this range will be clipped. If None, no clipping will be used. If "default", range will be set to (-1, 1) |
'default'
|
command_output_limits |
None or "default" or Tuple[float, float] or Tuple[Array[float], Array[float]]
|
if set, is the min/max scaled command. If both this value and @command_input_limits is not None, then all inputted command values will be scaled from the input range to the output range. If either is None, no scaling will be used. If "default", then this range will automatically be set to the @control_limits entry corresponding to self.control_type |
'default'
|
Source code in omnigibson/controllers/controller_base.py
clip_control(control)
Clips the inputted @control signal based on @control_limits.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
control |
Array[float]
|
control signal to clip |
required |
Returns:
Type | Description |
---|---|
Array[float]: Clipped control signal |
Source code in omnigibson/controllers/controller_base.py
nums2array(nums, dim)
staticmethod
Convert input @nums into numpy array of length @dim. If @nums is a single number, broadcasts it to the corresponding dimension size @dim before converting into a numpy array
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nums |
numeric or Iterable
|
Either single value or array of numbers |
required |
dim |
int
|
Size of array to broadcast input to |
required |
Returns:
Type | Description |
---|---|
np.array: Array filled with values specified in @nums |
Source code in omnigibson/controllers/controller_base.py
reset()
step(control_dict)
Take a controller step.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
control_dict |
Dict[str, Any]
|
dictionary that should include any relevant keyword-mapped states necessary for controller computation |
required |
Returns:
Type | Description |
---|---|
Array[float]: numpy array of outputted control signals |
Source code in omnigibson/controllers/controller_base.py
update_command(command)
Updates inputted @command internally.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
command |
Array[float]
|
inputted command to store internally in this controller |
required |
Source code in omnigibson/controllers/controller_base.py
ControlType
Source code in omnigibson/controllers/controller_base.py
get_type(type_str)
classmethod
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type_str |
str
|
One of "position", "velocity", or "effort" (any case), and maps it to the corresponding type |
required |
Returns:
Name | Type | Description |
---|---|---|
ControlType | control type corresponding to the associated string |
Source code in omnigibson/controllers/controller_base.py
GripperController
Bases: BaseController
Controller to control a gripper. All implemented controllers that encompass gripper capabilities should extend from this class.
Source code in omnigibson/controllers/controller_base.py
is_grasping()
Checks whether the current state of this gripper being controlled is in a grasping state. Should be implemented by subclass.
Returns:
Name | Type | Description |
---|---|---|
IsGraspingState | Grasping state of gripper |
Source code in omnigibson/controllers/controller_base.py
LocomotionController
Bases: BaseController
Controller to control locomotion. All implemented controllers that encompass locomotion capabilities should extend from this class.
Source code in omnigibson/controllers/controller_base.py
ManipulationController
Bases: BaseController
Controller to control manipulation. All implemented controllers that encompass manipulation capabilities should extend from this class.