GithubHelp home page GithubHelp logo

buzz-lang / buzz Goto Github PK

View Code? Open in Web Editor NEW
289.0 36.0 61.0 1.08 MB

A programming language designed for robot swarms.

License: MIT License

CMake 3.45% C++ 31.90% C 62.17% Emacs Lisp 0.69% Shell 1.05% Roff 0.74%

buzz's Introduction

What is Buzz?

Buzz is a novel programming language for heterogeneous robots swarms.

Buzz advocates a compositional approach, by offering primitives to define swarm behaviors both in a bottom-up and in a top-down fashion.

Bottom-up primitives include robot-wise commands and manipulation of neighborhood data through mapping/reducing/filtering operations.

Top-down primitives allow for the dynamic management of robot teams, and for sharing information globally across the swarm.

Self-organization results from the fact that the Buzz run-time platform is purely distributed.

The language can be extended to add new primitives (thus supporting heterogeneous robot swarms) and can be laid on top of other frameworks, such as ROS.

A simulation demonstration is available here.

The whitepaper on Buzz Design and Implementation is available here.

Documentation Contents

The documentation is structured as follows:

  1. Installation
  2. ARGoS Integration
  3. Buzz Concepts
    3.1 Basics
    3.2 Virtual Machine
  4. Buzz API
  5. Extending Buzz
  6. Examples
    6.1 Distance Gradient
    6.2 Pattern Formation
    6.3 REST-Like API
  7. Technical Specifications
    7.1 Assembly Language
    7.2 Backus-Naur Form Syntax
  8. Robot Integration
    8.1 Khepera IV

Who Made Buzz?

Buzz is a research project conducted at NESTLab, Worcester Polytechnic Institute, and MIST, École Polytechnique de Montréal. It is funded by the Natural Sciences and Engineering Research Council of Canada.

The main developer and maintainer is Carlo Pinciroli.

Buzz News

Scientific Publications

  • C. Pinciroli, G. Beltrame. 2016. Swarm-Oriented Programming of Distributed Robot Networks. IEEE Computer. In press.
  • C. Pinciroli, G. Beltrame. 2016. Buzz: An Extensible Programming Language for Heterogeneous Swarm Robotics. Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2016). In press.
  • C. Pinciroli and G. Beltrame. 2016. Buzz: A Programming Language for Robot Swarms. IEEE Software, volume 33, number 4, pages 97-100. IEEE Press.
  • C. Pinciroli, A. Lee-Brown, G. Beltrame. 2015. A Tuple Space for Data Sharing in Robot Swarms. 9th EAI International Conference on Bio-inspired Information and Communications Technologies (BICT 2015), pages 287-294. ACM Digital Library.

Media Coverage

Talks, Tutorials, Demos

Other

buzz's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buzz's Issues

Virtual Stigmergy conflict resolver segfault

The conflict resolver of Virtual Stigmergy(VS) seems to crash with a Segmentation Fault.
It used to work with the older version of Buzz + Argos.
The latest version of Buzz + ARGOS causes a segmentation fault when a conflict resolver lambda function is called, in the result of a conflict. There is also an invalid free during the initialization part. I am attaching a minimalistic buzz script that leads to a Memory leak and the leak summary from Valgrind.
VS_Bug.txt
leak_summery.txt

Improve error reporting

Improve error reporting so that, when an error occurs, the exact line of code where it happened is indicated.

Silent crash of buzz parser when script ends with a comment

When a buzz script ends with a comment in its last line, the buzz parser (bbzparse and bbzc) will create an empty .basm file and stop without displaying anything on the terminal.
The bug happens in the following cases:

  • The file contains only one (1) line with a comment (can have any amount of whitespace before it), without any new line after that.
    # Anything here, no new line after
    but if there is one (1) or more line (that doesn't only contains a comment, can be an empty line) before or after it, there is no crash.
    function foo() {
        # Do something
        return 1 + 2
    }
    bar = foo() # Blah Blah
    # Lets print something
    print("something")
    
    # The last line with just a comment
  • The file ends with a statement directly followed by a comment and has no new lines after it
    # Buzz stuff
    foo = {.bar = 42}
    print("Something") # No line return after this comment
    But if you add a new line at the end of the file, it won't crash.

parse_modulo in buzzparser.c can seg fault due to stack size

I was able to craft an input that triggered parse_modulo tons of times and eventually causes a segmentation fault because the stack is fully consumed.

I found this can 'resolve' the problem inside the parse_modulo function, but I'm sure it isn't the correct resolution. Is this something worth spending more time on? I mistakenly did not save the input file but could probably recreate it if it is needed.

static int counter = 0;
counter++;
if (counter > 1000) {
  return NULL;
}

Segmentation Fault 2018-01-30

Hello, I was using American Fuzzy Lop (afl-fuzz) to fuzz input to the bzzasm program on Linux. Is fixing the crashes from these input files something you're interested in? An example input file causing a crash is: r|r# (yes, that's the entire program)

