Skip to content

Commit 576a1aa

Browse files
committed
Remove default constructor for Priority
It's better to explicitly state the initial value.
1 parent 56ad37d commit 576a1aa

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

core/include/moveit/task_constructor/container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class SerialContainer : public ContainerBase
107107
/// the full trace (from start to end, but not including start) and its accumulated costs
108108
template <Interface::Direction dir>
109109
void traverse(const SolutionBase& start, const SolutionProcessor& cb, SolutionSequence::container_type& trace,
110-
const InterfaceState::Priority& = InterfaceState::Priority());
110+
const InterfaceState::Priority& = InterfaceState::Priority(0, 0.0));
111111

112112
protected:
113113
SerialContainer(SerialContainerPrivate* impl);

core/include/moveit/task_constructor/storage.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class InterfaceState
8383
*/
8484
struct Priority : public std::pair<unsigned int, double>
8585
{
86-
Priority() : Priority(0, 0.0) {}
8786
Priority(unsigned int depth, double cost) : std::pair<unsigned int, double>(depth, cost) {}
8887

8988
inline unsigned int depth() const { return this->first; }

core/src/storage.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,17 @@
4646
namespace moveit {
4747
namespace task_constructor {
4848

49-
const planning_scene::PlanningScenePtr& ensureUpdated(const planning_scene::PlanningScenePtr& scene) {
49+
planning_scene::PlanningSceneConstPtr ensureUpdated(const planning_scene::PlanningScenePtr& scene) {
5050
// ensure scene's state is updated
5151
if (scene->getCurrentState().dirty())
5252
scene->getCurrentStateNonConst().update();
5353
return scene;
5454
}
5555

56-
InterfaceState::InterfaceState(const planning_scene::PlanningScenePtr& ps) : scene_(ensureUpdated(ps)) {}
56+
InterfaceState::InterfaceState(const planning_scene::PlanningScenePtr& ps) : InterfaceState(ensureUpdated(ps)) {}
5757

58-
InterfaceState::InterfaceState(const planning_scene::PlanningSceneConstPtr& ps) : scene_(ps) {
58+
InterfaceState::InterfaceState(const planning_scene::PlanningSceneConstPtr& ps)
59+
: scene_(ps), priority_(Priority(0, 0.0)) {
5960
if (scene_->getCurrentState().dirty())
6061
ROS_ERROR_NAMED("InterfaceState", "Dirty PlanningScene! Please only forward clean ones into InterfaceState.");
6162
}

0 commit comments

Comments
 (0)