Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

robot::sim::VisualIKORTest Class Reference

provides a Visual to display IKORTest results More...

Inheritance diagram for robot::sim::VisualIKORTest:

Inheritance graph
[legend]
Collaboration diagram for robot::sim::VisualIKORTest:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ExternalizationType { Input = 1, Output = 2, IO = 3 }
typedef Int Attributes
typedef Int VisualType
enum  AttributeFlags {
  ShowAxes = 1, ShowBounds = 2, ShowCollisions = 4, ShowCollisionModel = 8,
  ShowCollisionDetection = 16, ShowEdges = 32, ShowNormals = 64, VerticesOnly = 128
}

Public Member Functions

 VisualIKORTest (ref< base::VFile > testSpecification, ref< base::VFileSystem > fs, ref< base::Cache > cache)
virtual String className () const
virtual bool visualTypeSupported (VisualType type) const
virtual osg::Node * createOSGVisual (Attributes visualAttributes=0) const
virtual void updateVisuals () const
virtual bool formatSupported (const String format, Real version=1.0, ExternalizationType type=IO) const
 query if specific format is supported (for input, output or both)

virtual void externalize (base::Externalizer &e, String format="", Real version=1.0)
 read or write object state to Externalizer

ref< BasicEnvironmentgetEnvironment ()
 the environment in which tests are performed

ref< const BasicEnvironmentgetEnvironment () const
void setEnvironment (ref< BasicEnvironment > env)
ref< RobotgetRobot ()
 which robot is to be tested?

ref< const RobotgetRobot () const
Int getManipulatorIndex () const
 which of the robot's manipulators is to be tested?

Int numTests () const
Test & getTest (Int index)
base::PathName getTestInputPath () const
 the VFileSystem path from which the test specification was read

void saveResults (bool saveTrajFiles=true, base::PathName alternateOutputFileName=base::PathName())
virtual void externalize (Externalizer &e, String format="", Real version=1.0) const
 write object state to Externalizer (throws if e is in Input)

virtual const String & getName () const
void load (ref< VFile > archive, const String &format="", Real version=1.0)
void save (ref< VFile > archive, const String &format="", Real version=1.0)
virtual bool isSameKindAs (const Object &) const
virtual bool isSameKindAs (const ReferencedObject &) const
void reference () const
bool unreference () const
const int referenceCount () const
void enableOnUnreferenceCall (bool enabled)
virtual void onUnreference () const
virtual osg::Node * createOSGVisual (Visual::Attributes visualAttributes=0) const

Public Attributes

bool displayObstacles
 true if obstacles are selected for display

bool displayAxes
 true if coordinate axes selected for display

bool displayPlatform
 true if the platform should be displayed

bool displayEEPath
 true if the path of the manip/tool is selected for display

Int displayStepMod
 only display every nth step (1 for all steps)

base::Point3 lookAtTarget
 camera parameters (as in gfx::LookAtCameraManipulator)

Real alpha
Real theta
Real d

Static Public Attributes

const Int OSGVisual = 1

Protected Types

typedef base::array< gfx::Segment3LineSegArray

Protected Member Functions

osg::Node * osgCreateAxes () const
osg::Node * osgCreateObstacles () const
osg::Node * osgCreateManipulator () const
osg::Node * osgCreateTrajectory () const
void svgLine (base::Externalizer &e, base::dom::DOMElement *svgElem, const gfx::Segment3 &line) const
void svgLines (base::Externalizer &e, base::dom::DOMElement *svgElem, const LineSegArray &lines) const
void svgText (base::Externalizer &e, base::dom::DOMElement *svgElem, const Point3 &pos, const String &text, Real size=11) const
void svgOutputAxes (base::Externalizer &e, base::dom::DOMElement *svgElem) const
virtual void setName (const String &name)

Static Protected Member Functions

LineSegArray manipToolAsLines (const KinematicChain &chain, const Vector &q, Int numPlatformLinks)
LineSegArray platformAsLines (ref< const PlatformDescription > platfDescr, const KinematicChain &platfChain, const Vector &q, Real steerAngle)
LineSegArray obstaclesAsLines (ref< const BasicEnvironment > env)
LineSegArray trajectoryAsLines (const array< base::Vector > &xs)
osg::Vec3Array * newVertexArrayFromLines (const LineSegArray &lines)
osg::Geometry * newGeometryFromLines (const LineSegArray &lines, const gfx::Color4 &color)