The file can be executed as ./bzzasm id_filename /tmp/1 /tmp/2 to cause a seg fault. I have been able to reproduce with clang and gcc.

Valgrind output looks as such:

==28975== Memcheck, a memory error detector
==28975== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==28975== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==28975== Command: ./bzzasm ./test /tmp/1 /tmp/2
==28975==
==28975== Invalid read of size 1
==28975==    at 0x55A3CC5: ____strtol_l_internal (strtol_l.c:293)
==28975==    by 0x4E3A854: buzz_asm (in /root/buzz-2/src/buzz/libbuzzdbg.so)
==28975==    by 0x400ACA: main (in /root/buzz-2/src/buzz/bzzasm)
==28975==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==28975==
==28975==
==28975== Process terminating with default action of signal 11 (SIGSEGV)
==28975==  Access not within mapped region at address 0x0
==28975==    at 0x55A3CC5: ____strtol_l_internal (strtol_l.c:293)
==28975==    by 0x4E3A854: buzz_asm (in /root/buzz-2/src/buzz/libbuzzdbg.so)
==28975==    by 0x400ACA: main (in /root/buzz-2/src/buzz/bzzasm)
==28975==  If you believe this happened as a result of a stack
==28975==  overflow in your program's main thread (unlikely but
==28975==  possible), you can try to increase the size of the
==28975==  main thread stack using the --main-stacksize= flag.
==28975==  The main thread stack size used in this run was 8388608.
==28975==
==28975== HEAP SUMMARY:
==28975==     in use at exit: 4,452 bytes in 15 blocks
==28975==   total heap usage: 16 allocs, 1 frees, 8,548 bytes allocated
==28975==
==28975== LEAK SUMMARY:
==28975==    definitely lost: 0 bytes in 0 blocks
==28975==    indirectly lost: 0 bytes in 0 blocks
==28975==      possibly lost: 0 bytes in 0 blocks
==28975==    still reachable: 4,452 bytes in 15 blocks
==28975==         suppressed: 0 bytes in 0 blocks
==28975== Rerun with --leak-check=full to see details of leaked memory
==28975==
==28975== For counts of detected and suppressed errors, rerun with: -v
==28975== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault

Let me know if I can provide any more information to help narrow down this issue.

Invalid comparisons in buzzobj_cmp

It seems that the intention of buzzobj_cmp in src/buzz/buzztype.c is to make comparisons between certain types illegal. For example, there is code for comparisons between 2 userdata, but not for userdata and other types, so it could be reasoned userdata can only be compared between themselves. This is not the case however (for example, they can be compard with nil).

This does not cause any error at the moment, because these other comparisons are handled implicitly by logic which is executed before in the code. However, some bugs could be introduced if the order of comparisons were changed.

This is highlighted by TEST(BuzzObjCompare, IncompatibleTypes) in src/testing/unittest/buzztype_test.cpp (instructions on how to run the tests are provided in src/testing/unittest/README.md), where the comparison between nil and a userdata should cause an error, but it doesn't.

The solution for this is likely a refactor of the function.

Not operator needs parentheses in if statement

In a composite "if" statement combining expressions with a boolean operator, if the second expression contains a "not" operator, then the second expression must be surrounded by parentheses. Not doing so causes a compilation error (Syntax error: expected identifier, found logic not).

For example:

function init() {
    # This is invalid syntax and causes a compilation error
    if (1 and not 0) {
        log("hello")
    }

    # This is valid syntax
    if (1 and (not 0)) {
        log("hello")
    }
}

This requirement seems unintuitive when comparing to languages like Python, where the parentheses would not be necessary.

buzzvm_step in buzzvm.c segmentation fault when arg is NULL

buzzvm.zip

This input to buzzrun causes a segmentation fault in buzzvm.c

valgrind shows:

