Aikido
aikido::trajectory Namespace Reference

Classes

class  BSpline
 B-spline trajectory define in a StateSpace. More...
 
class  Interpolated
 Trajectory that uses an Interpolator to interpolate between waypoints. More...
 
class  Spline
 Polynomial spline trajectory defined in a StateSpace. More...
 
class  Trajectory
 Time-parameterized path in a StateSpace. More...
 
struct  TrajectoryMetadata
 

Typedefs

using BSplinePtr = std::shared_ptr< BSpline >
 
using ConstBSplinePtr = std::shared_ptr< const BSpline >
 
using WeakBSplinePtr = std::weak_ptr< BSpline >
 
using WeakConstBSplinePtr = std::weak_ptr< const BSpline >
 
using UniqueBSplinePtr = std::unique_ptr< BSpline >
 
using UniqueConstBSplinePtr = std::unique_ptr< const BSpline >
 
using InterpolatedPtr = std::shared_ptr< Interpolated >
 
using ConstInterpolatedPtr = std::shared_ptr< const Interpolated >
 
using WeakInterpolatedPtr = std::weak_ptr< Interpolated >
 
using WeakConstInterpolatedPtr = std::weak_ptr< const Interpolated >
 
using UniqueInterpolatedPtr = std::unique_ptr< Interpolated >
 
using UniqueConstInterpolatedPtr = std::unique_ptr< const Interpolated >
 
using SplinePtr = std::shared_ptr< Spline >
 
using ConstSplinePtr = std::shared_ptr< const Spline >
 
using WeakSplinePtr = std::weak_ptr< Spline >
 
using WeakConstSplinePtr = std::weak_ptr< const Spline >
 
using UniqueSplinePtr = std::unique_ptr< Spline >
 
using UniqueConstSplinePtr = std::unique_ptr< const Spline >
 
using TrajectoryPtr = std::shared_ptr< Trajectory >
 
using ConstTrajectoryPtr = std::shared_ptr< const Trajectory >
 
using WeakTrajectoryPtr = std::weak_ptr< Trajectory >
 
using WeakConstTrajectoryPtr = std::weak_ptr< const Trajectory >
 
using UniqueTrajectoryPtr = std::unique_ptr< Trajectory >
 
using UniqueConstTrajectoryPtr = std::unique_ptr< const Trajectory >
 

Functions

UniqueSplinePtr convertToSpline (const Interpolated &inputTrajectory)
 Converts an interpolated trajectory to a piecewise linear spline trajectory. More...
 
UniqueInterpolatedPtr concatenate (const Interpolated &traj1, const Interpolated &traj2)
 Concatenates two interpolated trajectories. More...
 
double findTimeOfClosestStateOnTrajectory (const Trajectory &traj, const statespace::StateSpace::State *referenceState, double &distance, double timeStep=0.01)
 Finds the time of the closest state on a trajectory to a given state. More...
 
UniqueSplinePtr createPartialTrajectory (const Spline &traj, double partialStartTime)
 Retrieves part of a given spline trajectory. More...
 
UniqueInterpolatedPtr toR1JointTrajectory (const Interpolated &trajectory)
 Converts an interpolated trajectory from a Cartesian product space of SO(2) and R1 joints to a Cartesian product space of strictly R1 joints. More...
 

Typedef Documentation

◆ BSplinePtr

using aikido::trajectory::BSplinePtr = typedef std::shared_ptr< BSpline >

◆ ConstBSplinePtr

using aikido::trajectory::ConstBSplinePtr = typedef std::shared_ptr< const BSpline >

◆ ConstInterpolatedPtr

using aikido::trajectory::ConstInterpolatedPtr = typedef std::shared_ptr< const Interpolated >

◆ ConstSplinePtr

using aikido::trajectory::ConstSplinePtr = typedef std::shared_ptr< const Spline >

◆ ConstTrajectoryPtr

using aikido::trajectory::ConstTrajectoryPtr = typedef std::shared_ptr< const Trajectory >

◆ InterpolatedPtr

using aikido::trajectory::InterpolatedPtr = typedef std::shared_ptr< Interpolated >

◆ SplinePtr

using aikido::trajectory::SplinePtr = typedef std::shared_ptr< Spline >

◆ TrajectoryPtr

using aikido::trajectory::TrajectoryPtr = typedef std::shared_ptr< Trajectory >

◆ UniqueBSplinePtr

using aikido::trajectory::UniqueBSplinePtr = typedef std::unique_ptr< BSpline >

◆ UniqueConstBSplinePtr

using aikido::trajectory::UniqueConstBSplinePtr = typedef std::unique_ptr< const BSpline >

◆ UniqueConstInterpolatedPtr

using aikido::trajectory::UniqueConstInterpolatedPtr = typedef std::unique_ptr< const Interpolated >

◆ UniqueConstSplinePtr

using aikido::trajectory::UniqueConstSplinePtr = typedef std::unique_ptr< const Spline >

