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

robot::sim::SimulatedRobot Class Reference

Inheritance diagram for robot::sim::SimulatedRobot:

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

Collaboration graph
[legend]
List of all members.

Public Types

enum  CoordFrame {
  UnknownFrame, EndEffectorFrame, EndEffectorBaseFrame, BaseFrame,
  MountFrame, PlatformFrame, WorldFrame
}
typedef std::bitset< sizeof(Int)*8 CollidableFlags )
typedef Int CollidableFlag
enum  ExternalizationType { Input = 1, Output = 2, IO = 3 }

Public Member Functions

 SimulatedRobot (ref< base::VFile > robotSpecification, const base::Point3 &initialPosition, const base::Orient &initialOrientation, ref< physics::SolidSystem > solidSystem, bool dynamic=true)
 SimulatedRobot (ref< const robot::RobotDescription > robotDescription, const base::Point3 &initialPosition, const base::Orient &initialOrientation, ref< physics::SolidSystem > solidSystem, bool dynamic=true)
virtual String className () const
virtual ref< PlatformDescriptionnewPlatformDescription () const
virtual ref< ManipulatorDescriptionnewManipulatorDescription () const
virtual void setDynamic (bool enabled)
virtual void setSolidSystem (ref< physics::SolidSystem > solidSystem)
virtual array< std::pair<
String, String > > 
controlInterfaces () const
virtual ref< ControlInterfacegetControlInterface (String interfaceName="") throw (std::invalid_argument)
virtual bool isDescriptionProvided () const
 is there a description of this robot available?

virtual ref< physics::SolidgetPlatformSolid () const
virtual void setPosition (const Point3 &pos)
virtual Point3 getPosition () const
virtual void setOrientation (const Orient &orient)
virtual Orient getOrientation () const
virtual void setConfiguration (const base::Transform &configuration)
virtual base::Transform getConfiguration () const
bool checkProximity (ref< SimulatedTool > tool)
 test if tool is in position to be grasped by any end-effectors.

void placeToolInProximity (ref< SimulatedTool > tool, Int manipIndex=0)
 'magically' transport a tool to within grasping range of the end-effector

bool graspTool (Int manipIndex=0)
void releaseGrasp (Int manipIndex=0)
 release grasp

virtual ref< physics::CollidablecreateCollidable (CollidableFlags flags=0)
virtual bool formatSupported (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

virtual ref< const RobotDescriptiongetRobotDescription () const throw (std::logic_error)
 get a description of the robot, if provided. Throws an exception if no description can be provided.

virtual ref< RobotDescriptionnewRobotDescription () const
virtual ref< ToolDescriptionnewToolDescription () const
base::Matrix4 coordFrameTransform (CoordFrame from, CoordFrame to=PlatformFrame, Int manipulatorIndex=0, const base::Matrix4 &T=base::Matrix4(), const base::Point3 &platformPosition=base::Point3(), const base::Orient &platformOrientation=base::Orient()) const
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 setPositionOrientation (const Point3 &pos, const Orient &orient)
virtual void setPosition2D (const base::Point2 &p, Real theta)
 set the 2D (x,y,theta) position (theta is rot. angle about Z-axis)

virtual base::Point2 getPosition2D () const
 get the 2D (x,y) position

Real getOrientation2D () const
 get the 2D angle theta (rot. angle about Z-axis)

virtual const String & getName () 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)

Static Public Member Functions

CoordFrame coordFrame (const String &frameString)
 convert String coord. frame specifier to CoordFrame

String coordFrame (CoordFrame coordFrame)
 convert coord. frame specifier to String


Protected Types

enum  ControlType { ForceControl, VelControl, PosControl }

Protected Member Functions

void construct (const base::Point3 &initialPosition, const base::Orient &initialOrientation)
 construct the physical robot from loaded spec by adding bodies, joints and motors into solidSystem

void setRobotDescription (ref< const RobotDescription > robotDescription)
virtual void setName (const String &name)

Protected Attributes

ref< SimulatedPlatformplatform
 simulated robot platform

reflist< SimulatedSerialManipulatormanipulators
 simulated manipulators

