This (silly) example creates a random number generator block. It's
output is hexdump'ed (using the hexdump interaction block) and also
logged using a file_logger block.
$ luajit examples/trig_rnd_to_hexdump.lua
...Browse to http://localhost:8888
Explore:
- clicking on the node graph will show the connections
- clicking on blocks will show their interface
- start the
file_log1block to enable logging - start the
ptrig1block to start the system.
$ tools/ubx_genblock.lua -d std_blocks/myblock -c examples/block_model_example.lua
generating ...Run ubx_genblock -h for full options.
The following files are generated:
Makefilestandard makefile (you can edit this file)myblock.hblock interface and module registration code (don't edit)myblock.cmodule body (edit and implement functions)myblock.uscsimple microblx system composition file, see below (can be extended)types/vector.hsample type (edit and fill in struct body)robot_data.hsample type (edit and fill in struct body)
$ make # could also be run inside std_blocks/myblock$ tools/ubx_launch -webif -c std_blocks/myblock/myblock.uscRun ubx_launch -h for full options.
Browse to http://localhost:8888
-
Commands must be run from root of source tree. This will change in the future when blocks and libraries are installed.
-
Note the "random block example" uses a plain script to launch the system, while ubx_launch uses a declarative system model to launch, connect and configure blocks.