Commit 6fbb1b8e authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add HumanoidRobot

parent 255d4396
......@@ -68,6 +68,7 @@ ADD_DEFINITIONS(-DWITH_HPP_FCL)
SET(${PROJECT_NAME}_HEADERS
include/hpp/pinocchio/fwd.hh
include/hpp/pinocchio/device.hh
include/hpp/pinocchio/humanoid-robot.hh
include/hpp/pinocchio/joint.hh
include/hpp/pinocchio/body.hh
include/hpp/pinocchio/fake-container.hh
......
......@@ -370,9 +370,9 @@ namespace hpp {
/// \brief Constructor
Device(const std::string& name);
//DEPREC /// \brief Initialization.
//DEPREC ///
//DEPREC void init(const DeviceWkPtr_t& weakPtr);
/// \brief Initialization.
///
void init(const DeviceWkPtr_t& weakPtr);
//DEPREC /// \brief Initialization of of a clone device.
//DEPREC ///
//DEPREC void initCopy(const DeviceWkPtr_t& weakPtr, const Device& model);
......
//
// Copyright (c) 2016 CNRS
// Author: Joseph Mirabel from Florent Lamiraux
//
//
// This file is part of hpp-pinocchio
// hpp-pinocchio 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-pinocchio 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-pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#ifndef HPP_PINOCCHIO_HUMANOID_ROBOT_HH
#define HPP_PINOCCHIO_HUMANOID_ROBOT_HH
# include <iostream>
# include <vector>
# include <hpp/pinocchio/device.hh>
# include <hpp/pinocchio/fwd.hh>
# include <hpp/pinocchio/config.hh>
namespace hpp {
namespace pinocchio {
/// \brief Humanoid robot
class HPP_PINOCCHIO_DLLAPI HumanoidRobot : public Device
{
public:
/// \name Construction, copy and destruction
/// @{
virtual ~HumanoidRobot ();
/// \brief Clone as a CkwsDevice
HumanoidRobotPtr_t clone () const;
///
/// @}
///
/// \brief Creation of a new device
/// \return a shared pointer to the new device
/// \param name Name of the device (is passed to CkkpDeviceComponent)
static HumanoidRobotPtr_t create (const std::string& name);
/// \brief Get Joint corresponding to the waist.
JointPtr_t waist() const;
/// Set waist joint
void waist (const JointPtr_t& joint);
/// \brief Get Joint corresponding to the chest.
JointPtr_t chest() const;
/// Set chest joint
void chest (const JointPtr_t& joint);
/// \brief Get Joint corresponding to the left wrist.
JointPtr_t leftWrist() const;
/// Set left wrist
void leftWrist (const JointPtr_t& joint);
/// \brief Get Joint corresponding to the right wrist.
JointPtr_t rightWrist() const;
/// Set right wrist
void rightWrist (const JointPtr_t& joint);
/// \brief Get Joint corresponding to the left ankle.
JointPtr_t leftAnkle() const;
/// Set letf ankle
void leftAnkle (const JointPtr_t& joint);
/// \brief Get Joint corresponding to the right ankle.
JointPtr_t rightAnkle() const;
/// Set right ankle
void rightAnkle (const JointPtr_t& joint);
/// \brief Get gaze joint
JointPtr_t gazeJoint() const;
/// Set gaze joint
void gazeJoint (const JointPtr_t& joint);
/// Set gaze parameters
void gaze (const vector3_t& origin, const vector3_t& dir)
{
gazeOrigin_ = origin;
gazeDirection_ = dir;
}
protected:
/// \brief Constructor
HumanoidRobot (const std::string& name);
///
/// \brief Initialization.
///
void init (const HumanoidRobotWkPtr_t& weakPtr);
private:
HumanoidRobotWkPtr_t weakPtr_;
JointPtr_t waist_;
JointPtr_t chest_;
JointPtr_t leftWrist_;
JointPtr_t rightWrist_;
JointPtr_t leftAnkle_;
JointPtr_t rightAnkle_;
JointPtr_t gazeJoint_;
vector3_t gazeOrigin_;
vector3_t gazeDirection_;
}; // class HumanoidRobot
} // namespace pinocchio
} // namespace hpp
#endif // HPP_PINOCCHIO_HUMANOID_ROBOT_HH
......@@ -19,6 +19,7 @@ SET(LIBRARY_NAME ${PROJECT_NAME})
SET(LIBRARY_SOURCES
device.cc
humanoid-robot.cc
joint.cc
collision-object.cc
body.cc
......
......@@ -48,6 +48,7 @@ namespace hpp {
create (const std::string & name)
{
DevicePtr_t res = DevicePtr_t(new Device(name)); // init shared ptr
res->init (res);
res->weakPtr_ = res;
res->jointVector_ = JointVector(res);
res->obstacles_ = ObjectVector(res,0,CollisionObject::INNER);
......@@ -76,6 +77,11 @@ namespace hpp {
return res;
}
void Device::init(const DeviceWkPtr_t& weakPtr)
{
weakPtr_ = weakPtr;
}
void Device::
createData()
{
......
//
// Copyright (c) 2016 CNRS
// Author: Joseph Mirabel from Florent Lamiraux
//
//
// This file is part of hpp-pinocchio
// hpp-pinocchio 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-pinocchio 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-pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#include <hpp/pinocchio/humanoid-robot.hh>
namespace hpp {
namespace pinocchio {
HumanoidRobot::HumanoidRobot (const std::string& name)
: Device (name), weakPtr_ ()
{
}
// ========================================================================
HumanoidRobot::~HumanoidRobot ()
{
}
// ========================================================================
HumanoidRobotPtr_t HumanoidRobot::create (const std::string& name)
{
HumanoidRobot *hppHumanoidRobot = new HumanoidRobot (name);
HumanoidRobotPtr_t hppHumanoidRobotPtr_t (hppHumanoidRobot);
hppHumanoidRobot->init (hppHumanoidRobotPtr_t);
return hppHumanoidRobotPtr_t;
}
// ========================================================================
void HumanoidRobot::init(const HumanoidRobotWkPtr_t& weakPtr)
{
Device::init (weakPtr);
weakPtr_ = weakPtr;
}
/// \brief Get Joint corresponding to the waist.
JointPtr_t HumanoidRobot::waist() const
{
return waist_;
}
/// Set waist joint
void HumanoidRobot::waist (const JointPtr_t& joint)
{
waist_ = joint;
}
/// \brief Get Joint corresponding to the chest.
JointPtr_t HumanoidRobot::chest() const
{
return chest_;
}
/// Set chest joint
void HumanoidRobot::chest (const JointPtr_t& joint)
{
chest_ = joint;
}
/// \brief Get Joint corresponding to the left wrist.
JointPtr_t HumanoidRobot::leftWrist() const
{
return leftWrist_;
}
/// Set left wrist
void HumanoidRobot::leftWrist (const JointPtr_t& joint)
{
leftWrist_ = joint;
}
/// \brief Get Joint corresponding to the right wrist.
JointPtr_t HumanoidRobot::rightWrist() const
{
return rightWrist_;
}
/// Set right wrist
void HumanoidRobot::rightWrist (const JointPtr_t& joint)
{
rightWrist_ = joint;
}
/// \brief Get Joint corresponding to the left ankle.
JointPtr_t HumanoidRobot::leftAnkle() const
{
return leftAnkle_;
}
/// Set letf ankle
void HumanoidRobot::leftAnkle (const JointPtr_t& joint)
{
leftAnkle_ = joint;
}
/// \brief Get Joint corresponding to the right ankle.
JointPtr_t HumanoidRobot::rightAnkle() const
{
return rightAnkle_;
}
/// Set right ankle
void HumanoidRobot::rightAnkle (const JointPtr_t& joint)
{
rightAnkle_ = joint;
}
/// \brief Get gaze joint
JointPtr_t HumanoidRobot::gazeJoint() const
{
return gazeJoint_;
}
/// Set gaze joint
void HumanoidRobot::gazeJoint (const JointPtr_t& joint)
{
gazeJoint_ = joint;
}
} // namespace pinocchio
} // namespace hpp
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