timor.utilities.tolerated_pose

Classes

ToleratedPose

Defines a desired nominal placement/pose in world coordinates with a tolerance around.

Module Contents

class timor.utilities.tolerated_pose.ToleratedPose(nominal, tolerance=None)
Inheritance diagram of timor.utilities.tolerated_pose.ToleratedPose

Defines a desired nominal placement/pose in world coordinates with a tolerance around.

A tolerated placement defines a nominal placement and a volume around it which is considered valid.

Parameters:
__eq__(other)

Compares tolerated poses

__getitem__(item)

Indexing a ToleratedPose defaults to indexing the nominal placement

__getstate__()

Return objects which will be pickled and saved.

__repr__()

Make human-readable in debugger, etc.

__set_tolerance(value)

Type checking before setting the tolerance.

Parameters:

value (timor.task.Tolerance.ToleranceBase)

__setstate__(state)

Take object from parameter and use it to retrieve class state.

__str__()

Make human-readable.

static _deduce_package_dir(filepath, content)

Logic for deducing the package directory if the JSONable object is loaded from a file.

Parameters:
  • filepath (pathlib.Path) – The path to the file.

  • content (Union[Dict, List]) – The content of the file parsed into a dictionary.

Note:

This method can be overridden by subclasses to provide custom package directory resolution; e.g. Task.py.

Return type:

pathlib.Path

classmethod from_json_data(d, *args, **kwargs)

Create a ToleratedPose from a json description.

Parameters:
  • d (Dict[str, any]) – A json description as defined in the task documentation.

  • kwargs

    • ‘frameName’: The name of the nominal frame.

    • ’frames’: A FrameTree to resolve add / find the nominal frame.

    • ’annonymousFrame’: If True, the nominal frame will not be added to the FrameTree.

Returns:

A ToleratedPose.

Return type:

ToleratedPose

classmethod from_json_file(filepath, *args, **kwargs)

Factory method to load a class instance from a json file.

Parameters:
  • filepath (Union[pathlib.Path, str]) – The path to the json file.

  • args – Additional arguments to pass to the from_json_data factory method of the specific class.

  • kwargs – Additional arguments to pass to the from_json_data factory method of the specific class.

classmethod from_json_string(s, *args, **kwargs)

Create from a json string.

Parameters:

s (str)

nominal: timor.utilities.frames.Frame
to_json_data()

The json-compatible serialization of a placement with tolerance

Return type:

Dict[str, Union[List, str]]

to_json_file(save_at, *args, **kwargs)

Writes the instance to a json file.

Parameters:

save_at (Union[pathlib.Path, str]) – File location or folder to write the class to.

to_json_string()

Returns the json string representation of this placement.

Return type:

str

property tolerance: timor.task.Tolerance.ToleranceBase

The tolerances of the placement.

Return type:

timor.task.Tolerance.ToleranceBase

valid(other)

Returns whether the placement ‘other’ is within the tolerance of self.

Parameters:

other (timor.utilities.transformation.Transformation) – The placement to compare to.

Returns:

True if the other is valid with regard to self, False otherwise.

Return type:

bool

visualize(viz, name, scale=1.0, **kwargs)

Draws this placement inside the visualizer object

For detailed kwargs refer to Transformation::visualize

Parameters:
  • viz (pinocchio.visualize.MeshcatVisualizer)

  • name (str)

  • scale (float)