timor.utilities.tolerated_pose
Classes
Defines a desired nominal placement/pose in world coordinates with a tolerance around. |
Module Contents
- class timor.utilities.tolerated_pose.ToleratedPose(nominal, tolerance=None)

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:
nominal (Union[timor.utilities.transformation.Transformation, timor.utilities.frames.Frame]) – The nominal placement, either as a frame or a transformation assumed to be relative to the world frame.
tolerance (timor.task.Tolerance.ToleranceBase) – The tolerance around the nominal placement. Can be any cartesian or rotation tolerance. Defaults to a narrow spatial tolerance.
- __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:
- __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:
- 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:
- 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.
- nominal: timor.utilities.frames.Frame
- to_json_data()
The json-compatible serialization of a placement with tolerance
- 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.
- property tolerance: timor.task.Tolerance.ToleranceBase
The tolerances of the placement.
- Return type:
- 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: