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.Configuration
Defines a point within a trajectory.
A trajectory point is a sub-class of
Configuration
extended 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 (
list
offloat
, optional) – Joint values expressed in radians or meters, depending on the respective type.joint_types (
list
ofcompas.robots.Joint.TYPE
, optional) – Joint types, e.g. alist
ofcompas.robots.Joint.REVOLUTE
for revolute joints.velocities (
list
offloat
, optional) – Velocity of each joint.accelerations (
list
offloat
, optional) – Acceleration of each joint.time_from_start (
Duration
, optional) – Duration of trajectory point counting from the start.
- Attributes
joint_values (
list
offloat
) – Joint values expressed in radians or meters, depending on the respective type.joint_types (
list
ofcompas.robots.Joint.TYPE
) – Joint types, e.g. alist
ofcompas.robots.Joint.REVOLUTE
for 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, …])Initialize self.
Raises an error if there is not a joint name for every value.
close_to
(other[, tol])Returns
True
if the other Configuration’s joint_values are within a certain range.copy
()Create a copy of this
JointTrajectoryPoint
.from_data
(data)Construct a configuration from its data representation.
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.
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
JointTrajectoryPoint
with thisJointTrajectoryPoint
merged 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
()Get the data dictionary that represents the configuration.
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
DATASCHEMA
The schema of the data of this object.
JSONSCHEMA
The schema of the JSON representation of the data of this object.
acceleration_dict
A dictionary of joint accelerations by joint name.
accelerations
Acceleration of each joint.
data
The data representing the trajectory point.
dtype
The type of the object in the form of a “2-level” import and a class name.
effort
Effort of each joint.
effort_dict
A dictionary of joint efforts by joint name.
guid
The globally unique identifier of the object.
has_joint_names
Returns
True
when there is a joint name for every value.joint_dict
A dictionary of joint values by joint name.
joint_names
“List of joint names.
joint_types
Joint joint_types, e.g.
joint_values
Joint values expressed in radians or meters, depending on the respective type.
name
The name of the object.
positions
Alias of joint_values.
prismatic_values
Prismatic joint values in meters.
revolute_values
Revolute joint values in radians.
type_dict
A dictionary of joint types by joint name.
velocities
Velocity of each joint.
velocity_dict
A dictionary of joint velocities by joint name.