ilpincy / argos3-kilobot

Kilobot plugin for the multi-robot ARGoS3 simulator
15 stars 14 forks source link

Just a question #16

Closed julianx2rl closed 4 years ago

julianx2rl commented 4 years ago

Hello, I have a question, the thing is that when I follow the steps to compile the code, the behaviors get generated no problem, and I can run them.

But if for example, I just* had the files blinky.c and kilobot_blinky.argos, and the kilobot plugin: how do I compile blinky.c?

I tried with: g++ -I/usr/include/argos3/plugins/robots/kilobot/control_interface -fPIC -shared blinky.c -o blinky.so

But the file generated is only 7,8KB and when I run the file kilobot_blinky.argos the kilobot just sits there without doing anything.

Meanwhile the file generated in the compilation is 19,4KB and it does make the kilobot blink when I run kilobot_blinky.argos.

Thank you for your attention.

julianx2rl commented 4 years ago

I applied nm -gD blinky.so to both files and the one that's generated following the steps does have a lot more functions.

julianx2rl commented 4 years ago

I just tired compiling kilolib.c and blinky.c with (gcc -fPIC -c blinky.c / gcc -fPIC -c kilolib.c) and then link kilolib.o and blinky.o toghether with (gcc -shared -o blinky.so blinky.o kilolib.o), and it results in a blinky.so that's 19,3KB and according to (nm -gD blinky.so) has almost all of the functions that the original has, but the kilobot still just sits there and do nothing...

ilpincy commented 4 years ago

There's no reason to compile those files by hand. Just follow along the example provided here: https://github.com/ilpincy/argos3-kilobot/blob/master/src/examples/behaviors/CMakeLists.txt