==7166== Invalid read of size 8
==7166==    at 0x42C92D: buzzvm_lload (buzzvm.c:1267)
==7166==    by 0x42C92D: buzzvm_step (buzzvm.c:798)
==7166==    by 0x4024A3: main (buzzrun.c:97)
==7166==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Which is from here:

      case BUZZVM_INSTR_LLOAD: {
         inc_pc();
         get_arg(uint32_t);
         buzzvm_lload(vm, arg);
         break;
      }

Adding a check for arg being null removes the segmentation fault.

Any advice on how to resolve?

Bug in table library due to nil comparison from #91

PR #91 has introduced a difference in comparisons with nil. This seems to be the cause of bugs in the functions table.min and table.minkey, because the accumulator in reduce is set to nil (see code snippet below), which is always smaller than any numeric value in the PR (see lines 152-153 of src/buzz/buzztype.c). This means it does not affect table.max nor table.maxkey.

table.minkey = function(t) { return reduce(t, function(k, v, a) { return math.min(k, a) }, nil) }

This bug can easily be reproduced in any buzz script with the following code, which prints nil for both cases:
log(table.min({.0 = 0})) log(table.minkey({.0 = 0}))

The obvious (but unclean) fix for the table library could be to replace the accumulator with a MAX_INT constant or the like, however this does not solve the issue for other instances of comparisons between numbers and nil.

Cmake fails with "FindLua52.cmake"

Exact error

-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'argos3_simulator'
--   Found argos3_simulator, version 3.0.0-beta56
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
CMake Error at cmake/BuzzBuildChecks.cmake:16 (find_package):
  By not providing "FindLua52.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Lua52", but
  CMake did not find one.

  Could not find a package configuration file provided by "Lua52" with any of
  the following names:

    Lua52Config.cmake
    lua52-config.cmake

  Add the installation prefix of "Lua52" to CMAKE_PREFIX_PATH or set
  "Lua52_DIR" to a directory containing one of the above files.  If "Lua52"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:38 (include)


-- Configuring incomplete, errors occurred!
See also "<$HOME>/buzz/build/CMakeFiles/CMakeOutput.log".

Environment

OS: Ubuntu 19.10
Kernel: 5.3.0-7625-generic
cmake: 3.13.4
gcc: 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)
All packages updated to latest stable

Steps I followed

Installed ArGOS
by following the commands

git clone https://github.com/ilpincy/argos3.git argos3

sudo apt-get install cmake libfreeimage-dev libfreeimageplus-dev \
  qt5-default freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev \
  lua5.3 doxygen graphviz graphviz-dev asciidoc

 cd argos3
mkdir build_simulator
cd build_simulator
cmake ../src
make
make doc
sudo make install
. setup_env.sh 

Using the same terminal, i.e. keeping env variables from setup_env.sh, tested with argos examples, diffusion_1 and diffusion_10 working properly as expected.

Then starting with installing Buzz,

git clone https://github.com/MISTLab/Buzz.git buzz
cd buzz
mkdir build
cd build
cmake ../src

This place is the problem.

Solution

solution 1

After some trial and testing, following are the steps which solved my issue,

sudo apt install lua5.2 liblua5.2-dev

Getting the file from https://github.com/ilpincy/argos3/blob/b666cadcd0ba103007ced71882bfef5a77e1dc24/src/cmake/FindLua52.cmake
and putting in buzz/src/cmake/FindLua52.cmake solved the issue.

As argos require liblua5.3-dev and buzz has no dependency documented in readme for liblua5.2-dev, I had got stuck. Also tried removing the findLua52 (so lua5.2 and liblua5.2-dev is installed in the system) and trying to update ldconfig. The project can't compile without the file.

As no one else had this issue, maybe I have something wrong/different. Is the cmake line find_package(Lua52 REQUIRED) working without the file ?

solution 2

Diving deeper, got to know, cmake has
https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindLua51.cmake to get Lua5.1 but doesn't have "FindLua52.cmake" but instead https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindLua.cmake.

So tried changing line at
https://github.com/MISTLab/Buzz/blob/122a0b22c203b78235908afd1453c9a18c0be747/src/cmake/BuzzBuildChecks.cmake#L16

to find_package(Lua REQUIRED)

Which compiled successfully, though it took lua5.3 (installed in the dependency of argos) and not 5.2.

-- Checking for module 'argos3_simulator'
--   Found argos3_simulator, version 3.0.0-beta56
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.3.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.3.3") 
-- Configuring done

I cannot determine if the lua5.2 is required or lua5.3 as it is compiling with both of the solutions.

Considering Buzz only requires lua when ARGoS is present, and ARGoS is compiled with lua5.3,
changing the line to find_package(Lua REQUIRED) should be the solution I suppose.

