You should be able to interpret the NV_L_MOTOR and NV_R_MOTOR variables that avm creates in order to steer your robot. Since the avm uses keystokes to in part understand how the bot is moving when being trained you can hook up your own variables to respond to those.
For example, if you simply check if those variables are zero, negative or positive you can then treat them as individual keystokes. This can be done in vbscript or by just using an if statement module. I.e.
left = GetVariable("NV_L_MOTOR")
right = GetVariable("NV_R_MOTOR")
if left > 0 and right > 0 then
SetVariable "key_pressed", "forward"
elseif left < 0 and right < 0 then
SetVariable "key_pressed", "backward"
elseif left > 0 and right < 0 then
SetVariable "key_pressed", "turn_right"
elseif left < 0 and right > 0 then
SetVariable "key_pressed", "turn_left"
else
SetVariable "key_pressed", ""
end if
or something like that.
STeven.
|
|