Origin

class compas.robots.Origin(point, xaxis, yaxis)[source]

Bases: compas.geometry.primitives.frame.Frame

Reference frame represented by an instance of Frame.

An origin is defined by a base point and two orthonormal base vectors.

Parameters
  • point (point) – The origin of the origin.

  • xaxis (vector) – The x-axis of the origin.

  • yaxis (vector) – The y-axis of the origin.

Examples

>>> from compas.geometry import Point
>>> from compas.geometry import Vector
>>> o = Origin([0, 0, 0], [1, 0, 0], [0, 1, 0])
>>> o = Origin(Point(0, 0, 0), Vector(1, 0, 0), Point(0, 1, 0))

Inherited Attributes

DATASCHEMA

The schema of the data of this object.

JSONSCHEMA

The schema of the JSON representation of the data of this object.

JSONSCHEMANAME

axis_angle_vector

The axis-angle vector representing the rotation of the frame.

data

The data dictionary that represents the frame.

dtype

The type of the object in the form of a '2-level' import and a class name.

guid

The globally unique identifier of the object.

jsondefinitions

Reusable schema definitions.

jsonstring

The representation of the object data in JSON format.

jsonvalidator

JSON schema validator for draft 7.

name

The name of the object.

normal

The normal of the base plane of the frame.

point

The base point of the frame.

quaternion

The quaternion from the rotation given by the frame.

xaxis

The local X axis of the frame.

yaxis

The local Y axis of the frame.

zaxis

The Z axis of the frame.

Methods

from_urdf

Create origin instance from an URDF element.

get_urdf_element

scale

Scale the origin by a given factor.

Inherited Methods

copy

Make an independent copy of the data object.

euler_angles

The Euler angles from the rotation given by the frame.

from_axis_angle_vector

Construct a frame from an axis-angle vector representing the rotation.

from_data

Construct a frame from its data representation.

from_euler_angles

Construct a frame from a rotation represented by Euler angles.

from_json

Construct an object from serialized data contained in a JSON file.

from_jsonstring

Construct an object from serialized data contained in a JSON string.

from_list

Construct a frame from a list of 12 or 16 float values.

from_matrix

Construct a frame from a matrix.

from_plane

Constructs a frame from a plane.

from_points

Constructs a frame from 3 points.

from_quaternion

Construct a frame from a rotation represented by quaternion coefficients.

from_rotation

Constructs a frame from a Rotation.

from_transformation

Constructs a frame from a Transformation.

local_to_local_coordinates

Returns the object's coordinates in frame1 in the local coordinates of frame2.

to_data

Convert an object to its native data representation.

to_json

Serialize the data representation of an object to a JSON file.

to_jsonstring

Serialize the data representation of an object to a JSON string.

to_local_coordinates

Returns the object's coordinates in the local coordinate system of the frame.

to_world_coordinates

Returns the object's coordinates in the global coordinate frame.

transform

Transform the frame.

transformed

Returns a transformed copy of this geometry.

validate_data

Validate the object's data against its data schema (self.DATASCHEMA).

validate_json

Validate the object's data against its json schema (self.JSONSCHEMA).

worldXY

Construct the world XY frame.

worldYZ

Construct the world YZ frame.

worldZX

Construct the world ZX frame.