Commit 97842050 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add class Frame

parent f53afe09
......@@ -70,6 +70,7 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/pinocchio/device.hh
include/hpp/pinocchio/humanoid-robot.hh
include/hpp/pinocchio/joint.hh
include/hpp/pinocchio/frame.hh
include/hpp/pinocchio/body.hh
include/hpp/pinocchio/fake-container.hh
include/hpp/pinocchio/device-object-vector.hh
......
......@@ -27,6 +27,7 @@
# include <hpp/util/debug.hh>
# include <hpp/pinocchio/fwd.hh>
# include <hpp/pinocchio/frame.hh>
# include <hpp/pinocchio/config.hh>
# include <hpp/pinocchio/deprecated.hh>
# include <hpp/pinocchio/extra-config-space.hh>
......@@ -44,6 +45,7 @@ namespace hpp {
class HPP_PINOCCHIO_DLLAPI Device
{
friend class Joint;
friend class Frame;
public:
/// Flags to select computation
/// To optimize computation time, computations performed by method
......@@ -179,6 +181,11 @@ namespace hpp {
/// \throw runtime_error if device has no body with this name
JointPtr_t getJointByBodyName (const std::string& name) const;
/// Get frame by name
/// \param name name of the frame.
/// \throw runtime_error if device has no frame with this name
Frame getFrameByName (const std::string& name) const;
/// Size of configuration vectors
/// Sum of joint dimensions and of extra configuration space dimension
size_type configSize () const;
......
......@@ -49,12 +49,14 @@ namespace hpp {
HPP_PREDEF_CLASS (JointConfiguration);
HPP_PREDEF_CLASS (Gripper);
HPP_PREDEF_CLASS (CenterOfMassComputation);
class Frame;
enum Request_t {COLLISION, DISTANCE};
enum InOutType { INNER, OUTER };
// Pinocchio typedefs
typedef se3::JointIndex JointIndex;
typedef se3::FrameIndex FrameIndex;
typedef se3::GeomIndex GeomIndex;
typedef se3::Model Model;
typedef se3::Data Data;
......
......@@ -21,6 +21,7 @@ SET(LIBRARY_SOURCES
device.cc
humanoid-robot.cc
joint.cc
frame.cc
collision-object.cc
body.cc
device-object-vector.cc
......
......@@ -207,6 +207,19 @@ namespace hpp {
+ name);
}
Frame Device::
getFrameByName (const std::string& name) const
{
assert(model_);
const se3::FrameType type = (se3::FrameType)(se3::JOINT | se3::FIXED_JOINT);
if(! model_->existFrame(name, type))
throw std::logic_error ("Device " + name_ +
" does not have any frame named "
+ name);
FrameIndex id = model_->getFrameId(name, type);
return Frame(weakPtr_.lock(), id);
}
size_type Device::
configSize () const
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment