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
------------------------------------


No comments:

Post a Comment