Commit 30966a24 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix HumanoidRobot::clone

parent 2587cebd
......@@ -71,7 +71,7 @@ namespace hpp {
/// The pinocchio model is not copied (only copy the pointer).
/// A new Pinocchio "data" is created.
/// As the model is not copied, cloning is a non constant operation. \sa cloneConst
DevicePtr_t clone() { return createCopy(weakPtr_.lock()); }
virtual DevicePtr_t clone() { return createCopy(weakPtr_.lock()); }
/// \brief Clone as a CkwsDevice
/// Both pinocchio objects model and data are copied.
/// TODO: this method is not implemented yet (assert if called)
......
......@@ -38,8 +38,8 @@ namespace hpp {
/// @{
virtual ~HumanoidRobot ();
/// \brief Clone as a CkwsDevice
HumanoidRobotPtr_t clone () const;
/// \brief Clone as a HumanoidRobot
virtual DevicePtr_t clone () const;
///
/// @}
......
......@@ -57,6 +57,16 @@ namespace hpp {
// ========================================================================
DevicePtr_t HumanoidRobot::clone () const
{
HumanoidRobot *ptr = new HumanoidRobot (*this);
HumanoidRobotPtr_t shPtr (ptr);
ptr->initCopy (shPtr, *this);
return shPtr;
}
// ========================================================================
void HumanoidRobot::init(const HumanoidRobotWkPtr_t& weakPtr)
{
Device::init (weakPtr);
......
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