Wednesday, 16 March 2011

Creative Robotics Basic plan for Buridan's Robot a robot that needs help to make choices


Basic plan for Buridan's Robot a robot that needs help to make choices
//we are finally getting somewhere with Urbi in Creative Robotics

loadModule("urbi/qt-for-urbi");
load("thing.u");

var thing = Thing.new;

function conv(a){

var res = ((a* 3.4/100.0) -1.7);
res
}|

function gui_stuff()
{
var window = Qt.Widget.new;//create a window
var layout = Qt.GridLayout.new;//create the layout to display the
// things in the window
window.setLayout(layout);//set the layout in the window !notice the comment is longer than the line ....

//here you create the sliders
var shoulder_slider = Qt.Slider.new;
var elbow_slider = Qt.Slider.new;
var wrist_slider = Qt.Slider.new;
var hand_slider = Qt.Slider.new;


//here you add the stuff to the layout
layout.addWidget(shoulder_slider, 0, 0, Qt.Alignment.AlignHCenter);
layout.addWidget(elbow_slider, 0, 1, Qt.Alignment.AlignHCenter);
layout.addWidget(wrist_slider, 0, 2, Qt.Alignment.AlignHCenter);
layout.addWidget(hand_slider, 0, 3, Qt.Alignment.AlignHCenter);


//the following is how you catch an event, notice the event?(var msg) construct
at (shoulder_slider.sliderMoved?(var msg))
thing.shoulder.targetPos=conv(msg);


at (elbow_slider.sliderMoved?(var msg))
echo(msg);


at (wrist_slider.sliderMoved?(var msg))
echo(msg);


at (hand_slider.sliderMoved?(var msg))
echo(msg);


window.show;//here you make the window visible!!!!

};
//hmm interetsing http://support.robotis.com/en/product/bioloid/beginnerkit/download/bioloid_beginner_app.htm
this is our simple idea:



react to sound - wants to turn to sound - we have a sound sensor

react to light - wants to turn to light - we have a light sensor

if it detects both it will signal need for our support how - by moving head - signs of panic

we might use attack duck example - simple movements


we activate proximity sensor to give it permision to make a random decision


decision( Tag)

1 comment: