rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils#

1.  Module Contents#

1.1.  Functions#

compute_heading_and_up

compute_rot

quat_axis

scale_transform

Normalizes a given input tensor to a range of [-1, 1].

unscale_transform

Denormalizes a given input tensor from range of [-1, 1] to (lower, upper).

saturate

Clamps a given input tensor to (lower, upper).

quat_diff_rad

Get the difference in radians between two quaternions.

local_to_world_space

Convert a point from the local frame to the global frame Args:

normalise_quat_in_pose

Takes a pose and normalises the quaternion portion of it.

my_quat_rotate

quat_to_angle_axis

angle_axis_to_exp_map

quat_to_exp_map

quat_to_tan_norm

euler_xyz_to_exp_map

exp_map_to_angle_axis

exp_map_to_quat

slerp

calc_heading

calc_heading_quat

calc_heading_quat_inv

1.2.  API#

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.compute_heading_and_up(torso_rotation: Tensor, inv_start_rot: Tensor, to_target: Tensor, vec0: Tensor, vec1: Tensor, up_idx: int) Tuple[Tensor, Tensor, Tensor, Tensor, Tensor]#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.compute_rot(torso_quat, velocity, ang_velocity, targets, torso_positions)#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.quat_axis(q: Tensor, axis: int = 0) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.scale_transform(x: isaacgym.torch_utils.torch.Tensor, lower: isaacgym.torch_utils.torch.Tensor, upper: isaacgym.torch_utils.torch.Tensor) isaacgym.torch_utils.torch.Tensor#

Normalizes a given input tensor to a range of [-1, 1].

@note It uses pytorch broadcasting functionality to deal with batched input.

Args:

x: Input tensor of shape (N, dims). lower: The minimum value of the tensor. Shape (dims,) upper: The maximum value of the tensor. Shape (dims,)

Returns:

Normalized transform of the tensor. Shape (N, dims)

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.unscale_transform(x: isaacgym.torch_utils.torch.Tensor, lower: isaacgym.torch_utils.torch.Tensor, upper: isaacgym.torch_utils.torch.Tensor) isaacgym.torch_utils.torch.Tensor#

Denormalizes a given input tensor from range of [-1, 1] to (lower, upper).

@note It uses pytorch broadcasting functionality to deal with batched input.

Args:

x: Input tensor of shape (N, dims). lower: The minimum value of the tensor. Shape (dims,) upper: The maximum value of the tensor. Shape (dims,)

Returns:

Denormalized transform of the tensor. Shape (N, dims)

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.saturate(x: isaacgym.torch_utils.torch.Tensor, lower: isaacgym.torch_utils.torch.Tensor, upper: isaacgym.torch_utils.torch.Tensor) isaacgym.torch_utils.torch.Tensor#

Clamps a given input tensor to (lower, upper).

@note It uses pytorch broadcasting functionality to deal with batched input.

Args:

x: Input tensor of shape (N, dims). lower: The minimum value of the tensor. Shape (dims,) upper: The maximum value of the tensor. Shape (dims,)

Returns:

Clamped transform of the tensor. Shape (N, dims)

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.quat_diff_rad(a: isaacgym.torch_utils.torch.Tensor, b: isaacgym.torch_utils.torch.Tensor) isaacgym.torch_utils.torch.Tensor#

Get the difference in radians between two quaternions.

Args:

a: first quaternion, shape (N, 4) b: second quaternion, shape (N, 4)

Returns:

Difference in radians, shape (N,)

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.local_to_world_space(pos_offset_local: isaacgym.torch_utils.torch.Tensor, pose_global: isaacgym.torch_utils.torch.Tensor)#

Convert a point from the local frame to the global frame Args:

pos_offset_local: Point in local frame. Shape: [N, 3] pose_global: The spatial pose of this point. Shape: [N, 7]

Returns:

Position in the global frame. Shape: [N, 3]

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.normalise_quat_in_pose(pose)[source]#

Takes a pose and normalises the quaternion portion of it.

Args:

pose: shape N, 7

Returns:

Pose with normalised quat. Shape N, 7

rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.my_quat_rotate(q, v)#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.quat_to_angle_axis(q: Tensor) Tuple[Tensor, Tensor]#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.angle_axis_to_exp_map(angle: Tensor, axis: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.quat_to_exp_map(q: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.quat_to_tan_norm(q: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.euler_xyz_to_exp_map(roll: Tensor, pitch: Tensor, yaw: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.exp_map_to_angle_axis(exp_map)#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.exp_map_to_quat(exp_map)#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.slerp(q0: Tensor, q1: Tensor, t: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.calc_heading(q: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.calc_heading_quat(q: Tensor) Tensor#
rofunc.learning.RofuncRL.tasks.utils.torch_jit_utils.calc_heading_quat_inv(q: Tensor) Tensor#