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 of float, optional) – Joint values expressed in radians or meters, depending on the respective type.

  • types (list of compas.robots.Joint.TYPE, optional) – Joint types, e.g. a list of compas.robots.Joint.REVOLUTE for revolute joints.

  • velocities (list of float, optional) – Velocity of each joint.

  • accelerations (list of float, optional) – Acceleration of each joint.

  • effort (list of float, optional) – Effort of each joint.

  • time_from_start (Duration, optional) – Duration of trajectory point counting from the start.

Attributes
  • values (list of float) – Joint values expressed in radians or meters, depending on the respective type.

  • types (list of compas.robots.Joint.TYPE) – Joint types, e.g. a list of compas.robots.Joint.REVOLUTE for revolute joints.

  • velocities (list of float) – Velocity of each joint.

  • accelerations (list of float) – Acceleration of each joint.

  • effort (list of float) – Effort of each joint.

  • time_from_start (Duration) – Duration of trajectory point counting from the start.

  • positions (list of float) – Alias of values.

  • data (obj:dict) – The data representing the trajectory point.

Methods

__init__([values, types, velocities, …])

Initialize self.

check_joint_names()

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.

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.

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 another JointTrajectoryPoint in place along joint names.

merged(other)

Get a new JointTrajectoryPoint with this JointTrajectoryPoint merged with another JointTrajectoryPoint.

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.