9 typedef unsigned int uint;
82 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
89 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
96 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
103 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
110 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
117 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
124 CPPUNIT_ASSERT_EQUAL(f1,s.
pose(q));
150 Chain chain2 = chain1;
171 CPPUNIT_ASSERT(tree1.
addSegment(segment1,
"root"));
172 CPPUNIT_ASSERT(tree1.
addSegment(segment2,
"root"));
173 CPPUNIT_ASSERT(tree1.
addSegment(segment3,
"Segment 1"));
174 CPPUNIT_ASSERT(tree1.
addSegment(segment4,
"Segment 3"));
175 CPPUNIT_ASSERT(!tree1.
addSegment(segment1,
"Segment 6"));
176 CPPUNIT_ASSERT(!tree1.
addSegment(segment1,
"Segment 4"));
181 CPPUNIT_ASSERT(tree2.
addSegment(segment5,
"root"));
182 CPPUNIT_ASSERT(tree2.
addSegment(segment6,
"root"));
183 CPPUNIT_ASSERT(tree2.
addSegment(segment7,
"Segment 6"));
202 CPPUNIT_ASSERT(tree2.
addChain(chain1,
"Segment 6"));
204 CPPUNIT_ASSERT(tree1.
addTree(tree2,
"Segment 2"));
207 Chain extract_chain1;
208 CPPUNIT_ASSERT(tree1.
getChain(
"Segment 2",
"Segment 4", extract_chain1));
209 Chain extract_chain2;
210 CPPUNIT_ASSERT(tree1.
getChain(
"Segment 4",
"Segment 2", extract_chain2));
211 CPPUNIT_ASSERT(tree1.
getChain(
"Segment 4",
"Segment 2", extract_chain2));
212 CPPUNIT_ASSERT(extract_chain1.
getNrOfJoints()==extract_chain2.getNrOfJoints());
213 CPPUNIT_ASSERT(extract_chain1.
getNrOfSegments()==extract_chain2.getNrOfSegments());
219 JntArray jnt1(extract_chain2.getNrOfJoints());
220 JntArray jnt2(extract_chain2.getNrOfJoints());
221 for (
int i=0; i<(int)extract_chain2.getNrOfJoints(); i++){
223 jnt2((
int)extract_chain2.getNrOfJoints()-i-1) = jnt1(i);
225 solver1.JntToCart(jnt1, f1);
227 CPPUNIT_ASSERT(f1 == f2.
Inverse());
virtual int JntToCart(const JntArray &q_in, Frame &p_out, int segmentNr=-1)
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body...
static Rotation RotX(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Twist RefPoint(const Vector &v_base_AB) const
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
static Rotation RotZ(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
unsigned int getNrOfSegments() const
void addSegment(const Segment &segment)
This class represents an fixed size array containing joint values of a KDL::Chain.
Frame pose(const double &q) const
static Rotation RotY(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Frame pose(const double &q) const
Twist twist(const double &q, const double &qdot) const
represents both translational and rotational velocities.
bool addChain(const Chain &chain, const std::string &hook_name)
A concrete implementation of a 3 dimensional vector class.
const Joint & getJoint() const
bool addTree(const Tree &tree, const std::string &hook_name)
Vector p
origine of the Frame
void addChain(const Chain &chain)
unsigned int getNrOfJoints() const
Frame Inverse() const
Gives back inverse transformation of a Frame.
bool getChain(const std::string &chain_root, const std::string &chain_tip, Chain &chain) const
CPPUNIT_TEST_SUITE_REGISTRATION(KinFamTest)
represents a frame transformation in 3D space (rotation + translation)
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
bool addSegment(const Segment &segment, const std::string &hook_name)
IMETHOD void random(Vector &a)
addDelta operator for displacement rotational velocity.
This class encapsulates a tree kinematic interconnection structure. It is built out of segments...
Twist twist(const double &qdot) const
const JointType & getType() const