Unverified Commit c8767a96 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by GitHub
Browse files

Merge pull request #135 from jmirabel/devel

Frame computes child list only when required + serialization
parents 97580c46 d9315b8c
Pipeline #12585 passed with stage
in 8 minutes and 55 seconds
......@@ -84,8 +84,9 @@ namespace hpp {
/// Returns true if this frame is the universe frame.
bool isRootFrame () const;
const std::vector<FrameIndex>& children () const
const std::vector<FrameIndex>& children ()
{
setChildList();
return children_;
}
......
......@@ -111,6 +111,8 @@ namespace hpp {
void initCopy (const HumanoidRobotWkPtr_t& weakPtr, const HumanoidRobot& other);
/// For serialization only
HumanoidRobot () {}
private:
HumanoidRobotWkPtr_t weakPtr_;
JointPtr_t waist_;
......@@ -123,7 +125,6 @@ namespace hpp {
vector3_t gazeOrigin_;
vector3_t gazeDirection_;
HumanoidRobot () {}
HPP_SERIALIZABLE();
}; // class HumanoidRobot
} // namespace pinocchio
......
......@@ -49,7 +49,6 @@ namespace hpp {
assert (devicePtr_.lock());
assert (devicePtr_.lock()->modelPtr());
assert (std::size_t(frameIndex_)<model().frames.size());
setChildList();
}
void Frame::selfAssert() const
......@@ -123,7 +122,7 @@ namespace hpp {
void Frame::setChildList()
{
selfAssert();
children_.clear();
if (!children_.empty()) return;
if (!isFixed()) return;
const Model& m = model();
......@@ -176,6 +175,8 @@ namespace hpp {
void Frame::positionInParentFrame (const Transform3f& p)
{
selfAssert();
setChildList();
devicePtr_.lock()->invalidate();
Model& m = model();
GeomModel& geomModel = devicePtr_.lock()->geomModel();
......
Markdown is supported
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