Skip to content
Branch: master
Find file History
Pull request Compare This branch is 1 commit ahead, 171 commits behind tapsterbot:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
doc/movies
LICENSE
README.md
client.py
commands_parser.py
config.py
glue.py
robot_api.py

README.md

python folder

Here are elements defining a client written in Python which can drive the bot (i.e. send to it requests)

List of files

  • client.py The Python-written client to use so as to drive the robot, i.e. the "main" program
  • config.py The file having the configuration to use with for examples regular expresions, API's URL, etc.
  • glue.py Some Python glue so as to give logic to client and make the link with the robot_api.py file
  • robot_api.py The file which uses the HTTP API of the robot
  • commands_parser.py The file providing methods to parse and check commands

Usage

python client.py [-h] [--url ROBORSERVERURL] [--light COMMAND] [--file COMMANDSFILE] [--version]

Samples of commands to give

  • tap 100 100
  • n-tap 42 100 100
  • stress-tap 666 100 100
  • reset
  • swipe 300 300 100 100
  • n-swipe 5 300 300 100 100
  • stress-swipe 666 300 300 100 100
  • set-position 20 20 -155

How to use the client

  1. Define the configuration of your Tapster2 robot in config.py if needed
  2. Then...

To run the Python client in interactive / verbose mode, use:

  python client.py --url your-robot-url

or using the config.py file

  python client.py

To run the Python client in light mode using only a command, use:

  python client.py --url your-robot-url --light the-command-to-process

To run the Python client with a file of commands to process, use:

  python client.py --url your-robot-url --file path-to-the-command-file

If you want to get the version of the Python client, use:

  python client.py --version

The URL you may use must match the pattern protocol://ip:port, e.g. http://192.168.1.13:4242

Note

The default value for --url parameter is a combination of variables defined in config.py like http://127.0.0.1:4242. If you want to use this client, you have to have 'requests' module installed. To do so, you can run the following command or read this topic: The installed version of requests for this project is 2.18.4

  sudo pip install requests
You can’t perform that action at this time.