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

robot::sim::SimulatedBasicEnvironment Class Reference

Inheritance diagram for robot::sim::SimulatedBasicEnvironment:

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

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

 SimulatedBasicEnvironment (ref< base::VFileSystem > fs, ref< base::Cache > cache, const String &name="", bool dynamic=true)
 SimulatedBasicEnvironment (const SimulatedBasicEnvironment &e)
virtual void setDynamic (bool enabled)
virtual String className () const
virtual Object & clone () const
virtual ref< RobotDescriptionnewRobotDescription () const
virtual ref< ToolDescriptionnewToolDescription () const
virtual ref< RobotaddRobot (ref< const robot::RobotDescription > robotDescription, const base::Point3 &position, const base::Orient &orientation, bool anchored=false)
 add Robot with the given description to the environment at the specified position/orientation (fixed there if anchored is true)

virtual void removeRobot (ref< robot::Robot > robot)
virtual Int numRobots () const
virtual ref< RobotgetRobot (Int i)
virtual ref< Tool > addTool (ref< const robot::ToolDescription > toolDescription, const base::Point3 &position, const base::Orient &orientation)
virtual void removeTool (ref< Tool > tool)
virtual Int numTools () const
virtual ref< Tool > getTool (Int i)
virtual ref< const Tool > getTool (Int i) const
virtual void placeToolInProximity (ref< Tool > tool, ref< Robot > robot, Int manipulatorIndex=0)
 place the specified tool within grasping range of the end-effector of the specified robot manipulator

virtual ref< BasicEnvironment::ObstacleaddBoxObstacle (base::Dimension3 dim, const base::Point3 &position, const base::Orient &orientation, const String &name="")
virtual ref< BasicEnvironment::ObstacleaddSphereObstacle (Real radius, const base::Point3 &position, const base::Orient &orientation, const String &name="")
virtual ref< BasicEnvironment::ObstacleaddBoxObstacle (base::Dimension3 dim, const base::Point3 &position, const base::Orient &orientation, ref< const physics::Material > material, const String &name="")
virtual ref< BasicEnvironment::ObstacleaddSphereObstacle (Real radius, const base::Point3 &position, const base::Orient &orientation, ref< const physics::Material > material, const String &name="")
virtual void removeObstacle (ref< BasicEnvironment::Obstacle > obstacle)
virtual void setObstacleColor (ref< BasicEnvironment::Obstacle > obstacle, const gfx::Color3 &color)
virtual void setObstacleDensity (ref< BasicEnvironment::Obstacle > obstacle, Real density)
virtual Int numObstacles () const
virtual ref< Obstacle > getObstacle (Int i)
virtual ref< const Obstacle > getObstacle (Int i) const
virtual osg::Node * createOSGVisual (Visual::Attributes visualAttributes=0) const
virtual void preSimulate ()
virtual void simulateForSimTime (const base::Time &dt)
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, const String format="", Real version=1.0)
 read or write object state to Externalizer

virtual void removeObstacle (ref< Obstacle > obstacle)=0
virtual void simulateForSimTime (const Time &dt)=0
void simulateForRealTime (const Time &dt, Real simTimeStepSize=minSimStepSize)
virtual bool isSameKindAs (const ReferencedObject &) const
virtual bool isSameKindAs (const Object &) const
void reference () const
bool unreference () const
const int referenceCount () const
void enableOnUnreferenceCall (bool enabled)
virtual void onUnreference () const
virtual void externalize (Externalizer &e, String format="", Real version=1.0) const
 write object state to Externalizer (throws if e is in Input)

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 visualTypeSupported (VisualType type) const
ref< base::Cachecache () const
ref< base::VFileSystemfilesystem () const
virtual void renderFrame ()
virtual const String & getName () const

Static Public Attributes

const Real minSimStepSize
const Int OSGVisual = 1

Protected Types

typedef reflist< robot::sim::SimulatedRobotRobotList
typedef std::list< bool > RobotAnchoredList
typedef reflist< Tool > ToolList
typedef reflist< SolidObstacleObstacleList

Protected Member Functions

void construct ()
ref< physics::SolidfindObstacle (ref< Obstacle > obstacle)
void checkTools ()
 check each tool for proximity with end-effectors of each robot

virtual void setName (const String &name)

Protected Attributes

bool dynamic
 true for a dynamic simulation, fasle for static (no force/torque or velocity control, just position control)

