How to use Hugr Framework ?

If you are interested on how to program application using the Hugr framework, see Hugr Developer page.

Hugr Principles

The Hugr framework is a middleware library providing tools for applications to share information by simply reading and writing data-objects addressed by means of an application-defined name and a key.In some aspects, Hugr framework is related to OMG DDS (data distribution service) standard.

It is based on shared memory map called store where data are to be written or read by applications.
Each application must register the data it wants to share on the store.

Then the data are available for other processes to be read or to be set accessing to the store.

Hugr store supports any kind of data type: basic ones as integer, double, boolean, float, str::string but also object type as long as primitives for handling the data type are available.

Using Hugr withing the Cycab Toolkit

In the Cycab toolkit context, the Hugr framework is the key stone that enables the 3D simulator, the control application, the sensors drivers,… to run concurrently regardless of how those programs are designed.

Thus, a control application written to run on the simulated robotic platform is the same as the application to be run on the real platform as they access the same common media, ie the Hugr store.

For instance,

when using the simulated robotic platform,

the data in the store containing the odometric are given by the simulated odometric driver

when using the real robot,

the data in the store related to the odometric are given by the real odometric driver.

But as the control application is concerned : it handles the odometric
data coming from the store, regardless of which process sets the data.

The next section presents a set of useful tools to be used on the Hugr store in order to manage the contents of the store while applications are using it.
To illustrate our purpose, we suppose that you install the Cycab Toolkit package, and that you are ready to :

Launch the Hugr manager:

this manager is in charge of creating a Hugr store map to be used by the control application, the 3d simulator,…

This is the binary you need to create a Hugr store map. This program creates and allocates a IPCV5 shared memory map. Once it is launched, any application needing the Hugr framework can register data on the store, read and update data from the created store.

By default, hugrstore allocates a store which size is 65536 bits.
If the store is too short ? too big ? you can resize it using the flag –size.

You can have access using a WEB browser to the contents of a Hugr store.
For that, you need to run hugrweb utility.
This utility launched a WEB server which is linked to the Hugr store.
Once the program is started, it will tell you on with port the WEB server is launched (by default, the port : 8000 is chosen).
Then you can connect to this WEB server using your favorite WEB browser and visit : http://hostname:8000.