Struct SmootherCostFunction
Defined in File smoother_cost_function.hpp
Struct Documentation
Cost function for path smoothing with multiple terms including curvature, smoothness, distance from original and obstacle avoidance.
Public Functions
A constructor for nav2_constrained_smoother::SmootherCostFunction.
- Parameters:
original_path – Original position of the path node
next_to_last_length_ratio – Ratio of next path segment compared to previous. Negative if one of them represents reversing motion.
reversing – Whether the path segment after this node represents reversing motion.
costmap – A costmap to get values for collision and obstacle avoidance
params – Optimization weights and parameters
costmap_weight – Costmap cost weight. Can be params.costmap_weight or params.cusp_costmap_weight
Smoother cost function evaluation.
- Parameters:
pt – X, Y coords of current point
pt_next – X, Y coords of next point
pt_prev – X, Y coords of previous point
pt_residual – array of output residuals (smoothing, curvature, distance, cost)
- Returns:
if successful in computing values
Protected Functions
Cost function term for smooth paths.
- Parameters:
weight – Weight to apply to function
pt – Point Xi for evaluation
pt_next – Point Xi+1 for calculating Xi’s cost
pt_prev – Point Xi-1 for calculating Xi’s cost
r – Residual (cost) of term
Cost function term for maximum curved paths.
- Parameters:
weight – Weight to apply to function
pt – Point Xi for evaluation
pt_next – Point Xi+1 for calculating Xi’s cost
pt_prev – Point Xi-1 for calculating Xi’s cost
curvature_params – A struct to cache computations for the jacobian to use
r – Residual (cost) of term
Cost function derivative term for steering away changes in pose.
- Parameters:
weight – Weight to apply to function
xi – Point Xi for evaluation
xi_original – original point Xi for evaluation
r – Residual (cost) of term
Cost function term for steering away from costs.
- Parameters:
weight – Weight to apply to function
value – Point Xi’s cost’
params – computed values to reduce overhead
r – Residual (cost) of term
Protected Attributes