◆ UniqueConstTrajectoryPtr

using aikido::trajectory::UniqueConstTrajectoryPtr = typedef std::unique_ptr< const Trajectory >

◆ UniqueInterpolatedPtr

using aikido::trajectory::UniqueInterpolatedPtr = typedef std::unique_ptr< Interpolated >

◆ UniqueSplinePtr

using aikido::trajectory::UniqueSplinePtr = typedef std::unique_ptr< Spline >

◆ UniqueTrajectoryPtr

using aikido::trajectory::UniqueTrajectoryPtr = typedef std::unique_ptr< Trajectory >

◆ WeakBSplinePtr

using aikido::trajectory::WeakBSplinePtr = typedef std::weak_ptr< BSpline >

◆ WeakConstBSplinePtr

using aikido::trajectory::WeakConstBSplinePtr = typedef std::weak_ptr< const BSpline >

◆ WeakConstInterpolatedPtr

using aikido::trajectory::WeakConstInterpolatedPtr = typedef std::weak_ptr< const Interpolated >

◆ WeakConstSplinePtr

using aikido::trajectory::WeakConstSplinePtr = typedef std::weak_ptr< const Spline >

◆ WeakConstTrajectoryPtr

using aikido::trajectory::WeakConstTrajectoryPtr = typedef std::weak_ptr< const Trajectory >

◆ WeakInterpolatedPtr

using aikido::trajectory::WeakInterpolatedPtr = typedef std::weak_ptr< Interpolated >

◆ WeakSplinePtr

using aikido::trajectory::WeakSplinePtr = typedef std::weak_ptr< Spline >

◆ WeakTrajectoryPtr

using aikido::trajectory::WeakTrajectoryPtr = typedef std::weak_ptr< Trajectory >

Function Documentation

◆ concatenate()

UniqueInterpolatedPtr aikido::trajectory::concatenate ( const Interpolated traj1,
const Interpolated traj2 
)

Concatenates two interpolated trajectories.

This function concatenates two interpolated trajectories into one interpolated trajectory. The start state of the last segment in the first trajectory is connected with the start of the first segment in the second trajectory in concatenation. For example, concatenating trajectory a: [wp1(t=1), wp2(t=2.1), wp3(t=4)] and trajectory b: [wp4(t=2), wp5(t=7)] gets a new trajectory: [wp1(t=1), wp2(t=2.1), wp4(t=4), wp5(t=9)]. It gaurantees that the new duration is the sum of the durations of the two. wp3' is dervied by merging wp3 and wp4, which connects the start of wp3 and the end of wp4. The state spaces of two trajectories should be the same.

Parameters
[in]traj1The first half interpolated trajectory
[in]traj2The second half interpolated trajectory
Returns
The concatenated interpolated trajectory

◆ convertToSpline()

UniqueSplinePtr aikido::trajectory::convertToSpline ( const Interpolated inputTrajectory)

Converts an interpolated trajectory to a piecewise linear spline trajectory.

This function requires the _inputTrajectory to use a GeodesicInterpolator. So the conversion exactly preserves the geometric path.

Parameters
[in]inputTrajectoryInterpolated trajectory
Returns
A spline trajectory

◆ createPartialTrajectory()

UniqueSplinePtr aikido::trajectory::createPartialTrajectory ( const Spline traj,
double  partialStartTime 
)

Retrieves part of a given spline trajectory.

Given a spline trajectory traj between [startTime, endTime] and a time point partialStartTime, such that startTime <= partialStartTime <= endTime, retrieves the part of traj between partialStartTime and endTime. The retrieved spline is shifted in time to begin at startTime instead of at partialStartTime.

Parameters
[in]trajOriginal spline trajectory
[in]partialStartTimeStart time of the new trajectory
Exceptions
IfpartialStartTime is not in the interval defined by the trajectory start time and end time.
Returns
The new partial trajectory

◆ findTimeOfClosestStateOnTrajectory()

double aikido::trajectory::findTimeOfClosestStateOnTrajectory ( const Trajectory traj,
const statespace::StateSpace::State referenceState,
double &  distance,
double  timeStep = 0.01 
)

Finds the time of the closest state on a trajectory to a given state.

This function checks discrete states on [t0, t1, ..., tn] where t0 and tn are the start time and end time of the trajectory, respectively. The two endpoints are always included in the check. If two states are equidistant to the reference state, then the first one along the time-dimension will be returned.

Parameters
[in]trajInput trajectory
[in]referenceStateReference state
[out]distanceDistance to the closest state
[in]timeStepTime step in finding the closest state
Returns
The time of the closest state on the input trajectory

◆ toR1JointTrajectory()

UniqueInterpolatedPtr aikido::trajectory::toR1JointTrajectory ( const Interpolated trajectory)

Converts an interpolated trajectory from a Cartesian product space of SO(2) and R1 joints to a Cartesian product space of strictly R1 joints.

Parameters
[in]trajectoryTrajectory to be converted.
Returns
Converted trajectory.