Motion Planning#

class Trajectory
std::string id

Field for identifying trajectories (for the user).

std::string motion

Name of the motion this trajectory was planned for.

double duration

The trajectory duration in [s].

std::vector<double> times

The exact time stamps for the position, velocity, and acceleration values. The times will usually be sampled at the delta_time distance of the Planner class, but might deviate at the final step.

std::vector<Config> positions

The joint positions along the trajectory.

std::vector<Config> velocities

The joint velocities along the trajectory.

std::vector<Config> accelerations

The joint accelerations along the trajectory.

Trajectory reverse() const

Reverse the trajectory’s start and goal.

void append(const Trajectory &other)

Appends another trajectory to the current one.

Trajectory slice(size_t start, size_t steps) const

Get a slice of the trajectory starting from step start for a length of steps.

std::vector<Config> filter_path(const Config &max_distance)

Filter a path of sparse waypoints from the trajectory.

The path has a maximum distance per degree of freedom between the linear interpolation of the sparse waypoints and the original trajectory.

static Trajectory from_json_file(const std::filesystem::path &file)

Loads a trajectory from a *.json file.

void to_json_file(const std::filesystem::path &file)

Saves a trajectory to a *.json file.

size_t size()

The number of time steps within the trajectory.

std::string as_table() const

To pretty print the trajectory as a table of positions.

class Planner
double delta_time

The time step for sampling the trajectories from the planner in [s]. Usually, this should correspond to the control rate of the robot.

double last_calculation_duration

The duration of the last motion planning calculation in [ms].

Planner(std::shared_ptr<Environment> environment, double delta_time)

Constructs a planner for the given environment.

Planner(std::shared_ptr<Robot> robot, double delta_time)

Constructs a planner for the given robot and an empty environment.

Planner(const std::string &project, double delta_time)

Cloud version: Constructs a planner with the environment defined in the given Jacobi Studio project.

static std::shared_ptr<Planner> load_from_project_file(const std::filesystem::path &file)

On-prem version: Loads a planner from a *.jacobi-project file.

void add_motion(const Motion<Robot> &motion)
void add_motions(const std::vector<Motion<Robot>> &motions)
void load_motion_plan(const std::filesystem::path &file)

On-prem version: Loads a motion plan from the *.jacobi-plan file.

std::optional<Trajectory> plan(const ExactPoint &start, const ExactPoint &goal)

Plans a time-optimized, collision-free, and jerk-limited motion from start to goal.

std::optional<Trajectory> plan(const std::string &motion_name, const std::optional<ExactPoint> &start, const std::optional<ExactPoint> &goal)

Plans a time-optimized, collision-free, and jerk-limited motion given the motion name. In case the motion was specified by a start or goal region, the respective exact start or goal positions needs to be passed.

std::optional<Trajectory> plan(const Motion &motion)

Plans a collision-free point-to-point motion.

std::optional<Trajectory> plan(const LinearMotion &motion)

Plans a linear motion.

std::optional<Trajectory> plan(const LowLevelMotion &motion)

Plans a low-level motion.