Protected Attributes

Visual::Attributes attributes
osg::ref_ptr< osg::Switch > node
array< osg::ref_ptr< osg::Switch > > testPlatfSwitches
 one Switch per test, where children are joint space configurations of platform

array< osg::ref_ptr< osg::Switch > > testManipSwitches
 one Switch per test, where children are joint space configurations of manipulator

base::Matrix4 svgTransform
ref< base::VFileSystemfilesystem
ref< base::Cachecache
ref< SimulatedBasicEnvironmentenv
Int testRobotIndex
 which robot from the environment is used for testing

Int testManipulatorIndex
 which manipulator (in case the robot has multiple) is used for testing

array< Test > tests
base::PathName inputPath
int _refCount
bool onUnreferenceEnabled

Detailed Description

provides a Visual to display IKORTest results

Definition at line 48 of file VisualIKORTest.


Member Typedef Documentation

typedef Int gfx::Visual::Attributes [inherited]
 

Definition at line 39 of file Visual.

Referenced by gfx::Visual::createOSGVisual().

typedef base::array<gfx::Segment3> robot::sim::VisualIKORTest::LineSegArray [protected]
 

Definition at line 74 of file VisualIKORTest.

typedef Int gfx::Visual::VisualType [inherited]
 

Definition at line 44 of file Visual.

Referenced by gfx::Visual::visualTypeSupported().


Member Enumeration Documentation

enum gfx::Visual::AttributeFlags [inherited]
 

Enumeration values:
ShowAxes 
ShowBounds 
ShowCollisions 
ShowCollisionModel 
ShowCollisionDetection 
ShowEdges 
ShowNormals 
VerticesOnly 

Definition at line 40 of file Visual.

enum base::Externalizable::ExternalizationType [inherited]
 

Enumeration values:
Input 
Output 
IO 

Definition at line 40 of file Externalizable.


Constructor & Destructor Documentation

robot::sim::VisualIKORTest::VisualIKORTest ref< base::VFile testSpecification,
ref< base::VFileSystem fs,
ref< base::Cache cache
 


Member Function Documentation

virtual String robot::sim::VisualIKORTest::className  )  const [inline, virtual]
 

return the name of the object's class type. Must be defined by derived classes.

Reimplemented from robot::sim::IKORTest.

Definition at line 54 of file VisualIKORTest.

virtual osg::Node* gfx::Visual::createOSGVisual Visual::Attributes  visualAttributes = 0  )  const [inline, virtual, inherited]
 

Reimplemented in physics::GJKCollisionDetector, physics::OBBCollisionModel, physics::ODECollisionModel, physics::ODESolidSystem, physics::Solid, physics::SOLIDCollisionModel, and robot::sim::SimulatedBasicEnvironment.

Definition at line 49 of file Visual.

References gfx::Visual::Attributes, Logln, and NewObj.

virtual osg::Node* robot::sim::VisualIKORTest::createOSGVisual Attributes  visualAttributes = 0  )  const [virtual]
 

void base::Referenced::enableOnUnreferenceCall bool  enabled  )  [inline, inherited]
 

If enabled, each call to unreference() will also call virtual method onUnreference()

Definition at line 115 of file Referenced.

References base::Referenced::onUnreferenceEnabled.

virtual void base::Externalizable::externalize Externalizer e,
String  format = "",
Real  version = 1.0
const [virtual, inherited]
 

write object state to Externalizer (throws if e is in Input)

Reimplemented in physics::Box, physics::Capsule, physics::Cone, physics::Cylinder, physics::LODTerrain, physics::Polyhedron, physics::Sphere, robot::KinematicChain::Link, robot::KinematicChain, robot::ManipulatorDescription, robot::PlatformDescription, robot::RobotDescription, robot::sim::SimulatedManipulatorDescription, robot::sim::SimulatedRobotDescription, robot::sim::SimulatedSerialManipulator, robot::sim::SimulatedTool, and robot::ToolDescription.

virtual void robot::sim::VisualIKORTest::externalize base::Externalizer e,
String  format = "",
Real  version = 1.0
[virtual]
 

