lis-epfl / robogen

RoboGen - Robot generation through artificial evolution
http://www.robogen.org
GNU General Public License v3.0
27 stars 16 forks source link

BodyVerifier doesn't seem to check for wheels collision #45

Closed cyrilpic closed 10 years ago

cyrilpic commented 10 years ago

The evolution algorithm came up with the following robot which is physically not working:

{
 "id": 1,
 "brain": {
  "neuron": [
   {
    "ioId": 0,
    "biasWeight": 1.9630266427993774,
    "id": "CoreComponent-0",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 1,
    "biasWeight": -0.052899841219186783,
    "id": "CoreComponent-1",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 2,
    "biasWeight": -2.5832908153533936,
    "id": "CoreComponent-2",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 3,
    "biasWeight": 2.310793399810791,
    "id": "CoreComponent-3",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 4,
    "biasWeight": 0.49123850464820862,
    "id": "CoreComponent-4",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 5,
    "biasWeight": -0.66432464122772217,
    "id": "CoreComponent-5",
    "bodyPartId": "CoreComponent",
    "layer": "input"
   },
   {
    "ioId": 0,
    "biasWeight": -3.0,
    "id": "myid1000-0",
    "bodyPartId": "myid1000",
    "layer": "output"
   },
   {
    "ioId": 0,
    "biasWeight": -0.80561965703964233,
    "id": "myid1008-0",
    "bodyPartId": "myid1008",
    "layer": "input"
   },
   {
    "ioId": 0,
    "biasWeight": -0.10534308105707169,
    "id": "myid1009-0",
    "bodyPartId": "myid1009",
    "layer": "input"
   }
  ],
  "connection": [
   {
    "src": "CoreComponent-0",
    "dest": "myid1000-0",
    "weight": 2.8595128059387207
   },
   {
    "src": "CoreComponent-1",
    "dest": "myid1000-0",
    "weight": 2.5348289012908936
   },
   {
    "src": "CoreComponent-2",
    "dest": "myid1000-0",
    "weight": 1.3490732908248901
   },
   {
    "src": "CoreComponent-3",
    "dest": "myid1000-0",
    "weight": 2.3471887111663818
   },
   {
    "src": "CoreComponent-4",
    "dest": "myid1000-0",
    "weight": 0.50764721632003784
   },
   {
    "src": "CoreComponent-5",
    "dest": "myid1000-0",
    "weight": 1.0231053829193115
   },
   {
    "src": "myid1000-0",
    "dest": "myid1000-0",
    "weight": -1.3510990142822266
   },
   {
    "src": "myid1008-0",
    "dest": "myid1000-0",
    "weight": -1.3203727006912231
   },
   {
    "src": "myid1009-0",
    "dest": "myid1000-0",
    "weight": -1.9763047695159912
   }
  ]
 },
 "body": {
  "part": [
   {
    "type": "CoreComponent",
    "id": "CoreComponent",
    "root": true,
    "orientation": 2
   },
   {
    "type": "PassiveWheel",
    "id": "myid1002",
    "evolvableParam": [
     {
      "paramValue": 0.05345660075545311
     }
    ],
    "root": false,
    "orientation": 0
   },
   {
    "type": "LightSensor",
    "id": "myid1009",
    "root": false,
    "orientation": 2
   },
   {
    "type": "FixedBrick",
    "id": "myid1004",
    "root": false,
    "orientation": 1
   },
   {
    "type": "FixedBrick",
    "id": "myid1005",
    "root": false,
    "orientation": 3
   },
   {
    "type": "ActiveWheel",
    "id": "myid1000",
    "evolvableParam": [
     {
      "paramValue": 0.038631197065114975
     }
    ],
    "root": false,
    "orientation": 2
   },
   {
    "type": "LightSensor",
    "id": "myid1008",
    "root": false,
    "orientation": 2
   },
   {
    "type": "PassiveWheel",
    "id": "myid1003",
    "evolvableParam": [
     {
      "paramValue": 0.078816018998622894
     }
    ],
    "root": false,
    "orientation": 3
   }
  ],
  "connection": [
   {
    "destSlot": 0,
    "src": "CoreComponent",
    "dest": "myid1002",
    "srcSlot": 0
   },
   {
    "destSlot": 0,
    "src": "CoreComponent",
    "dest": "myid1009",
    "srcSlot": 1
   },
   {
    "destSlot": 0,
    "src": "CoreComponent",
    "dest": "myid1004",
    "srcSlot": 2
   },
   {
    "destSlot": 0,
    "src": "myid1004",
    "dest": "myid1005",
    "srcSlot": 1
   },
   {
    "destSlot": 0,
    "src": "myid1004",
    "dest": "myid1000",
    "srcSlot": 5
   },
   {
    "destSlot": 0,
    "src": "CoreComponent",
    "dest": "myid1008",
    "srcSlot": 3
   },
   {
    "destSlot": 0,
    "src": "CoreComponent",
    "dest": "myid1003",
    "srcSlot": 5
   }
  ]
 }
}
jauerb commented 10 years ago

What OS are you running on? In order for wheel wheel collisions to be checked, ODE needs to be build with the options --with-cylinder-cylinder=libccd

cyrilpic commented 10 years ago

OS X 10.9 and ODE was installed with brew (--enable-double-precision flag). So I don't know how the other options were configured.

jauerb commented 10 years ago

Unfortunately, you will need to have ODE installed with the --with-cylinder-cylinder=libccd flag as well as the --enable-double-precision flag to fix this issue. My apologies that this was not stated under the OS X documentation.

Unfortunately, there is nothing else we can do about it otherwise. Wheels are modeled as cylinders, and for some reason ODE will not detect cylinder-cylinder collisions by default

jauerb commented 10 years ago

I added it to http://www.robogen.org/wiki/index.php/Building_RoboGen_on_Mac

cyrilpic commented 10 years ago

Using libccd does solve the issue, but actually, brew cannot automatically parse the option as described in the wiki. I have created a pull request on the homebrew repository to support "--enable-libccd". The command line would then become :

brew install cmake libpng boost protobuf gnuplot open-scene-graph jansson ode --enable-double-precision --enable-libccd