ref< physics::SolidSystemsolidSystem
 SolidSystem into which the robot's physical parts will be added.

ref< physics::SpatialGroupspatialGroup
 a group containing the platform and manipulators

bool dynamic
int _refCount
bool onUnreferenceEnabled

Detailed Description

A concrete Robot class that instantiates a simulated robot according to a supplied specification. Simulated by adding bodies, joints and motors to solidSystem.

Definition at line 58 of file SimulatedRobot.


Member Typedef Documentation

typedef Int physics::CollidableProvider::CollidableFlag [inherited]
 

Definition at line 45 of file CollidableProvider.

typedef std::bitset<sizeof(Int)*8 physics::CollidableProvider::CollidableFlags) [inherited]
 

Definition at line 44 of file CollidableProvider.


Member Enumeration Documentation

enum robot::sim::SimulatedRobot::ControlType [protected]
 

ForceControl & VelControl require a dynamic simulation; PosControl will also function for simple non-dynamic simulations

Enumeration values:
ForceControl 
VelControl 
PosControl 

Definition at line 204 of file SimulatedRobot.

enum robot::Robot::CoordFrame [inherited]
 

Enumeration values:
UnknownFrame 
EndEffectorFrame 
EndEffectorBaseFrame 
BaseFrame 
MountFrame 
PlatformFrame 
WorldFrame 

Definition at line 81 of file Robot.

enum base::Externalizable::ExternalizationType [inherited]
 

Enumeration values:
Input 
Output 
IO 

Definition at line 40 of file Externalizable.


Constructor & Destructor Documentation

robot::sim::SimulatedRobot::SimulatedRobot ref< base::VFile robotSpecification,
const base::Point3 initialPosition,
const base::Orient initialOrientation,
ref< physics::SolidSystem solidSystem,
bool  dynamic = true
 

robot::sim::SimulatedRobot::SimulatedRobot ref< const robot::RobotDescription robotDescription,
const base::Point3 initialPosition,
const base::Orient initialOrientation,
ref< physics::SolidSystem solidSystem,
bool  dynamic = true
 


Member Function Documentation

bool robot::sim::SimulatedRobot::checkProximity ref< SimulatedTool tool  ) 
 

test if tool is in position to be grasped by any end-effectors.

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

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

Implements base::Object.

Definition at line 70 of file SimulatedRobot.

void robot::sim::SimulatedRobot::construct const base::Point3 initialPosition,
const base::Orient initialOrientation
[protected]
 

construct the physical robot from loaded spec by adding bodies, joints and motors into solidSystem

virtual array<std::pair<String,String> > robot::sim::SimulatedRobot::controlInterfaces  )  const [virtual]
 

A Robot provides a number of ControlInterfaces for various parts, such as its drive platform, manipulators and other sensors etc. Refer to documentation for specific concrete Robot implementation for specific ControlInterface names and descriptions. This method enumerates the ControlInterface names and their types. The interfaces can be obtained by passing the name to the getControlInterface() method.

Reimplemented from robot::Robot.

String robot::Robot::coordFrame CoordFrame  coordFrame  )  [static, inherited]
 

convert coord. frame specifier to String

CoordFrame robot::Robot::coordFrame const String &  frameString  )  [static, inherited]
 

convert String coord. frame specifier to CoordFrame

base::Matrix4 robot::Robot::coordFrameTransform CoordFrame  from,
CoordFrame  to = PlatformFrame,
Int  manipulatorIndex = 0,
const base::Matrix4 T = base::Matrix4(),
const base::Point3 platformPosition = base::Point3(),
const base::Orient platformOrientation = base::Orient()
const [inherited]
 

Obtain transformation that will transform between coordinate frames Some transformations will require further information, such as specifying the forward kinematics transform from the base frame to the end-effector frame, or which manipulator (EndEffector[Base]Frame, BaseFrame & MountFrame) Transformations involving the WorldFrame require the platform position and orientation.

virtual ref<physics::Collidable> robot::sim::SimulatedRobot::createCollidable CollidableFlags  flags = 0  )  [virtual]
 

Implements physics::CollidableProvider.

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

read or write object state to Externalizer

Implements base::Externalizable.