ref< physics::SolidSystemsystem
 SolidSystem for simulating physical bodies in this environment.

ref< physics::CollidableGroupcollidables
 Collidables for items in the environment.

ref< physics::CollidablegroundCollidable
 Collidable for the ground.

ref< physics::CollisionCullercollisionCuller
 CollisionCuller registering which Collidables shouldn't be collided.

ref< physics::Solidground
 Solid ground (flat).

ref< physics::ConstraintGroupcgroup
 constraints (e.g. for fixing robots to the ground)

RobotList robots
 list of robots in the environment

ToolList tools
 list of tools in the environment

ObstacleList obstacles
 list of Solid obstacles in the environment

RobotAnchoredList robotsAnchored
 for each robot, is it anchored to the environment?

Visual::Attributes attributes
osg::ref_ptr< osg::Group > rootnode
int _refCount
bool onUnreferenceEnabled
ref< base::VFileSystemvfilesystem
ref< base::CachetheCache

Detailed Description

A basic 'no-frills' simulated environment for robots Robot instances added must be of type SimulatedRobot.

Definition at line 59 of file SimulatedBasicEnvironment.


Member Typedef Documentation

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

Definition at line 39 of file Visual.

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

typedef reflist<SolidObstacle> robot::sim::SimulatedBasicEnvironment::ObstacleList [protected]
 

Definition at line 211 of file SimulatedBasicEnvironment.

typedef std::list<bool> robot::sim::SimulatedBasicEnvironment::RobotAnchoredList [protected]
 

Definition at line 209 of file SimulatedBasicEnvironment.

typedef reflist<robot::sim::SimulatedRobot> robot::sim::SimulatedBasicEnvironment::RobotList [protected]
 

Definition at line 208 of file SimulatedBasicEnvironment.

typedef reflist<Tool> robot::sim::SimulatedBasicEnvironment::ToolList [protected]
 

Definition at line 210 of file SimulatedBasicEnvironment.

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::SimulatedBasicEnvironment::SimulatedBasicEnvironment ref< base::VFileSystem fs,
ref< base::Cache cache,
const String &  name = "",
bool  dynamic = true
 

Referenced by clone().

robot::sim::SimulatedBasicEnvironment::SimulatedBasicEnvironment const SimulatedBasicEnvironment e  ) 
 


Member Function Documentation

virtual ref<BasicEnvironment::Obstacle> robot::sim::SimulatedBasicEnvironment::addBoxObstacle base::Dimension3  dim,
const base::Point3 position,
const base::Orient orientation,
ref< const physics::Material material,
const String &  name = ""
[virtual]
 

virtual ref<BasicEnvironment::Obstacle> robot::sim::SimulatedBasicEnvironment::addBoxObstacle base::Dimension3  dim,
const base::Point3 position,
const base::Orient orientation,
const String &  name = ""
[virtual]
 

Implements robot::sim::BasicEnvironment.

virtual ref<Robot> robot::sim::SimulatedBasicEnvironment::addRobot ref< const robot::RobotDescription robotDescription,
const base::Point3 position,
const base::Orient orientation,
bool  anchored = false
[virtual]
 

add Robot with the given description to the environment at the specified position/orientation (fixed there if anchored is true)

Implements robot::sim::Environment.

virtual ref<BasicEnvironment::Obstacle> robot::sim::SimulatedBasicEnvironment::addSphereObstacle Real  radius,
const base::Point3 position,
const base::Orient orientation,
ref< const physics::Material material,
const String &  name = ""
[virtual]
 

virtual ref<BasicEnvironment::Obstacle> robot::sim::SimulatedBasicEnvironment::addSphereObstacle Real  radius,
const base::Point3 position,
const base::Orient orientation,
const String &  name = ""
[virtual]
 

Implements robot::sim::BasicEnvironment.

virtual ref<Tool> robot::sim::SimulatedBasicEnvironment::addTool ref< const robot::ToolDescription toolDescription,
const base::Point3 position,
const base::Orient orientation
[virtual]
 

Implements robot::sim::BasicEnvironment.

ref<base::Cache> base::World::cache  )  const [inline, inherited]
 

Definition at line 51 of file World.

References base::World::theCache.

void robot::sim::SimulatedBasicEnvironment::checkTools  )  [protected]
 

check each tool for proximity with end-effectors of each robot

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

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

Reimplemented from gfx::OSGWorld.

Definition at line 67 of file SimulatedBasicEnvironment.

