tesseract_robotics.common¶
Common types, utilities, and resource handling.
Eigen arguments take arrays, lists and tuples
Every Eigen::Vector3d, VectorXd, Matrix3d, Matrix4d (and other dense Eigen)
parameter accepts a NumPy array, a list or a tuple, nested for a matrix:
iso.translate([0.5, 0.2, 0.3]), Isometry3d([x, y, z], q), Quaterniond(R.tolist()).
The shape must match exactly ([1, 2] for a Vector3d raises TypeError, nothing is
padded or truncated). Integers convert to float64; strings, None, complex numbers and
ragged nesting raise TypeError, and an integer parameter (mesh faces) refuses floats.
Returned matrices are always NumPy arrays. The exception is a parameter a function writes
into (see Frame and error math): it needs the array itself.
Transforms¶
Isometry3d¶
Eigen rigid-body transform (rotation + translation). Raw C++ binding.
from tesseract_robotics.common import Isometry3d
import numpy as np
# Identity transform
pose = Isometry3d.Identity()
# From a 4x4 matrix
mat = np.eye(4)
mat[:3, 3] = [0.5, 0.2, 0.3]
pose = Isometry3d(mat)
# Access components (read-only properties; each returns a copy)
position = pose.translation # np.array([x, y, z])
rotation = pose.rotation # 3x3 rotation matrix
matrix = pose.matrix # 4x4 homogeneous matrix
# Compose
combined = pose1 * pose2
# Apply to many points at once: (N, 3) in, (N, 3) out, in one call
points = np.random.default_rng(0).normal(size=(1000, 3))
mapped = pose.apply_points(points) # row i == pose * points[i], bitwise
rotated = pose.apply_directions(points) # rotation only, no translation
apply_points and apply_directions take an (N, 3) array, including N = 0 and strided views
such as a[:, :3], and return a new (N, 3) float64 array. A single point stays pose * p; a
(3,) array passed to apply_points raises TypeError. Each row is computed exactly as
pose * p computes it, so the results agree bit for bit. A Python loop over pose * p costs about
1 µs per point; apply_points costs about 1 µs per call up to a few dozen points.
Prefer planning.Pose for authoring
For building/serializing transforms in Python, use
tesseract_robotics.planning.Pose — it accepts scalar-last quaternions
(qx, qy, qz, qw) and offers from_xyz_quat, from_rpy, etc. Convert
to an Isometry3d when calling the raw C++ API.
Quaterniond¶
Eigen quaternion. Project canonical order is scalar-last
[qx, qy, qz, qw] — use Quaterniond.from_xyzw(qx, qy, qz, qw) to build
and access components via the q.x, q.y, q.z, q.w properties.
from tesseract_robotics.common import Quaterniond
q = Quaterniond.from_xyzw(0.0, 0.0, 0.0, 1.0) # identity: scalar-last
# Component access — properties, not method calls.
print(f"x={q.x}, y={q.y}, z={q.z}, w={q.w}")
# Flat coefficient vector is also scalar-last (Eigen storage order).
qx, qy, qz, qw = q.coeffs()
rotation_matrix = q.toRotationMatrix()
One rotation per quaternion
toRotationMatrix, to_rpy, eulerAngles, q * v, AngleAxisd(q) and the Isometry3d
constructors, *, rotate and prerotate all convert the same quaternion, so
Isometry3d(q).linear equals q.toRotationMatrix() bit for bit. A quaternion with
|q.squaredNorm() - 1| <= 6·eps (unit to float64 rounding) is converted as given; any other is
divided by its norm first, so a non-unit quaternion reads out as the rotation of its direction.
A zero or non-finite quaternion raises DegenerateRotationError.
No scalar-first constructor
Eigen's Quaterniond(w, x, y, z) is not bound: four scalars raise
TypeError. Use Quaterniond.from_xyzw(qx, qy, qz, qw) or
Quaterniond([qx, qy, qz, qw]); reorder when porting C++.
q.coeffs(), q.vec(), the Quaterniond(Vector4d) ctor, and Pose's
quaternion-returning factories all use scalar-last [qx, qy, qz, qw].
AngleAxisd¶
Axis-angle rotation representation.
from tesseract_robotics.common import AngleAxisd
import numpy as np
# 90 degrees around Z axis
aa = AngleAxisd(np.pi/2, np.array([0, 0, 1]))
rotation_matrix = aa.toRotationMatrix()
nearest_rotation¶
The rotation closest to a 3x3 matrix in the Frobenius norm: U·diag(1, 1, det(U·Vᵀ))·Vᵀ from
the SVD M = U·Σ·Vᵀ (Eigen's JacobiSVD). Use it to project a rotation that carries arithmetic
noise (a pose stored from float32 math) back onto SO(3).
from tesseract_robotics.common import Quaterniond, nearest_rotation
R = nearest_rotation(noisy_rotation) # (3, 3) float64, det +1
q = Quaterniond(R) # passes the orthonormality check
- The result is always a proper rotation (det +1). For a reflection (det(M) < 0) it is the nearest rotation, not the orthogonal factor: the smallest singular direction flips.
- Not bitwise idempotent: an exact rotation comes back within a few ulp (measured ≤ 5.5 ε over
10 000 random rotations, osx-arm64), because
U·Vᵀre-rounds. - A NaN or infinite entry raises
NonFiniteMatrixError(aValueError); a shape other than 3x3 raisesTypeError. - The minimiser is unique only for rank ≥ 2 (and σ₂ > σ₃ when det(M) < 0). Otherwise one
minimiser comes back without warning: the zero matrix,
diag(1, 0, 0)anddiag(1, 1, -1)all return the identity.
Rigidity readouts¶
The checks that accept a matrix as a rotation, in Eigen: orthonormality_residual(R) is
max|RᵀR − I| of a 3x3 (0 for an exact rotation) and determinant(R) its determinant. The stack
forms read the rotation block of each transform of an (M, 4, 4) stack, and norm_each the norm
of each row of an (N, 3) array.
from tesseract_robotics.common import (
orthonormality_residual_each,
rotation_determinant_each,
)
residual = orthonormality_residual_each(stack) # (M,): row i bitwise orthonormality_residual(stack[i, :3, :3])
proper = rotation_determinant_each(stack) > 0.0 # (M,): row i bitwise determinant(stack[i, :3, :3])
Frame and error math¶
Re-base twists and jacobians, and compute pose errors, with tesseract's own math. A twist
is a (6,) array [vx, vy, vz, wx, wy, wz]; a jacobian is (6, n).
import numpy as np
from tesseract_robotics.common import Isometry3d, jacobianChangeBase, jacobianChangeRefPoint
joint_group = env.getJointGroup("manipulator")
q = np.zeros(6)
T_new_base = Isometry3d.Identity()
J = joint_group.calcJacobian(q, "tool0") # (6, n), Fortran order, in the group base frame
jacobianChangeBase(J, T_new_base) # rotate every column into T_new_base, in place
jacobianChangeRefPoint(J, [0.0, 0.0, 0.1]) # v += ω × p, in place
In place: these functions write into the array you pass
twistChangeRefPoint, twistChangeBase, jacobianChangeBase, jacobianChangeRefPoint
and applyTolerances return None and change their first argument, as in C++. They
raise TypeError for anything they would have to convert first, since the result
would be written into a temporary copy and lost: a list or tuple, float32, read-only
or non-contiguous arrays, and C-order (6, n > 1) jacobians. calcJacobian returns Fortran order;
convert others with np.asfortranarray.
jacobianChangeRefPoint takes the point in the jacobian's base frame. To match
calcJacobian(q, link, p), whose p is in the link frame, rotate it first:
jacobianChangeRefPoint(J, joint_group.calcFwdKin(q)[link].rotation @ p).
Pose errors are [translation, angle-axis rotation] 6-vectors:
from tesseract_robotics.common import (
applyTolerances, calcJacobianTransformErrorDiff, calcRotationalError, calcTransformError,
)
calcRotationalError(R) # θ·axis, θ in [-π, π]
calcTransformError(t1, t2) # error of t1.inverse() * t2
# Finite-difference column of a pose-error jacobian. Subtracting two calcTransformError
# results jumps by ~2π near the angle-axis ±π boundary; this does not.
d = calcJacobianTransformErrorDiff(target, source, source_perturbed)
d = calcJacobianTransformErrorDiff(target, target_perturbed, source, source_perturbed)
lower_tol, upper_tol = np.full(6, -1.0), np.full(6, 1.0)
d = calcJacobianTransformErrorDiff(target, source, source_perturbed, lower_tol, upper_tol)
v = np.array([-2.0, 0.5, 3.0])
applyTolerances(v, np.full(3, -1.0), np.full(3, 1.0)) # v is now [-1., 0., 2.]
The tolerance pair of applyTolerances and of the tolerance overloads of
calcJacobianTransformErrorDiff must be both empty (no tolerance) or both of the value's
size (6 for the error diff); anything else raises ToleranceSizeMismatchError, a
ValueError.
Ids¶
Links and joints are addressed by id (upstream IDENTITY_DESIGN.md). An id is
built from a name; anywhere an id is expected a str converts implicitly.
from tesseract_robotics.common import JointId, LinkId, LinkIdPair
tool0 = LinkId("tool0")
tool0.name() # "tool0"; str(tool0) is the same
tool0 == "tool0" # True: ids compare equal to their name
{tool0: 1}["tool0"] # 1: hash(id) == hash(name), so str keys find id-keyed entries
LinkIdPair("a", "b").orderedNameView() # ("a", "b"), alphabetical
Maps keyed by a link or joint (SceneState.link_transforms, calcFwdKin,
getLinkTransforms, ...) are plain dict[str, ...] keyed by name, so
transforms["tool0"] is exactly typed. A parameter that takes such a map accepts
names or ids as keys. LinkId and JointId do not convert into each other.
Type checkers
The stubs accept LinkId | str wherever a parameter takes an id, and
Mapping[LinkId, V] | Mapping[str, V] wherever it takes an id-keyed map.
Resource Locators¶
GeneralResourceLocator¶
Resolves package:// URLs to file paths.
from tesseract_robotics import get_tesseract_resource_path
from tesseract_robotics.common import GeneralResourceLocator
# tesseract's support data (tesseract-robotics-nanobind-support) as a search path
locator = GeneralResourceLocator(paths=[get_tesseract_resource_path()])
# Resolve package URL
resource = locator.locateResource("package://tesseract/support/urdf/abb_irb2400.urdf")
path = resource.getFilePath()
tesseract_robotics never adds search paths itself: a locator searches what it is given and the
environment variables below.
A package is a directory that holds a package.xml; its name is the directory name. The
locator finds packages in the directories it is given and in their subdirectories. Without
arguments it reads TESSERACT_RESOURCE_PATH, ROS_PACKAGE_PATH and AMENT_PREFIX_PATH.
Both other constructors take keyword arguments only, because a positional list[str] could
mean either directories or environment variable names:
from pathlib import Path
locator = GeneralResourceLocator(paths=[Path("~/ws/src").expanduser()]) # + the default env vars
locator = GeneralResourceLocator(environment_variables=["MY_RESOURCE_PATH"])
locator.addPath(Path("/opt/robots")) # False if the directory does not exist
locator.loadEnvironmentVariable("MY_PATHS") # False if the variable is unset
locateResource returns None when it cannot resolve the url.
BytesResource¶
In-memory resource from bytes.
from tesseract_robotics.common import BytesResource
data = b"<robot name='test'></robot>"
resource = BytesResource("robot.urdf", data)
Every Resource is also a ResourceLocator: resource.locateResource(url) resolves a url
relative to the resource, through the parent locator it was built with (None without a
parent). BytesResource first asks the parent for the url as given, then for the file next
to its own url:
urdf = BytesResource("package://my_robot/urdf/robot.urdf", data, parent=locator)
mesh = urdf.locateResource("base.stl") # tries "base.stl", then "package://my_robot/urdf/base.stl"
Collision¶
AllowedCollisionMatrix¶
Defines which link pairs to skip during collision checking.
from tesseract_robotics.common import AllowedCollisionMatrix
acm = AllowedCollisionMatrix()
# Allow collision between links
acm.addAllowedCollision("link_1", "link_2", "Adjacent links")
# Check if allowed
is_allowed = acm.isCollisionAllowed(("link_1", "link_2"))
# Remove entry
acm.removeAllowedCollision("link_1", "link_2")
# Clear all
acm.clearAllowedCollisions()
An ACM converts to and from its entries, a dict[LinkIdPair, str]. The constructor takes
LinkIdPair or (str, str) keys and orders each pair, so ("link_b", "link_a") is stored as
("link_a", "link_b"). A LinkIdPair is unordered and never equals a tuple: index the entries
dict with a LinkIdPair, not a tuple.
from tesseract_robotics.common import (
AllowedCollisionMatrix, LinkIdPair, getAllowedCollisions,
)
acm = AllowedCollisionMatrix({("link_b", "link_a"): "Adjacent links"})
entries = acm.getAllAllowedCollisions() # {LinkIdPair(link_a, link_b): "Adjacent links"}
assert entries[LinkIdPair("link_b", "link_a")] == "Adjacent links"
assert ("link_a", "link_b") not in entries # a tuple never equals a LinkIdPair
print(acm) # one "link=<a> link=<b> reason=<r>" line per entry
acm.reserveAllowedCollisionMatrix(100) # pre-size; entries unchanged
# Links allowed to collide with any of the given links; each partner once unless
# remove_duplicates=False. The order follows the dict's, so treat it as a set.
assert {str(link) for link in getAllowedCollisions(["link_a"], entries)} == {"link_b"}
acm.removeAllowedCollision("link_a") # drop every entry involving link_a
assert not acm.getAllAllowedCollisions()
CollisionMarginData¶
Configure collision margins per link pair.
from tesseract_robotics.common import CollisionMarginData
margins = CollisionMarginData()
margins.setDefaultCollisionMargin(0.025)
margins.setCollisionMargin("link_a", "link_b", 0.05)
default = margins.getDefaultCollisionMargin()
pair_margin = margins.getCollisionMargin("link_a", "link_b")
CollisionMarginPairData holds the pair margins alone. Both types build from pair data,
shift and scale every margin, and merge another set of pair margins:
from tesseract_robotics.common import (
CollisionMarginData,
CollisionMarginPairData,
CollisionMarginPairOverrideType,
)
pairs = CollisionMarginPairData({("link_a", "link_b"): 0.05, ("link_a", "link_c"): 0.02})
margins = CollisionMarginData(0.025, pairs) # or CollisionMarginData(pairs): default 0.0
margins.incrementMargins(0.01) # default and every pair margin +0.01 m
margins.scaleMargins(2.0) # then x2
# MODIFY sets the given pairs and keeps the rest; REPLACE keeps only the given pairs.
margins.apply(CollisionMarginPairData({("link_b", "link_d"): 0.07}), CollisionMarginPairOverrideType.MODIFY)
margins.getMaxCollisionMargin() # largest margin overall
margins.getMaxCollisionMargin("link_a") # largest margin involving link_a (at least the default)
pairs.getMaxCollisionMargin("link_z") # None: no pair margin involves link_z
State¶
JointState¶
Joint positions and velocities.
from tesseract_robotics.common import JointState
state = JointState()
state.joint_ids = ["j1", "j2", "j3"]
state.position = np.array([0.0, 0.5, -0.5])
state.velocity = np.array([0.0, 0.0, 0.0])
JointTrajectory¶
A sequence of JointStates with a description and a uuid (its canonical string; a
malformed string raises ValueError). It behaves like a list of states: len, indexing
(negative indices count from the end; out of range raises IndexError), assignment and
iteration, plus push_back, pop_back, front, back, at, clear and empty.
from tesseract_robotics.common import JointState, JointTrajectory
names = ["j1", "j2", "j3"]
traj = JointTrajectory([JointState(names, np.zeros(3))], "approach")
traj.push_back(JointState(names, np.array([0.0, 0.5, -0.5])))
js = traj[-1]
js.time = 1.0
traj[-1] = js # write back: element access returns a copy
Element access returns a copy
traj[i], front(), back(), at(i), iteration and the states list are copies,
so traj[0].time = 1.0 changes nothing. Assign the edited state back with
traj[0] = js, or assign a whole new list to traj.states. A reference into the
underlying vector would dangle as soon as push_back reallocated it.
Trajectories compare by value (== compares uuid, description and states) and are
unhashable.
KinematicLimits¶
Joint position, velocity, acceleration limits.
from tesseract_robotics.common import KinematicLimits
limits = kin_group.getLimits()
print(f"Position min: {limits.joint_limits[:, 0]}")
print(f"Position max: {limits.joint_limits[:, 1]}")
print(f"Velocity: {limits.velocity_limits}")
print(f"Acceleration: {limits.acceleration_limits}")
print(f"Jerk: {limits.jerk_limits}")
Each field is an (n, 2) array of [lower, upper] rows. limits.resize(n) resizes all
four to (n, 2); their values are unset afterwards, so assign them before use.
Three free functions check or clamp joint values against an (n, 2) limit array:
import numpy as np
from tesseract_robotics.common import enforceLimits, isWithinLimits, satisfiesLimits
limits = np.array([[-1.0, 1.0], [-2.0, 2.0]])
isWithinLimits(np.array([0.5, -1.5]), limits) # True: inside or on the bounds, no tolerance
satisfiesLimits(np.array([1.0 + 1e-7, 0.0]), limits) # True: within the 1e-6 default max_diff
enforceLimits(np.array([1.5, -3.0]), limits) # array([ 1., -2.]): a clamped copy
enforceLimits returns a new array and leaves its input unchanged (C++ clamps in place).
isWithinLimits and enforceLimits raise LimitsSizeMismatchError (a ValueError) when
the number of values differs from the number of limit rows.
Manipulator Info¶
ManipulatorInfo¶
Describes a kinematic group configuration.
from tesseract_robotics.common import ManipulatorInfo
info = ManipulatorInfo()
info.manipulator = "manipulator" # group name
info.working_frame = "base_link" # reference frame
info.tcp_frame = "tool0" # tool center point
info.tcp_offset = Isometry3d.Identity() # optional TCP offset
# or all at once; tcp_offset (a link name or an Isometry3d) defaults to the identity
info = ManipulatorInfo("manipulator", "base_link", "tool0")
tcp_offset holds a str (a link name) or an Isometry3d; any other type raises
TypeError. Reading it returns a copy, so assign a new value instead of editing it in
place.
info.empty() is True unless manipulator, working_frame and tcp_frame are all set.
base.getCombined(override) returns a copy of base with every non-empty field of
override; an overriding tcp_frame brings override.tcp_offset along with it:
override = ManipulatorInfo()
override.tcp_frame = "tool1"
combined = info.getCombined(override) # tcp_frame "tool1", tcp_offset from override
Plugin Info¶
Plugin configuration for the four plugin loaders: KinematicsPluginInfo,
ContactManagersPluginInfo, ProfilesPluginInfo and TaskComposerPluginInfo. Each has
search_paths, search_libraries, insert(other), clear(), empty() and a read-only
CONFIG_KEY (its key in a tesseract YAML config, e.g. "contact_manager_plugins").
from tesseract_robotics.common import (
ContactManagersPluginInfo, PluginInfo, PluginInfoContainer,
)
bullet = PluginInfo()
bullet.class_name = "BulletDiscreteBVHManagerFactory"
info = ContactManagersPluginInfo()
info.search_libraries = ["tesseract_collision_bullet_factories"]
info.discrete_plugin_infos.default_plugin = "BulletDiscreteBVHManager"
info.discrete_plugin_infos.plugins = {"BulletDiscreteBVHManager": bullet}
Note
A PluginInfoContainer field (discrete_plugin_infos, continuous_plugin_infos,
executor_plugin_infos, task_plugin_infos) is a reference: editing it in place
persists. A dict field (PluginInfoContainer.plugins, ProfilesPluginInfo.plugin_infos,
KinematicsPluginInfo.fwd_plugin_infos) converts to a fresh dict on every access:
assign the whole field, since info.plugin_infos["x"] = ... edits a copy.
Calibration Info¶
CalibrationInfo holds calibrated joint origins: for each joint name in joints, the
environment replaces that joint's origin (a ChangeJointOriginCommand). An SRDF carries one
through its <calibration_config> file, read into SRDFModel.calibration_info.
from tesseract_robotics.common import CalibrationInfo, Isometry3d
info = CalibrationInfo()
info.joints = {"joint_a1": Isometry3d.Identity()} # assign the whole dict
other = CalibrationInfo()
other.joints = {"joint_a2": Isometry3d.Identity()}
info.insert(other) # overwrites by joint name
assert CalibrationInfo.CONFIG_KEY == "calibration"
Note
joints converts to a fresh dict on every access: info.joints["j"] = t edits a copy.
Equality is upstream's: each transform compares with isApprox(1e-5).
Every class on this page whose C++ type declares operator== compares by value (==, with
the C++ tolerances) and is unhashable, except ResourceLocator and Resource, which compare by
identity (their C++ operator== is always true). KinematicLimits of different shapes are
unequal.
Logging¶
Tesseract logs through spdlog (upstream #1367). The default logger is named
"tesseract"; its level controls tesseract's console output.
from tesseract_robotics.common import (
LogLevel, addLogRecordHandler, getLogger, isLogLevelEnabled, removeLogRecordHandler,
)
logger = getLogger() # getLogger("tesseract")
logger.set_level(LogLevel.err) # suppress warnings
logger.set_level(LogLevel.debug) # enable debug output
assert isLogLevelEnabled(LogLevel.debug)
# Route records into Python (any thread; the handler runs with the GIL held)
records = []
handler_id = addLogRecordHandler(records.append)
...
removeLogRecordHandler(handler_id)
A LogRecord carries level, message, logger_name, component_name,
attributes, timestamp, filename, line and function_name. An exception
raised by a handler is reported through sys.unraisablehook.
A handler sees every record in addition to the logger's sinks, which still write
to stderr. To send tesseract's output to Python logging instead, replace the
sinks: a record then goes to each sink whose level admits it, once.
import logging
from tesseract_robotics.common import PythonLoggingSink, StderrSink, getLogger
sink = PythonLoggingSink("myapp.tesseract") # records go to logging.getLogger("myapp.tesseract")
sink.set_pattern("%v (%s:%#)") # spdlog pattern for the text; "%v" (the message) by default
getLogger().sinks = [sink] # replaces stderr; assign before other threads log
getLogger().sinks = [StderrSink()] # back to stderr
Each Python LogRecord gets the level (spdlog trace maps to 5, below DEBUG),
the source pathname, lineno and funcName, and the spdlog logger's name as
the spdlog_logger attribute. Records the Python logger is not enabled for are
dropped at the sink. A sink's own level (set_level) filters before that.
Sinks are C++ objects that Python holds a share of: a logger that keeps one does not keep a Python object alive, so the default logger, which outlives the interpreter, holds nothing of Python's at exit.
Python handlers, Python sinks and C++ threads
A Python handler or PythonLoggingSink takes the GIL on whichever thread logs.
C++ code that joins logging threads while the caller holds the GIL then
deadlocks: drain an executor's futures (wait()) before dropping it while a
handler or Python sink is installed.
console_bridge API removed
setLogLevel, getLogLevel, log, useOutputHandler,
restorePreviousOutputHandler, OutputHandler and the CONSOLE_BRIDGE_LOG_*
constants are gone: upstream tesseract no longer logs through console_bridge,
so they had no effect on its output.
Container Types¶
C++ containers cross as plain Python containers; there are no container classes to import.
| C++ | Python |
|---|---|
std::vector<Isometry3d> |
list[Isometry3d] |
std::vector<Vector3d> |
list[np.ndarray] - list of 3D points |
| link-name to transform maps | dict[str, Isometry3d], keyed by link name |
Reference¶
tesseract_common Python bindings (nanobind)
LinkId
¶
JointId
¶
LinkIdPair
¶
Isometry3d
¶
apply_points
¶
apply_points(points: Annotated[NDArray[float64], dict(shape=(None, 3), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(None, 3), order=C)]
apply_directions
¶
apply_directions(vectors: Annotated[NDArray[float64], dict(shape=(None, 3), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(None, 3), order=C)]
compose_each
¶
compose_each(transforms: Annotated[NDArray[float64], dict(shape=(None, 4, 4), order=C, writable=False)]) -> Annotated[NDArray[numpy.float64], dict(shape=(None, 4, 4), order=C)]
precompose_each
¶
precompose_each(transforms: Annotated[NDArray[float64], dict(shape=(None, 4, 4), order=C, writable=False)]) -> Annotated[NDArray[numpy.float64], dict(shape=(None, 4, 4), order=C)]
translate
¶
translate(vec: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Isometry3d
pretranslate
¶
pretranslate(vec: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Isometry3d
Translation3d
¶
Quaterniond
¶
FromTwoVectors
staticmethod
¶
FromTwoVectors(a: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float], b: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Quaterniond
toRotationMatrix
¶
The 3x3 rotation matrix; bitwise Isometry3d(q).linear. The quaternion is converted as given when |q.squaredNorm() - 1| <= 6·eps (unit to float64 rounding) and as q / |q| otherwise, so every member gives one quaternion the same rotation, bit for bit. A zero or non-finite quaternion raises DegenerateRotationError.
to_rpy
¶
(roll, pitch, yaw) [rad] of R = Rz(yaw)·Ry(pitch)·Rx(roll), the inverse of from_rpy; read from toRotationMatrix(). The quaternion is converted as given when |q.squaredNorm() - 1| <= 6·eps (unit to float64 rounding) and as q / |q| otherwise, so every member gives one quaternion the same rotation, bit for bit. A zero or non-finite quaternion raises DegenerateRotationError.
eulerAngles
¶
Intrinsic Euler angles [rad] in the 3-axis order (e.g. 'ZYX'), Eigen's eulerAngles of toRotationMatrix(). The quaternion is converted as given when |q.squaredNorm() - 1| <= 6·eps (unit to float64 rounding) and as q / |q| otherwise, so every member gives one quaternion the same rotation, bit for bit. A zero or non-finite quaternion raises DegenerateRotationError.
NotRotationError
¶
Bases: ValueError
A matrix offered as a rotation (or rigid transform) is not one: max|RᵀR − I| above EIGEN_DEFAULT_PREC, a non-finite entry, or a bottom row other than [0, 0, 0, 1].
DegenerateRotationError
¶
Bases: ValueError
A quaternion or rotation axis that is zero or not finite: it names no rotation.
DegenerateGeometryError
¶
Bases: ValueError
A Hyperplane3d / ParametrizedLine3d input with no direction: a zero normal or direction, coincident points, or collinear points.
NonFiniteMatrixError
¶
Bases: ValueError
nearest_rotation got a matrix with a NaN or infinite entry.
Hyperplane3d
¶
Through
staticmethod
¶
Through(p0: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float], p1: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float], p2: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Hyperplane3d
signedDistance
¶
signedDistance(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> float
absDistance
¶
absDistance(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> float
projection
¶
projection(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Annotated[NDArray[numpy.float64], dict(shape=3, order=C)]
ParametrizedLine3d
¶
__init__
¶
__init__(origin: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float], direction: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> None
Through
staticmethod
¶
Through(p0: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float], p1: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> ParametrizedLine3d
distance
¶
distance(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> float
squaredDistance
¶
squaredDistance(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> float
projection
¶
projection(point: Annotated[NDArray[float64], dict(shape=3, order=C)] | Sequence[float]) -> Annotated[NDArray[numpy.float64], dict(shape=3, order=C)]
intersectionPoint
¶
intersectionPoint(plane: Hyperplane3d) -> Annotated[NDArray[numpy.float64], dict(shape=3, order=C)]
ResourceLocator
¶
GeneralResourceLocator
¶
Bases: ResourceLocator
Resource
¶
BytesResource
¶
SimpleLocatedResource
¶
ManipulatorInfo
¶
tcp_offset
property
writable
¶
TCP offset: a link (LinkId, or its name as str) or a pose (Isometry3d). Reading returns a copy.
JointState
¶
JointTrajectory
¶
ACMContactAllowedValidator
¶
Bases: ContactAllowedValidator
CombinedContactAllowedValidatorType
¶
CombinedContactAllowedValidator
¶
Bases: ContactAllowedValidator
CollisionMarginPairOverrideType
¶
CollisionMarginPairData
¶
CollisionMarginData
¶
KinematicLimits
¶
LimitsSizeMismatchError
¶
Bases: ValueError
isWithinLimits / enforceLimits got values and limits of different lengths.
ToleranceSizeMismatchError
¶
Bases: ValueError
lower_tolerance / upper_tolerance are not both empty or both the expected size.
PluginInfo
¶
config
property
writable
¶
Plugin config as a YAML document string (a YAML::Node in C++).
PluginInfoContainer
¶
PluginDiscoveryInfo
¶
Plugin library discovery: search paths and library names (without prefix or suffix).
PropertyTree
¶
A node of a configuration schema: a YAML value, metadata attributes and ordered children.
applyConfig
¶
Merge the YAML config text into the schema and validate it; returns every error, empty when valid. A key the schema does not declare is an error unless allow_extra_properties. Malformed YAML raises ValueError.
validate
¶
Every validation error of the tree, empty when valid.
__getitem__
¶
The child at key; raises KeyError when absent.
fromYAML
staticmethod
¶
A tree from the YAML that toYAML(exclude_attributes=False) writes.
KinematicsPluginInfo
¶
Bases: PluginDiscoveryInfo
ContactManagersPluginInfo
¶
Bases: PluginDiscoveryInfo
CalibrationInfo
¶
joints
property
writable
¶
Joint name -> calibrated joint origin. A copy on read: assign the whole dict, or use insert.
TaskComposerPluginInfo
¶
Bases: PluginDiscoveryInfo
ProfilesPluginInfo
¶
Bases: PluginDiscoveryInfo
LogLevel
¶
Bases: Enum
LogSink
¶
An spdlog sink: one place a Logger writes its records
StderrSink
¶
PythonLoggingSink
¶
Bases: LogSink
Writes each record to Python's logging module, on the logger named name, with its level,
source file, line and function; the text is the sink's pattern ('%v', the message, by default).
Records the Python logger is not enabled for are dropped there. Takes the GIL on the logging thread.
Logger
¶
A named spdlog logger (tesseract's default is 'tesseract')
sinks
property
writable
¶
The logger's sinks, as a list. Assign a new list to change them, before other threads log (spdlog's sink list is not thread safe), e.g. at startup. A logger created later by getLogger(name) copies the default logger's sinks.
LogRecord
¶
One tesseract log event, as passed to a record handler
apply_directions_each
¶
apply_directions_each(transforms: Annotated[NDArray[float64], dict(shape=(None, 4, 4), order=C, writable=False)], vectors: Annotated[NDArray[float64], dict(shape=(None, 3), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(None, 3), order=C)]
nearest_rotation
¶
nearest_rotation(matrix: Annotated[NDArray[float64], dict(shape=(3, 3), order=F)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(3, 3), order=F)]
The rotation closest to a 3x3 matrix in the Frobenius norm, U·diag(1, 1, det(U·Vᵀ))·Vᵀ from its SVD; det is +1 also for a reflection. A new array; the input is unchanged.
orthonormality_residual
¶
orthonormality_residual(matrix: Annotated[NDArray[float64], dict(shape=(3, 3), order=F)] | Sequence[Sequence[float]]) -> float
max|RᵀR − I| of a 3x3 matrix, dimensionless: 0 for an exact rotation.
determinant
¶
determinant(matrix: Annotated[NDArray[float64], dict(shape=(3, 3), order=F)] | Sequence[Sequence[float]]) -> float
The determinant of a 3x3 matrix: +1 for a rotation, -1 for a reflection.
orthonormality_residual_each
¶
orthonormality_residual_each(transforms: Annotated[NDArray[float64], dict(shape=(None, 4, 4), order=C, writable=False)]) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]
max|RᵀR − I| of the rotation block of each transform of an (M, 4, 4) stack, (M,); row i is bitwise orthonormality_residual(stack[i, :3, :3]).
rotation_determinant_each
¶
rotation_determinant_each(transforms: Annotated[NDArray[float64], dict(shape=(None, 4, 4), order=C, writable=False)]) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]
The determinant of the rotation block of each transform of an (M, 4, 4) stack, (M,); row i is bitwise determinant(stack[i, :3, :3]).
norm_each
¶
norm_each(vectors: Annotated[NDArray[float64], dict(shape=(None, 3), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]
The Euclidean norm of each row of an (N, 3) array, (N,).
getAllowedCollisions
¶
getAllowedCollisions(link_ids: Sequence[LinkId | str], acm_entries: Mapping[LinkIdPair, str] | Mapping[tuple[str, str], str], remove_duplicates: bool = True) -> list[LinkId]
isWithinLimits
¶
isWithinLimits(values: Annotated[NDArray[float64], dict(shape=(None,), writable=False)] | Sequence[float], limits: Annotated[NDArray[float64], dict(shape=(None, 2), writable=False)] | Sequence[Sequence[float]]) -> bool
True if every value lies in its [lower, upper] row; no tolerance.
enforceLimits
¶
enforceLimits(values: Annotated[NDArray[float64], dict(shape=(None,), writable=False)] | Sequence[float], limits: Annotated[NDArray[float64], dict(shape=(None, 2), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]
values clamped into limits, as a new array; the input is unchanged.
twistChangeRefPoint
¶
twistChangeRefPoint(twist: Annotated[NDArray[float64], dict(shape=6, order=C)], ref_point: Annotated[NDArray[float64], dict(shape=3, writable=False)] | Sequence[float]) -> None
Move the twist's reference point by ref_point (v += ω × ref_point), in place.
twistChangeBase
¶
twistChangeBase(twist: Annotated[NDArray[float64], dict(shape=6, order=C)], change_base: Isometry3d) -> None
Rotate the twist into the frame change_base, in place.
jacobianChangeBase
¶
jacobianChangeBase(jacobian: Annotated[NDArray[float64], dict(shape=(6, None))], change_base: Isometry3d) -> None
Rotate every column of a (6, n) Fortran-order jacobian into change_base, in place.
jacobianChangeRefPoint
¶
jacobianChangeRefPoint(jacobian: Annotated[NDArray[float64], dict(shape=(6, None))], ref_point: Annotated[NDArray[float64], dict(shape=3, writable=False)] | Sequence[float]) -> None
Move the reference point of a (6, n) Fortran-order jacobian by ref_point, in place.
calcRotationalError
¶
calcRotationalError(R: Annotated[NDArray[float64], dict(shape=(3, 3), writable=False)] | Sequence[Sequence[float]]) -> Annotated[NDArray[numpy.float64], dict(shape=3, order=C)]
Angle-axis vector θ·a of the rotation R, with θ in [-π, π].
calcTransformError
¶
calcTransformError(t1: Isometry3d, t2: Isometry3d) -> Annotated[NDArray[numpy.float64], dict(shape=(None,), order=C)]
Error of t1.inverse() * t2 as [translation, angle-axis rotation].
applyTolerances
¶
applyTolerances(v: Annotated[NDArray[float64], dict(shape=(None,), order=C)], lower_tolerance: Annotated[NDArray[float64], dict(shape=(None,), writable=False)] | Sequence[float], upper_tolerance: Annotated[NDArray[float64], dict(shape=(None,), writable=False)] | Sequence[float]) -> None
In place: 0 inside [lower, upper], v - lower below it, v - upper above it; no-op when both are empty.
getLogger
¶
Get (or create) a tesseract spdlog logger; set_level() on it controls tesseract's output
isLogLevelEnabled
¶
Whether the default tesseract logger emits at this level
addLogRecordHandler
¶
Register handler(record: LogRecord), called for every emitted record; returns its id
removeLogRecordHandler
¶
Unregister a handler by id; False if the id is not registered