read or write object state to Externalizer

Reimplemented from robot::sim::IKORTest.

virtual bool robot::sim::VisualIKORTest::formatSupported const String  format,
Real  version = 1.0,
ExternalizationType  type = IO
const [inline, virtual]
 

query if specific format is supported (for input, output or both)

Reimplemented from robot::sim::IKORTest.

Definition at line 65 of file VisualIKORTest.

ref<const BasicEnvironment> robot::sim::IKORTest::getEnvironment  )  const [inline, inherited]
 

Definition at line 146 of file IKORTest.

References robot::sim::IKORTest::env.

ref<BasicEnvironment> robot::sim::IKORTest::getEnvironment  )  [inline, inherited]
 

the environment in which tests are performed

Definition at line 145 of file IKORTest.

References robot::sim::IKORTest::env.

Int robot::sim::IKORTest::getManipulatorIndex  )  const [inline, inherited]
 

which of the robot's manipulators is to be tested?

Definition at line 154 of file IKORTest.

References robot::sim::IKORTest::testManipulatorIndex.

virtual const String& base::Named::getName  )  const [inline, virtual, inherited]
 

Definition at line 44 of file Named.

References base::String.

Referenced by physics::Collidable::findNamed(), physics::operator<<(), robot::ToolDescription::operator=(), robot::RobotDescription::operator=(), robot::PlatformDescription::operator=(), robot::ManipulatorDescription::operator=(), base::Named::operator=(), and robot::ManipulatorDescription::operator==().

ref<const Robot> robot::sim::IKORTest::getRobot  )  const [inline, inherited]
 

Definition at line 151 of file IKORTest.

References robot::sim::IKORTest::env, and robot::sim::IKORTest::testRobotIndex.

ref<Robot> robot::sim::IKORTest::getRobot  )  [inline, inherited]
 

which robot is to be tested?

Definition at line 150 of file IKORTest.

References robot::sim::IKORTest::env, and robot::sim::IKORTest::testRobotIndex.

Test& robot::sim::IKORTest::getTest Int  index  )  [inline, inherited]
 

Definition at line 157 of file IKORTest.

References Assert, robot::sim::IKORTest::numTests(), and robot::sim::IKORTest::tests.

base::PathName robot::sim::IKORTest::getTestInputPath  )  const [inline, inherited]
 

the VFileSystem path from which the test specification was read

Definition at line 160 of file IKORTest.

References robot::sim::IKORTest::inputPath.

virtual bool base::ReferencedObject::isSameKindAs const ReferencedObject  )  const [inline, virtual, inherited]
 

Definition at line 52 of file ReferencedObject.

virtual bool base::Object::isSameKindAs const Object  )  const [inline, virtual, inherited]
 

Definition at line 47 of file Object.

void base::Externalizable::load ref< VFile archive,
const String format = "",
Real  version = 1.0
[inherited]
 

LineSegArray robot::sim::VisualIKORTest::manipToolAsLines const KinematicChain chain,
const Vector q,
Int  numPlatformLinks
[static, protected]
 

osg::Geometry* robot::sim::VisualIKORTest::newGeometryFromLines const LineSegArray lines,
const gfx::Color4 color
[static, protected]
 

osg::Vec3Array* robot::sim::VisualIKORTest::newVertexArrayFromLines const LineSegArray lines  )  [static, protected]
 

Int robot::sim::IKORTest::numTests  )  const [inline, inherited]
 

Definition at line 156 of file IKORTest.

References robot::sim::IKORTest::tests.

Referenced by robot::sim::IKORTest::getTest().

LineSegArray robot::sim::VisualIKORTest::obstaclesAsLines ref< const BasicEnvironment env  )  [static, protected]
 

virtual void base::Referenced::onUnreference  )  const [inline, virtual, inherited]
 

Called by unreference() if enabled via enableOnUnreferenceCall(true). Typically overridden in subclasses that wish to know about unreference() calls - for example to handle manually breaking cyclic references

Reimplemented in robot::control::ControllableAdaptor::AdaptorControlInterface, and robot::control::ControllableAdaptor.

Definition at line 121 of file Referenced.

Referenced by base::Referenced::unreference().

osg::Node* robot::sim::VisualIKORTest::osgCreateAxes  )  const [protected]
 

