Posts Tagged ‘ducks’

Homecamp 09

April 29th, 2009

Homecamp 09 was last weekend and I feel it was an amazing success. Like many people I attended with the intention of sitting in the background watching and learning, however I was prepared to present if need be. By  prepared I meen gluegunned some ducks to a load of fairy lights and packed an arduino.

I didn’t take any notes during the days as I was streaming the event into OpenSim from my laptop with my isite camera. I dont recommend this for future events. Nor was this intended before the day. Below are few of the talks that I took away with me.

  • Martin Dix (@martindix) from currentcost spoke and suprised us all with his free gift  (More about this in a future post) and some statistics about how many current costs had been produced.
  • The Aimee API
  • Electricity 2.0 by Tom Raftery link for a previous video of this talk

There were lots of other areas discussed over the course of the day making it very interesting. I attempted to present some of the work I had done in OpenSim as well as my twittering flat.

I drove the two guys from theAttick who agreed to do the filming and sound for the day, great guys, slightly insane but great. I hope to get some of their videos on here soon.

Sorry for the lack of information, in this post next time I will make sure I can take some notes :)

Mobile Ducks have migrated for the summer

April 27th, 2009

A few people asked me about my Ducks not being on the server (well 1) .

I have been asked to remove the randomly moving around ducks from the our SIM on ReactionGrid. I was “Cooking the server” and as the server was donated to us I felt obliged not to take advantage.

Thanks once again for the people at ReactionGrid for providing us with a server to use for HomeCamp, lets see if we can improve its use for the next HomeCamp.

HomeCamp blog post to follow and a twitter search library post to follow when I get a few minute

Friendly Ghost Ducks

April 18th, 2009

I was aiming to produce an autonomous  dynamic enviroment developer tool for open sim.  As I had no idea what this would include I decided to start small and took the duck model supplied by Chris H and added a little script.

The first iteration  randomly chooses a direction (North, South, East or West)  and moves one meter. This repeated every second. I had to introduce a 270m boundary otherwise the ducks had a habit of trying to change sims.

float x = 82;
float y = 237.682;
float z = 22.5;
float period = 1;
float noMove = 10;
float touchCount =0;
default
{
timer()
{
list dice = [0,1,2,3,4];
integer rand = llList2Integer(llListRandomize(dice, 1),0);
vector xyz_angles = <0,0,0>;
integer i=0;
for( i=0;i<noMove;i++) {
if (rand == 0)
{
x=x+period/noMove;
if (x < 92)
{
xyz_angles = <0,0,180>;
}
else {
x=x-period/noMove;
x=x-period/noMove;
xyz_angles = <0,0,0>;
}
}
else if (rand ==1) {
x=x-period/noMove;
if (x > 71)
{
xyz_angles = <0,0,0>;
}
else {
x=x+period/noMove;
x=x+period/noMove;
xyz_angles = <0,0,180>;
}
}
else if (rand == 2) {
y=y-period/noMove;
if (y > 226)
{
xyz_angles = <0,0,90>;
}
else {
y=y+period/noMove;
y=y+period/noMove;
xyz_angles = <0,0,270>;
}
}
else if (rand==3) {
xyz_angles = <0,0,270>;
y=y+period/noMove;
if (y < 247)
{
xyz_angles = <0,0,270>;
}
else {
y=y-period/noMove;
y=y-period/noMove;
xyz_angles = <0,0,90>;
}
}
//llSay(0,(string)x+” “+(string)y+” “+(string)z);
vector angles_in_radians = xyz_angles*DEG_TO_RAD;
rotation rot_xyzq = llEuler2Rot(angles_in_radians);
llSetRot(rot_xyzq);
llSleep(period/noMove);
llSetPos(<x,y,z>);
}
}
state_entry()
{
llSetTimerEvent(period+0.5);
llSetText(” “,<1, 0, 0>,1);
}
touch_start(integer total_number)
{

string soughtName = llDetectedName(0);;
touchCount = touchCount + 1;
}
}

The second (and current) iteration of Duck allows them to be more interactive. If you talk while near the duck, it becomes scared of you (-1 modifier) however if you touch it it likes you (+1 modifier). The distance and direction it moves is connected to the accumulated modifier. If the modifier is positive it moves towards  you, if it is negative it moves away from you.

float x = 82;
float y = 237.682;
float z = 22.5;
float period = 4;
float noMove = 10;
float touchCount =0;
vector location;
string name;
list likesName = [];
list likesOpinions = [];
integer listen_handle ;
default
{
sensor( integer vIntFound )
{
if (vIntFound < 1   )
{
name = “”;
}
integer vIntCounter = 0;
location = llDetectedPos( vIntCounter ) ;
name = llDetectedName(vIntCounter);
}
timer()
{
vector oldLocation = location;
list dice = [0,1,2,3,4];
float oldPeriod = period;
llSensor( “”, “”, AGENT, 5, PI );
if (name != “”){
integer indx = llListFindList(likesName,name);
if (indx == -1) {
indx = 1;
}
integer like = llList2Integer(likesOpinions,indx);
if (like > 10 ) {
like = 10;
}
period = 15;
y = y-(y-location.y)/noMove*like;
x = x-(x-location.x)/noMove*like;
llSetPos(<x,y,z>);
//llOwnerSay(“Walking towards “+name+” “+(string)x+” “+(string)y+” “+(string)z);
name = “”;
}
else {
period = oldPeriod;
integer rand = llList2Integer(llListRandomize(dice, 1),0);
vector xyz_angles = <0,0,0>;
integer i=0;
for( i=0;i<noMove;i++) {
if (rand == 0)
{
x=x+period/noMove;
if (x < 92)
{
xyz_angles = <0,0,180>;
}
else {
x=x-period/noMove;
x=x-period/noMove;
xyz_angles = <0,0,0>;
}
}
else if (rand ==1) {
x=x-period/noMove;
if (x > 71)
{
xyz_angles = <0,0,0>;
}
else {
x=x+period/noMove;
x=x+period/noMove;
xyz_angles = <0,0,180>;
}
}
else if (rand == 2) {
y=y-period/noMove;
if (y > 226)
{
xyz_angles = <0,0,90>;
}
else {
y=y+period/noMove;
y=y+period/noMove;
xyz_angles = <0,0,270>;
}
}
else if (rand==3) {
xyz_angles = <0,0,270>;
y=y+period/noMove;
if (y < 247)
{
xyz_angles = <0,0,270>;
}
else {
y=y-period/noMove;
y=y-period/noMove;
xyz_angles = <0,0,90>;
}
}
//llSay(0,(string)x+” “+(string)y+” “+(string)z);
vector angles_in_radians = xyz_angles*DEG_TO_RAD;
rotation rot_xyzq = llEuler2Rot(angles_in_radians);
llSetRot(rot_xyzq);
llSleep(period/noMove);
llSetPos(<x,y,z>);
}
}
}
state_entry()
{
llSetPos(<x,y,z>);
llSetTimerEvent(period+0.5);
llSetText(” “,<1, 0, 0>,1);
listen_handle = llListen(0, “”, llGetOwner(), “”);
}
touch_start(integer total_number)
{
string soughtName = llDetectedName(0);
integer indx = llListFindList(likesName,soughtName);
if (indx == -1 ) {
likesName = llListInsertList(likesName, [soughtName], llGetListLength(likesName));
indx = llListFindList(likesName,soughtName);
}
integer mod = llList2Integer(likesOpinions,indx) + 1;
if (mod ==0) {
mod =1;
}
likesOpinions = llListReplaceList(likesOpinions,[mod],indx,indx);
llOwnerSay(soughtName +” likeness is set to “+mod);
touchCount = touchCount + 1;
}
listen( integer channel, string name, key id, string message )
{
string soughtName = name;
llSay(0,soughtName + ” just spoke and scared me”);
integer indx = llListFindList(likesName,soughtName);
if (indx == -1 ) {
likesName = llListInsertList(likesName, [soughtName], llGetListLength(likesName));
indx = llListFindList(likesName,soughtName);
}
integer mod = llList2Integer(likesOpinions,indx) – 1;
if (mod ==0) {
mod = -1;
}
likesOpinions = llListReplaceList(likesOpinions,[mod],indx,indx);
llOwnerSay(soughtName +” likeness is set to “+mod);
}
}

Not sure what will be done next, feedback is welcome

Eightbar Post, MQTT Ducks

March 17th, 2009

The friendly guys over at EightBar (well Andy Piper) have put up a post I was writing for here about my ducks

Please head over and take a look at http://eightbar.co.uk/2009/03/12/the-amazing-mqtt-enabled-ducks/

It explains why, how and where next.

I have been workng in opensim with homecamp recently and hope to publish some information about my work there over the next few days.

MQTT Flashing Ducks

January 19th, 2009

Flashing Duck

Well First project was working, got a string of ducks to listen for a MQTT subscription.

However as soon as I took the picture it broke. It seems to be a linux thing. Will fix it soon.

Just need to work out what to do with them when they work.

This works with an  Arduino that takes a serial hex code that triggers the LEDs on or OFF.  I have a perl script that works on my server and listens for MQTT subscriptions on Ducks.  I got the Arduino code from “Making things talk” (link) it is a great book on the basics of Arduinos and networking with them.