Ai Dreams Forum

Robotics => General Robotics Talk => Topic started by: MagnusWootton on July 19, 2022, 01:54:16 pm

Title: useful tasks for robots that are easy to motivate
Post by: MagnusWootton on July 19, 2022, 01:54:16 pm
While doing the dishes is a bit of an enlongated program that would be handy to have a robot do for you, theres some other programs which are shorter and have less detections to get done.

A digging robot would be an example,   builders often need an excavator, so if you could fully automate that task I bet its alot easier than doing a dishes robot, you need to get the dirt from here, and put it over there,   and its such a horrible laborious task and it would be nice if u could get the robot to do it possibly just with a bit of hand waving and communicating word id's to it.

It could build bike ramps,  and concrete supports, where the main part of the job is excavation, and if the robot handled it, the job would be done with very little effort comparitavely.

Another two that are already out there is the carrying follower robot and the floor sweeper,  those two are very easy tasks and there's bots out there for those 2 jobs already.    It would be nice to walk around not having to carry things, and the bot can take over for that.

One more thing, which you don't see very often, would be a gatherer robot,  where you give it an id for what it needs to find, and it'll pull back as many versions of that thing that it scavengers around for.   I always thought that would be so handy if you were a smoker, cause it could go around finding all the cigarette butts on the ground for you.

The thing I find kinda interesting,  is another thing that doesnt take so much code. (At the beginning, until you need to add all the safety code.)  Is just say taking someone out or pinning them down.  Thats another one that doesnt take that much code,  making it a weapon.     :)'
But I guess if you have to put all the code in to stop it from hurting people too much,  then it gets a little more complicated but not by much.

I think all those things, make great examples of simple to write goal programs that could really help out the world,  anyone got one they can add??
Title: Re: useful tasks for robots that are easy to motivate
Post by: WriterOfMinds on July 19, 2022, 03:58:23 pm
I always figured "takedown" would be a fairly hard problem, even without special safety measures. Because the human is also an intelligent agent, and will easily evade any motion that's too simple. So the robot has to process what the human is doing and react in real time. Unless it outclasses the human so much in speed and size that it can literally just follow them and run them over.
Title: Re: useful tasks for robots that are easy to motivate
Post by: MagnusWootton on July 20, 2022, 03:02:52 am
Yes,  takedowns!   :D        If you make the robot you could get into a lot of trouble.

If you can just manage to see the opponent geometry successfully,   computers can fight pretty easy off very little goal programming,   just detect the opponent upside down, and that can actually be the only code required to get the opponent upside down!     Its not much more code other than just walking,  but doing it safely that's the problem I see.   Instead of monitoring its own body positions, you just have to monitor the opponents,    but u do need a fairly good computer vision system to have it modelled consistently.   

Plus of course the other problem,  you need to search in the realistic space, not just a virtual space, to make the goal programming possible to be used.  (I guess thats the hard bit.)
So I guess, most people will say this is impossible and think Im being silly for even mentioning it.

Doing it virtually is easier. (But it does make a very good video game that could make u lots of money already.)  I can whip out my little walker robot if u need a demo. :)
Title: Re: useful tasks for robots that are easy to motivate
Post by: MagnusWootton on July 21, 2022, 06:18:06 pm
If you just do a greedy search, you can still walk along  (It doesnt run, but it does walk slowly.)
And I bet u can have a form of wrestling it does as well,  based apon a constant greedy decision, each time it moves, just based apon very near to where it currently is.
Title: Re: useful tasks for robots that are easy to motivate
Post by: MagnusWootton on July 25, 2022, 02:14:45 pm
I just wrote an easy goal program,  here it is,  took very little effort! I bet a kid can do this.

The motivation is a game where theres so many teams of so many robots and they have to flip the opponent teams robots over. If they get flipped 3 times, then they will not unturn themselves anymore.  I do that by checking the state, and then i dont remove the flip angle from the score anymore, and then they should play dead once they get their 3rd flip.

They move around by retreating if they get more than 1 robot ganging up on them, and then theyll flee to their closest ally.
Also theres a little thing in there that if one of their friends is flipped nearby, they will unflip him,   if he has no power to flip himself because his flipcount has gone to 3, but if the robot manages to flip him over he can temporarily come back alive again,  because their friends flip angle is also put into their score, so they are motivated by it.

Thats how its sitting in the algorythm as it is right now anyhow.  Just wrote it,  took about an hour,  *facepalm* going so slowly, have no motivation myself.  score really low personally....  cant code for nuts at the moment, just got to keep on truckin'.

