In the .argos file I wrote the following piece of code:
Code: Select all
<controllers>
<kilobot_controller id="kbc">
<actuators>
<kilobot_led implementation="default" />
</actuators>
<sensors>
<positioning implementation="default" />
</sensors>
<params behavior="build/examples/behaviors/blinky" />
</kilobot_controller>
</controllers>
Code: Select all
#include <kilolib.h>
#include <stdio.h>
#include <argos3/core/utility/math/quaternion.h>
void setup()
{
// Put any setup code here. This is run once before entering the loop.
}
void loop()
{
// Put the main code here. This is run repeatedly.
// Set the LED red.
set_color(RGB(1, 0, 0));
// Wait half a second (500 ms).
delay(500);
// Set the LED blue.
set_color(RGB(0, 0, 1));
// Wait half a second (500 ms).
delay(500);
printf("X - %f\n", GetX());
}
int main()
{
// Initialize the hardware.
kilo_init();
// Register the program.
kilo_start(setup, loop);
return 0;
}
Code: Select all
antonio@antonio-Lenovo-V110-15AST:~/Downloads/argos3-kilobot-master/build$ make
[ 65%] Automatic MOC for target argos3plugin_simulator_kilolib
[ 65%] Built target argos3plugin_simulator_kilolib_autogen
[ 65%] Built target argos3plugin_simulator_kilolib
[ 65%] Automatic MOC for target argos3plugin_simulator_kilobot
[ 65%] Built target argos3plugin_simulator_kilobot_autogen
[ 65%] Built target argos3plugin_simulator_kilobot
[ 65%] Automatic MOC for target kilobot_diffusion
[ 65%] Built target kilobot_diffusion_autogen
[ 65%] Built target kilobot_diffusion
[ 65%] Automatic MOC for target kilobot_phototaxis
[ 65%] Built target kilobot_phototaxis_autogen
[ 65%] Built target kilobot_phototaxis
[ 65%] Automatic MOC for target orbit_star
[ 65%] Built target orbit_star_autogen
[ 65%] Built target orbit_star
[ 65%] Automatic MOC for target test_speaker_mod
[ 65%] Built target test_speaker_mod_autogen
[ 65%] Built target test_speaker_mod
[ 65%] Automatic MOC for target move_to_light
[ 65%] Built target move_to_light_autogen
[ 65%] Built target move_to_light
[ 65%] Automatic MOC for target simple_movement
[ 65%] Built target simple_movement_autogen
[ 65%] Built target simple_movement
[ 65%] Automatic MOC for target gradient_simple
[ 65%] Built target gradient_simple_autogen
[ 65%] Built target gradient_simple
[ 65%] Automatic MOC for target test_listener
[ 65%] Built target test_listener_autogen
[ 65%] Built target test_listener
[ 65%] Automatic MOC for target blinky
[ 65%] Built target blinky_autogen
Scanning dependencies of target blinky
[ 65%] Building C object examples/behaviors/CMakeFiles/blinky.dir/blinky.c.o
In file included from /usr/include/argos3/core/utility/math/quaternion.h:10:0,
from /home/antonio/Downloads/argos3-kilobot-master/src/examples/behaviors/blinky.c:3:
/usr/include/argos3/core/utility/math/vector3.h:10:1: error: unknown type name ‘namespace’
namespace argos {
^~~~~~~~~
/usr/include/argos3/core/utility/math/vector3.h:10:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
namespace argos {
^
In file included from /usr/include/argos3/core/utility/math/vector3.h:17:0,
from /usr/include/argos3/core/utility/math/quaternion.h:10,
from /home/antonio/Downloads/argos3-kilobot-master/src/examples/behaviors/blinky.c:3:
/usr/include/argos3/core/utility/math/general.h:13:10: fatal error: vector: No such file or directory
#include <vector>
^~~~~~~~
compilation terminated.
examples/behaviors/CMakeFiles/blinky.dir/build.make:62: recipe for target 'examples/behaviors/CMakeFiles/blinky.dir/blinky.c.o' failed
make[2]: *** [examples/behaviors/CMakeFiles/blinky.dir/blinky.c.o] Error 1
CMakeFiles/Makefile2:773: recipe for target 'examples/behaviors/CMakeFiles/blinky.dir/all' failed
make[1]: *** [examples/behaviors/CMakeFiles/blinky.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2