|
trajectory_optimization v1.3.1
|
#include <trajectory_optimization_rws.hpp>
Public Member Functions | |
| TrajectoryOptimizationRWSNode (const rclcpp::NodeOptions &options) | |
| Initializes the optimization node for a kinematic bicycle model with rear wheel steering. | |
Public Member Functions inherited from trajectory_optimization::TrajectoryOptimizationNode | |
| TrajectoryOptimizationNode (const std::string node_name, const rclcpp::NodeOptions &options) | |
| Initializes the base node and loads the common optimizer configuration. | |
| ~TrajectoryOptimizationNode () override | |
| Releases solver resources owned by the node. | |
| TrajectoryOptimizationNode (const TrajectoryOptimizationNode &)=delete | |
| Copy construction is disabled because the node owns non-copyable runtime resources. | |
| TrajectoryOptimizationNode & | operator= (const TrajectoryOptimizationNode &)=delete |
| Copy assignment is disabled because the node owns non-copyable runtime resources. | |
| TrajectoryOptimizationNode (TrajectoryOptimizationNode &&)=delete | |
| Move construction is disabled to keep solver and ROS handles bound to a single instance. | |
| TrajectoryOptimizationNode & | operator= (TrajectoryOptimizationNode &&)=delete |
| Move assignment is disabled to keep solver and ROS handles bound to a single instance. | |
Private Member Functions | |
| void | initializeTrajectory (trajectory_planning_msgs::msg::Trajectory &trajectory) override |
| Initializes a drivable trajectory message for a kinematic bicycle model with rear wheel steering. | |
| std::vector< double > | getBiLevelX0 (const perception_msgs::msg::EgoData &ego_data) override |
| Computes the initial optimizer state using bi-level stabilizaion. | |
| std::vector< double > | getHighLevelX0 (const perception_msgs::msg::EgoData &ego_data) override |
| Computes the initial optimizer state using high-level stabilization. | |
| void | convertToTrajectoryMsg (trajectory_planning_msgs::msg::Trajectory &trajectory) override |
| Maps the optimized state trajectory into a trajectory message for a kinematic bicycle model with rear wheel steering. | |
| double | computeVehicleSlipAngle (const double &delta_front, const double &delta_rear) const |
| Computes the kinematic vehicle slip angle from front and rear steering angles. | |
Static Private Member Functions | |
| static double | projectVectorAonV (const geometry_msgs::msg::Vector3 &a, const geometry_msgs::msg::Vector3 &v) |
| Projects the acceleration vector onto the current direction of motion. | |
Private Attributes | |
| double | distance_front_axle_ = 1.7 |
| double | distance_rear_axle_ = 1.7 |
| double | bi_level_dDelta_front_ = 5.0 |
| double | bi_level_dDelta_rear_ = 5.0 |
Additional Inherited Members | |
Protected Types inherited from trajectory_optimization::TrajectoryOptimizationNode | |
| enum | CONSIDER_BOUNDARIES { NO_BOUNDS = 0 , SUGGESTED_LANE = 1 , INCLUDING_ADJACENT = 2 , DRIVABLE_SPACE = 3 } |
| enum | CONSIDER_OBJECTS { NO_OBJECTS = 0 , STATIC_OBJECTS = 1 , PREDICTED_OBJECTS = 2 } |
Protected Member Functions inherited from trajectory_optimization::TrajectoryOptimizationNode | |
| template<typename T > | |
| void | declareAndLoadParameter (const std::string &name, T ¶m, const std::string &description, const bool add_to_auto_reconfigurable_params=true, const bool is_required=false, const bool read_only=false, const std::optional< double > &from_value=std::nullopt, const std::optional< double > &to_value=std::nullopt, const std::optional< double > &step_value=std::nullopt, const std::string &additional_constraints="") |
| Declares a ROS parameter, loads its value and optionally registers it for runtime updates. | |
| rcl_interfaces::msg::SetParametersResult | parametersCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Applies parameter updates that can be reconfigured while the node is running. | |
| void | setup () |
| Creates ROS interfaces, initializes cached messages and prepares the solver. | |
| void | resetSolver () |
| Resets the optimizer memory while retaining the generated solver instance. | |
| bool | setInitialGuess (const std::vector< double > &x_init, const rclcpp::Time &stamp) |
| Builds and sets a dynamically consistent NLP initial guess from the current state and cached controls. | |
| void | setupSolver () |
| Creates the acados solver instance and initializes its state buffers. | |
| void | freeSolver () |
| Frees the acados solver and clears cached optimization results. | |
| void | printSolution (const PerformanceMetrics &metrics) |
| Logs solver status and optional debug statistics for the last optimization run. | |
| void | logPerformance (const PerformanceMetrics &metrics) |
| Emits one machine-readable performance record when performance logging is enabled. | |
| bool | trajectory2outputFrame (trajectory_planning_msgs::msg::Trajectory &trajectory) |
| Transforms the planned trajectory into the configured output frame (trajectory_frame_id_) if required. | |
| bool | linearInterpolation (const std::vector< double > &X, const std::vector< double > &Y, const double &desired_x, double &output_y, const bool wrap_angle=false) |
| Interpolates a value from sampled data and optionally handles angle wrap-around. | |
| void | egoDataCallback (const perception_msgs::msg::EgoData::ConstSharedPtr msg) |
| Stores the latest ego state used by the optimizer. | |
| void | objectListCallback (const perception_msgs::msg::ObjectList::ConstSharedPtr msg) |
| Stores the current object list when object handling is enabled. | |
| void | referenceTrajectoryCallback (const trajectory_planning_msgs::msg::Trajectory::ConstSharedPtr msg) |
| Updates the reference trajectory and optionally triggers optimization immediately. | |
| void | routeCallback (const route_planning_msgs::msg::Route::ConstSharedPtr msg) |
| Stores the current route used for boundary constraints when enabled. | |
| void | planningCycle () |
| Runs one full planning cycle from input preparation, over solver execution, to trajectory publication. | |
| bool | updateOcpInputs (const perception_msgs::msg::EgoData &ego_data, const perception_msgs::msg::ObjectList &object_list, const route_planning_msgs::msg::Route &route, const trajectory_planning_msgs::msg::Trajectory &reference_trajectory, const std::vector< double > &x_init) |
| Transforms external inputs into the optimizer frame and writes them into the OCP. | |
| void | setOcpGlobalParameters (const std::vector< double > &cost_weights, const trajectory_planning_msgs::msg::Trajectory &reference_trajectory, const route_planning_msgs::msg::Route &route) |
| Writes stage-independent data into the OCP. | |
| void | setOcpParameters (const perception_msgs::msg::EgoData &ego_data, const perception_msgs::msg::ObjectList &object_list) |
| Writes stage-wise obstacle and dynamic weighting parameters into the OCP. | |
| std::vector< std::pair< double, double > > | normalBoundaryDistance (const trajectory_planning_msgs::msg::Trajectory &reference_trajectory, const route_planning_msgs::msg::Route &route) |
| Computes minimum normal distances from the reference path to the active route boundaries. | |
| std::vector< double > | discretizeBB2Circles (const double x, const double y, const double yaw, const double length, const double width) |
| Approximates an oriented bounding box with a set of obstacle circles. | |
| void | vizCircles (const std::vector< double > &obstacles) |
| Publishes visualization markers for the obstacle circles currently used by the optimizer. | |
| void | vizEgoCircles (const std::vector< double > &x_trajectory, const std::string &model_name) |
| Publishes the ego-vehicle circle approximation used by the selected OCP model. | |
| void | vizBoundaryPoints (const std::vector< Eigen::Vector2d > &left_boundary_points, const std::vector< Eigen::Vector2d > &right_boundary_points) |
| Publishes the boundary intersections corresponding to the distances passed to the OCP. | |
Static Protected Member Functions inherited from trajectory_optimization::TrajectoryOptimizationNode | |
| static double | wrap_angle_rad (double angle_rad, double min_val=-M_PI, double max_val=M_PI) |
| Wraps an angle into a configured interval. | |
| static void | keepNClosestObjects (perception_msgs::msg::ObjectList &object_list, const int n_objects) |
| Keeps the nearest forward objects and discards the remaining entries. | |
Protected Attributes inherited from trajectory_optimization::TrajectoryOptimizationNode | |
| OnSetParametersCallbackHandle::SharedPtr | parameters_callback_ |
| rclcpp::Subscription< perception_msgs::msg::EgoData >::SharedPtr | ego_data_sub_ |
| rclcpp::Subscription< perception_msgs::msg::ObjectList >::SharedPtr | object_list_sub_ |
| rclcpp::Subscription< route_planning_msgs::msg::Route >::SharedPtr | route_sub_ |
| rclcpp::Subscription< trajectory_planning_msgs::msg::Trajectory >::SharedPtr | reference_trajectory_sub_ |
| rclcpp::Publisher< trajectory_planning_msgs::msg::Trajectory >::SharedPtr | trajectory_pub_ |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | circles_pub_ |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | ego_circles_pub_ |
| rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr | boundary_pub_ |
| rclcpp::TimerBase::SharedPtr | planning_timer_ |
| std::unique_ptr< tf2_ros::Buffer > | tf2_buffer_ |
| std::shared_ptr< tf2_ros::TransformListener > | tf2_listener_ |
| perception_msgs::msg::EgoData | ego_data_ |
| perception_msgs::msg::ObjectList | object_list_ |
| route_planning_msgs::msg::Route | route_ |
| trajectory_planning_msgs::msg::Trajectory | reference_trajectory_ |
| std::vector< std::tuple< std::string, std::function< void(const rclcpp::Parameter &)> > > | auto_reconfigurable_params_ |
| std::string | vehicle_frame_id_ = "base_link" |
| std::string | trajectory_frame_id_ = "base_link" |
| std::string | fixed_over_time_frame_id_ = "map" |
| std::string | model_name_ = "karl" |
| double | ego_data_timeout_ = 1.0 |
| double | optimization_freq_ = 10.0 |
| int | n_shots_ = 50 |
| double | optimization_horizon_ = 1.0 |
| bool | verbose_ = false |
| bool | performance_logging_ = false |
| bool | debug_viz_ = false |
| double | standstill_threshold_ = 0.45 |
| bool | high_level_stabilization_ = false |
| bool | add_x_init_to_ref_ = false |
| uint8_t | consider_objects_ = CONSIDER_OBJECTS::PREDICTED_OBJECTS |
| uint8_t | consider_boundaries_ = CONSIDER_BOUNDARIES::SUGGESTED_LANE |
| bool | run_as_callback_ = false |
| double | bi_level_dV_ = 5.0 |
| double | bi_level_dA_ = 2.0 |
| double | bi_level_dY_ = 0.1 |
| double | bi_level_dYaw_ = 5.0 |
| trajectory_planning_msgs::msg::Trajectory | latest_valid_trajectory_ |
| std::vector< double > | control_guess_ |
| rclcpp::Time | control_guess_stamp_ {0, 0, RCL_ROS_TIME} |
| std::vector< double > | viz_circles_ |
| std::vector< double > | cost_weights_ = std::vector<double>(12, 1.0) |
| double | dynamic_weight_ = 1.0 |
| double | thw_ = 2.0 |
| double | d_min_obstacle_long_ = 5.0 |
| double | d_min_obstacle_lat_ = 0.5 |
| double | d_min_boundary_lat_ = 0.0 |
| double | min_prediction_probability_ = 0.0 |
| std::vector< int64_t > | p_cost_weights_shape_ = {12, 1} |
| std::vector< int64_t > | p_ref_path_shape_ = {51, 6} |
| std::vector< int64_t > | p_obstacle_circles_shape_ = {30, 3} |
| ocp_model_capsule_t | ocp_capsule_ |
| ocp_nlp_config * | nlp_config_ |
| ocp_nlp_dims * | nlp_dims_ |
| ocp_nlp_in * | nlp_in_ |
| ocp_nlp_out * | nlp_out_ |
| ocp_nlp_solver * | nlp_solver_ |
| void * | nlp_opts_ |
| std::vector< double > | xtraj_ |
| std::vector< double > | utraj_ |
| uint64_t | logging_cycle_ = 0 |
| std::unique_ptr< PerformanceLogger > | performance_logger_ |
Definition at line 10 of file trajectory_optimization_rws.hpp.
|
explicit |
Initializes the optimization node for a kinematic bicycle model with rear wheel steering.
| [in] | options | ROS node options used for construction. |
Definition at line 13 of file trajectory_optimization_rws.cpp.
|
private |
Computes the kinematic vehicle slip angle from front and rear steering angles.
| [in] | delta_front | Front steering angle. |
| [in] | delta_rear | Rear steering angle. |
Definition at line 134 of file trajectory_optimization_rws.cpp.
|
overrideprivatevirtual |
Maps the optimized state trajectory into a trajectory message for a kinematic bicycle model with rear wheel steering.
| [in,out] | trajectory | Trajectory message to populate. |
Implements trajectory_optimization::TrajectoryOptimizationNode.
Definition at line 119 of file trajectory_optimization_rws.cpp.
|
overrideprivatevirtual |
Computes the initial optimizer state using bi-level stabilizaion.
| [in] | ego_data | Current EgoData based on the kinematic bicycle model with rear wheel steering. |
Implements trajectory_optimization::TrajectoryOptimizationNode.
Definition at line 28 of file trajectory_optimization_rws.cpp.
|
overrideprivatevirtual |
Computes the initial optimizer state using high-level stabilization.
| [in] | ego_data | Current EgoData based on the kinematic bicycle model with rear wheel steering. |
Implements trajectory_optimization::TrajectoryOptimizationNode.
Definition at line 107 of file trajectory_optimization_rws.cpp.
|
overrideprivatevirtual |
Initializes a drivable trajectory message for a kinematic bicycle model with rear wheel steering.
| [out] | trajectory | Trajectory message to initialize. |
Implements trajectory_optimization::TrajectoryOptimizationNode.
Definition at line 23 of file trajectory_optimization_rws.cpp.
|
staticprivate |
Projects the acceleration vector onto the current direction of motion.
| [in] | a | Acceleration vector. |
| [in] | v | Velocity vector. |
Definition at line 141 of file trajectory_optimization_rws.cpp.
|
private |
Definition at line 73 of file trajectory_optimization_rws.hpp.
|
private |
Definition at line 74 of file trajectory_optimization_rws.hpp.
|
private |
Definition at line 69 of file trajectory_optimization_rws.hpp.
|
private |
Definition at line 70 of file trajectory_optimization_rws.hpp.