Thursday, June 30, 2016

RoboUnit, RoboAgent implementation log

   These days is so much happening in robo4j project. The easies way how to express the most of changes is the attached image. Although robo4j system S has been already able partially reconfigure itself upcoming implementation offers massive improvements. 
  Stay tuned !

Monday, June 27, 2016

Robo4j-Joystick demo update

   Together with robo4j-joystick demo, the update is coming of the main package is coming  too.  All main package changes are focused on improving the robo4j system configuration procedures, exception handling and agents. In the case of main package there will be soon published much more, including blog post.
  The robo4j-Joystick demo got improved the JavaFx UI interface with exception handling and information publishing. The communication between robot has be also improved. 
  The current demo version provides the information about the robot connection state. The Button provides two different states: Connect, Close. The Information about the connection procedure success is displayed aside in the connection label.



Have a fun and Stay tuned!

Thursday, June 23, 2016

1st Robo4j Demo is coming :: first taste of JavaFx Joystick

  Few days ago I've mentioned an Idea of having Robo4j JavaFx Joystick to my friend  @eppnikos . At that time he was seriously investigating JavaFx features. He completely open to take the challenge. 
  After few days he come up with base of Robo4j Java FX Joystick. I've connected the JavaFx app with Robo4j and pretty cool demo is born.

  What is Robo4j JavaFx Joystick ? 
  It's JavaFx application using Robo4j.io library for connection with robot. JavaFX app is generating events. Those events are handled by one of Robo4j agent which communicates with another internal agents.... 
More detailed post will be released soon.

  Stay tuned and enjoy video!
Robo4j is alive! May the force be with it! 


Sunday, June 19, 2016

Robo4j brick-client POST request using JSON arrays

   The 1st robo4j brick-client POST request version has been using JSON field "command". There was not  implemented support for JSON Arrays. Old POST command has also any type of response. The robo4j socket has been only closed.
--OLD POST--
$curl -H "Content-Type: application/json" -X 
POST -d '{"command" : "right=10;left=10;back=20;move=50"}' http://:8022
   Robo4j alfa-0.2 release introduces POST request with JSON Arrays support. The new array field has name "commands". 
--NEW POST--
$curl -H "Content-Type: application/json" -X POST -d '{"commands" : 
       [{"name" : "move", "value" : "20"},
        {"name" : "back", "value" : "20"}
       ]}' http://:8022
  The new POST request also provides the simple response. The response consists from the HTTP header and text message:
No Information about POST
   The new support of JSON Arrays will allow in upcoming future much better integration with 3rd party technologies.  

@miragemiko has written the short blog post with attached video. The video shows the stability of the robo4j-brick-client.

Saturday, June 18, 2016

Robo4j brick-client socket server update

  Robo4j framework has released update of its light-weight socket server. Update contains possibility to use cURL to command the robot directly. 
$curl  -X GET  http://:8022?move=30\&left=10\&right=10\&back=20
The internal socket server is planned to run fully asynchronously. The result is printed out after being processed with the result state. In case of mentioned command the following output is printed directly into the command line:
<HTML>
<HEAD>    
<TITLE>        
Robo4j Client success page    
</TITLE>
</HEAD>
<BODY>
<H1>Robo4j Client default success page</H1>
<p>    Robo4j Command has been successfully processed!<BR>    Congratulation</p><p>    command= [ClientRequestDTO{type=RequestCommandEnum{code=1, name='move'}, value='30'}, ClientRequestDTO{type=RequestCommandEnum{code=3, name='left'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=2, name='right'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=4, name='back'}, value='20'}]</p>
</BODY>
</HTML>
When robot status is required following command is used:
$curl  -X GET  http://192.168.178.26:8022/status
Robot answers through the command line in the following form:
<HTML>
<HEAD>
<TITLE>        
Robo4j Client status page    
</TITLE>
</HEAD>
<BODY>
<H1>Robo4j Client default status page</H1>
<p>    Robo4j Core agent status successfully generated!<BR>
<p>    CACHE= [AgentStatus{status=AgentStatusEnum{code=1, def='active'}, messages=[]}, AgentStatus{status=AgentStatusEnum{code=4, def='request_get'}, messages=[[ClientRequestDTO{type=RequestCommandEnum{code=1, name='move'}, value='30'}, ClientRequestDTO{type=RequestCommandEnum{code=3, name='left'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=2, name='right'}, value='10'}, ClientRequestDTO{type=RequestCommandEnum{code=4, name='back'}, value='20'}]]}]</p>
</BODY>
</HTML>

   The small update contains also code changes according to the way how the incoming events/tasks are being processed.
