Skip to content
Snippets Groups Projects
Commit ebffbaa4 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add graph header files.

parent a56aec47
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,9 @@ SET (${PROJECT_NAME}_HEADERS
include/hpp/manipulation/object.hh
include/hpp/manipulation/problem-solver.hh
include/hpp/manipulation/robot.hh
include/hpp/manipulation/graph/gripper-state.hh
include/hpp/manipulation/graph/gripper-transition.hh
include/hpp/manipulation/graph/gripper-state-selector.hh
)
# Add dependency toward hpp-model library in pkg-config file.
......
// 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/>.
#include "hpp/manipulation/fwd.hh"
#include "hpp/manipulation/graph/gripper-state.hh"
namespace hpp {
namespace manipulation {
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
{
public:
/// Returns the state of a configuration.
virtual GripperState 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 -----
// 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_GRIPPER_STATE_HH
# define HPP_MANIPULATION_GRAPH_GRIPPER_STATE_HH
#include <hpp/core/constraints-set.hh>
#include "hpp/manipulation/fwd.hh"
namespace hpp {
namespace manipulation {
namespace graph {
/// State of a gripper.
///
/// Nodes of the graph of constraints. There is one
/// graph for each gripper.
class HPP_MANIPULATION_DLLAPI GripperState
{
public:
/// Check whether the configuration is in this state.
/// \return True if this state contains this configuration
/// \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.
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_;
/// Set of constraints to be statisfied.
ConstraintSet* constraints_;
/// A selector that will implement the selection of the next state.
GripperStateSelector* selector_;
}; // class GripperState
} // namespace graph
} // namespace manipulation
} // namespace hpp
#endif // HPP_MANIPULATION_GRAPH_GRIPPER_STATE_HH
// 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_GRIPPER_TRANSITION_HH
# define HPP_MANIPULATION_GRAPH_GRIPPER_TRANSITION_HH
#include <hpp/core/constraints-set.hh>
#include "hpp/manipulation/fwd.hh"
#include "hpp/manipulation/graph/gripper-state.hh"
namespace hpp {
namespace manipulation {
namespace graph {
/// Transition between states of a gripper.
///
/// Vertices of the graph of constraints.
class HPP_MANIPULATION_DLLAPI GripperTransition
{
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);
/// 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;
private:
/// The two ends of the transition.
GripperState* startState, endState;
/// Set of constraints to be statisfied.
ConstraintSet* constraints_;
/// Projectors ensuring that a path between q_near and q_proj is
/// valid regarding the manipulation rules.
ConfigProjector* configurationProjector_;
/// Projectors ensuring that a path between two configurations in
/// the same leaf lies in the leaf.
ConfigProjector* pathProjector_;
}; // class GripperState
} // namespace graph
} // namespace manipulation
} // namespace hpp
#endif // HPP_MANIPULATION_GRAPH_GRIPPER_TRANSITION_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment