sex bots

robots in love
you’ll have to pardon me while i wax anthropomorhpic for a moment.  why is it that robots, designed or imagined, always exist solely to fulfill a purpose or pleasure for human beings?  don’t they have feelings too?  maybe it’s about time we made some robots whose sole purpose is to hook up with other robots, get a little freaky, and make some robot progeny.

in this article we’ll be exploring robot love.  i made a couple of simple lego mindstorms robots and programmed them to reproduce — i.e. they can swap code.  effectively, two robots come together, trade their genome, die, and two new robots are born in their place.

turn up the barry white.  get out your mindstorms.  let’s get it on.


when i started working on this project, i had to make some initial decisions about how robot reproduction would actually work.  since they can’t create a new robot, their reproduction will have to function a little differently than what we are accustomed to.

what i wanted was some mechanism that would enable two parent robots to combine their software to produce two distinct child robots, which would replace their parents and exhibit new and unique behavior.

the robots i am using are simple two-wheel, two-sensor bots.  in these bots, the genome will serve to determine the behaviors of the robot’s normal life processes, namely:

  • the robot’s primary execution loop

  • what to do if the left sensor is hit

  • what to do if the right sensor is hit

the genetic code determines what happens in each of these three tasks.  possible actions can be any combination of the following:

  • go forward

  • go backward

  • turn left

  • turn right

  • attempt to reproduce

  • do nothing

so a reasonable execution loop might be: forward, mate, forward, etc.

a left sensor loop might be: backward, right, right, etc.

getting it on
mating robots
each of the three life processes has a fixed length.  when the robot is turned on, these are initialized to a very basic routine and most of the possible actions are filled with noops.

when a robot attempts to mate, it sends out a signal on the ir port.  if the other robot is able to see this signal, it will initiate a handshake to begin the genome transfer.  the parents trade one piece of a routine at a time, replacing their former actionwith the new child program.

in order to deter child generations from becoming lazy, i added a requirement that a certain number of movements had to occur between each successful mating before they could become ‘mature’ and capable of initiating the mating procedure.


when two robots reproduce, each recieves a copy of the other’s genetic code.  the outcome for each possible action for each life routine is a random choice between the two parent codes.  this alone would result in some pretty booring children, given that both parents are initialized with the same code, so i added a roughly 1 percent chance that a mutation will occur for each action that is copied.

the idea is that a robot which is better capable of maneuvering around without getting stuck will have a better chance of finding another robot and procreating.

unfortunately, i only have two robots at my disposal, but the results have still been really interesting.  all sorts of different behaviors have cropped up, from robots that drive in big circles and zig-zags,  to ones that always go in the same direction when they hit something.

robotic extinction
in a small population, however, things don’t always work out for the best.  one of the robots pictured above mutated such that it didn’t turn when a sensor was hit.  the second robot managed to mate with it once, but then became plagued with the same genetic malfunction.  they were unable to get out of the corner and basically became extinct.

with a larger population, you would probably see fewer mass extinctions and more interesting group behavior.  with only two robots, they tend to have a nearly identical makeup in each generation.

one could imagine a larger colony breaking up into different classes — some robots that don’t move much and are easy to be found, and others that are good at wandering and spreading throughout the community.

if anyone out there has access to a bunch of mindstorms, give it a try and let us know about your results.

possible applications
aside from just being a simple and fun way to model life and evolution (not to mention a shameless title for an article), sex bots have some interesting potential applications.

robot optimization
when i released my robots for the first time, the software that i initialized them with was not ideally suited for the environment i placed them in.  occasionally they got hung up in corners, or moved around in continuous circles that would never intersect and allow them to see eachother.

with a small starter community, you could just turn them loose in their environment and let them run for a while.  they would genetically optimize their routine to fit their environment.  those that couldn’t find eachother would essentially become extinct.  the rest would adapt to maneuvering in their environment while maintaining communication.

automatic software updates
you could also pretty easily code in a version identifier.  when mating, a robot would check to see if they are from the same version pool as the other.  a previous version would adopt the new version in whole, whereas two robots of the same version would mate normally.  imagine a distributed, loose network of robots that need a software upgrade.  simply release a few robots with the new software and the population would eventually convert automatically to the new version.