Enjoy and more is coming soon!

Wednesday, June 15, 2016

Robo4j.io alfa-0.2 release - documentation : part2

  This post is the second extension to the previous documentation post part1. Previously has been shown how to instruct the robot by commands over HTTP connection by using POST, GET  request types.  
--GET--
$curl  -X GET  http://brick_ip:8022?left=10\&right=10
--POST--
$curl -H "Content-Type: application/json" -X 
POST -d '{"command" : "right=10;left=10"}' http://brick_ip:8022
  The following post will explain and introduce another services which are available in current robo4j alfa-0.2 release. Those services are provided by the robo4j-brick-client light-weight socket server. 
  The socket server is responsible for handling HTTP requests. It is open on the port 8022. The running services also provide access to the robo4j AGENT. This agentis running on the brick. This specific AGENT implementation is currently responsible for cashing processed command requests. You can access it by using cURL or simply your favorite web browser.
http://192.168.178.26:8022/status
  The robo4j-brick-client returns its current state with information which commands have been received. 
  The next service provided by GET request is, already mentioned, command request. After the command has been send the robot will generate following response

Such response provides information about command process state. 
   The last service which is touch in this post is the EXIT service .
http://192.168.178.26:8022/exit
By sending exit request to the robot the exit response is generated.
The response is generated after all Executors are stopped and application process is ready to finish.
Have a great day! 
Stay tuned and enjoy all news.

Tuesday, June 14, 2016

Robo4j.io alfa-0.2 release - documentation : part1


   The Robo4j alfa-0.2 release is another big step for Robo4.j framework. It contains 1st version of robo4-brick-client. 
   The Robo4j brick-client is standalone module which uses native robot hardware. The module contains also stand alone server which is able to communicate with rest the of the word.    The communication with the robo4j-brick-client uses JSON lightweight data-interchange format. The current implementation allows to send basic robot platform orient commands. 
Such commands allow to process simple movements (move, back, right, left) with the Robo4j Alfa Robot unit
   Before you can use the build-in features of the robo4j-brick-client you need to run application itself directly on the Levo EV3 brick. It means that client needs to becompiled as fatJar and uploaded on the brick by busing, for example, the following command:
$scp ./Robo4jBrick.jar brick_user@brick_ip:/home/root/lejos/samples
example of accessing Robo4j brick-client from command-line using cURL:
$curl  -X GET  http://brick_ip:8022?left=10\&right=10
Before we go little more into the details it's worthwhile to mention that POST service is also available.
The POST request will be in future preferred over the SSL communication layer.
$curl -H "Content-Type: application/json" -X 
POST -d '{"command" : "right=10;left=10"}' http://brick_ip:8022

  You've seen the main visible change in alfa-0.2 release. But it's not everything, the robot hardware specific apart has been move to the package robo4j-lego module and robo4j Agent structure has been improved. 
  Robo4j alfa-0.2 also comes up with robo4j-commons which is the set of commonly used utils and features across the whole Robo4j project.
  Last visible improvement it Robo4j template engine PageParser. This engine is currently responsible for generation robo4j-line help and robo4j-brick-client web pages.
Videos and more is coming 
Stay tuned!

   


Monday, June 13, 2016

Braking news: Robo4j supported by JetBrains

  Yesterday Robo4j.io has proudly announced new alfa-0.2 release. 
  Today Robo4j proudly announces that framework has been added on the list of JetBrains supported Open-Source projects. Today Robo4j has become, officially ! 

JetBrains supported Open-Source project
Thank you JetBrains!

