JointTrajectoryPoint¶
-
class
compas_fab.robots.
JointTrajectoryPoint
(values=None, types=None, velocities=None, accelerations=None, effort=None, time_from_start=None)[source]¶ Bases:
compas_fab.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 values + velocities and accelerations, or as values + efforts.
- Parameters
values (
list
offloat
, optional) – Joint values expressed in radians or meters, depending on the respective type.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
values (
list
offloat
) – Joint values expressed in radians or meters, depending on the respective type.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__
([values, types, velocities, …])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 values are within a certain range.copy
()Create a copy of this
JointTrajectoryPoint
.from_data
(data)Construct a configuration from its data representation.
Construct a configuration from prismatic and revolute joint values.
from_revolute_values
(values[, joint_names])Construct a configuration from revolute joint values in radians.
iter_differences
(other)Generator over the differences to another Configuration’s values.
max_difference
(other)Returns the maximum difference to another Configuration’s values.
merge
(other)Merge the
JointTrajectoryPoint
with anotherJointTrajectoryPoint
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.
Attributes
acceleration_dict
A dictionary of joint accelerations by joint name.
accelerations
Acceleration of each joint.
data
The data representing the trajectory point.
effort
Effort of each joint.
effort_dict
A dictionary of joint efforts by joint name.
has_joint_names
Returns
True
when there is a joint name for every value.joint_dict
A dictionary of joint values by joint name.
positions
Alias of 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.