Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct HybridMotionTable
*/
MotionPoses getProjections(const NodeHybrid * node);

MotionModel motion_model = MotionModel::UNKNOWN;
MotionPoses projections;
unsigned int size_x;
unsigned int num_angle_quantization;
Expand Down
17 changes: 8 additions & 9 deletions nav2_smac_planner/src/node_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ void HybridMotionTable::initDubin(

// if nothing changed, no need to re-compute primitives
if (num_angle_quantization_in == num_angle_quantization &&
min_turning_radius == search_info.minimum_turning_radius)
min_turning_radius == search_info.minimum_turning_radius &&
motion_model == MotionModel::DUBIN)
{
return;
}

num_angle_quantization = num_angle_quantization_in;
num_angle_quantization_float = static_cast<float>(num_angle_quantization);
min_turning_radius = search_info.minimum_turning_radius;
motion_model = MotionModel::DUBIN;

// angle must meet 3 requirements:
// 1) be increment of quantized bin size
Expand Down Expand Up @@ -115,9 +117,7 @@ void HybridMotionTable::initDubin(
projections.emplace_back(delta_x, -delta_y, -increments); // Right

// Create the correct OMPL state space
Comment thread
SteveMacenski marked this conversation as resolved.
if (!state_space) {
state_space = std::make_unique<ompl::base::DubinsStateSpace>(min_turning_radius);
}
state_space = std::make_unique<ompl::base::DubinsStateSpace>(min_turning_radius);

// Precompute projection deltas
delta_xs.resize(projections.size());
Expand Down Expand Up @@ -158,14 +158,16 @@ void HybridMotionTable::initReedsShepp(

// if nothing changed, no need to re-compute primitives
if (num_angle_quantization_in == num_angle_quantization &&
min_turning_radius == search_info.minimum_turning_radius)
min_turning_radius == search_info.minimum_turning_radius &&
motion_model == MotionModel::REEDS_SHEPP)
{
return;
}

num_angle_quantization = num_angle_quantization_in;
num_angle_quantization_float = static_cast<float>(num_angle_quantization);
min_turning_radius = search_info.minimum_turning_radius;
motion_model = MotionModel::REEDS_SHEPP;

float angle = 2.0 * asin(sqrt(2.0) / (2 * min_turning_radius));
bin_size =
Expand All @@ -191,10 +193,7 @@ void HybridMotionTable::initReedsShepp(
projections.emplace_back(-delta_x, -delta_y, increments); // Backward + Right

// Create the correct OMPL state space
if (!state_space) {
state_space = std::make_unique<ompl::base::ReedsSheppStateSpace>(
min_turning_radius);
}
state_space = std::make_unique<ompl::base::ReedsSheppStateSpace>(min_turning_radius);

// Precompute projection deltas
delta_xs.resize(projections.size());
Expand Down