5 Struct TRAJECTORY
gullradriel edited this page 2026-10-09 00:55:18 +02:00

TRAJECTORY

Module: TRAJECTORY: cubic Hermite spline dead reckoning and movement simulation for 2D/3D

structure holding all data for trajectory interpolation / extrapolation

#include "n_trajectory.h"

Public Attributes

Name
double start_time
timestamp of start state
PHYSICS start
state at trajectory start (initial known state)
TRAJECTORY_POINT * points
array of waypoints for multi-point paths (NULL if single segment)
int nb_points_allocated
allocated capacity of the points array
int nb_points
number of waypoints in the points array
int nb_components
number of components to process: TRAJECTORY_2D (2) or TRAJECTORY_3D (3)
int mode
current computation mode: TRAJECTORY_INTERP, TRAJECTORY_EXTRAP, or TRAJECTORY_BEFORE
VECTOR3D m1_orient
Hermite tangent at end for orientation (end.angular_speed * duration).
VECTOR3D m1
Hermite tangent at end for position (end.speed * duration).
VECTOR3D m0_orient
Hermite tangent at start for orientation (start.angular_speed * duration).
VECTOR3D m0
Hermite tangent at start for position (start.speed * duration).
double end_time
timestamp of end state
PHYSICS end
state at trajectory end (terminal known state)
double duration
duration = end_time - start_time
double current_time
last computed time
int current_segment
index of the currently loaded segment (points[i] -> points[i+1]), -1 if none
PHYSICS current
current computed state at current_time

Public Attributes Documentation

variable start_time

double start_time;

timestamp of start state

variable start

PHYSICS start;

state at trajectory start (initial known state)

variable points

TRAJECTORY_POINT * points;

array of waypoints for multi-point paths (NULL if single segment)

variable nb_points_allocated

int nb_points_allocated;

allocated capacity of the points array

variable nb_points

int nb_points;

number of waypoints in the points array

variable nb_components

int nb_components;

number of components to process: TRAJECTORY_2D (2) or TRAJECTORY_3D (3)

variable mode

int mode;

current computation mode: TRAJECTORY_INTERP, TRAJECTORY_EXTRAP, or TRAJECTORY_BEFORE

variable m1_orient

VECTOR3D m1_orient;

Hermite tangent at end for orientation (end.angular_speed * duration).

variable m1

VECTOR3D m1;

Hermite tangent at end for position (end.speed * duration).

variable m0_orient

VECTOR3D m0_orient;

Hermite tangent at start for orientation (start.angular_speed * duration).

variable m0

VECTOR3D m0;

Hermite tangent at start for position (start.speed * duration).

variable end_time

double end_time;

timestamp of end state

variable end

PHYSICS end;

state at trajectory end (terminal known state)

variable duration

double duration;

duration = end_time - start_time

variable current_time

double current_time;

last computed time

variable current_segment

int current_segment;

index of the currently loaded segment (points[i] -> points[i+1]), -1 if none

variable current

PHYSICS current;

current computed state at current_time