Sunday, June 12, 2016

Robo4j alfa-0.2 release is successfully OUT !

   
 
  Robo4j proudly announces successful alfa-0.2 release. The release is already available over the GitHub account but documentation is not ready at this moment. 
  The documentation with all new features will be published in next days. Robo4j.io is also preparing some new videos.
  Stay tuned! 

Tuesday, June 7, 2016

Command-line Interface

   Robo4j framework currently offers the command-line interface. The command-line interface allows you to create your own commands and process them. Following post should get you little closer. To exit any of sections it's enough to type "exit" key word. 
   At the beginning (after start) is displayed set of options: 

-------------------------------------

Robo4j.io command-line interface info

options numbers:

1. show help
2. available commands
3. save new command
4. run command-line
5. exit
------------------------------------

   Let's go through the possibilities step by step
  •  "show help" :: allows you to any time review how Robo4j.io interface works 
------------------------------------
Robo4j.io command-line module is designed for full interaction with the robot.
It allows you to use Active, Basic, Complex commands
to controll Robo4j.io Alfa robot.
Every command-line section contains its own help to properly inform user how to interact within.

Options summary:
2. Available commands
The table contains the command name and robot command the will be processed after command has been typed.

----------------------------------------------------
|   name       |  consist of commands              |
|   basic42    |  move(10),back(10)                |
----------------------------------------------------

3. Save command
Save specific command by using predefined prefix.
Prefixes:
a) Basic command    ->  B:
b) Complex command  ->  C:

example: {"type" : "B", "name" : "magic22", "content" : "move(22),right(360),back(33)" }

4. Run Robo4j Command line
Usage of prexes allows you to send specific command to the Robot
prefixes:
a) A: - Active command :: usage A:move available option
   A: (move,back,left,right)
b) B: - Basic command
c) C: - Complex command
d) H: - Hand command :: usage H:command 

------------------------------------
  • "available commands" :: display list of currently available commands
------------------------------------
available commands...
type B: name= exit content= exit
type B: name= rotate1 content= move(10),right(30),left(30),back(10)
type B: name= line1 content= move(30),back(30),move(30)

------------------------------------

  • "save new command" :: 

------------------------------------
Robo4j.io new command section
You can create new command for the robot and store it into system internal cache. new command format is JSON like.
example: {"type" : "B", "name" : "magic22", "content" : "move(22),right(360),back(33)" }
------------------------------------
  • "run command line" :: robot command line allows you to command the robot. 
------------------------------------
command-line section...
COMMAND THE ROBOT
BridgeCommandProducer INIT
BridgeCommandConsumer INIT
BridgeCommandProducer READY and IN CYCLE
AGENT ACTIVE = [AgentStatus{status=AgentStatusEnum{code=1, def='active'}, messages=[]}]
WRITE YOUR COMMAND
------------------------------------


Saturday, June 4, 2016

NEWS: Robo4j alfa-0.1 release is out

   Great news! Promised release date has been achieved and source-code has been deployed on GitHub under GPL license version 3. 
   What the release contains: 
  • robo4j-core
    •  core functionality which provides communication with robot, synchronisation of asynchronous events and etc.
  • robo4j-line
    • command line interface which is capable to dynamically extend robot behaviour
  To make the robot work it's necessary to follow previous blog post about how to build the robot.
   The configuration of the Robo4j.io framework is then straight forward. It's necessary to link all robot parts properly together. For those purposes Robo4j.io offers following types of annotations:
  • @SystemProperties - such annotation configures underlaying system, in this case it's Lego Mindstorms brick
  • @RoboEngine - such annotation is necessary to configure any engine available on the brick 
  • @RoboSensor - annotation allowos to link robot sensor with the Robo4j infrastructure 
  • @BatchAnnotation - allows to pre-configure Basic Commands. Such command are then available and ready to be used by the interface
   All configuration parts are then processed at initiation time of the Robo4j.io inside the entry point. 
This entry point is the the class ControlPad.

   Pictured configuration is pretty straight forward and more will be published soon!
   Enjoy Robo4j.io kick-off