From 48b1f27349e0a66196cb9ed2882676980a403570 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Mon, 7 Jul 2014 19:11:09 +0200 Subject: [PATCH] Rename Classes --- .../graph/{gripper-transition.hh => edge.hh} | 28 ++++++------- include/hpp/manipulation/graph/fwd.hh | 39 +++++++++++++++++++ ...per-state-selector.hh => node-selector.hh} | 21 ++++++---- .../graph/{gripper-state.hh => node.hh} | 25 ++++++------ 4 files changed, 75 insertions(+), 38 deletions(-) rename include/hpp/manipulation/graph/{gripper-transition.hh => edge.hh} (70%) create mode 100644 include/hpp/manipulation/graph/fwd.hh rename include/hpp/manipulation/graph/{gripper-state-selector.hh => node-selector.hh} (71%) rename include/hpp/manipulation/graph/{gripper-state.hh => node.hh} (75%) diff --git a/include/hpp/manipulation/graph/gripper-transition.hh b/include/hpp/manipulation/graph/edge.hh similarity index 70% rename from include/hpp/manipulation/graph/gripper-transition.hh rename to include/hpp/manipulation/graph/edge.hh index d49bfcf0..03b005bb 100644 --- a/include/hpp/manipulation/graph/gripper-transition.hh +++ b/include/hpp/manipulation/graph/edge.hh @@ -14,8 +14,8 @@ // received a copy of the GNU Lesser General Public License along with // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. -#ifndef HPP_MANIPULATION_GRAPH_GRIPPER_TRANSITION_HH -# define HPP_MANIPULATION_GRAPH_GRIPPER_TRANSITION_HH +#ifndef HPP_MANIPULATION_GRAPH_EDGE_HH +# define HPP_MANIPULATION_GRAPH_EDGE_HH #include <hpp/core/constraints-set.hh> @@ -25,43 +25,39 @@ namespace hpp { namespace manipulation { namespace graph { - /// Transition between states of a gripper. + /// Transition between states of a end-effector. /// /// Vertices of the graph of constraints. - class HPP_MANIPULATION_DLLAPI GripperTransition + class HPP_MANIPULATION_DLLAPI Edge { public: /// Projector to project onto the same leaf as config. /// \return The initialized projector. /// \param config Configuration that will initialize the projector. - ConfigProjector* configurationProjector(model::Configuration_t config); + ConfigProjectorPtr_t configurationProjector(const Configuration_t config); /// Projector to project a path. /// \return The initialized projector. /// \param config Configuration that will initialize the projector. - ConfigProjector* pathProjector(model::Configuration_t config); - - protected: - typedef hpp::core::ConstraintSet ConstraintSet; - typedef hpp::core::ConfigProjector ConfigProjector; + ConfigProjectorPtr_t pathProjector(const Configuration_t config); private: /// The two ends of the transition. - GripperState* startState, endState; + NodeWkPtr_t startState, endState; /// Set of constraints to be statisfied. - ConstraintSet* constraints_; + ConstraintSetPtr_t constraints_; /// Projectors ensuring that a path between q_near and q_proj is /// valid regarding the manipulation rules. - ConfigProjector* configurationProjector_; + ConfigProjectorPtr_t configurationProjector_; /// Projectors ensuring that a path between two configurations in /// the same leaf lies in the leaf. - ConfigProjector* pathProjector_; - }; // class GripperState + ConfigProjectorPtr_t pathProjector_; + }; // class Edge } // namespace graph } // namespace manipulation } // namespace hpp -#endif // HPP_MANIPULATION_GRAPH_GRIPPER_TRANSITION_HH +#endif // HPP_MANIPULATION_GRAPH_EDGE_HH diff --git a/include/hpp/manipulation/graph/fwd.hh b/include/hpp/manipulation/graph/fwd.hh new file mode 100644 index 00000000..73b398b5 --- /dev/null +++ b/include/hpp/manipulation/graph/fwd.hh @@ -0,0 +1,39 @@ +// Copyright (c) 2014, LAAS-CNRS +// Authors: Joseph Mirabel (joseph.mirabel@laas.fr) +// +// This file is part of hpp-manipulation. +// hpp-manipulation is free software: you can redistribute it +// and/or modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation, either version +// 3 of the License, or (at your option) any later version. +// +// hpp-manipulation is distributed in the hope that it will be +// useful, but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Lesser Public License for more details. You should have +// received a copy of the GNU Lesser General Public License along with +// hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. + +#ifndef HPP_MANIPULATION_GRAPH_FWD_HH +# define HPP_MANIPULATION_GRAPH_FWD_HH + +#include <hpp/util/pointer.hh> +#include <hpp/util/config.h> + +namespace hpp { + namespace manipulation { + namespace graph { + HPP_PREDEF_CLASS (Node); + HPP_PREDEF_CLASS (Edge); + HPP_PREDEF_CLASS (NodeSelector); + typedef boost::shared_ptr < Edge > EdgePtr_t; + typedef boost::shared_ptr < NodeSelector > NodeSelectorPtr_t; + + typedef hpp::core::ConstraintSet_t ConstraintSet_t; + typedef hpp::core::ConstraintSetPtr_t ConstraintSetPtr_t; + typedef hpp::core::ConfigProjectorPtr_t ConfigProjectorPtr_t; + } // namespace graph + } // namespace manipulation +} // namespace hpp + +#endif // HPP_MANIPULATION_GRAPH_FWD_HH diff --git a/include/hpp/manipulation/graph/gripper-state-selector.hh b/include/hpp/manipulation/graph/node-selector.hh similarity index 71% rename from include/hpp/manipulation/graph/gripper-state-selector.hh rename to include/hpp/manipulation/graph/node-selector.hh index 602a88dc..b507cfcd 100644 --- a/include/hpp/manipulation/graph/gripper-state-selector.hh +++ b/include/hpp/manipulation/graph/node-selector.hh @@ -14,6 +14,9 @@ // received a copy of the GNU Lesser General Public License along with // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. +#ifndef HPP_MANIPULATION_GRAPH_NODE_SELECTOR_HH +# define HPP_MANIPULATION_GRAPH_NODE_SELECTOR_HH + #include "hpp/manipulation/fwd.hh" #include "hpp/manipulation/graph/gripper-state.hh" @@ -22,16 +25,18 @@ namespace hpp { namespace graph { /// This class is used to get the state of a configuration. States have to /// be ordered because a configuration can be in several states. - class HPP_MANIPULATION_DLLAPI GripperStateSelector + class HPP_MANIPULATION_DLLAPI NodeSelector { public: /// Returns the state of a configuration. - virtual GripperState getState(const Configuration_t config) const; + virtual Node getState(const Configuration_t config) const; private: - /// List of the states of one gripper, ordered by priority. - std::vector< GripperState > orderedStates_; - } - } // ----- End of namespace graph ----- - } // ----- End of namespace manipulation ----- -} // ----- End of namespace hpp ----- + /// List of the states of one end-effector, ordered by priority. + std::vector< NodeWkPtr_t > orderedStates_; + }; // + } // namespace graph + } // namespace manipulation +} // namespace hpp + +#endif // HPP_MANIPULATION_GRAPH_NODE_SELECTOR_HH diff --git a/include/hpp/manipulation/graph/gripper-state.hh b/include/hpp/manipulation/graph/node.hh similarity index 75% rename from include/hpp/manipulation/graph/gripper-state.hh rename to include/hpp/manipulation/graph/node.hh index 9a23a6fc..08880ef4 100644 --- a/include/hpp/manipulation/graph/gripper-state.hh +++ b/include/hpp/manipulation/graph/node.hh @@ -14,8 +14,8 @@ // received a copy of the GNU Lesser General Public License along with // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. -#ifndef HPP_MANIPULATION_GRAPH_GRIPPER_STATE_HH -# define HPP_MANIPULATION_GRAPH_GRIPPER_STATE_HH +#ifndef HPP_MANIPULATION_GRAPH_NODE_HH +# define HPP_MANIPULATION_GRAPH_NODE_HH #include <hpp/core/constraints-set.hh> @@ -24,11 +24,11 @@ namespace hpp { namespace manipulation { namespace graph { - /// State of a gripper. + /// State of an end-effector. /// /// Nodes of the graph of constraints. There is one - /// graph for each gripper. - class HPP_MANIPULATION_DLLAPI GripperState + /// graph for each end-effector. + class HPP_MANIPULATION_DLLAPI Node { public: /// Check whether the configuration is in this state. @@ -36,25 +36,22 @@ namespace hpp { /// \param config The configuration to be tested. /// \note You should note use that to know in which states a /// configuration is. This only checks if the configuration satisfies - /// the constraints. Instead, use the class GripperStateSelector. + /// the constraints. Instead, use the class NodeSelector. virtual bool contains(const Configuration_t config) const; - protected: - typedef hpp::core::ConstraintSet ConstraintSet; - private: /// List of possible motions from this state (i.e. the outgoing /// vertices). - std::vector<GripperTransition*> neighbors_; + std::vector < EdgePtr_t > neighbors_; /// Set of constraints to be statisfied. - ConstraintSet* constraints_; + ConstraintSetPtr_t constraints_; /// A selector that will implement the selection of the next state. - GripperStateSelector* selector_; - }; // class GripperState + NodeSelectorPtr_t selector_; + }; // class Node } // namespace graph } // namespace manipulation } // namespace hpp -#endif // HPP_MANIPULATION_GRAPH_GRIPPER_STATE_HH +#endif // HPP_MANIPULATION_GRAPH_NODE_HH -- GitLab