15 #ifndef NAV2_SMAC_PLANNER__TYPES_HPP_
16 #define NAV2_SMAC_PLANNER__TYPES_HPP_
23 #include "rclcpp_lifecycle/lifecycle_node.hpp"
24 #include "nav2_util/node_utils.hpp"
26 namespace nav2_smac_planner
29 typedef std::pair<float, uint64_t> NodeHeuristicPair;
37 float minimum_turning_radius{8.0};
38 float non_straight_penalty{1.05};
39 float change_penalty{0.0};
40 float reverse_penalty{2.0};
41 float cost_penalty{2.0};
42 float retrospective_penalty{0.015};
43 float rotation_penalty{5.0};
44 float analytic_expansion_ratio{3.5};
45 float analytic_expansion_max_length{60.0};
46 float analytic_expansion_max_cost{200.0};
47 bool analytic_expansion_max_cost_override{
false};
48 std::string lattice_filepath;
49 bool cache_obstacle_heuristic{
false};
50 bool allow_reverse_expansion{
false};
51 bool allow_primitive_interpolation{
false};
52 bool downsample_obstacle_heuristic{
true};
53 bool use_quadratic_cost_penalty{
false};
75 void get(std::shared_ptr<rclcpp_lifecycle::LifecycleNode> node,
const std::string & name)
77 std::string local_name = name + std::string(
".smoother.");
80 nav2_util::declare_parameter_if_not_declared(
81 node, local_name +
"tolerance", rclcpp::ParameterValue(1e-10));
82 node->get_parameter(local_name +
"tolerance", tolerance_);
83 nav2_util::declare_parameter_if_not_declared(
84 node, local_name +
"max_iterations", rclcpp::ParameterValue(1000));
85 node->get_parameter(local_name +
"max_iterations", max_its_);
86 nav2_util::declare_parameter_if_not_declared(
87 node, local_name +
"w_data", rclcpp::ParameterValue(0.2));
88 node->get_parameter(local_name +
"w_data", w_data_);
89 nav2_util::declare_parameter_if_not_declared(
90 node, local_name +
"w_smooth", rclcpp::ParameterValue(0.3));
91 node->get_parameter(local_name +
"w_smooth", w_smooth_);
92 nav2_util::declare_parameter_if_not_declared(
93 node, local_name +
"do_refinement", rclcpp::ParameterValue(
true));
94 node->get_parameter(local_name +
"do_refinement", do_refinement_);
95 nav2_util::declare_parameter_if_not_declared(
96 node, local_name +
"refinement_num", rclcpp::ParameterValue(2));
97 node->get_parameter(local_name +
"refinement_num", refinement_num_);
142 MotionPose(
const float & x,
const float & y,
const float & theta,
const TurnDirection & turn_dir)
143 : _x(x), _y(y), _theta(theta), _turn_dir(turn_dir)
149 this->_x - p2._x, this->_y - p2._y, this->_theta - p2._theta, TurnDirection::UNKNOWN);
158 typedef std::vector<MotionPose> MotionPoses;
166 float min_turning_radius;
167 float grid_resolution;
168 unsigned int number_of_headings;
169 std::vector<float> heading_angles;
170 unsigned int number_of_trajectories;
171 std::string motion_model;
180 unsigned int trajectory_id;
183 float turning_radius;
184 float trajectory_length;
186 float straight_length;
191 typedef std::vector<MotionPrimitive> MotionPrimitives;
192 typedef std::vector<MotionPrimitive *> MotionPrimitivePtrs;
A struct for poses in motion primitives.
MotionPose(const float &x, const float &y, const float &theta, const TurnDirection &turn_dir)
A constructor for nav2_smac_planner::MotionPose.
MotionPose()
A constructor for nav2_smac_planner::MotionPose.
A struct of all motion primitive data.
Search properties and penalties.
Parameters for the smoother cost function.
void get(std::shared_ptr< rclcpp_lifecycle::LifecycleNode > node, const std::string &name)
Get params from ROS parameter.
SmootherParams()
A constructor for nav2_smac_planner::SmootherParams.
A struct with the motion primitive's direction embedded.