Brick
Loading...
Searching...
No Matches
trajectory_generator.h
1#pragma once
2
3#include <vector>
4
5#include "core/math/spline/hermite_point.h"
6#include "core/math/trajectory/trajectory.h"
7#include "core/math/trajectory/trajectory_config.h"
8#include "core/math/units.h"
9
10using namespace units::literals;
11
12/**
13 * @brief Helper utility class for generating time-parameterized constrained trajectories from
14 * waypoints.
15 */
17 public:
18 /**
19 * @brief Generates a time-parameterized Trajectory from Hermite waypoints and a
20 * TrajectoryConfig.
21 * @param waypoints Vector of Hermite boundary waypoints (positions, tangents, second
22 * derivatives).
23 * @param config Trajectory configuration containing velocity limits, accelerations, direction,
24 * and constraints.
25 * @return units::Time-parameterized Trajectory instance.
26 */
28 const std::vector<HermitePoint>& waypoints, const TrajectoryConfig& config
29 );
30
31 /**
32 * @brief Generates a time-parameterized Trajectory from simple Pose2d waypoints.
33 * Internal heuristics are used to compute optimal spline tangency (speed).
34 * @param tangent_scale Scale factor applied to heuristic tangent magnitudes.
35 */
37 const std::vector<Pose2d>& waypoints, const TrajectoryConfig& config,
38 double tangent_scale = 1.2
39 );
40
41 /**
42 * @brief Splicing helper for On-The-Fly Replanning.
43 * Generates a new path starting precisely at current_pose, maintaining the
44 * units::momentum of current_velocity, and routing to the target_waypoints.
45 * @param current_pose The robot's current instantaneous position and heading.
46 * @param current_velocity The robot's current forward speed.
47 * @param target_waypoints The remaining destinations.
48 * @param config The base config. start_velocity will be overwritten to match current_velocity.
49 * @param tangent_scale Fudge factor applied to tangent magnitudes.
50 */
52 const Pose2d& current_pose, units::Velocity current_velocity,
53 const std::vector<Pose2d>& target_waypoints, TrajectoryConfig config,
54 double tangent_scale = 1.2
55 );
56
57 static const Trajectory kDoNothingTrajectory;
58};
Definition pose2d.h:21
Definition trajectory_config.h:26
Helper utility class for generating time-parameterized constrained trajectories from waypoints.
Definition trajectory_generator.h:16
static Trajectory generate_trajectory(const Pose2d &current_pose, units::Velocity current_velocity, const std::vector< Pose2d > &target_waypoints, TrajectoryConfig config, double tangent_scale=1.2)
Splicing helper for On-The-Fly Replanning. Generates a new path starting precisely at current_pose,...
static Trajectory generate_trajectory(const std::vector< HermitePoint > &waypoints, const TrajectoryConfig &config)
Generates a time-parameterized Trajectory from Hermite waypoints and a TrajectoryConfig.
static Trajectory generate_trajectory(const std::vector< Pose2d > &waypoints, const TrajectoryConfig &config, double tangent_scale=1.2)
Generates a time-parameterized Trajectory from simple Pose2d waypoints. Internal heuristics are used ...
Represents a time-parameterized 2D motion trajectory.
Definition trajectory.h:37
Definition units.h:691