Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment...

23
Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004 Cooperative Robotics Simulator Group

Transcript of Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment...

Page 1: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Cooperative Robotic SimulatorEnvironment Simulator

Cooperative Robotic SimulatorEnvironment Simulator

Masters’ ReportScott J. HarmonMay 12, 2004

Cooperative Robotics Simulator Group

Page 2: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

OutlineOutline

Introduction Overall system Demo

Environment Module Main Loop Map Component Robot and Sensor Components

Module Communications/Major Protocols Robot <--> Environment Viewer<--> Environment

Future Work Network improvements Map improvements Reflection

Page 3: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Overall System ArchitectureOverall System Architecture

Multiple Modules written in Java: Environment Robot Viewer Control Panel Communications

Page 4: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Overall System Architecture-2Overall System Architecture-2

[1]

Robot ControlCode

Robot HardwareSimulator

Hardware SimulatorAPI

Environment Simulator

RobotSimulator

EnvironmentControl Panel

SimController

CommunicationsController

EnvironmentBuilding Tool

EnvironmentDesigner

EnvironmentController

EnvironmentModel

3D ViewerUser

Page 5: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Example DeploymentExample Deployment

Environment

Robot1

Robot2

RobotN

Viewer1

ControlPanel

Messaging

ViewerN

Page 6: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

DemonstrationDemonstration

Page 7: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

System ComponentsSystem Components

«executable»environment::Environment

«executable»robot::HardwareSimulator

«executable»viewer::CRS3DViewer

«executable»controlpanel::ControlPanelClient

ControlPanel Robot

Viewer

communications::CommunicationsSystem

«call»

«send»

«send»

«send»

Page 8: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Environment ComponentsEnvironment Components

EnvironmentEnvironmentFileLoader

EnvironmentMap

EnvironmentObject

EnvironmentObjectRobot

CollisionDetection

RobotSensor

«call»

«call»

«call»

«call»

«derived»«call»

Page 9: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Environment ModuleEnvironment Module

Coordinates and drives the simulation Main Loop using time-step based approach

Models the virtual environment Keeps track of positional and state information of all objects in the

virtual environment

Page 10: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Environment - Main LoopEnvironment - Main Loop

Iterated for each time-step Time-steps size is set at runtime

Drives the simulation

Page 11: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Environment - Main Loop-2Environment - Main Loop-21 waitForRobots();2 setState(STATE_ROBOTS);3 sendObjectsToVRMLClients();4 currentTime = 0;5 running = true;6 setState(STATE_RUNNING);7 while(running) {8 //get the event for this timestep from each Robot9 //lock the robotqueue10 synchronized(robots) {11 //This double-stepped get allows the stuff to travel here before I block trying to get it.12 for (int i = 0; i < robots.size(); i++) {13 EnvironmentObjectRobot robot = (EnvironmentObjectRobot) robots.get(i);14 robot.prepGetEvents(currentTime);15 }16 for (int i = 0; i < robots.size(); i++) {17 EnvironmentObjectRobot robot = (EnvironmentObjectRobot) robots.get(i);18 robot.queueEvents();19 }20 }21 //process queue from front (top).22 processActionEventQueue();23 //send out sensor readings to robots.24 processSensorEventQueue();25 //add timestep to VRMLUpdates.26 for (int i = 0; i < viewerUpdateQueue.size(); i++) {27 ((ViewerUpdateLocation)viewerUpdateQueue.get(i)).timestep = currentTime;28 }29 //send out VRMLUpdates to the VRML viewer30 sendViewerEvents(viewerUpdateQueue);31 currentTime++;32 try {33 Thread.sleep(steppausetime);34 } catch (InterruptedException e) {}35 }

Page 12: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Communications between ModulesCommunications between Modules

Java Socket used Each component connects on a pre-determined port to the

Environment. Serializable objects are sent over the Socket connection.

Page 13: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Robot <--> Environment ProtocolRobot <--> Environment ProtocolEnvironment Robot1

Connect

MyName (String)

Time-Step size (Long)

Timestep (Long)

RobotRequest-1

RobotRequest-2

RobotRequest-N (last message flag set)

RobotSensorResponse-1

RobotSensorResponse-2

RobotSensorResponse-N (last message flag set).

This section repeats forthe life of the simulation.

Message-1 (if messaging is enabled)

Page 14: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Viewer <--> Environment ProtocolViewer <--> Environment Protocol

Environment Viewer

Connect

ViewerObject-1

ViewerObject-2

ViewerObject-3

ViewerObject-4

ViewerObject-N (last message flag set)

ViewerUpdate-1

ViewerUpdate-3

ViewerUpdate-2

ViewerUpdate-N

This section repeats forthe life of the simulation.

Page 15: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

ConclusionsConclusions

Simulator is distributable because of the modularity

Modules communicate using protocols over a socket connection

Environment module is responsible for orchestrating the simulation and for modeling the virtual environment.

Page 16: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Future WorkFuture Work

There are three areas in the Environment module to improve: Network Map Reflection

Page 17: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Future Work – NetworkFuture Work – Network Network is utilized for communications between modules

Enhancements: Optimize by reducing amount of communications Improve latency

Fetch Robot commands in separate threads while previous commands are being evaluated

Page 18: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Future Work – Network-2Future Work – Network-2 Example Protocol:

Environment EnvironmentObjectRobot1 EnvironmentObjectRobot2

RobotHardware1 RobotHardware2Start

Start

Timestep1

Timestep1Reqest

Reqest2

Reqest3

Request

Request2

Request3

Local Threads

Remote Processes

Timestep2

Timestep2Reqest

Reqest2 Request

Request2

getEvents(timestep)

getEvents(timestep)

EventList

EventList

This section repeats forthe life of the simulation.

Page 19: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Future Work – Map ComponentFuture Work – Map Component Map Component in charge of modeling the virtual environment

Enhancements: Domain specific Map components

What physics needs to be modeled?

Collision Detection improvementsJava3DGrid World (Change time into space)

DistributeCan we distribute the maintenance of the virtual environment across

multiple system?

Compound objects (grouping)A robot might be made up of more than one geometric shape.

Page 20: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

Future Work – ReflectionFuture Work – Reflection Java Reflection allows the dynamic loading of classes by name

Enhancements: Make all sensors and effectors loaded dynamically by name

Allows us to add sensors and effectors without the need to modify the original code

Different Maps (virtual environment maintainer) loadable by nameAllows “pluggable” components

Page 21: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

ReferencesReferences

[1] The Official Project website, http://www.cis.ksu.edu/~sdeloach/ai/projects/crsim.htm

Page 22: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

AcknowledgementsAcknowledgements

Committee: Dr. DeLoach Dr. Gustafson Dr. Hsu

Teammates: Venkata Prashant Rapaka, Arun Prakash Ganesan, Esteban Guillen,

and Aaron Chavez

Page 23: Computing & Information Sciences Kansas State University Cooperative Robotic Simulator Environment Simulator Masters’ Report Scott J. Harmon May 12, 2004.

Computing & Information SciencesKansas State University

QuestionsQuestions