Skip to content

Commit 3d1dc83

Browse files
authored
Merge pull request #82 from amock/cost-aware-planning
Cost-aware planning
2 parents ae5be64 + bd30e75 commit 3d1dc83

21 files changed

+277
-292
lines changed

cvp_mesh_planner/src/cvp_mesh_planner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& start, con
230230
std::list<std::pair<mesh_map::Vector, lvr2::FaceHandle>>& path,
231231
std::string& message)
232232
{
233-
return waveFrontPropagation(start, goal, mesh_map_->edgeDistances(), mesh_map_->vertexCosts(), path, message,
233+
return waveFrontPropagation(start, goal, mesh_map_->edgeWeights(), mesh_map_->vertexCosts(), path, message,
234234
potential_, predecessors_);
235235
}
236236

@@ -633,7 +633,7 @@ inline bool CVPMeshPlanner::waveFrontUpdateFMM(
633633
}
634634
}
635635

636-
return false;
636+
return false;
637637
}
638638

639639
uint32_t CVPMeshPlanner::waveFrontPropagation(const mesh_map::Vector& original_start,

dijkstra_mesh_planner/src/dijkstra_mesh_planner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void DijkstraMeshPlanner::computeVectorMap()
198198
uint32_t DijkstraMeshPlanner::dijkstra(const mesh_map::Vector& start, const mesh_map::Vector& goal,
199199
std::list<lvr2::VertexHandle>& path)
200200
{
201-
return dijkstra(start, goal, mesh_map_->edgeDistances(), mesh_map_->vertexCosts(), path, potential_, predecessors_);
201+
return dijkstra(start, goal, mesh_map_->edgeWeights(), mesh_map_->vertexCosts(), path, potential_, predecessors_);
202202
}
203203

204204
uint32_t DijkstraMeshPlanner::dijkstra(const mesh_map::Vector& original_start, const mesh_map::Vector& original_goal,

mesh_layers/include/mesh_layers/border_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class BorderLayer : public mesh_map::AbstractLayer
139139
struct {
140140
double threshold = 0.5;
141141
double border_cost = 1.0;
142-
double factor = 1.0;
143142
} config_;
144143
};
145144

mesh_layers/include/mesh_layers/clearance_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class ClearanceLayer : public mesh_map::AbstractLayer
142142
struct {
143143
double robot_height = 0.5;
144144
double height_inflation = 0.3;
145-
double factor = 1.0;
146145
} config_;
147146
};
148147

mesh_layers/include/mesh_layers/height_diff_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class HeightDiffLayer : public mesh_map::AbstractLayer
139139
struct {
140140
double threshold = 0.185;
141141
double radius = 0.3;
142-
double factor = 1.0;
143142
} config_;
144143
};
145144

mesh_layers/include/mesh_layers/inflation_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ class InflationLayer : public mesh_map::AbstractLayer
227227
struct {
228228
double inscribed_radius = 0.25;
229229
double inflation_radius = 0.4;
230-
double factor = 1.0;
231230
double lethal_value = 1.0;
232231
double inscribed_value = 0.99;
233232
double cost_scaling_factor = 1.0;

mesh_layers/include/mesh_layers/ridge_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class RidgeLayer : public mesh_map::AbstractLayer
142142
struct {
143143
double threshold = 0.3;
144144
double radius = 0.3;
145-
double factor = 1.0;
146145
} config_;
147146
};
148147

mesh_layers/include/mesh_layers/roughness_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class RoughnessLayer : public mesh_map::AbstractLayer
140140
struct {
141141
double threshold = 0.3;
142142
double radius = 0.3;
143-
double factor = 1.0;
144143
} config_;
145144
};
146145

mesh_layers/include/mesh_layers/steepness_layer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ class SteepnessLayer : public mesh_map::AbstractLayer
138138
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr dyn_params_handler_;
139139
struct {
140140
double threshold = 0.3;
141-
double factor = 1.0;
142141
} config_;
143142

144143
};

mesh_layers/src/border_layer.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ rcl_interfaces::msg::SetParametersResult BorderLayer::reconfigureCallback(std::v
127127
config_.border_cost = parameter.as_double();
128128
recompute_costs = true;
129129
recompute_lethals = true;
130-
} else if (parameter.get_name() == mesh_map::MeshMap::MESH_MAP_NAMESPACE + "." + layer_name_ + ".factor") {
131-
config_.factor = parameter.as_double();
132130
}
133131
}
134132

@@ -175,16 +173,6 @@ bool BorderLayer::initialize()
175173
descriptor.floating_point_range.push_back(range);
176174
config_.border_cost = node_->declare_parameter(mesh_map::MeshMap::MESH_MAP_NAMESPACE + "." + layer_name_ + ".border_cost", config_.border_cost, descriptor);
177175
}
178-
{ // factor
179-
rcl_interfaces::msg::ParameterDescriptor descriptor;
180-
descriptor.description = "Using this factor to weight this layer.";
181-
descriptor.type = rcl_interfaces::msg::ParameterType::PARAMETER_DOUBLE;
182-
rcl_interfaces::msg::FloatingPointRange range;
183-
range.from_value = 0.0;
184-
range.to_value = 1.0;
185-
descriptor.floating_point_range.push_back(range);
186-
config_.factor = node_->declare_parameter(mesh_map::MeshMap::MESH_MAP_NAMESPACE + "." + layer_name_ + ".factor", config_.factor, descriptor);
187-
}
188176
dyn_params_handler_ = node_->add_on_set_parameters_callback(std::bind(
189177
&BorderLayer::reconfigureCallback, this, std::placeholders::_1));
190178
return true;

0 commit comments

Comments
 (0)