(the full code for a team robot wrestling game motivator.)

struct STATE_MEM
 float flipweight;  //ranging from 0 -> 1 is how flipped the robot is. (just do it with the angle of the central body.)
 bool flipped;      //if this is true, this has to unflip for it to get flipped again.
 uint flips;        //if this goes to 3, the robot will not unturn itself anymore,  just plays dead.

struct GBBOT
 STATE_MEM state_mem;

 int hinge_pos[GBBOT_HINGES]; //the actual hinge position. this only moves at 1 set speed. (u get speed changes below this set speed by it deactivating and activating.)
 int hinge_min[GBBOT_HINGES];
 int hinge_max[GBBOT_HINGES];
 int hinge_tpos[GBBOT_HINGES];  //target virtual position of the hinge has a position
 int hinge_tvel[GBBOT_HINGES];  //and a velocity,  and operates in a low passed fashion.
 TEN tendon[GBBOT_TENDONS];  //so these tendons get their lengths set to rotate the legs! (best way i think!)
 uint motorstring[GBBOT_HINGES*PROJECTIONS];          //set the hinge animation with these.
 uint closest[GBSIMBOTS-1]; //closest 2 other bots.
 uint closest_stick[2];            //my stick and the closer robots stick
 PLN closest_plane[GBBOT_PNTS];    //plane for the floor underneath the foot.
 uint team;
 uint bot;

struct ENVIRO
 GBBOT gbbot[GBBOTS*GBTEAMS+1];  //dont forget the +1 for the default robot stance.
 GBBOT gbbotsim[GBSIMBOTS]; //sim it and 2 closest.
 GBBOT gbbotsim2[GBSIMBOTS]; //sim it and 2 closest.

#define FLIPS_TILL_OUT        3
#define FLIPSCOREWEIGHT       1000

void step_statemem(GBBOT* bot)
 bool flipped=false;
 //get the angle of the body.
 int bodyvec=(bot->pnt[0].x-bot->pnt[4].x);
 float fw=(-(bodyvec/bot->edge[48].length)*2)-1;
 if(fw>0.5) flipped=true;

int compute_gb_score(void) //in here goes the sim bots.  (and the terrain if u want, but u wont need it for this.)
 uint i,j,k,l,m;
 int score=0;
 //update the flip state. (they have a small amount of temporary memory to remember some values.
 // compute what team the n simulated bots are on.
 uint hometeam=enviro.gbbotsim2[0].team;
 bool enemy[GBSIMBOTS-1];
 //then you want the enemies flipped, and it unflipped.  (only if its not its last flip.)
 PNT centrepos1[GBSIMBOTS];
 //get the centrepositions of the sim bots.
 //then if your friend is flipped, and ur nearby, you reduce proximity to help him unflip.
  if(enemy[i]==false){float distance=abs(centrepos1[0].x-centrepos1[i+1].x)+abs(centrepos1[0].y-centrepos1[i+1].y)+abs(centrepos1[0].z-centrepos1[i+1].z);if(distance<UNFLIPFRIENDPROXIMITY){score-=distance;}}
 bool finding_friend=false;

 uint enemies=0;
 uint friends=0;
  //go to the nearest friend on the map. (doesnt need to be an updated position.)

 //get the centrepositions of the bots mainlist.
 bool friend1[GBTEAMS*GBBOTS];
 bool flipped1[GBTEAMS*GBBOTS];

 //if finding friend is true  i go to closest friend.
 //otherwise i go to closest unflipped enemy.
 //MOVING (changing battle topology.)
 uint closest=0;
 uint closest_dist=1000000000;
   if(enviro.gbbotsim2[0].bot!=j || enviro.gbbotsim2[0].team!=i)
    uint dist=abs(centrepos1[0].x-centrepos[i*GBBOTS+j].x)+abs(centrepos1[0].y-centrepos[i*GBBOTS+j].y)+abs(centrepos1[0].z-centrepos[i*GBBOTS+j].z);
     bool mark=false;
                   else{if(friend1[i*GBBOTS+j]==false && flipped1[i*GBBOTS+j]==false){mark=true;}}

 return score;

So... I want to get this thing actually running,  Ive nearly got the rest of the framework in,  but its probably another couple of days cause Im working so slowly...  :(     But hopefully Ill get the little robot wrestling game going.
I hope once I get it going in the computer, Ill be able to run it on the gtx2070 bot in real life and it may be able to do it outside my house in the driveway!
Ill keep going.