control_utils
Set of utilities for helping to execute robot control
FKSolver
Class for thinly wrapping Lula Forward Kinematics solver
Source code in OmniGibson/omnigibson/utils/control_utils.py
get_link_poses(joint_positions, link_names)
Given @joint_positions, get poses of the desired links (specified by @link_names)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
joint_positions
|
n - array
|
Joint positions in configuration space |
required |
link_names
|
list
|
List of robot link names we want to specify (e.g. "gripper_link") |
required |
Returns:
| Type | Description |
|---|---|
link_poses (dict
|
Dictionary mapping each robot link name to its pose |
Source code in OmniGibson/omnigibson/utils/control_utils.py
IKSolver
Class for thinly wrapping Lula IK solver
Source code in OmniGibson/omnigibson/utils/control_utils.py
solve(target_pos, target_quat=None, tolerance_pos=0.002, tolerance_quat=0.01, weight_pos=1.0, weight_quat=0.05, bfgs_orientation_weight=100.0, max_iterations=10, initial_joint_pos=None)
Backs out joint positions to achieve desired @target_pos and @target_quat
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_pos
|
3 - array
|
desired (x,y,z) local target cartesian position in robot's base coordinate frame |
required |
target_quat
|
4 - array or None
|
If specified, desired (x,y,z,w) local target quaternion orientation in robot's base coordinate frame. If None, IK will be position-only (will override settings such that orientation's tolerance is very high and weight is 0) |
None
|
tolerance_pos
|
float
|
Maximum position error (L2-norm) for a successful IK solution |
0.002
|
tolerance_quat
|
float
|
Maximum orientation error (per-axis L2-norm) for a successful IK solution |
0.01
|
weight_pos
|
float
|
Weight for the relative importance of position error during CCD |
1.0
|
weight_quat
|
float
|
Weight for the relative importance of position error during CCD |
0.05
|
bfgs_orientation_weight
|
float
|
Weight when applying BFGS algorithm during optimization. Only used if target_quat is specified |
100.0
|
max_iterations
|
int
|
Number of iterations used for each cyclic coordinate descent. |
10
|
initial_joint_pos
|
None or n - array
|
If specified, will set the initial cspace seed when solving for joint positions. Otherwise, will use self.reset_joint_pos |
None
|
Returns:
| Type | Description |
|---|---|
None or n - array
|
Joint positions for reaching desired target_pos and target_quat, otherwise None if no solution was found |