150 likes | 291 Views
CISbots. Robotics Simulator Intelligent Systems Lab. What is it ?. Software framework - Simulating Robotics Algorithms. Objectives / High Level Features. Generic – No physical environment assumptions 3D Visualization Extensible – Add new entities Open Source – Maintained on SourceForge
E N D
CISbots Robotics Simulator Intelligent Systems Lab
What is it ? • Software framework - Simulating Robotics Algorithms
Objectives / High Level Features • Generic – No physical environment assumptions • 3D Visualization • Extensible – Add new entities • Open Source – Maintained on SourceForge • Developed in C++ with MS Visual Studio 2008
Architecture Simulator 3D Visualization Environment Managers Robot Entities Obstacle Entities
Object Entities • Both static objects (e.g. floor, obstacles) and dynamic objects are entities • Entity has: • Properties – A set of labeled string values • These maintain the object’s state (position, shape) • One property all entities have is a GUID • A motion function called progress • For dynamic objects, the actions / movement it performs
Simulation Flow • Frame Stages: • Preprocess • Move • Management • Render • Post-process
Serialized Simulation Environment <serialization> <simulator> <properties> <property name="timestamp" value="1"/> <property name="frame_time" value="100"/> </properties> </simulator> <entities> <entity module="box"> <properties> <property name="guid" value="floor"/> <property name="module" value="box"/> <property name="matrix" value="1 0 0 0;0 1 0 0;0 0 1 0;0 -1 0 1"/> <property name="vrml" value="blackbox.wrl"/> <property name="scale" value="320,2,240"/> <property name="collidable" value="NO"/> </properties> </entity> Example
Typical Robot Progress • Typical progress function contains: • Save original robot state • Evaluation of world state / sensors • Modify transformation matrix • Apply collision response, if necessary
3D World Space • Each visible entity has a 4x4 transformation matrix • Specifies position and orientation • Matrix is usually modified by applyingTranslation and Rotation transforms Y - up Z - forward 1 0 0 00 1 0 00 0 1 0x y z 1 c 0 s 0 0 1 0 0-s 0 c 0 0 0 0 1 X - right TranslationTransform Yaw Rotation Transformc=cos(a), s=sin(a)
Sensors • Theoretically, any type of sensor can be implemented • Currently implemented: • Camera – Uses 3D visualization to generate imageCan be placed in any position / orientation (synchronous) • Laser distance sensor – Returns point of contact of first object along ray path (asynchronous)
Notifications • Entities may generate events • Entities may register to get notifications of events from other entities • Examples: • 3D Visualization registers to get all motion events • An entity gets notification when an asynchronous sensor has a result value
Entity Software Structure • Each entity type is a dynamic library (DLL) • DLL exports a fixed set of functions: • GetName Returns name of entity type • GetDescription A short description • Startup Initialization if needed • Shutdown Called before DLL is unloaded • Create Create a new entity instance • GetIconPath Path to an icon image
Physics • Physics rules can be implemented if needed • Collision detection manager is in place • All entities marked as collidable are checked • In case of collision, both entities are ‘notified’
Communication • A socket server is built into the simulator to allow an external program to control entities • The external program can be on the same or different machine than the one running the simulation • Message refer to entities using the entity GUID