timor.utilities.tolerated_pose ============================== .. py:module:: timor.utilities.tolerated_pose Classes ------- .. autoapisummary:: timor.utilities.tolerated_pose.ToleratedPose Module Contents --------------- .. py:class:: ToleratedPose(nominal, tolerance = None) .. autoapi-inheritance-diagram:: timor.utilities.tolerated_pose.ToleratedPose :parts: 1 :private-bases: 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. :param nominal: The nominal placement, either as a frame or a transformation assumed to be relative to the world frame. :param tolerance: The tolerance around the nominal placement. Can be any cartesian or rotation tolerance. Defaults to a narrow spatial tolerance. .. py:method:: __eq__(other) Compares tolerated poses .. py:method:: __getitem__(item) Indexing a ToleratedPose defaults to indexing the nominal placement .. py:method:: __getstate__() Return objects which will be pickled and saved. .. py:method:: __repr__() Make human-readable in debugger, etc. .. py:method:: __set_tolerance(value) Type checking before setting the tolerance. .. py:method:: __setstate__(state) Take object from parameter and use it to retrieve class state. .. py:method:: __str__() Make human-readable. .. py:method:: _deduce_package_dir(filepath, content) :staticmethod: Logic for deducing the package directory if the JSONable object is loaded from a file. :param filepath: The path to the file. :param content: 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. .. py:method:: from_json_data(d, *args, **kwargs) :classmethod: Create a ToleratedPose from a json description. :param d: A json description as defined in the task documentation. :param 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. :return: A ToleratedPose. .. py:method:: from_json_file(filepath, *args, **kwargs) :classmethod: Factory method to load a class instance from a json file. :param filepath: The path to the json file. :param args: Additional arguments to pass to the from_json_data factory method of the specific class. :param kwargs: Additional arguments to pass to the from_json_data factory method of the specific class. .. py:method:: from_json_string(s, *args, **kwargs) :classmethod: Create from a json string. .. py:attribute:: nominal :type: timor.utilities.frames.Frame .. py:method:: to_json_data() The json-compatible serialization of a placement with tolerance .. py:method:: to_json_file(save_at, *args, **kwargs) Writes the instance to a json file. :param save_at: File location or folder to write the class to. .. py:method:: to_json_string() Returns the json string representation of this placement. .. py:property:: tolerance :type: timor.task.Tolerance.ToleranceBase The tolerances of the placement. .. py:method:: valid(other) Returns whether the placement 'other' is within the tolerance of self. :param other: The placement to compare to. :return: True if the other is valid with regard to self, False otherwise. .. py:method:: visualize(viz, name, scale = 1.0, **kwargs) Draws this placement inside the visualizer object For detailed kwargs refer to Transformation::visualize