FluentNao icon indicating copy to clipboard operation
FluentNao copied to clipboard

Fluent Nao Events

Open dnajd opened this issue 11 years ago • 0 comments

Get rid of my attempt at events and use this: https://github.com/davesnowdon/naoutil/blob/master/naoutil/src/main/python/naoutil/memory.py

naoscript to be able to tie a script to a event like this

 nao.event.left_bumper(naoScriptId)

and have it fetch script 112 and trigger it when the left_bumper is pressed. :) add a probability of happening and load in a couple of scripts... it could seem more autonomous

nao.left_bumper(112, .10)
nao.left_bumper(120, .10)
nao.left_bumper(20, .10)

So if the left bumper is touched, it iterates through saved events, each one having a 10 percent chance of happening. first one to happen takes the event.

Dave Snowdon: I'd be tempted to express that as a list of tuples:

nao.left_bumper([(.1, 112), (.1, 120), (.1, 20)])

Also want to do time based events, not sure how I would handle it, but ...

nao.event.time("1:00pm", naoScriptId, probabilityPercent)

Dave Snowdon: I think there is exsiting python code for scheduling

  • http://pythonhosted.org/APScheduler/cronschedule.html
  • http://stackoverflow.com/questions/373335/suggestions-for-a-cron-like-scheduler-in-python

Also want to support others

nao.event.face_recog(naoScriptId, probabilityPercent)

dnajd avatar Apr 29 '13 07:04 dnajd