Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
buzz_argos [2018/03/18 23:17] – [Writing debug information] root | buzz_argos [2018/03/18 23:34] (current) – [Debugging Buzz Programs] root | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== ARGoS + Buzz quick start ===== | ||
+ | ==== Installing ARGoS ==== | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | To install ARGoS, go to http:// | ||
+ | |||
+ | ==== Installing Buzz ==== | ||
+ | |||
+ | Compile and install Buzz following the instructions reported in the [[https:// | ||
+ | |||
+ | ==== Library Configuration ==== | ||
+ | |||
+ | The Buzz integration library for ARGoS is composed of two elements: | ||
+ | |||
+ | - A set of ARGoS controllers. At the moment, available controllers include one for the [[http:// | ||
+ | |||
+ | - A special definition of ARGoS' QtOpenGL user functions, which allow Buzz scripts to draw in the OpenGL visualization of ARGoS. | ||
+ | |||
+ | To have ARGoS find the Buzz integration library in case you installed it in a non-default location, set the environment variable '' | ||
+ | |||
+ | <code bash> | ||
+ | $ export ARGOS_PLUGIN_PATH=/ | ||
+ | </ | ||
+ | |||
+ | If you installed Buzz without specifying a custom installation prefix (e.g., using only '' | ||
+ | |||
+ | ==== Defining an ARGoS experiment file ==== | ||
+ | |||
+ | To use ARGoS and Buzz together, define your '' | ||
+ | |||
+ | However, instead of a custom controller, in the ''< | ||
+ | |||
+ | <code xml> | ||
+ | < | ||
+ | For a full example of an ARGoS configuration file, refer to | ||
+ | |||
+ | | ||
+ | |||
+ | and the other examples at | ||
+ | |||
+ | | ||
+ | --> | ||
+ | |||
+ | ... | ||
+ | |||
+ | < | ||
+ | |||
+ | <!-- Include this if you're using foot-bots --> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <params /> | ||
+ | </ | ||
+ | |||
+ | <!-- Include this if you're using Khepera IV --> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <params /> | ||
+ | </ | ||
+ | |||
+ | <!-- Include this if you're using Spiri --> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <params /> | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ... | ||
+ | |||
+ | <arena ...> | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ... | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ... | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ... | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ... | ||
+ | |||
+ | </ | ||
+ | |||
+ | Always make sure the parameters '' | ||
+ | |||
+ | If you want ARGoS to start with a Buzz script already loaded, you can specify that in the ''< | ||
+ | |||
+ | <code xml> | ||
+ | ... | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | | ||
+ | <!-- This loads the specified files at startup --> | ||
+ | <params bytecode_file=" | ||
+ | | ||
+ | </ | ||
+ | | ||
+ | ... | ||
+ | | ||
+ | </ | ||
+ | |||
+ | To activate the Buzz editor and support debugging, use '' | ||
+ | |||
+ | <code xml> | ||
+ | <!-- For a full example of an ARGoS configuration file, refer to | ||
+ | | ||
+ | --> | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | You can launch ARGoS as usual, with the command: | ||
+ | |||
+ | <code bash> | ||
+ | $ argos3 -c myexperiment.argos | ||
+ | </ | ||
+ | |||
+ | ==== Debugging Buzz Programs ==== | ||
+ | |||
+ | === Inspecting a Robot' | ||
+ | |||
+ | To understand what's happening on a specific robot, shift-click on it in the ARGoS visualization to select it. This opens a tree widget in the Buzz editor that reports the value of all the variables, and the list of available functions on the robot. | ||
+ | |||
+ | === Debugging Information === | ||
+ | |||
+ | The Buzz integration library offers a data structure, called '' | ||
+ | |||
+ | == Writing Text on Top of a Robot == | ||
+ | |||
+ | * '' | ||
+ | * prints a message on top of the robot, after the robot id | ||
+ | * '' | ||
+ | |||
+ | == Drawing the Trajectory of a Robot == | ||
+ | |||
+ | * '' | ||
+ | * enable trajectory tracking setting how many points should be stored and the drawing color | ||
+ | * '' | ||
+ | * '' | ||
+ | * enable trajectory tracking setting how many points should be stored | ||
+ | * '' | ||
+ | * enable trajectory tracking keeping maxpoints' | ||
+ | * '' | ||
+ | * '' | ||
+ | * enable trajectory tracking keeping maxpoints' | ||
+ | * '' | ||
+ | * disable trajectory tracking | ||
+ | * '' | ||
+ | * delete all the trajectory points | ||
+ | |||
+ | == Drawing Vectors == | ||
+ | |||
+ | * '' | ||
+ | * draw a ray from the reference point of the robot to '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * draw a ray from '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * delete all the rays |