your idea here
there are undoubtedly many ways to go about making a reproducing robot, and i’m sure there are many more uses for this technology that i haven’t even though of.  so go make your own sex bots and let us know about it!

84 thoughts on “sex bots

  1. That is simply fascinating. Congratulations for making something so amazingly cool and innovative. I’ve come across some purely software evolutionary programs, but this with actual bots is very neat. Good job. btw, you should make your code and bot design open source so that maybe people can make the code even better and actually get together with their bots. Thanks.

  2. This was a very impressive post.

    I would like to offer you a chance to expand the project in several ways.
    1) more of your current “sex-bots” operating in a larger society.
    2) different platforms for the “sex-bots” (ie. slightly different wheel configurations, varied drive system gear ratios, etc.)
    [this follows from the ‘all breeds of dogs are the same species’ commment]
    3) a more challenging environment, potentially a size-able portion of a university research lab.

    I’m the current president of the RIT Robotic Club. [ ]
    **website currently sucks, upgrades will be finished in the next two weeks**

    We currently have about 10 Mindstorms kits, and plan to purchase as many as a dozen more over the next two months.
    We could potentially collaborate, to create a larger trial run of your project.

    I realize that this is your project, and I’m in no way attempting to steal it from you.
    I just thought you might like to see what your programs would do in a larger environment.

    Lemme know,

    most of my life:

  3. I actually have access to a large group of mindstorms (8 or 10). Unfortunately, they’re all being used for a Robotics class right now. I may be able to get access to them after the semester ends. Is it possible that I could get the code you used for your robots? I’m actually writing a paper on the topic… so any information you can give me would be useful.

  4. You know, if a lot of people were interested, you could even turn this into a larger project, letting many people download your source code, use it on a given robot platform, then upload their results and the details of the robot design to a central server (or if it got really big, you could probably set up some kind of gnutella like client to share bot designs and source code). Have a massive collaborative effort. As I understand it, a lot of evolution is thought to occur when groups are separated and then allowed to mix and compete. Different people could use different standard for selection amongs their population of robots; this would be like have different environments. This would be a very large undertaking, but maybe not too large for any one person or group of people.

  5. thanks for all the great feedback!

    stay tuned. i’ll be posting more information and my source for this project soon. the current project is written in nqc, so it’s a bit limited, but very accessible.

    if you have kids in lego league, this might be a fun project for their team to play around with over the summer. a lot of schools in my area have 2 or more teams, and i’d bet it wouldn’t be too uncommon to find 7 or 8 mindstorms kits among the participants.

  6. I think that sexualy reproducing robots is a highly sensitive subject. If robots have really achived what man kind has nown forever, what is there to stop them from wiping human kind out eventually (3-4thousand years). We’re not talking about anytime soon, but the future is out there. Personally I do think however that sex bots are a good jump in the right direction for technology, I just think we need to be carefull.

  7. So,

    Behold the power of the internet, and crazy random-ness:

    This weekend I happened to be in the Twin Cities area (MN), and responded to Jason’s e-mail saying it would be hard to collaborate with RIT research in upstate NY, all the way from Minnesota.

    Long story short, Jason and I met up at a coffee shop in downtown St. Paul tonight, and talked for over 2 hours about this and other robotics projects.

    I’m very excited about all of the work that Jason has done with this project, and I think this could be the start of some very cool research.
    As mentioned by Josh, we could have isolated communities who mix their ‘genetic’ code, and see what happens.

    I’m a 4th year EE @ RIT, and plan to be working on a social ‘ant’ colony project this summer; to study social patterns and other cool-ness.
    [Just for kicks, and because I think robots are fun.]

    I think that having a few ‘colonies’ doing their own ‘genetic evolution’ could be a very cool collaborative project.
    It would sort of be ‘distributed evolution’ like SETI@home is distributed computing.

    [ my WAY old-school SETI group: ]

    Drop me a line if you perhaps wanna build a colony over the summer, or find one near you to be involved with, and/or just collaborate on this:

  8. i should add that nate is a very cool fellow and it was a pleasure to have him come visit sunny minnesota. if any of you other hackers care to drop by the minneapolis/st. paul area, send me a line and we can go out for coffee too.

    i can be reached at: jason at virtuoffice-dot-com, or jmstriegel on aim.

    i’m really looking forward to expanding this idea further. robot colonies are going to take the world by storm.

  9. this is really interesting…didn’t think you could do something like this with legos. it made me very interesting in messing around with them…can’t wait for your code. is the programming language of a declarative type (prolog,ml,lisp) or is it imperative (c/c++,java). thanks

  10. I had the same idea 7 years ago but with B.E.A.M. robots. This is the future folks. Getting the bots to reproduce themselves physically will truly be artificial life — and challenging for humans. This cutting edge stuff by “hackers” is decades ahead of what you’ll find in many universities “teaching” engineering. In 5 – 10 years a company will produce a toy based on this for the Xmas season and everyone will think “Wow how advanced!”

  11. A conputer infared port is a good idea, like suggested in comment #48 ,only its purpouse will be that robots who don’t reach it will be unable to reproduce, thus weeding out weak robots. obstacles could block robots from it, so robots have to become more able at overcoming obstacles, and the difficulty of the obstacles would be increased as the robots mastered them. of course, this also requires a large group of robots, that start with random genetics, or all robots will die out rather quickly.

  12. I think you could combine the ideas of the computer ir port and the centralized server. That way you could have a database of other people’s codes (other ‘bots’ dna) and a ir port in the environment. Then the bot could mate with the ir port and recieve genetic code from a random bot in the database, connecting your populations, and making them overall more diverse, even if you only have 2 bots.

  13. Nice job… This will work better with
    – More robots, so more LEGOS, or a computer simulation
    – Use very simple neural networks, experiment some different way to connect neurons each others.

    The same thing was done with more robots, by two scientist, Nolfi and Floreano. Many articles on the net about their work.

  14. That is definitely the best hack ever! I don’t understand this stuff nearly as well as most of you, but it is fascinating! I did have an idea, though. What if you made them able to communicate through the web. A virtual world of virtual obstacles for them to overcome (like an online multi-player game) in order to meet and mate with others. Then you and everyone with access to a block could see the infinite possibilities of large groups. Start off simple by them communicating to your pc via ir which then uploads to the web to communicate with someone else’s block.

  15. I can just say “Wow.” I never thought we would get this far so fast. The future is now ladies and gentleman. Sit down, shut up, and hold on.
    A step by step guide to do this would really open up a whole new craze in my opinion. I can see entire groups of 20-100 people getting together for a convention doing this sometime soon. Why? Because we can! Build our own speciliazed bots for just this application. I know that myself, haveing until now, no interest in anything even similiar to the whole programming bots etc. Well… Sign me the hell up! You perked my interest for sure with the possibilites. If any of you botters are in Canada, the Maritime provinces you can look me up.
    Be glad to meet up and help with any botting to be done.

    And I repeat. Just wow… You are a god amongst men, Hacker.

  16. There are lots of games out there like RoboCom and c-robots that you might like. The point is essentially programming a robot to kill the other robot and multiply so you dominate the gameboard. A little less benign (unless your robots like it rough) but pretty fun.

  17. Nice project. Suggestion for solving the “extinction/population size” problem: use two physical bots, give them each a starting genome out of a database on the pc (say starting database of 20). Bot one gets 3 “rounds” (of for instance, a minute) of “lifespan”, if it has not reproduced within that time, it dies: i.e. it’s genome is deleted from the database. Bot two gets one round/minute, if it has not reproduced, it does not die, but goes back into cold storage on the pc, and is replaced by another of the 20 on the pc (at random). “Babies” get uploaded into the pc, and then used in the same way. The round time gets determined by the number of genomes in the database (i.e. the amount of “competition”), so 10 genomes left would make 2 minute rounds, 30 genomes, only 30 sec rounds. What do you guys think?

  18. Just an idea – a tutorial for doing this with reuglar pic and DC motors – no mindstorms. I mean – how’s that for evolution Everyone gets there own body. One can be a beer can that could roll over, one cound be a long flat box, etc,etc. Just an idea.

  19. I know that in pro robot development, a useful technique they use is to run “genetic” programs, where, by combining different programs, thousand of times, you can get the best way to perform a task.

    It’s like if you’re learning to walk, you try over and over, and kept the knowledge or perform the task “walk” that result better.

    The next step maybe be to run a simulator, and combine the genes a population of X bots, then, let it run in the night and, in the morning, you’ll get the results and choose the smartest bots.

  20. Well i’m going to a camp this week with some lego robots (and we’re learning java, some C++) etc, but the language they have there is called “Lego TC LOGO” never heard of it before, but could somebody write a program that would basically have our robot beam code to other bots, then have them start doing this? I’m not qutie sure how it would work, in this language… but it’d be funny to take over everyone else’s lego bots (especially since they would all be built differently, could cause some interesting code evolution).

    Email me,

  21. nice thing about adapting in an environment….its like natural selection.. the bad ones would become “extinct” in your case the ones driving into a corner and never turning back..while the good ones would spread their better genes

  22. The sex robot is a nice concept,nd am thinking of doing the project in sch….so pls ca u send me all necessary information,components 2 use and many other things u know i’ll need 2 carryout the project.
    Nice concept!

  23. dude this is pretty awsome. Just reading through all of the comments i thought of an idea that goes along with a challenging terrain. I doubt it would be possible with legos though, most likely microcontrolers or something.But, here it is. Each robot should have the possibility to alter itself (by servos mounted on the robot just for the purpose of changing itself) such as shifting the location of sensors and irs, only slightly though to start. this would alter their perception and the way they manouvered. Also you could change motor speed, possibly gear ratios (harder to do), height of chassis, lenght of wheel base. So you build the first two or however many and incorporate just about everything else everbody has said above and when they mate they exchange the code and DATA detailing their PHSYICAL characteristics. So in theory after mating and passing on (dead) the new data would be loaded and the robot would literally change physically and mentally(program). You could get fat bots, skinny bots, tall bots, bots with the optimal placement of sensors (after evolving), and bots evolved best for that environment. The posibilitys are endless. The data is only loaded when the bots are born then it is just saved untill robot sex and the best physical characteristics along with programing would be past on.

  24. i like the idea of roving “drone-bots” and a computer “queen-hub”. why not mirror the physical values of “roving” and “stationary” in the code while you’re at it– the drones change, the hub remains the same….
    on another note, is anybody else reminded of code of the lifemaker?

  25. The initial story, and a lot of the comments has set my pants on fire.
    I’ve pre-purchased 2 lego nxt’s that are shipping in July 2006. From there I hope to get mine to do something similiar to your project.
    Haven’t decided if its going to be in NQC, or something else. Another
    comment mentioned 50+ legos transferring code….and I’m thinking along those lines. I’ve created a website for an eventual effort towards this in the Seattle area–>

    My ideas on your project being like the Tierra evolving software project was posted here–>

    Thanks for the initial story.

  26. If there where say 250 of the robots in a large area, with the challenges, you could potentially end up with a group of robots capable of communicating to eachother as we speak, and getting unique and very complex personalities. Also there should be a way that the bots die, like if they fall upside down, they are disabled, and that is where the bots could truly reproduce. Instead of sharing their information/genes/memes they could pass this on to the once dead robots. However for these bots to become truly advanced, they should be bipeds, and humanesque. This way we can easily tell the level of intelligence from the tasks that they carry out. The base robots would have to themselves be very advanced though, orelse they wouldn’t even be able to move. Also they should have re-charge points. Eventually you should have the most advanced and unique things around, with intelligence which rivals ourselves.

  27. since your idea and code consists of java, and your trying to create a senario of reproduction and we are dealing with computers here, what if one of your bots gets a viral infection and makes the other bots unable to find a recieving mate and it corrupts your code begins writing its own and sudenly takes the bots apart and combines each into one big bot. LMAO But your idea with the sexbot is very intersting and funny .

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s