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

Add Device::clone

parent 6c34a0ca
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,8 @@ namespace hpp {
void setRobotRootPosition (const std::string& robotName,
const Transform3f& positionWRTParentJoint);
virtual pinocchio::DevicePtr_t clone () const;
/// \name Collisions
/// \{
......@@ -95,6 +97,12 @@ namespace hpp {
self_ = self;
}
void initCopy (const DeviceWkPtr_t& self, const Device& other)
{
Parent_t::initCopy (self, other);
self_ = self;
}
private:
DeviceWkPtr_t self_;
......
......@@ -32,6 +32,14 @@ namespace hpp {
using se3::Frame;
using se3::FrameIndex;
pinocchio::DevicePtr_t Device::clone () const
{
Device* ptr = new Device(*this);
DevicePtr_t shPtr (ptr);
ptr->initCopy (shPtr, *this);
return shPtr;
}
void Device::setRobotRootPosition (const std::string& rn,
const Transform3f& t)
{
......@@ -99,6 +107,5 @@ namespace hpp {
Containers_t::print <GripperPtr_t> (os);
return os;
}
} // namespace manipulation
} // namespace hpp
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