User defined graphical elements

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

User defined graphical elements

Previous pageReturn to chapter overview

Robotino® Factory is able to display user defined graphical elements send to Robotino® Factory over network. This can be done with the command line tool robtopic or by the Robotino's API2 interface.

 

Example robtopic:

 

Create a json file, which described the graphical elements to be displayed:

 

{

"lines" : [

 {

         "key" : "l1" ,

         "x0" : 0 ,

         "y0" : 0 ,

         "x1" : 1 ,

         "y1" : 1 ,

         "color" : "red" ,

         "width" : 0.5

 }

 ] ,

"circles" : [

 {

         "key" : "c1" ,

         "x" : 1 ,

         "y" : 1 ,

         "radius" : 1 ,

         "fillColor" : "#FFFF0000" ,

         "color" : "black" ,

         "lineWidth" : 0.1

 }

 ] ,

"images" : [

 {

         "key" : "i1",

         "x" : -1.2 ,

         "y" : 2 ,

         "opacity" : 0.5 ,

         "offset" : 0 ,

         "size" : 1476

 }

 ]

}

 

Save this description as test.json and run robtopic on Robotino or on the SmartSoft-Master node

 

robtopic pub customVis once test.json test.png

 

test.png is the image with size 1476 bytes. Depending on the operating system Robotino® Factory is executed on, png, jpg, bmp, pgm ... files can be displayed. If you want to display multiple images these images have to be combined in a single file. offset is than the starting byte of the image and size the number of bytes following.

 

The API2 interface defines the class CustomVis. With setCustomVisData you can transmit the content of the json file and the image data to Robotino® Factory.