RCKit library for Arduino
This is the Arduino RCKit 1.1 library.
RCKit provides a kit of software objects that make it easy to build an RCOIP (Remote Control Over IP) receiver on Arduino. RCOIP protocol is used to carry remote control commands from a transmitter to a receiver over an IP transport such as Ethernet or Wi-Fi.
As such it can be used to build Remote Controlled (RC) vehicles and devices of various kinds, along with matching transmitters. Large numbers of channels can be supported, along with a back-channel which sends data from the Receiver to the Transmitter. A compatible iPhone transmitter app is also available.
The transmitter could be a handheld Wi-Fi enabled device such as an iPhone, iPad or Arduino based device. Or it could be an interactive program running on a desktop computer. The RCTx iPhone transmitter app is available on the Apple App Store. It provides a simple RCOIP transmitter equipped with 2 joysticks and a number of switches.
The receiver (using this RCKit software) could be a remote controlled car, plane, helicopter or some other device.
The RCOIP protocol is a 2-way protocol that defines UDP messages between the RCOIP transmitter and receiver. This effectively makes the transmitter a UDP client and the receiver a UDP server. Messages sent from the transmitter to the receiver include setting analog outputs, and messages from the receiver to the transmitter include receiver status messages.
RCTx, RCKit and the RCOIP protocol offer the following advantages over conventional Remote Control:
- Large numbers of channels (> 100) not just 5 or 6, including analog, digital, text, data etc.
- Back channel for telemetry (voltages, signal strengths, GPS position etc)
- Failsafe modes
- Programmable, configurable and extensible
- Works with a variety of types of vehicle and remote devices
- Hackable
- Opportunity to tightly integrate remote control and autonomous vehicle software control
- Works with a variety of IP transports Wi-Fi (ad-hoc or infrastructure), Wired etc.
Videos explaining how it works and what you can do with it can be found at:
The version of the package that this documentation refers to can be downloaded from
http://www.open.com.au/mikem/arduino/RCKit/RCKit-1.1.zip You can find the latest version at
http://www.open.com.au/mikem/arduino/RCKit
Tested on Arduino Duemilanove, Diecimila, Mega and Asynclabs Yellowjacket with arduino-0018 on OpenSuSE 11.1 and avr-libc-1.6.2-5.11, cross-avr-binutils-2.19-9.1 and cross-avr-gcc43-4.3.3_20081022-9.3
- Setters
Setter are object that receive a value, maybe transform it and then do something with it. Typically they set an output pin according to the received input value, but almost any other transformation, output or communication can be imagined.
The following output Setter objects are provided with RCKit. They can be used to translate receiver channel values into physical outputs:
The following transformation
Setter objects are provided with RCKit. They can be used to transform receiver channel values before being given to one of the output
Setter classes above:
- RCRx
RCRx class is a Wi-Fi
RCOIP receiver. It works with Arduino and WiShield and any
RCOIP compliant Wi-Fi Transmitter (such as the RCTx iPhone app available on the Apple App Store).
By default, RCRx is configured as an Ad-Hoc Wi-Fi network with SSID of 'RCArduino' By default, the network is Open (ie no encryption) and It is configured with a static IP address of 169.254.1.100. These setting can be changed by editing RCRx.cpp in the RCKit distribution.
When the RCRx object is constructed, it must be given an array of Setter objects. When a RCOIPv1CmdSetAnalogChannels is received by RCRx, The Setter corresponding to each Channel value in the RCOIPv1CmdSetAnalogChannels command will be passed to the respective Setter in the analogOutputs array. The Arduino software is expected to be configured so that each analogOutput is connected to a Setter that will implement the received value, perhaps by setting an analog or digital output on an Arduino pin. Setter objects are provided to achieve this.
RCRx will automatically respond to received commands with RCOIPv1ReplyReceiverStatus messages as appropriate to the configured timeouts etc. See the RCOIP protocol document for more details.
- Examples
Several example Arduino sketches are included, including a regression test suite and a sample complete 5 channel receiver with Servo outputs.
The following example programs are provided:
- TestSuite
- RCRx
- HBridgeRCRx
- HBridge2RCRx
- DifferentialRCRx
- RCTx iPhone App
RCTx is an
RCOIP compliant transmitter for iPhone available on the Apple App Store at
http://itunes.apple.com/app/rctx/id377833472?mt=8
It presents a simulated RC transmitter with 2 joysticks and a number of switches. The left josystick sets channels 0 and 1 and the right joystick channels 2 and 3. The switches set channels 4 through 9 inclusive. The one connected to channel 4 is momentary contact. The install and configure RCTx:
- install the RCTx app on your iPhone.
- Build and upload your RCRx program you your Arduino+WiShield hardware
- Power up the Arduino
- Turn on your iphone, go to Settings, Wi-Fi. Enable Wi-Fi
- After about 30 seconds, you should see the RCArduino network appear as an available network on the iPhone. Tap on it. Now tap on the RCArduino network details arrow to the right of the RCArduino line. Select 'Static'. Enter an IP Address of 169.254.1.1. Enter a Subnet Mask of 255.255.0.0
- After about 10 seconds, the iPhone should be successfully connected to the RCArduino network. You now have an ad-hoc connection to the Arduino. The Arduino will have the address 169.254.1.100 and the iPhone wil have address 169.254.1.1
- Start the RCTx app on the iPhone.
- After about 5 seconds, you should see the NO CONNECT in the bottom left corner change to show RSSI and the correct battery voltage (if the Arduino is so equipped).
- Move the josticks and buttons. This will send RCOIP commands to the Arduino. RCRx in the arduino will convert them to analog output signals to drive your hardware. Have fun.
- Prerequisites
Requires:
- Installation
Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your sketchbook.
- Author:
- Mike McCauley (mikem@open.com.au)
This software and the
RCOIP protocol is Copyright (C) 2010 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V2 or Commercial:
- Open Source Licensing GPL V2
- This is the appropriate option if you want to share the source code of your application with everyone you distribute it to, and you also want to give them the right to share who uses it. If you wish to use this software under Open Source Licensing, you must contribute all your source code to the open source community in accordance with the GPL Version 2 when your application is distributed. See http://www.gnu.org/copyleft/gpl.html
- Commercial Licensing
- This is the appropriate option if you are creating proprietary applications and you are not prepared to distribute and share the source code of your application. Contact info@open.com.au for details.
- Revision History
- Version:
- 1.0 Initial release
1.1 Added Linear