A remote control application for the Arduino-based robot
See the details in our blogs:
- http://onerobotstory.blogspot.com/ (English)
- http://refunpro.blogspot.com/ (Ukrainian)
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
- Download the distribution archive: roboremote.zip
- Extract to any location
- Run roboremote.cmd (in Windows)
Remote control is performed over Wi-Fi connection using simple telnet-like connection. It is also compatible with RoboRemo: http://www.roboremo.com/
Command From RC | Action | Response from the Robot (on success) |
---|---|---|
MI | Mode-Idle | MI |
MA | Mode-AI | MA |
MS | Mode-Scenario | MS |
MR | Mode-Remote Control | MR |
W | Move Forward | - |
S | Move Backward | - |
A | Turn Left | - |
D | Turn Right | - |
LFx | Turn Front Lights (1 - ON, 2 - OFF) | LF1 or LF0 |
LRx | Turn Rear Lights (1 - ON, 2 - OFF) | LR1 or LR0 |
LSx | Turn Side Lights (1 - ON, 2 - OFF) | LS1 or LS0 |
R0 | Refresh Distances (with the head turn) | RLxx - left distance, where xx is a distance in centimeters with the leading zeros. RL-- means "not available" |
RFxx - front distance | ||
RRxx - right distance | ||
ROABCD - obstacle detectors state ("1"s or "0"s), A - left-ahead, B - left-edge, C - right-edge, D - right-ahead |
||
R1 | Refresh Distances (without the head turn) | same as above |
XAAABBB | Set the drives speed to AAA (left) and BBB (right). The speed is in range 000 - 511. 000 is full reverse, 511 means full ahead. | - |
- | Debug message from the robot | ~message text |
All commands should be followed by \n.
Video stream rendering is done by vlcj http://capricasoftware.co.uk/#/projects/vlcj
- Install VLC (make sure to match java and VLC platform - 32 or 64 bit)
- Add the following jars from the vlcj distro
- vlcj
- jna
- jna-platform
- slf4j-api
We use JInput library from https://java.net/projects/jinput to work with the joysticks and other gamepads.
Set-up instructions for Eclipse:
- Extract distribution zip to some folder (including native *.dll and *.so).
- Open Project Properties-> Java Build Path -> Libraries. "Add External Jars...": add jinput.jar and jinput-test.jar
- Open Project Properties-> Java Build Path -> Source. Expand the application source entry and add the library folder at "Native library location".
Caveats:
- JInput does not refresh a controllers list as well as does not notify if the controller was plugged-in. So start the app with all the controllers connected.
- JInput does not provide any means to work in the systems with two controllers with the same names. The first random controller will be chosen in this case.
Simple Logging Facade for Java (SLF4J) https://www.slf4j.org/ Anyway it is required by vlcj
Icons were derived from here: http://icons.webtoolhub.com/icon-p0s1155-set.aspx
- Implement smoother joystick position translation to the motors speed (MainWindow.generateMotorsCommand())
Added support for the front, rear, and side LED lights. More details here: http://refunpro.blogspot.com/??? (Ukr)
Initial version. More details here: https://onerobotstory.blogspot.com/2017/08/12-better-remote-control-with-fpv.html (Eng) or here http://refunpro.blogspot.com/2017/07/17.html (Ukr)