sk.robotics.rlcs.agents.camera
Class ViewPosAgent

java.lang.Object
  extended by sk.robotics.rlcs.agentspace.Agent
      extended by sk.robotics.rlcs.agents.image.ImageFilterAgent
          extended by sk.robotics.rlcs.agents.camera.ViewPosAgent
All Implemented Interfaces:
java.lang.Runnable

public class ViewPosAgent
extends ImageFilterAgent

Agent for drawing detected position and destinations of robots into an image. To be used in image processing pipelines. Draws given set of positions, and given set of destinations. The positions and destinations are fully independent, they do not have to correspond to the same set of robots.

This agent is by default triggered by given position and destination blocks, as well as by the source image block. Note that it uses custom trigger ID for the source image block, which allows to distinguish between trigger sources, which in turn allows to ignore triggers caused by the position and destnation block, if there was no real change. This prevents unneccessary drawing, and thus saves processor time.


Nested Class Summary
static class ViewPosAgent.Cfg
           
 
Nested classes/interfaces inherited from class sk.robotics.rlcs.agentspace.Agent
Agent.AgentThread, Agent.Hidden, Agent.ThreadCreator, Agent.WorkerThreadGroup
 
Field Summary
 
Fields inherited from class sk.robotics.rlcs.agentspace.Agent
logTimeFormat, space, thread, workerThreads
 
Constructor Summary
ViewPosAgent(ViewPosAgent.Cfg cfg)
           
 
Method Summary
protected  void filter(java.awt.image.BufferedImage image)
           
protected  void senseSelectAct(int triggeredIds)
          Sense-select-act, called upon trigger().
 
Methods inherited from class sk.robotics.rlcs.agents.image.ImageFilterAgent
filter, senseSelectAct
 
Methods inherited from class sk.robotics.rlcs.agentspace.Agent
cleanup, exit, getConfig, getIdleTime, getWorkerThreadGroup, isAlive, kill, log, log, log, log, log, run, setLogLevel, setPeriodicTrigger, setPeriodicTrigger, sleep, start, startup, toString, trigger, trigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewPosAgent

public ViewPosAgent(ViewPosAgent.Cfg cfg)
Method Detail

senseSelectAct

protected void senseSelectAct(int triggeredIds)
Description copied from class: Agent
Sense-select-act, called upon trigger(). One of the two overloads should be overriden. The overload without arguments is for convenience, can be used if derived agent doesn't need to distinguish between different types of triggers.

Overrides:
senseSelectAct in class Agent
Parameters:
triggeredIds - Or-ed combination of triggered ID's (params for trigger()).

filter

protected void filter(java.awt.image.BufferedImage image)
Overrides:
filter in class ImageFilterAgent