virtual bool robot::sim::SimulatedRobot::formatSupported 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 base::Transform robot::sim::SimulatedRobot::getConfiguration  )  const [virtual]
 

Reimplemented from physics::PositionableOrientable.

virtual ref<ControlInterface> robot::sim::SimulatedRobot::getControlInterface String  interfaceName = ""  )  throw (std::invalid_argument) [virtual]
 

SimulatedRobot provides the following ControlInterfaces (name:type):

platform:PlatformControl (only available when dynamic==true)

  • outputs control drive and stearing motors, depending on the specific platform (possibly none e.g. for a fixed platform) For the basic non-holonomic mobile platform, the first two inputs control the left & right drive motor torques and the third control the steering motor torque. The inputs provide the angular velocity of the drive wheels and the steering angle.

platformVelocity:PlatformVelocityControl (only available when dynamic==true)

  • As for PlatformControl, but the outputs control target velocity instead of torque.

platformPosition:PlatformPositionControl (only available when dynamic==false)

  • outputs control the x,y and angle of the platform w.r.t to the world coordinate frame. The angle is clockwise relative to the x-axis (about z).

manipulatorN:JointForceControl (only available when dynamic==true)

  • where N is the manipulator number (from 1). Outputs control joint force/torque and corresponding inputs give joint position.

manipulatorVelocityN:JointVelocityControl (only available when dynamic==true)

  • where N is the manipulator number (from 1). Outputs control joint velocity and corresponding inputs give joint position.

manipulatorPositionN:JointPositionControl

  • outputs control the position of a manipulators joints (angle for revolute joints, extension for prismatic joints etc.)

manipulatorProximityN:LinkProximitySensors

  • where N is the manipulator number (from 1).
  • Inputs provide proximity sensor information for each link. Each sequence of 5 inputs provides the following information on the sensors of a single link: 0: distance to closest object detected by proximity sensors on the link (or 0 if none detected) 1-3: (x,y,z) direction vector to the closest object detected by proximity sensors on the link 4: the distance along the link x-axis of the proximity sensor that detected the closest object to the link e.g. l*5 + 0 is the distance to the closest object detected by link l=[0..LastLink]
  • There are no outputs

manipulatorToolGripN:ToolGripControl

  • single scalar input represents tool proximity to tool grip mechanism. 0 => not in range to be grasped, 1 => in range to be grasped (or currently grasped) single scalar output controls tool gripper latch 1 => grasp/latch tool, 0 => ungrasp/unlatch tool

toolN:JointForceControl (only available when dynamic==true)

  • joint force/torque output for tool joints (if any); and joint position inputs. Note that the inputSize() and outputSize() change dynamically depending on which tool is grasped (0 when no tool is grasped)

toolVelocityN:JointVelocityControl (only available when dynamic==true)

  • joint velocity output for tool joints (if any); and joint position inputs. Note that the inputSize() and outputSize() change dynamically depending on which tool is grasped (0 when no tool is grasped)

toolPositionN:JointPositionControl (only available when dynamic==false)

  • joint position for tool joints (if any). Note that the inputSize() and outputSize() change dynamically depending on which tool is grasped (0 when no tool is grasped)

Implements robot::Robot.

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 Orient robot::sim::SimulatedRobot::getOrientation  )  const [virtual]
 

Implements physics::Orientable.

Real physics::PositionableOrientable::getOrientation2D  )  const [inherited]
 

get the 2D angle theta (rot. angle about Z-axis)

virtual ref<physics::Solid> robot::sim::SimulatedRobot::getPlatformSolid  )  const [inline, virtual]
 

Definition at line 151 of file SimulatedRobot.

References platform.

virtual Point3 robot::sim::SimulatedRobot::getPosition  )  const [virtual]
 

Implements physics::Positionable.

virtual base::Point2 physics::PositionableOrientable::getPosition2D  )  const [inline, virtual, inherited]
 

get the 2D (x,y) position

Definition at line 72 of file PositionableOrientable.

References physics::Positionable::getPosition(), base::Point2, base::Point3, base::Vector3::x, and base::Vector3::y.

