Remove default constructor for Priority

It's better to explicitly state the initial value.
This commit is contained in:
Robert Haschke 2020-12-05 12:59:08 +01:00
parent 56ad37d80e
commit 576a1aa48d
3 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ protected:
/// the full trace (from start to end, but not including start) and its accumulated costs
template <Interface::Direction dir>
void traverse(const SolutionBase& start, const SolutionProcessor& cb, SolutionSequence::container_type& trace,
const InterfaceState::Priority& = InterfaceState::Priority());
const InterfaceState::Priority& = InterfaceState::Priority(0, 0.0));
protected:
SerialContainer(SerialContainerPrivate* impl);

View File

@ -83,7 +83,6 @@ public:
*/
struct Priority : public std::pair<unsigned int, double>
{
Priority() : Priority(0, 0.0) {}
Priority(unsigned int depth, double cost) : std::pair<unsigned int, double>(depth, cost) {}
inline unsigned int depth() const { return this->first; }

View File

@ -46,16 +46,17 @@
namespace moveit {
namespace task_constructor {
const planning_scene::PlanningScenePtr& ensureUpdated(const planning_scene::PlanningScenePtr& scene) {
planning_scene::PlanningSceneConstPtr ensureUpdated(const planning_scene::PlanningScenePtr& scene) {
// ensure scene's state is updated
if (scene->getCurrentState().dirty())
scene->getCurrentStateNonConst().update();
return scene;
}
InterfaceState::InterfaceState(const planning_scene::PlanningScenePtr& ps) : scene_(ensureUpdated(ps)) {}
InterfaceState::InterfaceState(const planning_scene::PlanningScenePtr& ps) : InterfaceState(ensureUpdated(ps)) {}
InterfaceState::InterfaceState(const planning_scene::PlanningSceneConstPtr& ps) : scene_(ps) {
InterfaceState::InterfaceState(const planning_scene::PlanningSceneConstPtr& ps)
: scene_(ps), priority_(Priority(0, 0.0)) {
if (scene_->getCurrentState().dirty())
ROS_ERROR_NAMED("InterfaceState", "Dirty PlanningScene! Please only forward clean ones into InterfaceState.");
}