An ongoing robotics project in Flowbotics

As suggest by Sébastien here I will post on my progress of building a robotics project in Flowbotics, starting as a complete novice in Flowbotics, but with many years experience in software development and architecture.

First some background. My interest and purpose is to build real world autonomous robots based upon Perceptual Control Theory, which is a approach to living systems, and robotics, as a hierarchy of feedback control systems which control their perceptions (inputs) rather than the conventional view of controlling (motor) output. You can see some videos of robots on the youtube channel. All the control systems consist of simulations of neural signals and associated functions. So, any implementation is entirely digital signal processing.

Currently I have a framework of Java libraries to run on the (Lego) robots. The framework comprises generic Java functionality for running the control systems which are defined by XML configuration files, which specify all the necessary parameters, such as gain, for the system functions. There is also a Swing GUI for monitoring the real time system remotely over TCPIP.

Working with XML configuration files is not ideal so it would be good to create the configuration within a GUI, where functions can be connected together, and grouped into control systems, and the whole system can be viewed graphically. This is where Flowbotics comes in and looks just the sort of thing I need. It would also be good to use the same project schematic to monitor the remote system and to modify remote parameters in real time. And to hot deploy modified projects to the remote robot.

So my intention is to do the following:

]create a module for a neural function, requires properties and list of parameters/:m]
]group neural function modules into control system modules/:m]
]group control systems into layers/:m]
]create different modes for the same schematic, e.g. LOCAL, CONFIGURE, MONITOR/:m]
]call Java functions to build the XML /:m]
]create ruby functions at heart of neural module to control processing according to mode/:m]
]create TCP connections to remote system/:m]
]use scope GUIs for displaying real time control variables/:m]

Here are some things I think I will need,

]Global variables for the modes/:m]
]Shell execute for calling the Java functions, and returning function output/:m]
]Set properties of modules/:m]
]Lists (or arrays) of input parameters to modules, where each parameter consists of three strings, name, value, datatype/:m]
]TCPIP connection to remote system to accept set of floats, each of which correspond a neural function/:m]
]In each function read, and display, corresponding float /:m]

I am just starting out working out how to use Flowbotics, here are a few things not yet sorted out,

]it wasn’t apparent how to connect to the scope component/:m]
]the shell exec component doesn’t appear to return output from the shell/:m]
]the ruby component has a “LoadError (in method parse)” message with test code of “2+2”/:m]

I will update this thread with the progress of this project. Any pointers or suggestions to aid with the development would be most welcome.

Regards,
Rupert

Hi Rupert,

We are glad to see you post about this very interesting and ambitious project!

Let us know if there is anything specific we can help you with and good luck!

Sincerely,

Thanks. Can I first check on the documentation and tutorials?

Here is what I have seen:

]FlowStone Basics Video/:m]
]Flowbotics User Guide/:m]
]Flowstone User Guide/:m]
]Flowstone Component Reference/:m]

Are there other resources I should be looking at? For example, where would I find how to link up a scope GUI, with a component with a float output?

Regards,
Rupert Young
www.perceptualrobots.com

Hi Rupert,

Those four links are pretty much all the starting information currently available. We have a feeling you have already been to the FlowBotics Developer Zone, but we shall add it here for others who may be looking for help. You may also find this short tutorial interesting.

In FlowBotics Studio, most GUIs are created using a mix of bitmaps and Ruby to draw interactive elements. We recommend having a look at the projects that come with FlowBotics Studio as a starting point.

Sincerely,

Do you mean the lynxmotion projects? They don’t seem to do anything.

I’ve created a “Parameter” datatype module as per below.

I moved it have into a custom toolbox and saved this in a fsp file, but how do I save it as a module that can be in any project?

Also I would like to pass a number of these into another module as a list of inputs. How can I create an array of these modules to pass in as a single input?

Hi,

Adding a module to the toolbox requires a few steps. First, you must select all objects and create a module with them. Then, you must go into the module and add inputs and outputs as required. Once done, go back to the previous view and rename your module. Afterwards, select the module and press “Add to toolbox”. Your module is now part of the toolbox and can be used in other projects.
If you need to backup or copy your custom modules, please note they are usually saved in the following folder: %appdata%\FlowBotics\Modules\User. Please see the attached file for detailed steps with screenshots.