virtual Object& robot::sim::SimulatedBasicEnvironment::clone  )  const [inline, virtual]
 

return a shallow copy, with Object& return type. Must be defined by derived classes.

Implements base::Cloneable.

Definition at line 69 of file SimulatedBasicEnvironment.

References NewObj, and SimulatedBasicEnvironment().

void robot::sim::SimulatedBasicEnvironment::construct  )  [protected]
 

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

Reimplemented from gfx::Visual.

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::SimulatedBasicEnvironment::externalize base::Externalizer e,
const String  format = "",
Real  version = 1.0
[virtual]
 

read or write object state to Externalizer

Implements base::Externalizable.

ref<base::VFileSystem> base::World::filesystem  )  const [inline, inherited]
 

Definition at line 52 of file World.

ref<physics::Solid> robot::sim::SimulatedBasicEnvironment::findObstacle ref< Obstacle >  obstacle  )  [protected]
 

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

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

Implements base::Externalizable.

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==().

virtual ref<const Obstacle> robot::sim::SimulatedBasicEnvironment::getObstacle Int  i  )  const [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 139 of file SimulatedBasicEnvironment.

References base::elementAt(), and obstacles.

virtual ref<Obstacle> robot::sim::SimulatedBasicEnvironment::getObstacle Int  i  )  [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 138 of file SimulatedBasicEnvironment.

References base::elementAt(), and obstacles.

virtual ref<Robot> robot::sim::SimulatedBasicEnvironment::getRobot Int  i  )  [inline, virtual]
 

Implements robot::sim::Environment.

Definition at line 88 of file SimulatedBasicEnvironment.

References base::elementAt(), and robots.

virtual ref<const Tool> robot::sim::SimulatedBasicEnvironment::getTool Int  i  )  const [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 101 of file SimulatedBasicEnvironment.

References base::elementAt(), and tools.

virtual ref<Tool> robot::sim::SimulatedBasicEnvironment::getTool Int  i  )  [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 100 of file SimulatedBasicEnvironment.

References base::elementAt(), and tools.

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

Definition at line 47 of file Object.

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

Definition at line 52 of file ReferencedObject.

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

virtual ref<RobotDescription> robot::sim::SimulatedBasicEnvironment::newRobotDescription  )  const [inline, virtual]
 

Implements robot::sim::Environment.

Definition at line 73 of file SimulatedBasicEnvironment.

References NewObj.

virtual ref<ToolDescription> robot::sim::SimulatedBasicEnvironment::newToolDescription  )  const [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 76 of file SimulatedBasicEnvironment.

References NewObj.

virtual Int robot::sim::SimulatedBasicEnvironment::numObstacles  )  const [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 137 of file SimulatedBasicEnvironment.

References obstacles, and base::reflist< _Tp, _Alloc >::size().

virtual Int robot::sim::SimulatedBasicEnvironment::numRobots  )  const [inline, virtual]
 

Implements robot::sim::Environment.

Definition at line 87 of file SimulatedBasicEnvironment.

References robots, and base::reflist< _Tp, _Alloc >::size().

virtual Int robot::sim::SimulatedBasicEnvironment::numTools  )  const [inline, virtual]
 

Implements robot::sim::BasicEnvironment.

Definition at line 99 of file SimulatedBasicEnvironment.

References base::reflist< _Tp, _Alloc >::size(), and tools.

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().

virtual void robot::sim::SimulatedBasicEnvironment::placeToolInProximity ref< Tool >  tool,
ref< Robot robot,
Int  manipulatorIndex = 0
[virtual]
 

place the specified tool within grasping range of the end-effector of the specified robot manipulator

Implements robot::sim::BasicEnvironment.

virtual void robot::sim::SimulatedBasicEnvironment::preSimulate  )  [virtual]
 

Implements base::Simulatable.

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().

virtual void robot::sim::BasicEnvironment::removeObstacle ref< Obstacle obstacle  )  [pure virtual, inherited]
 

Implemented in robot::sim::TestBasicEnvironment.

virtual void robot::sim::SimulatedBasicEnvironment::removeObstacle ref< BasicEnvironment::Obstacle obstacle  )  [virtual]
 

virtual void robot::sim::SimulatedBasicEnvironment::removeRobot ref< robot::Robot robot  )  [virtual]
 

Implements robot::sim::Environment.

