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, unsigned int> NodeHeuristicPair;
37 float minimum_turning_radius;
38 float non_straight_penalty;
40 float reverse_penalty;
42 float retrospective_penalty;
43 float rotation_penalty;
44 float analytic_expansion_ratio;
45 float analytic_expansion_max_length;
46 std::string lattice_filepath;
47 bool cache_obstacle_heuristic;
48 bool allow_reverse_expansion;
70 void get(std::shared_ptr<rclcpp_lifecycle::LifecycleNode> node,
const std::string & name)
72 std::string local_name = name + std::string(
".smoother.");
75 nav2_util::declare_parameter_if_not_declared(
76 node, local_name +
"tolerance", rclcpp::ParameterValue(1e-10));
77 node->get_parameter(local_name +
"tolerance", tolerance_);
78 nav2_util::declare_parameter_if_not_declared(
79 node, local_name +
"max_iterations", rclcpp::ParameterValue(1000));
80 node->get_parameter(local_name +
"max_iterations", max_its_);
81 nav2_util::declare_parameter_if_not_declared(
82 node, local_name +
"w_data", rclcpp::ParameterValue(0.2));
83 node->get_parameter(local_name +
"w_data", w_data_);
84 nav2_util::declare_parameter_if_not_declared(
85 node, local_name +
"w_smooth", rclcpp::ParameterValue(0.3));
86 node->get_parameter(local_name +
"w_smooth", w_smooth_);
87 nav2_util::declare_parameter_if_not_declared(
88 node, local_name +
"do_refinement", rclcpp::ParameterValue(
true));
89 node->get_parameter(local_name +
"do_refinement", do_refinement_);
117 MotionPose(
const float & x,
const float & y,
const float & theta)
118 : _x(x), _y(y), _theta(theta)
123 return MotionPose(this->_x - p2._x, this->_y - p2._y, this->_theta - p2._theta);
131 typedef std::vector<MotionPose> MotionPoses;
139 float min_turning_radius;
140 float grid_resolution;
141 unsigned int number_of_headings;
142 std::vector<float> heading_angles;
143 unsigned int number_of_trajectories;
144 std::string motion_model;
153 unsigned int trajectory_id;
156 float turning_radius;
157 float trajectory_length;
159 float straight_length;
164 typedef std::vector<MotionPrimitive> MotionPrimitives;
165 typedef std::vector<MotionPrimitive *> MotionPrimitivePtrs;
A struct for poses in motion primitives.
MotionPose(const float &x, const float &y, const float &theta)
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.