Also as shown in https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindLua.cmake#L51 any future versions of lua will be auto added, and hence solution 2 will be better.

Please suggest for any future tests required to help in this issue.

Help needed: buzz_qt not found

Hi!

I am using a Linux Mint box (based on ubuntu 18.04) and while I can seemingly get the controller to run the OpenGL integration does not work. Specifically "buzz_qt" is not found:

[FATAL] Failed to initialize the visualization. Parse error in the <visualization> subtree. [FATAL] Failed opening QTOpenGL user function library [FATAL] Symbol "buzz_qt" not found

All installation paths are default. Buzz was (re-)built after Argos was installed and the headers for "buzz_qt" exists:

/usr/local/include/buzz/argos/buzz_qt_find_dialog.h
/usr/local/include/buzz/argos/buzz_qt_statetree_item.h
/usr/local/include/buzz/argos/buzz_qt_statetree_model.h
/usr/local/include/buzz/argos/buzz_qt.h
/usr/local/include/buzz/argos/buzz_qt_editor.h
/usr/local/include/buzz/argos/buzz_qt_main_window.h
/usr/local/include/buzz/argos/buzz_qt_syntax_highlighter.h

I am using the following test experiment:

<argos-configuration>

  <!-- ************************* -->
  <!-- * General configuration * -->
  <!-- ************************* -->
  <framework>
    <system threads="0" />
    <experiment length="0"
                ticks_per_second="1"
                random_seed="124" />
  </framework>

  <!-- *************** -->
  <!-- * Controllers * -->
  <!-- *************** -->
  <controllers>
 
  <!-- Include this if you're using foot-bots -->
  <buzz_controller_footbot id="fdc">
    <actuators>
      <differential_steering implementation="default" />
      <range_and_bearing implementation="default" />
    </actuators>
    <sensors>
      <range_and_bearing implementation="medium" medium="rab" show_rays="true" noise_std_dev="0" />
    </sensors>
    <params />
  </buzz_controller_footbot>
  
  </controllers>

  <!-- *********************** -->
  <!-- * Arena configuration * -->
  <!-- *********************** -->
  <arena size="5, 5, 1" center="0,0,0.5">

    <box id="wall_north" size="4,0.1,0.5" movable="false">
      <body position="0,2,0" orientation="0,0,0" />
    </box>
    <box id="wall_south" size="4,0.1,0.5" movable="false">
      <body position="0,-2,0" orientation="0,0,0" />
    </box>
    <box id="wall_east" size="0.1,4,0.5" movable="false">
      <body position="2,0,0" orientation="0,0,0" />
    </box>
    <box id="wall_west" size="0.1,4,0.5" movable="false">
      <body position="-2,0,0" orientation="0,0,0" />
    </box>

    <!--
        You can distribute entities randomly. Here, we distribute
        10 foot-bots in this way:
        - the position is uniformly distributed
        on the ground, in the square whose corners are (-2,-2) and (2,2)
        - the orientations are non-zero only when rotating around Z and chosen
        from a gaussian distribution, whose mean is zero degrees and
        standard deviation is 360 degrees.
    -->
    <distribute>
      <position method="uniform" min="-2,-2,0" max="2,2,0" />
      <orientation method="gaussian" mean="0,0,0" std_dev="360,0,0" />
      <entity quantity="10" max_trials="100">
        <foot-bot id="fb" rab_data_size="100">
          <controller config="fdc" />
        </foot-bot>
      </entity>
    </distribute>


  </arena>

  <!-- ******************* -->
  <!-- * Physics engines * -->
  <!-- ******************* -->
  <physics_engines>
    <dynamics2d id="dyn2d" />
  </physics_engines>

  <!-- ********* -->
  <!-- * Media * -->
  <!-- ********* -->
  <media>  
	<range_and_bearing id="rab" />
  </media>

  <!-- ****************** -->
  <!-- * Visualization * -->
  <!-- ****************** -->
  
<visualization>
  <qt-opengl>
    <user_functions label="buzz_qt" />
  </qt-opengl>
</visualization>


</argos-configuration>

Any suggestions would be appreciated. Thanks!

Swarm closures missing

The Buzz wiki specifies that the following closures should exist within Buzz, however they are not implemented anywhere:

  • swarm.intersection
  • swarm.union
  • swarm.difference
  • swarm.unselect

CMake fail on compilation

Installing Buzz, cmake ../src fails with:

-- checking for module 'argos3_simulator'
--   package 'argos3_simulator' not found
CMake Error at utility/CMakeLists.txt:40 (install):
  Syntax error in cmake code at

    /home/<usr>/buzz/src/utility/CMakeLists.txt:40

  when parsing string

    execute_process( \
      COMMAND ${CMAKE_COMMAND} -E create_symlink \
      ${CMAKE_INSTALL_PREFIX}/share/buzz/cmake/FindBuzz.cmake \
      ${CMAKE_ROOT}/Modules/FindBuzz.cmake   \
      )

  syntax error, unexpected cal_SYMBOL, expecting $end (32)

I'm guessing that it is the obvious, and that I am missing the argos3_simulator, but I have it installed on my system under /home/<usr>/argos3. Reading through the relevant CMakeOutput.log doesn't reveal much to me, it is long but I can post it if it would help. Reading the installation directions, it sounds like ARGoS is optional, so I am not sure why the Buzz compiler not finding ARGoS would result in a critical failure during compilation.

Any thoughts as to a work around/solution?

System

  • Ubuntu 14.04
  • CMake 2.8.12.2
  • gcc 6.3.0

Encounter mistakes when use table in communication

When use functions
neighbors.broadcast("key", sendTable)
and neighbors.listen("key", function(vid, recvTable, rid) { })
to communicate, if sendTable and recvTable are defined as tables, and several recvTables are stored in another map, such as messageStorage, fail to fetch the right value of recvTable in messageStorage.
Sample source codes are provided in attached file, with testbzzDesired.bzz and testbzzDesired.argos showing the desired result, and testbzz.bzz and testbzz.argos showing the actual result.
bzzIssue.zip

Inconsistencies in float/string vs int/string comparisons

Comparisons between string values and float values behave differently than those between string values and int values.
More precisely, int values can reliably compared to string values, as the implicit conversion is performed correctly. However, this is not the case for float values. This is due to the usage of sprintf to perform the conversion (for example, lines 185-189 of src/buzz/buzztype.c).

Code to reproduce:

function init() {
    log(-9 == "-9")        # Result: 1
    log(-9.0 == "-9.0")    # Result: 0
    log(-9 == -9.0)        # Result: 1
}

Associated test suite: TEST(BuzzObjCompare, String) in src/testing/unittest/buzztype_test.cpp (instructions on how to run the tests are provided in src/testing/unittest/README.md).

Failed to initialize (beginners error)

I am trying to get started using buzz and argos an am having a rough time of it. I am able to successfully run the argos tutorials but have run into issues while trying to run the buzz tutorials. I believe it is a library issue but I am not experienced enough to figure out the problem.

Here is my console output while trying to run gradient.bzz ( Ubuntu 16.04 WSL):

Buzz_gradient_error

Gradient.bzz: (.txt)

gradient_bzz.txt

Gradient.argos: (txt)

gradient_argos.txt

Initially I thought it was because buzz was installed in a different dir than argos, while that did not seem to be the issue, I re-installed so the file tree is now as follows:

rootfs/usr/lib/argos3/argos3-examples; buzz; buzz-examples

Thanks for the help and sorry for such a basic question

Error during installation, cannot read include files

Hi,

I was trying to install buzz following your steps, but when I do so, I get the following error:

Can't find file 'string.bzz'
/Users/marcel_torne/buzz/src/include/queue.bzz:1:20: Can't read 'string.bzz'

Could you please help me with the installation? I would really appreciate.

Please find bellow the console output when running make:

make
[  1%] Automatic MOC for target buzz
[  1%] Built target buzz_autogen
[  2%] Building CXX object buzz/CMakeFiles/buzz.dir/buzz_autogen/mocs_compilation.cpp.o
[  3%] Building C object buzz/CMakeFiles/buzz.dir/buzzdarray.c.o
[  4%] Building C object buzz/CMakeFiles/buzz.dir/buzzdict.c.o
[  5%] Building C object buzz/CMakeFiles/buzz.dir/buzzset.c.o
[  5%] Building C object buzz/CMakeFiles/buzz.dir/buzztype.c.o
[  6%] Building C object buzz/CMakeFiles/buzz.dir/buzzheap.c.o
[  7%] Building C object buzz/CMakeFiles/buzz.dir/buzzmsg.c.o
[  8%] Building C object buzz/CMakeFiles/buzz.dir/buzzinmsg.c.o
[  9%] Building C object buzz/CMakeFiles/buzz.dir/buzzoutmsg.c.o
[  9%] Building C object buzz/CMakeFiles/buzz.dir/buzzvstig.c.o
[ 10%] Building C object buzz/CMakeFiles/buzz.dir/buzzswarm.c.o
[ 11%] Building C object buzz/CMakeFiles/buzz.dir/buzzneighbors.c.o
[ 12%] Building C object buzz/CMakeFiles/buzz.dir/buzzstrman.c.o
[ 13%] Building C object buzz/CMakeFiles/buzz.dir/buzzmath.c.o
[ 14%] Building C object buzz/CMakeFiles/buzz.dir/buzzio.c.o
[ 14%] Building C object buzz/CMakeFiles/buzz.dir/buzzstring.c.o
[ 15%] Building C object buzz/CMakeFiles/buzz.dir/buzzvm.c.o
[ 16%] Linking CXX shared library libbuzz.dylib
[ 16%] Built target buzz
[ 17%] Automatic MOC for target buzzdbg
[ 17%] Built target buzzdbg_autogen
[ 18%] Building CXX object buzz/CMakeFiles/buzzdbg.dir/buzzdbg_autogen/mocs_compilation.cpp.o
[ 18%] Building C object buzz/CMakeFiles/buzzdbg.dir/buzzasm.c.o
[ 19%] Building C object buzz/CMakeFiles/buzzdbg.dir/buzzdebug.c.o
[ 20%] Linking CXX shared library libbuzzdbg.dylib
[ 20%] Built target buzzdbg
[ 21%] Automatic MOC for target bzzrun
[ 21%] Built target bzzrun_autogen
[ 22%] Building CXX object buzz/CMakeFiles/bzzrun.dir/bzzrun_autogen/mocs_compilation.cpp.o
[ 22%] Building C object buzz/CMakeFiles/bzzrun.dir/buzzrun.c.o
[ 23%] Linking CXX executable bzzrun
[ 23%] Built target bzzrun
[ 24%] Automatic MOC for target bzzdeasm
[ 24%] Built target bzzdeasm_autogen
[ 25%] Building CXX object buzz/CMakeFiles/bzzdeasm.dir/bzzdeasm_autogen/mocs_compilation.cpp.o
[ 25%] Building C object buzz/CMakeFiles/bzzdeasm.dir/buzzdeasm_main.c.o
[ 26%] Linking CXX executable bzzdeasm
[ 26%] Built target bzzdeasm
[ 27%] Automatic MOC for target bzzasm
[ 27%] Built target bzzasm_autogen
[ 28%] Building CXX object buzz/CMakeFiles/bzzasm.dir/bzzasm_autogen/mocs_compilation.cpp.o
[ 29%] Building C object buzz/CMakeFiles/bzzasm.dir/buzzasm_main.c.o
[ 29%] Linking CXX executable bzzasm
[ 29%] Built target bzzasm
[ 30%] Automatic MOC for target bzzparse
[ 30%] Built target bzzparse_autogen
[ 31%] Building CXX object buzz/CMakeFiles/bzzparse.dir/bzzparse_autogen/mocs_compilation.cpp.o
[ 32%] Building C object buzz/CMakeFiles/bzzparse.dir/buzzlex.c.o
[ 32%] Building C object buzz/CMakeFiles/bzzparse.dir/buzzparser.c.o
[ 33%] Building C object buzz/CMakeFiles/bzzparse.dir/buzzparse.c.o
[ 34%] Linking CXX executable bzzparse
[ 34%] Built target bzzparse
[ 35%] Automatic MOC for target argos3plugin_simulator_buzz
[ 35%] Built target argos3plugin_simulator_buzz_autogen
[ 35%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/argos3plugin_simulator_buzz_autogen/mocs_compilation.cpp.o
[ 36%] Building C object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/__/buzzlex.c.o
[ 37%] Building C object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/__/buzzparser.c.o
[ 38%] Building C object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/__/buzzasm.c.o
[ 39%] Building C object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/__/buzzdebug.c.o
[ 39%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_controller.cpp.o
[ 40%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_controller_footbot.cpp.o
[ 41%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_controller_spiri.cpp.o
[ 42%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_controller_eyebot.cpp.o
[ 43%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_loop_functions.cpp.o
[ 44%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt.cpp.o
[ 44%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt_editor.cpp.o
[ 45%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt_main_window.cpp.o
[ 46%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt_statetree_item.cpp.o
[ 47%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt_statetree_model.cpp.o
[ 48%] Building CXX object buzz/argos/CMakeFiles/argos3plugin_simulator_buzz.dir/buzz_qt_syntax_highlighter.cpp.o
[ 48%] Linking CXX shared library libargos3plugin_simulator_buzz.dylib
[ 48%] Built target argos3plugin_simulator_buzz
[ 49%] Compiling Buzz script testqueue.bzz, including "/Users/marcel_torne/buzz/src/include/matrix.bzz;/Users/marcel_torne/buzz/src/include/table.bzz"
Can't find file 'string.bzz'
/Users/marcel_torne/buzz/src/include/queue.bzz:1:20: Can't read 'string.bzz'
make[2]: *** [testing/testqueue.bo] Error 1
make[1]: *** [testing/CMakeFiles/testqueue.bzz.dir/all] Error 2
make: *** [all] Error 2

I'm installing buzz on:

  • macOS Big Sur 11.6
  • Apple clang version 13.0.0 (clang-1300.0.29.3)
  • cmake version 3.21.3

Thank you very much in advance for your help

online resources to build a community

This software fascinates me greatly and it would be very useful to have a community around that software. Perhaps it could be based around the traditional resources of a mailing list, forum and/or wiki where we could discuss the software, get help on problems, show off examples and so on. Is there anything like this existing or do you have plans to build something? Github has a certain community aspect, but dedicated tools would be very useful.

Cheers,

Robin

Buzz on ROS

Hi there! Really neat and interesting API you have created. Congrats!
...But I'm a ROS/gazebo user and what I pretende to know is if there are plans to create a ROS package of it? It would be of great use for most of ROS community.

Thanks and once again congrats for this great piece of work.

problems with files

I have a file: fpd = io.fopen("fpd.csv","a+") # have also tried with "w" and "a"
and use it: fpd.fwrite(string.tostring(s),",",id,",",string.tostring(pd)), where s has an integer and pd a float.

Since there are no examples on how to use files, I couldn't deduce why i get this error on every bot:

[ROBOT 7] afluir.bo: execution terminated abnormally: /home/alan/Documentos/pruebas/khepera-iv/afluir.bzz:166:1: type mismatch: expected closure, got nil

============================================================
state: error error: 6
code size: 2444 oldpc: 2003 pc: 2004
stacks: 2 cur: 1
cur instr: callc
next instr: pop
6 [string] 157:'209,972672'
5 [string] 64:','
4 [int] 7
3 [string] 64:','
2 [string] 156:'0'
1 [nil]
0 [table] 2 elements
[string] 152:'handle' -> [TODO] type = 6
[string] 153:'name' -> [string] 21:'fpd.csv'

Unexpected behavior of footbot

I don't know if this the correct place to make a question because it might simply be that I misunderstood something, but since I don't find any other place, here I go. For the attached experiment I expected:

  1. that the bot stops at t == 50,
  2. that the bot moves in a straight line,

but neither of these behaviors happen: it continues circling infinitely. I'll really appreciate any help, best regards,

Alan Calderón Castro
pruebas_footbot.argos.txt
pruebas.bzz.txt

Wrong lamba parameter parsing

The following code listings generate different behavior. (A) is correct, (B) is wrong.

# Code (A), correct
f = function(a,b,c) {
  log(a,";",b,";",c)
}
f(1,2,3)
# Code (B), wrong
if(1) {
  f = function(a,b,c) {
    log(a,";",b,";",c)
  }
}
f(1,2,3)
# Assembly (A): correct, notice the lload statements
52:	pushnil	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
53:	pushs 1	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
58:	gload	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
59:	lload 1	|3,9,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
64:	pushs 2	|3,10,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
69:	lload 2	|3,15,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
74:	pushs 2	|3,16,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
79:	lload 3	|3,21,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
84:	pushi 5	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
89:	callc	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
90:	pop	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
# Assembly (B): correct, notice the lload statements
62:	pushnil	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
63:	pushs 1	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
68:	gload	|3,7,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
69:	lload 0	|3,9,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
74:	pushs 2	|3,10,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
79:	lload 1	|3,15,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
84:	pushs 2	|3,16,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
89:	lload 2	|3,21,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
94:	pushi 5	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
99:	callc	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz
100:	pop	|4,2,/Users/cpinciroli/Fabrica/Buzz/buzz/src/testing/testfunction.bzz

The problem is related to parsing, in particular when a lambda is created inside a block (in this case the if), but the if is not itself into a function().

I don't have a fix yet, need to check how to solve it.

Hello world with bzzrun

Hi, I am trying to run a simple hello word script using bzzrun directly instead of using Argos. The print and log function results in the VM crashing with error code 6 for type mismatch. When we are not using the print function the script can run fine. I am on OpenSuse Tumbleweed but my partner have the same issue on Ubuntu 20.04

We are using the provided tools to compile with bzzc HelloBuzz.bzz
Are we doing something wrong?

Here is the script

# Executed once at init time.
function init() {
    print("Hello World!")
}

init()

Here is the traceback

============================================================
state: ready    error: 0
code size: 73   oldpc: 37       pc: 38
stacks: 1       cur: 1
cur instr: nop
next instr: pushnil
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 38       pc: 39
stacks: 1       cur: 1
cur instr: pushnil
next instr: pushs 0
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 39       pc: 44
stacks: 1       cur: 1
cur instr: pushs 0
next instr: gload
        1       [string] 0:'init'
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 44       pc: 45
stacks: 1       cur: 1
cur instr: gload
next instr: pushi 0
        1       [n-closure] 53
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 45       pc: 50
stacks: 1       cur: 1
cur instr: pushi 0
next instr: callc
        2       [int] 0
        1       [n-closure] 53
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 51       pc: 53
stacks: 2       cur: 1
cur instr: pop
next instr: pushnil
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 53       pc: 54
stacks: 2       cur: 1
cur instr: pushnil
next instr: pushs 1
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 54       pc: 59
stacks: 2       cur: 1
cur instr: pushs 1
next instr: gload
        1       [string] 1:'print'
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 59       pc: 60
stacks: 2       cur: 1
cur instr: gload
next instr: pushs 2
        1       [nil]
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 60       pc: 65
stacks: 2       cur: 1
cur instr: pushs 2
next instr: pushi 1
        2       [string] 2:'Hello World!'
        1       [nil]
        0       [nil]
============================================================

============================================================
state: ready    error: 0
code size: 73   oldpc: 65       pc: 70
stacks: 2       cur: 1
cur instr: pushi 1
next instr: callc
        3       [int] 1
        2       [string] 2:'Hello World!'
        1       [nil]
        0       [nil]
============================================================

============================================================
state: error    error: 6
code size: 73   oldpc: 70       pc: 71
stacks: 2       cur: 1
cur instr: callc
next instr: pop
        2       [string] 2:'Hello World!'
        1       [nil]
        0       [nil]
============================================================

HelloBuzz.bo: execution terminated abnormally at /home/xavier/src/SwarmUS-ROS/Buzz_gazebo/buzz_scripts/HelloBuzz.bzz:5:0 : type mismatch: expected closure, got nil

bzzparse returns 0 when fails to read included file

When an included file is not found, bzzparse returns 0. Our compilation pipelines still continues even if the compilation failed and we end up with invalid nop only bytecode.

To reproduce:

The in.bzz file

include "invalid_file.bzz"

The shell script

bzzparse in.bzz out.basm # Prints "Can't read 'invalid_file.bzz'"
echo $? # Returns 0, should return a non-zero error code

Issuess with RAB sensor and actuator with Buzz controller for epuck model

I tried to create a buzz controller for e-puck, by basically copy-pasting the code from the footbot buzz controller. But there seems to be a error for the range and bearing sensor used by the epuck model. Any idea how to solve it?. I also had a quick look at [(https://github.com/demiurge-project/argos3-epuck/tree/master/src/plugins/robots/e-puck/simulator)], they seem to have a bug fix for this, could that be the problem?.

 argos3 -c epuck.argos 
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_epuck.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_entities.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_media.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_pointmass3d.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_dynamics3d.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_kheperaiv.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3core_simulator.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_spiri.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_dynamics2d.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_footbot.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_buzz.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_genericrobot.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_eyebot.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_qtopengl.so"
[INFO] Loaded library "/usr/local/lib/argos3/libargos3plugin_simulator_prototype.so"
[INFO] Not using threads
[INFO] Using random seed = 124
[INFO] Using simulation clock tick = 0.1
[INFO] Total experiment length in clock ticks = unlimited
[INFO] The physics engine "dyn2d" will perform 10 iterations per tick (dt = 0.01 sec)
[FATAL] Failed to initialize the space.
[FATAL] Failed to initialize entity "ep1".
[FATAL] Failed to initialize controllable entity "controller_0".
[FATAL] Can't set controller for controllable entity "controller_0"
[FATAL] Error initializing the range and bearing medium sensor
[FATAL] Error parsing attribute "medium"
Attribute does not exist <ticpp.h@1791>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.