The simplest way to create a single output is to use an array builder (and an array splitter later on) to combine the values into one line. You can also use a Ruby module to combine the values into data structure (you can find examples of this in the projects provided with FlowBotics Studio). Attached is an example using both the array builder and the array splitter.

Sincerely,
2015-04-08 - Module array.fsp (33.6 KB)


2015-04-08 - Modules.pdf (349 KB)

Thanks. Can I save my modules in a different folder, for version conntrol?

Thanks. The output of my module is a ruby value, can the array builder handle that, it only seems to have integer, float and string?

Where do I find the examples?

The custom module path cannot be changed at this time. We will take note of this and it will be added to our list of features to be considered.
For now, we can recommend using a simple script to automate the version control of those files / or the entire folder.

You are right, the default array builder module cannot combine complex data like a ruby value. Instead, replace the array builder with a ruby module that will combine the ruby values passed to it.

You can find examples of ruby value uses in the Lynxmotion FlowBotics projects folder. Open one of them (screenshot is of the quadruped example) and go one level down. Then, pan to the right and go into the “Robot Definition” module. From there check out the ruby code inside the module. If you wish to see how it is used later on, simply select the output component and press TAB to cycle through the various places where it is used.

Sincerely,

Ok, I am trying to create a list of my “Parameter” modules. I thought I’d have a class with an array and pass that and my parameters into a ruby component and create the list there, as shown in the image.

However, the output in the third ruby component doesn’t look quite right and actually the code in the centre ruby component has no effect anyway, so I must be doing something wrong. Project attached.

Any suggestions?


ParameterArrayTest.fsp (28.8 KB)

Hi Rupert,

We are investigating your issue and will respond to you soon.

Sincerely,

Hi Rupert,

Here is a full parameter combining example. It is fully functional as far as we can tell and allows as many parameter blocks and parameter name/value pairs inside those blocks.
The end results of the combination of all of the parameters in the parameter blocks is one giant array or hash (your choice) that can be passed to any other Ruby component to extract information.

We recommend to use the hash object to combine the parameter blocks as it ensure that you always access the right values whereas using an array requires relying on the index and the order of the objects inside the array.
Comments were added inside the modules, so please take the time to read all of them for details on the implementation and how the modules function.

Please let us know if you have more questions.

Sincerely,
Parameter Array Exemple 2.fsp (8.54 KB)
Parameter Array Exemple.fsp (8.1 KB)

That looks fantastic! Thanks for your efforts. I’ll go through it detail, I may be some time.

I’ve created the first module for my project, for a parameter for a control system configuration, code attached.

A couple of questions below.

Can the font size of the label (on the front panel, below as “Parameter”) be increased?

Can the value of the module label (below as “ParameterLabel”) be referenced within the module as a variable?


ParameterTest.fsp (1.84 KB)

Another module for creating a list of the parameters.

Why does output 2 not print the value of i, and is always zero?

The number of parameter inputs is variable though less than about 10. Can the number of module inputs be variable rather than having to manually add each input?

If I modify the module after it has been added to the toolbox the one in the toolbox is not updated. How can they be synchronized?
ParameterListTest.fsp (2.64 KB)

Hi,

We will examine your questions and reply with more information soon. Please note considering the type of questions and complexity, it will probably take a few days.

Sincerely,

Hi,

Here are answers to your questions:

Yes it can. You can increase the size of the font of the label by modifying it in the Ruby module that generates the label. See the following images for reference: step 1, step 2.

The name of the module does not seem to be accessible in the Ruby module currently. The easiest work-around for now would be to have a String input for the name of the parameter module.

This is due to the fact that “i” from def event i,v is not an integer but a complex type. By changing the @i code for an integer arithmetic, you force a conversion to integer of i to be used instead of the object i itself.
This trick was used in our examples from before. Here is an example that we tried with your code (output #2 changes with this):

def event i,v @i = (i + 0) @len = @paramlist.list.length ...]

Yes, by using only one input and making sure the parameter objects are uniquely identified. Take a look at the attached example (modified from yours). This should be close to an optimal solution now.

You can achieve synchronization between modules that are in use (placed in your project), as described in the manual here. Once modified, the module is different from the one in the toolbox and will need to be added again (and possibly remove the old one).

Please let us know if this helps and of any other advancements you make.

Sincerely,
ParameterListTest_V2.fsp (3.03 KB)


Parameter label text size - 0001.png