Package robot_script :: Package event_simulators :: Module fakeHuman :: Class FakeHuman
[hide private]
[frames] | no frames]

Class FakeHuman

source code

            object --+            
                     |            
    threading._Verbose --+        
                         |        
          threading.Thread --+    
                             |    
event_simulator.EventSimulator --+
                                 |
                                FakeHuman

Simulating the perceptual data we would get from a human

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getDiff(self, target, current, speed) source code
 
moveTowardsTarget(self, speed) source code
 
publishTFPose(self, pose, name, parent) source code
 
start(self, motionSchedule)
Starts the simulator.
source code
 
update(self, dummy)
Called repeatedly from the EventSimulator thread.
source code
 
visualizeFakeHuman(self) source code

Inherited from event_simulator.EventSimulator: getEventQueue, run, sigintHandler, stop

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

start(self, motionSchedule)

source code 

Starts the simulator.

Parameters:
  • schedule - plan with times and callback arguments.
  • callback - callable to invoke at the times indicated in the schedule.
  • repeat - if True, schedule is excecuted over and over.
Overrides: threading.Thread.start

update(self, dummy)

source code 

Called repeatedly from the EventSimulator thread. Moves the Rviz human towards various locations in small increments. Locations, speed, and move times are taken from self.motionSchedule, which was passed into the start() method. Example schedule is the following dict (keys are fractional seconds):

       motionSchedule[2]  = None;
       motionSchedule[5]  = {target: [2,-1], speed: [0.1,0.03]}; 
       motionSchedule[10] = None;
       motionSchedule[12] = {target: [4,-2], speed: [.1,.055]}; 
       motionSchedule[16] = None;
       motionSchedule[20] = {target: [0.6,.5], speed: [.08,.1]};
       motionSchedule[27] = None;    
Parameters:
  • dummy (None.) - EventSimulator calls with an argument, which is None in our case, and unused.