osg::Node* robot::sim::VisualIKORTest::osgCreateManipulator  )  const [protected]
 

osg::Node* robot::sim::VisualIKORTest::osgCreateObstacles  )  const [protected]
 

osg::Node* robot::sim::VisualIKORTest::osgCreateTrajectory  )  const [protected]
 

LineSegArray robot::sim::VisualIKORTest::platformAsLines ref< const PlatformDescription platfDescr,
const KinematicChain platfChain,
const Vector q,
Real  steerAngle
[static, protected]
 

void base::Referenced::reference  )  const [inline, inherited]
 

Increment the reference count by one, indicating that this object has another pointer which is referencing it.

Definition at line 65 of file Referenced.

References base::Referenced::_refCount.

const int base::Referenced::referenceCount  )  const [inline, inherited]
 

Return the number pointers currently referencing this object.

Definition at line 112 of file Referenced.

References base::Referenced::_refCount.

Referenced by robot::control::ControllableAdaptor::AdaptorControlInterface::onUnreference().

void base::Externalizable::save ref< VFile archive,
const String format = "",
Real  version = 1.0
[inherited]
 

void robot::sim::IKORTest::saveResults bool  saveTrajFiles = true,
base::PathName  alternateOutputFileName = base::PathName()
[inherited]
 

save the test and any results Externalizes the entire IKORTest specification with results (if present) Also, if saveTrajFiles is true, the result trajectory of each test is saved in a seperate file (per test)

void robot::sim::IKORTest::setEnvironment ref< BasicEnvironment env  )  [inherited]
 

virtual void base::Named::setName const String name  )  [inline, protected, virtual, inherited]
 

Reimplemented in physics::Collidable, physics::Solid, and robot::sim::BasicEnvironment::Obstacle.

Definition at line 47 of file Named.

References base::String.

Referenced by robot::control::ControllableAdaptor::AdaptorControlInterface::AdaptorControlInterface(), robot::control::kinematics::BetaFormConstraints::BetaFormConstraint::BetaFormConstraint(), robot::control::kinematics::IKORController::EEPositionControlInterface::EEPositionControlInterface(), robot::control::kinematics::IKOR::JointLimitBetaConstraint::JointLimitBetaConstraint(), robot::control::kinematics::IKORController::LinkPositionsControlInterface::LinkPositionsControlInterface(), robot::ToolDescription::operator=(), robot::RobotDescription::operator=(), robot::PlatformDescription::operator=(), robot::ManipulatorDescription::operator=(), base::Named::operator=(), robot::control::ManipulatorPIDPositionController::PositionInterface::PositionInterface(), robot::RobotDescription::set(), robot::PlatformDescription::set(), robot::ManipulatorDescription::set(), and physics::Solid::setName().

void robot::sim::VisualIKORTest::svgLine base::Externalizer e,
base::dom::DOMElement *  svgElem,
const gfx::Segment3 line
const [protected]
 

void robot::sim::VisualIKORTest::svgLines base::Externalizer e,
base::dom::DOMElement *  svgElem,
const LineSegArray lines
const [protected]
 

void robot::sim::VisualIKORTest::svgOutputAxes base::Externalizer e,
base::dom::DOMElement *  svgElem
const [protected]
 

void robot::sim::VisualIKORTest::svgText base::Externalizer e,
base::dom::DOMElement *  svgElem,
const Point3 pos,
const String &  text,
Real  size = 11
const [protected]
 

LineSegArray robot::sim::VisualIKORTest::trajectoryAsLines const array< base::Vector > &  xs  )  [static, protected]
 

bool base::Referenced::unreference  )  const [inline, inherited]
 

Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the refence count goes to zero, it is assumed that this object is nolonger referenced and is automatically deleted.

Definition at line 81 of file Referenced.

References base::Referenced::_refCount, Exception, base::Referenced::onUnreference(), and base::Referenced::onUnreferenceEnabled.

virtual void robot::sim::VisualIKORTest::updateVisuals  )  const [virtual]
 

virtual bool robot::sim::VisualIKORTest::visualTypeSupported VisualType  type  )  const [inline, virtual]
 

Reimplemented from gfx::Visual.

Definition at line 58 of file VisualIKORTest.


Member Data Documentation

