storm_kit.mpc.cost package

class DistCost(weight=None, vec_weight=None, gaussian_params={}, device=device(type='cpu'), float_dtype=torch.float32, **kwargs)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(disp_vec, dist_type='l2', beta=1.0, RETURN_GOAL_DIST=False)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class FiniteDifferenceCost(tensor_args={'device': device(type='cpu'), 'dtype': torch.float32}, weight=1.0, order=1, gaussian_params={}, **kwargs)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(ctrl_seq, dt)[source]

ctrl_seq: [B X H X d_act]

training: bool
class JacobianCost(ndofs, device, float_dtype, retract_weight)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(state_batch, ee_pos_batch, ee_rot_batch, goal_ee_pos, goal_ee_rot, jac_batch, dt, proj_type='transpose', dist_type='l2', weight=1.0, beta=1.0, retract_state=None)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_relative_transform(ee_pos_batch, ee_rot_batch, goal_ee_pos, goal_ee_rot)[source]
training: bool
class PoseCost(weight, vec_weight=[], position_gaussian_params={}, orientation_gaussian_params={}, tensor_args={'device': 'cpu', 'dtype': torch.float32}, hinge_val=100.0, convergence_val=[0.0, 0.0])[source]

Bases: torch.nn.modules.module.Module

Rotation cost

\[\]

r &= sum_{i=0}^{num_rows} (R^{i,:} - R_{g}^{i,:})^2 cost &= sum w dot r

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(ee_pos_batch, ee_rot_batch, ee_goal_pos, ee_goal_rot)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class ProjectedDistCost(ndofs, weight=None, vec_weight=None, gaussian_params={}, device=device(type='cpu'), float_dtype=torch.float32)[source]

Bases: storm_kit.mpc.cost.dist_cost.DistCost

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(disp_vec, jac_batch, proj_type='transpose', dist_type='squared_l2', beta=1.0)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_pinv_null_disp(disp_vec, jac_batch)[source]
get_transpose_null_disp(disp_vec, jac_batch)[source]
training: bool
class ZeroCost(device=device(type='cpu'), float_dtype=torch.float64, hinge_val=100.0, weight=1.0, gaussian_params={}, max_vel=0.01)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

_is_full_backward_hook: Optional[bool]
forward(vels, goal_dist)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
get_inv_null_cost(J_full, goal_state, state_batch, device='cpu')[source]
get_transpose_null_cost(J_full, goal_state, state_batch, device='cpu')[source]