[prev in list] [next in list] [prev in thread] [next in thread] 

List:       orocos-dev
Subject:    [Orocos-Dev] [Bug 1011] New: KDL Tree.NrOfSegments() and SegmentMap.size() disagreement
From:       earl.darren () gmail ! com (Darren Earl)
Date:       2012-12-03 18:26:36
Message-ID: bug-1011-4 () http ! bugs ! orocos ! org/
[Download RAW message or body]


http://bugs.orocos.org/show_bug.cgi?id=1011

           Summary: KDL Tree.NrOfSegments() and SegmentMap.size()
                    disagreement
           Product: KDL
           Version: kdl-trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Kinematic chains
        AssignedTo: orocos-dev at lists.mech.kuleuven.be
        ReportedBy: earl.darren at gmail.com
                CC: orocos-dev at lists.mech.kuleuven.be
   Estimated Hours: 0.0


In KDL git repository with HEAD==8e450497c70c1a7cec2ff723fc7b482022c1640f
regarding
orocos_kinematics_dynamics/orocos_kdl/src/tree.hpp
orocos_kinematics_dynamics/orocos_kdl/src/tree.cpp

In Class KDL::Tree 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. 
The behaviour was responsible for an out-of-bounds array error in 3rd party
code.

-- 
Configure bugmail: http://bugs.orocos.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic