Forking behaviour error Kilobot

Requests regarding how to set up experiments in ARGoS.
novothsz
Posts: 8
Joined: Tue Jan 08, 2019 6:28 pm

Forking behaviour error Kilobot

Postby novothsz » Wed Feb 20, 2019 9:43 pm

Hi!

Currently I am running a (immature) genetic algorithm with Kilobots and it is very similar to the genetic algorithm example written for the footbots.

Unfortunately I am facing the issue, that after a couple of calls of the modified LaunchARGoS function (always around the 83rd call) the following error message is printed out:


Code: Select all

libc++abi.dylib: terminating with uncaught exception of type argos::CARGoSException: [FATAL] Forking the behavior process of kb2: Resource temporarily unavailable
(there are three Kilobots placed in the arena and sometimes the behaviour of the other Kilobots cannot be forked.

Is there something I can do about it?
I am running the newest MacOS, and the number of threads is set to 0.

Thanks!

Szilárd

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Forking behaviour error Kilobot

Postby pincy » Thu Feb 21, 2019 7:50 am

Can you share your code, so I can understand what the issue might be?
I made ARGoS.

novothsz
Posts: 8
Joined: Tue Jan 08, 2019 6:28 pm

Re: Forking behaviour error Kilobot

Postby novothsz » Thu Feb 21, 2019 12:46 pm

Looking at my code is equivalent to asking for trouble…

A quick overview:

1.The main behavior, is called square0.
The setup:
reads a couple of txt/csv files. The txt files are either already there or created by the trajectory loop function. Mostly, each Kilobot has to read the same datafile.
All this reading txt is partly because I do not know how to tell the Kilobots their global position in the arena which in the development phase I want to have access to.
The loop:
also reads txt files and there are long delay() functions

2.The trajectory loop function:
It writes the csv files.

3.The embedding/galib/main:
in its main() it sets up argos and the genetic algorithm
in the LaunchARGoS() simply:

Code: Select all

static argos::CSimulator& cSimulator = argos::CSimulator::GetInstance(); cSimulator.Reset();
4.I have modified some CMakeLists, probably also not how one is supposed to modify them, so for this reason and because of the many reading/writing things, it might not run on your computer…
For example in embedding/galib/CMakeLists is have:

/usr/local/include
/usr/local/lib/libga.a
because without it, it doesn't detect some part of the galib library and I get:
__ZN8GAGenome13NoInitializerERS_

You might have to delete these lines...
Attachments
src.zip
(3.96 MiB) Downloaded 462 times

novothsz
Posts: 8
Joined: Tue Jan 08, 2019 6:28 pm

Re: Forking behaviour error Kilobot

Postby novothsz » Thu Feb 21, 2019 4:05 pm

I tried to run basically the same code on Ubuntu (only had to change cmakelist in embedding/galib: got rid of the words “local”) to see if I experience the problem there as well, only to get the error message:

Code: Select all

terminate called after throwing an instance of 'argos::CARGoSException' what(): [FATAL] Failed to initialize the physics engines. Parse error in the <physics_engines> subtree. [FATAL] Symbol "dynamics2d" not found Aborted (core dumped)
What works:

Code: Select all

argos::CSimulator& cSimulator = argos::CSimulator::GetInstance(); cSimulator.SetExperimentFileName("experiments/galib.argos");
and where it breaks:

Code: Select all

cSimulator.LoadExperiment();
An addition to my previous post:
the way I compile & run things is with:

Code: Select all

cd build cmake -DCMAKE_BUILD_TYPE=Release ../src make make install cd .. build/embedding/galib/galib_phototaxis

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Forking behaviour error Kilobot

Postby pincy » Sat Feb 23, 2019 6:30 pm

I'll have a look.

Just a quick comment: hardcoding the path GALIB is unnecessary, just copy the example I provided that uses CMake variables. This makes the compilation process more robust.
I made ARGoS.

novothsz
Posts: 8
Joined: Tue Jan 08, 2019 6:28 pm

Re: Forking behaviour error Kilobot

Postby novothsz » Mon Feb 25, 2019 12:24 pm

Thank you!

Btw. I have finally figured out how to add GALIB with CMake variables, but it didn't fix the main issue.


Return to “How to... ?”