virtual void robot::sim::SimulatedBasicEnvironment::removeTool ref< Tool >  tool  )  [virtual]
 

Implements robot::sim::BasicEnvironment.

virtual void base::World::renderFrame  )  [inline, virtual, inherited]
 

Definition at line 54 of file World.

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

virtual void robot::sim::SimulatedBasicEnvironment::setDynamic bool  enabled  )  [virtual]
 

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().

virtual void robot::sim::SimulatedBasicEnvironment::setObstacleColor ref< BasicEnvironment::Obstacle obstacle,
const gfx::Color3 color
[virtual]
 

virtual void robot::sim::SimulatedBasicEnvironment::setObstacleDensity ref< BasicEnvironment::Obstacle obstacle,
Real  density
[virtual]
 

void base::Simulatable::simulateForRealTime const Time dt,
Real  simTimeStepSize = minSimStepSize
[inherited]
 

Reimplemented in base::Universe.

virtual void base::Simulatable::simulateForSimTime const Time dt  )  [pure virtual, inherited]
 

Implemented in base::Universe.

virtual void robot::sim::SimulatedBasicEnvironment::simulateForSimTime const base::Time dt  )  [virtual]
 

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 bool gfx::OSGWorld::visualTypeSupported VisualType  type  )  const [inline, virtual, inherited]
 

Reimplemented from gfx::Visual.

Definition at line 49 of file OSGWorld.


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().

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

Definition at line 218 of file SimulatedBasicEnvironment.

ref<physics::ConstraintGroup> robot::sim::SimulatedBasicEnvironment::cgroup [protected]
 

constraints (e.g. for fixing robots to the ground)

Definition at line 206 of file SimulatedBasicEnvironment.

ref<physics::CollidableGroup> robot::sim::SimulatedBasicEnvironment::collidables [protected]
 

Collidables for items in the environment.

Definition at line 202 of file SimulatedBasicEnvironment.

ref<physics::CollisionCuller> robot::sim::SimulatedBasicEnvironment::collisionCuller [protected]
 

CollisionCuller registering which Collidables shouldn't be collided.

Definition at line 204 of file SimulatedBasicEnvironment.

bool robot::sim::SimulatedBasicEnvironment::dynamic [protected]
 

true for a dynamic simulation, fasle for static (no force/torque or velocity control, just position control)

Definition at line 199 of file SimulatedBasicEnvironment.

ref<physics::Solid> robot::sim::SimulatedBasicEnvironment::ground [protected]
 

Solid ground (flat).

Definition at line 205 of file SimulatedBasicEnvironment.

ref<physics::Collidable> robot::sim::SimulatedBasicEnvironment::groundCollidable [protected]
 

Collidable for the ground.

Definition at line 203 of file SimulatedBasicEnvironment.

const Real base::Simulatable::minSimStepSize [static, inherited]
 

Definition at line 39 of file Simulatable.

ObstacleList robot::sim::SimulatedBasicEnvironment::obstacles [protected]
 

list of Solid obstacles in the environment

Definition at line 215 of file SimulatedBasicEnvironment.

Referenced by getObstacle(), and numObstacles().

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.

RobotList robot::sim::SimulatedBasicEnvironment::robots [protected]
 

list of robots in the environment

Definition at line 213 of file SimulatedBasicEnvironment.

Referenced by getRobot(), and numRobots().

RobotAnchoredList robot::sim::SimulatedBasicEnvironment::robotsAnchored [protected]
 

for each robot, is it anchored to the environment?

Definition at line 216 of file SimulatedBasicEnvironment.

osg::ref_ptr<osg::Group> robot::sim::SimulatedBasicEnvironment::rootnode [mutable, protected]
 

Definition at line 219 of file SimulatedBasicEnvironment.

ref<physics::SolidSystem> robot::sim::SimulatedBasicEnvironment::system [protected]
 

SolidSystem for simulating physical bodies in this environment.

Definition at line 201 of file SimulatedBasicEnvironment.

ref<base::Cache> base::World::theCache [protected, inherited]
 

Definition at line 58 of file World.

Referenced by base::World::cache(), and base::World::World().

ToolList robot::sim::SimulatedBasicEnvironment::tools [protected]
 

list of tools in the environment

Definition at line 214 of file SimulatedBasicEnvironment.

Referenced by getTool(), and numTools().

ref<base::VFileSystem> base::World::vfilesystem [protected, inherited]
 

Definition at line 57 of file World.


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