JointTrajectoryPoint
- class compas_fab.robots.JointTrajectoryPoint(joint_values=None, joint_types=None, velocities=None, accelerations=None, effort=None, time_from_start=None, joint_names=None)[source]
Bases:
compas.robots.configuration.ConfigurationDefines a point within a trajectory.
A trajectory point is a sub-class of
Configurationextended with acceleration, effort and time from start information.Trajectory points are defined either as joint_values + velocities and accelerations, or as joint_values + efforts.
- Parameters
joint_values (
listoffloat, optional) – Joint values expressed in radians or meters, depending on the respective type.joint_types (
listofcompas.robots.Joint.TYPE, optional) – Joint types, e.g. alistofcompas.robots.Joint.REVOLUTEfor revolute joints.velocities (
listoffloat, optional) – Velocity of each joint.accelerations (
listoffloat, optional) – Acceleration of each joint.time_from_start (
Duration, optional) – Duration of trajectory point counting from the start.
- Attributes
joint_values (
listoffloat) – Joint values expressed in radians or meters, depending on the respective type.joint_types (
listofcompas.robots.Joint.TYPE) – Joint types, e.g. alistofcompas.robots.Joint.REVOLUTEfor revolute joints.time_from_start (
Duration) – Duration of trajectory point counting from the start.data (obj:dict) – The data representing the trajectory point.
Methods
__init__([joint_values, joint_types, ...])Raises an error if there is not a joint name for every value.
close_to(other[, tol])Returns
Trueif the other Configuration's joint_values are within a certain range.copy()Create a copy of this
JointTrajectoryPoint.from_data(data)Construct an object of this type from the provided data.
from_json(filepath)Construct an object from serialized data contained in a JSON file.
from_jsonstring(string)Construct an object from serialized data contained in a JSON string.
from_prismatic_and_revolute_values(...[, ...])Construct a configuration from prismatic and revolute joint values.
from_revolute_values(values[, joint_names])Construct a configuration from revolute joint values in radians.
get(key[, default])items()iter_differences(other)Generator over the differences to another Configuration's joint_values.
keys()max_difference(other)Returns the maximum difference to another Configuration's joint values.
merge(other)Merge the configuration with another configuration in place along joint names.
merged(other)Get a new
JointTrajectoryPointwith thisJointTrajectoryPointmerged with anotherJointTrajectoryPoint.scale(scale_factor)Scales the joint positions of the current configuration.
scaled(scale_factor)Return a scaled copy of this configuration.
to_data()Convert an object to its native data representation.
to_json(filepath[, pretty])Serialize the data representation of an object to a JSON file.
to_jsonstring([pretty])Serialize the data representation of an object to a JSON string.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).
values()Attributes
DATASCHEMAThe schema of the data of this object.
JSONSCHEMAThe schema of the JSON representation of the data of this object.
JSONSCHEMANAMEacceleration_dictA dictionary of joint accelerations by joint name.
accelerationsAcceleration of each joint.
dataThe data representing the trajectory point.
dtypeThe type of the object in the form of a '2-level' import and a class name.
effortEffort of each joint.
effort_dictA dictionary of joint efforts by joint name.
guidThe globally unique identifier of the object.
has_joint_namesReturns
Truewhen there is a joint name for every value.joint_dictA dictionary of joint values by joint name.
joint_names"List of joint names.
joint_typesJoint joint_types, e.g.
joint_valuesJoint values expressed in radians or meters, depending on the respective type.
jsondefinitionsReusable schema definitions.
jsonstringThe representation of the object data in JSON format.
jsonvalidatorJSON schema validator for draft 7.
nameThe name of the object.
positionsAlias of joint_values.
prismatic_valuesPrismatic joint values in meters.
revolute_valuesRevolute joint values in radians.
type_dictA dictionary of joint types by joint name.
velocitiesVelocity of each joint.
velocity_dictA dictionary of joint velocities by joint name.