[prev in list] [next in list] [prev in thread] [next in thread]
List: orocos-users
Subject: [Orocos-users] KDL Tree.NrOfSegments() and SegmentMap.size() disagreement
From: Erwin.Aertbelien () mech ! kuleuven ! be (=?ISO-8859-1?Q?Erwin_Aertbeli=EBn?=)
Date: 2012-11-28 20:53:45
Message-ID: 50B679D9.5080104 () mech ! kuleuven ! be
[Download RAW message or body]
Op 28/11/2012 21:47, Dominick Vanthienen schreef:
>
> On 11/28/2012 07:23 PM, earl, darren j wrote:
> > I've noticed that in the Class Tree that the NrOfSegments() function reports one \
> > less segment than is in the SegmentMap segment member variable--presumably the \
> > root is not included in the count of segments. The cause is in the constructor \
> > (Tree.cpp):
> > Tree::Tree(const std::string& _root_name) :
> > nrOfSegments(0), nrOfJoints(0),root_name(_root_name) {
> > segments.insert(make_pair(root_name, TreeElement::Root(root_name)));
> > }
> >
> > Tree::Tree(const Tree& in) {
> > segments.clear();
> > nrOfSegments = 0;
> > nrOfJoints = 0;
> > root_name = in.root_name;
> >
> > segments.insert(make_pair(root_name, TreeElement::Root(root_name)));
> > this->addTree(in, root_name);
> > }
> >
> >
> > nrOfSegments is initialized to zero but the root is inserted into segments. Is \
> > this intended behaviour? Class Chain seems to count all segments including the \
> > root segment, and I found this discrepancy surprising (and a source of a bug in \
> > my own program).
> there are indeed some inconsistencies,
> we refactored this part of the code that solves this problem
> Erwin, is this code available? if yes, where?
ow... This is on our (currently private) branch containing our research
experiments on expression trees.
Nick, you'll find it on the expression tree repository I talked about in
todays meeting (cfr. report of the meeting).
I'm not that familiar with the Tree class, could you transfer this part
to the main branch ? ( the files involving Tree).
> (
>
> nick
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic