View Single Post
  #5   Spotlight this post!  
Unread 08-04-2010, 19:09
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Autonomous Control

Okay, good, were're mostly describing the same thing.
However, to keep the LabVIEW code as transparent as possible, I was thinking that I wouldn't call the mechanism functions by reference and use OOP, but instead use parallel dataflow and cluster (struct) typedefs.

So the way it is working currently, each mechanism has its own task manager, and its own queue. There may have to be a dispatcher taking all the events and putting them in the appropriate queues, and getting the "pass/fail/timeout" back from the mechanism event managers, so that it's easily accessible by the planner.

Currently the event datatype looks like this:

cluster "Action"
string "action name/#"
u16 "Action Type" enum {no action, forward(ft/s), turn(deg/s), strafe(ft/s), move(fwd, stf, trn), kick(ft), retract, kick-retract(ft, s), arm height(ft)}
array "action values" 1D
sgl "value"
cluster "start"
u8 "when" enum {now, named value=, named input=, action complete, wait (s), time (s)}
string "name"
sgl "value"
u8 "compare" enum {=, >, <}
u8 "if conflict" enum {wait until finished, override that, skip this}
cluster "end"
u8 "when" enum {auto, named value=, named input=, action complete, wait (s), time (s)}
string "name"
sgl "value"
u8 "compare" enum {=, <, >}
bool "allow override"
The "override" here is very similar to timeout, but it doesn't time out until another event is sent. I tried to make this as flexible as possible, so people could do anything from "drive forward until you are 20in away from an obstacle" to "kick when the robot is done turning".
__________________
-- Marshal Horn