Reference: Trajectory
A trajectory is a path between a set of configuration space points. It performs smoothing and filtering on this path.
A trajectory holds waypoints of different pieces of data and their corresponding interpolation method. A waypoint can specify robot joints, timestamps, body transformations, events, etc. Subclasses of trajectories have differnet way of executing and interpolating the waypoints. A trajectory is just the executor, it is not responsible for re-timing and re-adjusting its path, which is a planner’s job. A trajectory cannot be executed without timestamps being present.
Every trajectory has a ConfigurationSpecification that defines what is stored in each point. This allows points to hold any type of custom information and to synchronize better with the configuration spaces of the planners. Use the Trajectory.GetConfigurationSpecification() to get the details of what data is in the trajectory and its dimensions.
Every point should have a deltatime value that specifies the time it takes to go to it given the previous point, and velocity information for each data point. The first point’s deltatime should be 0. In order to playback a set of waypoints within the robot’s velocity and acceleration limits, use the planningutils.RetimeActiveDOFTrajectory() or planningutils.RetimeAffineTrajectory(). If your configuraiton already has time data, but not velocities, you can specify hastimestamps=True to the parameters.
The file format for exporting the trajectory is in XML:
<trajectory type="string">
<configuration>
<group name="string" offset="#OFF1" dof="#D1" interpolation="string"/>
<group name="string" offset="#OFF2" dof="#D2" interpolation="string"/>
</configuration>
<data count="#N">
1 2 3 4 5
</data>
<readable>
<usercustomclasses/>
</readable>
<description>My trajectory
</description>
</trajectory>
First tags specified. The configuration describes one type of data inside the trajectory and how it is stored and processed. See ConfigurationSpecification for details on the individual attributes. In trajectories a group name=”deltatime” should be present if the trajectory is to be executed. The deltatime values always need to be positive.
The raw data of the trajectory, there is count x dof values. Multiple data tags can be present
attributes: