Testing:Framework
From OpenRAVE
| Language: |
English |
openrave will use python's unittest package to test all functionality. All tests are in a test folder in the root directory.
Contents |
General Guidelines
- openrave does not crash/segfault when given wrong input, instead it should print out meaningful error messages e.g. throw and exception
- be cautious about shared pointers and garbage collection
What to Test
creating, destroying, and loading plugins/interfaces
creating and loading scenes
- setting up the environment
- check no body is present after environment is initialized with Environment()
- check no body is left after environment is destroyed with Destroy
- loading scenes
- load a scene with broken xml grammar, expect Load return False
- load a scene with good xml grammar, expect Load return True
- check number and names of loaded bodies match the expected values (GetBodies, GetName)
initializing, adding, and accessing objects
- creating objects
- reading bodies through ReadKinBodyXMLFile and ReadKinBodyXMLData (the *Data functions allow you to pass XML directly)
- load a kinbody with bad grammar using ReadKinBodyXMLFile
- load a kinbody with good grammar using ReadKinBodyXMLFile
- add the loaded kinbody to the environment using AddKinBody
- check # of bodies the environment using GetBodies
- check added body's networkid using GetNetworkId
- check added body's name using GetName
- check added body's transform using GetTransform
- reading robots through ReadRobotXMLFile and ReadRobotXMLData
- adding objects to the environment through AddKinBody, AddRobot; accessing through GetKinBody, GetRobot
initializing, loading interfaces
- initializing interface through XML: ReadInterfaceXMLFile and ReadInterfaceXMLData
- each interface can have several XML parsers attached through RegisterXMLReader (custom loaders)
- parsed data can be stored in the interface and accessed through GetReadableInterfaces()
- creating interface through CreateInterface, CreateRobot, CreatePlanner, CreateCollisionChecker
destroying kinbodies
- make sure all destructors are called properly
- to test shared pointers: have several kinbodies each using one more feature than the other, e.g., first kinbody has just one link, the next has several links and introduces joints
(future) dynamic plugin loading
- reloading interface without restarting openrave
kinbody kinematics, geometry, transformations, basic information retrieval, updating
- transformation: SetTransform, GetTransform, SetBodyTransformations, GetBodyTransformations
- joint: SetJointValues, GetJointValues
- info: GetDOF, SetName/GetName, GetJointLimits, ,GetJoints, GetLinks
- AABB: ComputeAABB
- body hierarchy: DoesAffect
- link geometries: hinge, slider, and spherical
- any structural change to the body (new kinematic structure) or positional change should be propagated and update the corresponding time stamp and kinbody properties, which can be checked by GetUpdateStamp and KinBodyProperty
- any static property change should trigger RegisterChangeCallback
robot basics
manipulators
- check the following fields: arm joints, gripper joints, ik solver, palm direction, closing direction for fingers, grasp frame (GetEndEffectorTransform != GetEndEffector()->GetTransform()); GetChildJoints, GetChildDOFIndices, GetChildLinks, GetIndependentLinks
- transform the robot see if the manipulator also transform correctly
attaching sensors
- loading sensor, check with GetAttachingLink, SetRelativeTransform
- check sensor frame with GetRelativeTransform, GetTransform
active DOF
- any combination of joints (out of order)
- affine DOF e.g. translation on X,Y,Z, rotation around X,Y,Z and any axis (3D)
grabbing bodies
- test that grabbed body is translated properly
- in collision checker testing, test grabbed bodies are treated as being joined to the robot
- test all grabbing and releasing methods: Grab, Release, ReleaseAll, RegrabAll(releases all the bodies and grabs them again), IsGrabbing, GetGrabbed
collision checking and attached bodies (with all sorts of destructions/creations in the middle)
- initialization: SetCollisionChecker, GetCollisionChecker
- collision tests using CheckCollision, CheckSelfCollision

