1 #ifndef POLY_TRAJECTORY_FACTORY_H
2 #define POLY_TRAJECTORY_FACTORY_H
8 #include <bb_controls_msgs/action/locomotion.hpp>
9 #include <bb_controls_msgs/srv/spline_traj.hpp>
27 using Request = bb_controls_msgs::srv::SplineTraj::Request;
47 std::shared_ptr<Trajectory6DOFLimits> limits);
81 std::unique_ptr<TrajectoryBase>
build()
override;
85 std::shared_ptr<Trajectory6DOFLimits> limits_;
86 std::vector<Pose> raw_goals_;
87 double origin_twist_norm_threshold_ = 0.03;
88 bool relative_xy_ =
false;
89 bool relative_z_ =
false;
90 bool relative_heading_ =
false;
91 bool interpolate_heading_ =
false;
92 bool needs_angle_unwrapping_ =
true;
93 std::string frame_id_ =
"world_ned";
94 bool is_valid_ =
true;
101 std::vector<Pose> compute_absolute_goals()
const;
110 std::vector<Pose> add_heading_interpolation(
const std::vector<Pose>& goals)
const;
Factory that builds polynomial waypoint-following trajectories.
Definition: PolyTrajectoryFactory.h:25
bb_controls_msgs::srv::SplineTraj::Request Request
Definition: PolyTrajectoryFactory.h:27
PolyTrajectoryFactory & with_frame_id(const std::string &frame_id)
Sets the TF world frame ID embedded in visualisation messages.
Definition: PolyTrajectoryFactory.cpp:109
bb_controls_msgs::action::Locomotion Locomotion
Definition: PolyTrajectoryFactory.h:28
PolyTrajectoryFactory & with_angle_unwrapping(bool needs_angle_unwrapping=true)
Controls whether yaw angles are unwrapped across consecutive waypoints.
Definition: PolyTrajectoryFactory.cpp:114
PolyTrajectoryFactory & with_origin_twist_threshold(double max_norm)
Sets the origin twist norm threshold below which the initial twist is zeroed.
Definition: PolyTrajectoryFactory.cpp:104
std::unique_ptr< TrajectoryBase > build() override
Builds and returns the configured trajectory.
Definition: PolyTrajectoryFactory.cpp:119
PolyTrajectoryFactory(const Request &req, const State &origin, std::shared_ptr< Trajectory6DOFLimits > limits)
Constructs the factory from a SplineTraj service request.
Definition: PolyTrajectoryFactory.cpp:10
Abstract factory interface for constructing TrajectoryBase instances.
Definition: TrajectoryFactoryInterface.h:15
Full kinematic state of the vehicle.
Definition: Types.h:63