newton.utils#

Classes

RecorderBasic

A class to record and playback simulation body transforms.

RecorderModelAndState

A class to record and playback simulation model and state using JSON serialization.

Functions

boltzmann(a, b, alpha)

Compute the Boltzmann-weighted average of two values.

color_graph(num_nodes, graph_edge_indices[, ...])

A function that generates coloring for a graph, which is represented by the number of nodes and an array of edges.

create_box_mesh(extents)

Create a rectangular box (cuboid) mesh.

create_capsule_mesh(radius, half_height[, ...])

Create a capsule (pill-shaped) mesh with hemispherical ends.

create_cone_mesh(radius, half_height[, ...])

Create a cone mesh with circular base and pointed top.

create_cylinder_mesh(radius, half_height[, ...])

Create a cylinder or truncated cone mesh.

create_plane_mesh(width, length)

Create a rectangular plane mesh in the XY plane.

create_sphere_mesh([radius, num_latitudes, ...])

Create a sphere mesh with specified parameters.

download_asset(asset_folder[, cache_dir, ...])

Downloads a specific folder from the newton-assets GitHub repository into a local cache.

leaky_max(a, b)

Compute a numerically stable, differentiable approximation of max(a, b).

leaky_min(a, b)

Compute a numerically stable, differentiable approximation of min(a, b).

plot_graph(vertices, edges[, edge_labels])

Plots a graph using matplotlib and networkx.

quat_between_axes(*axes)

Compute the rotation between a sequence of axes.

quat_decompose(q)

Decompose a quaternion into extrinsic Euler angles.

quat_from_euler(e, i, j, k)

Convert Euler angles to a quaternion.

quat_to_euler(q, i, j, k)

Convert a quaternion into Euler angles.

quat_to_rpy(q)

Convert a quaternion into Euler angles (roll, pitch, yaw).

quat_twist(axis, q)

Return the twist around an axis.

quat_twist_angle(axis, q)

Return the angle of the twist around an axis.

smooth_max(a, b, eps)

Compute a smooth approximation of the maximum of two values.

smooth_min(a, b, eps)

Compute a smooth approximation of the minimum of two values.

transform_twist(t, x)

Transform a spatial twist between coordinate frames.

transform_wrench(t, x)

Transform a spatial wrench between coordinate frames.

vec_abs(a)

Compute the elementwise absolute value of a 3D vector.

vec_leaky_max(a, b)

Compute the elementwise "leaky" maximum of two 3D vectors.

vec_leaky_min(a, b)

Compute the elementwise "leaky" minimum of two 3D vectors.

vec_max(a, b)

Compute the elementwise maximum of two 3D vectors.

vec_min(a, b)

Compute the elementwise minimum of two 3D vectors.

velocity_at_point(qd, r)

Return the velocity of a point relative to the frame that owns the provided spatial velocity.