virtual ref<const RobotDescription> robot::Robot::getRobotDescription  )  const throw (std::logic_error) [inline, virtual, inherited]
 

get a description of the robot, if provided. Throws an exception if no description can be provided.

Definition at line 64 of file Robot.

References Exception, and robot::Robot::isDescriptionProvided().

bool robot::sim::SimulatedRobot::graspTool Int  manipIndex = 0  ) 
 

gasp tool (if a suitable one is within grasping proximity of the end-effector) returns true if a tool was grasped

virtual bool robot::sim::SimulatedRobot::isDescriptionProvided  )  const [inline, virtual]
 

is there a description of this robot available?

Reimplemented from robot::Robot.

Definition at line 149 of file SimulatedRobot.

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<ManipulatorDescription> robot::sim::SimulatedRobot::newManipulatorDescription  )  const [inline, virtual]
 

Reimplemented from robot::Robot.

Definition at line 74 of file SimulatedRobot.

References NewObj.

virtual ref<PlatformDescription> robot::sim::SimulatedRobot::newPlatformDescription  )  const [inline, virtual]
 

Reimplemented from robot::Robot.

Definition at line 73 of file SimulatedRobot.

References NewObj.

virtual ref<RobotDescription> robot::Robot::newRobotDescription  )  const [inline, virtual, inherited]
 

Definition at line 74 of file Robot.

References NewObj.

virtual ref<ToolDescription> robot::Robot::newToolDescription  )  const [inline, virtual, inherited]
 

Definition at line 77 of file Robot.

References NewObj.

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

void robot::sim::SimulatedRobot::placeToolInProximity ref< SimulatedTool tool,
Int  manipIndex = 0
 

'magically' transport a tool to within grasping range of the end-effector

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 robot::sim::SimulatedRobot::releaseGrasp Int  manipIndex = 0  ) 
 

release grasp

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

virtual void robot::sim::SimulatedRobot::setConfiguration const base::Transform configuration  )  [virtual]
 

Reimplemented from physics::PositionableOrientable.

virtual void robot::sim::SimulatedRobot::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::SimulatedRobot::setOrientation const Orient orient  )  [virtual]
 

Implements physics::Orientable.

virtual void robot::sim::SimulatedRobot::setPosition const Point3 pos  )  [virtual]
 

Implements physics::Positionable.

virtual void physics::PositionableOrientable::setPosition2D const base::Point2 p,
Real  theta
[virtual, inherited]
 

set the 2D (x,y,theta) position (theta is rot. angle about Z-axis)

virtual void physics::PositionableOrientable::setPositionOrientation const Point3 pos,
const Orient orient
[inline, virtual, inherited]
 

Definition at line 48 of file PositionableOrientable.

References base::Point3, and physics::PositionableOrientable::setConfiguration().

void robot::Robot::setRobotDescription ref< const RobotDescription robotDescription  )  [inline, protected, inherited]
 

Definition at line 115 of file Robot.

virtual void robot::sim::SimulatedRobot::setSolidSystem ref< physics::SolidSystem solidSystem  )  [inline, virtual]
 

Definition at line 79 of file SimulatedRobot.

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.


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

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

if true, full physics is simulated; if false, the Solids that comprise the Robot only have a position/orientation - no velocity/acceleration (and the position based ControlInterfaces can be used instead of the velocity & force/torque interfaces)

Definition at line 199 of file SimulatedRobot.

reflist<SimulatedSerialManipulator> robot::sim::SimulatedRobot::manipulators [protected]
 

simulated manipulators

Definition at line 191 of file SimulatedRobot.

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

ref<SimulatedPlatform> robot::sim::SimulatedRobot::platform [protected]
 

simulated robot platform

Definition at line 190 of file SimulatedRobot.

Referenced by getPlatformSolid().

ref<physics::SolidSystem> robot::sim::SimulatedRobot::solidSystem [protected]
 

SolidSystem into which the robot's physical parts will be added.

Definition at line 193 of file SimulatedRobot.

ref<physics::SpatialGroup> robot::sim::SimulatedRobot::spatialGroup [protected]
 

a group containing the platform and manipulators

Definition at line 195 of file SimulatedRobot.


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