mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
Remove default constructor for Priority
It's better to explicitly state the initial value.
This commit is contained in:
parent
56ad37d80e
commit
576a1aa48d
@ -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);
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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.");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user