Class Trajectory::Waypoint

Nested Relationships

This class is a nested type of Class Trajectory.

Class Documentation

class Waypoint

Public Functions

Eigen::Vector3d position() const

Get the intended physical location of the robot at the end of this Trajectory Waypoint.

This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.

Waypoint &position(Eigen::Vector3d new_position)

Set the intended physical location of the robot at the end of this Trajectory Waypoint.

This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.

Parameters:

new_position[in] The new position for this Trajectory Waypoint.

Eigen::Vector3d velocity() const

Get the intended velocity of the robot at the end of this Trajectory Waypoint.

This is a 2D homogeneous position. The first two values in the vector are x and y velocities, while the third is rotational velocity about the z-axis.

Waypoint &velocity(Eigen::Vector3d new_velocity)

Set the intended velocity of the robot at the end of this Trajectory Waypoint.

This is a 2D homogeneous position. The first two values in the vector are x and y coordinates, while the third is rotation about the z-axis.

Parameters:

new_velocity[in] The new velocity at this Trajectory Waypoint.

Time time() const

Get the time that the trajectory will reach this Waypoint.

std::size_t index() const

The index of this waypoint within its trajectory. Waypoints are indexed according to their chronological order. Adjusting the time of any waypoint in a trajectory could change its index and/or the index of other waypoints.

Waypoint &change_time(Time new_time)

Change the timing of this Trajectory Waypoint. Note that this function will only affect this waypoint, and may cause this waypoint to be reordered within the Trajectory.

To change the timing for this waypoint while preserving the relative times of all subsequent Trajectory Waypoints, use adjust_times() instead.

See also

adjust_times(Time new_time)

Note

If this Waypoint’s time crosses over another Waypoint’s time, that signficantly changes the topology of the Trajectory, because it will change the order in which the positions are traversed.

Warning

If you change the time value of this Waypoint such that it falls directly on another Waypoint’s time, you will get a std::invalid_argument exception, because discontinuous jumps are not supported, and indicate a significant mishandling of trajectory data, which is most likely a serious bug that should be remedied.

Parameters:

new_time[in] The new timing for this Trajectory Waypoint.

void adjust_times(Duration delta_t)

Adjust the timing of this waypoint and all subsequent waypoints by the given duration. This is guaranteed to maintain the ordering of the Trajectory Waypoints, and is more efficient than changing all the times directly.

Warning

If a negative delta_t is given, it must not cause this Waypoint’s time to be less than or equal to the time of its preceding Waypoint, or else a std::invalid_argument exception will be thrown.

Parameters:

delta_t[in] How much to change the timing of this waypoint and all later waypoints. If negative, it must not cross over the time of the previous waypoint, or else a std::invalid_argument will be thrown.