int base::Referenced::_refCount [mutable, protected, inherited]
 

Definition at line 136 of file Referenced.

Referenced by base::Referenced::reference(), base::Referenced::referenceCount(), base::Referenced::Referenced(), base::Referenced::unreference(), and base::Referenced::~Referenced().

Real robot::sim::IKORTest::alpha [inherited]
 

Definition at line 179 of file IKORTest.

Visual::Attributes robot::sim::VisualIKORTest::attributes [mutable, protected]
 

Definition at line 83 of file VisualIKORTest.

ref<base::Cache> robot::sim::IKORTest::cache [protected, inherited]
 

Definition at line 190 of file IKORTest.

Real robot::sim::IKORTest::d [inherited]
 

Definition at line 179 of file IKORTest.

bool robot::sim::IKORTest::displayAxes [inherited]
 

true if coordinate axes selected for display

Definition at line 172 of file IKORTest.

bool robot::sim::IKORTest::displayEEPath [inherited]
 

true if the path of the manip/tool is selected for display

Definition at line 174 of file IKORTest.

bool robot::sim::IKORTest::displayObstacles [inherited]
 

true if obstacles are selected for display

Definition at line 171 of file IKORTest.

bool robot::sim::IKORTest::displayPlatform [inherited]
 

true if the platform should be displayed

Definition at line 173 of file IKORTest.

Int robot::sim::IKORTest::displayStepMod [inherited]
 

only display every nth step (1 for all steps)

Definition at line 175 of file IKORTest.

ref<SimulatedBasicEnvironment> robot::sim::IKORTest::env [protected, inherited]
 

Definition at line 191 of file IKORTest.

Referenced by robot::sim::IKORTest::getEnvironment(), and robot::sim::IKORTest::getRobot().

ref<base::VFileSystem> robot::sim::IKORTest::filesystem [protected, inherited]
 

Definition at line 189 of file IKORTest.

base::PathName robot::sim::IKORTest::inputPath [protected, inherited]
 

Definition at line 197 of file IKORTest.

Referenced by robot::sim::IKORTest::getTestInputPath().

base::Point3 robot::sim::IKORTest::lookAtTarget [inherited]
 

camera parameters (as in gfx::LookAtCameraManipulator)

Definition at line 178 of file IKORTest.

osg::ref_ptr<osg::Switch> robot::sim::VisualIKORTest::node [mutable, protected]
 

Definition at line 84 of file VisualIKORTest.

bool base::Referenced::onUnreferenceEnabled [protected, inherited]
 

Definition at line 137 of file Referenced.

Referenced by base::Referenced::enableOnUnreferenceCall(), base::Referenced::Referenced(), and base::Referenced::unreference().

const Int gfx::Visual::OSGVisual = 1 [static, inherited]
 

Definition at line 45 of file Visual.

base::Matrix4 robot::sim::VisualIKORTest::svgTransform [protected]
 

Definition at line 99 of file VisualIKORTest.

array< osg::ref_ptr<osg::Switch> > robot::sim::VisualIKORTest::testManipSwitches [mutable, protected]
 

one Switch per test, where children are joint space configurations of manipulator

Definition at line 95 of file VisualIKORTest.

Int robot::sim::IKORTest::testManipulatorIndex [protected, inherited]
 

which manipulator (in case the robot has multiple) is used for testing

Definition at line 193 of file IKORTest.

Referenced by robot::sim::IKORTest::getManipulatorIndex().

array< osg::ref_ptr<osg::Switch> > robot::sim::VisualIKORTest::testPlatfSwitches [mutable, protected]
 

one Switch per test, where children are joint space configurations of platform

Definition at line 94 of file VisualIKORTest.

Int robot::sim::IKORTest::testRobotIndex [protected, inherited]
 

which robot from the environment is used for testing

Definition at line 192 of file IKORTest.

Referenced by robot::sim::IKORTest::getRobot().

array<Test> robot::sim::IKORTest::tests [protected, inherited]
 

Definition at line 196 of file IKORTest.

Referenced by robot::sim::IKORTest::getTest(), and robot::sim::IKORTest::numTests().

Real robot::sim::IKORTest::theta [inherited]
 

Definition at line 179 of file IKORTest.


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:43:34 2004 for OpenSim by doxygen 1.3.6