The Cuddlebot Control Server cuddled
is implemented using the
Go Programming Language as a RESTful API.
This version of the Control Server is an update from mikepb's version. It includes server control implementation for the smooth command, as well as detailed and improved build instructions for Ubuntu systems (up to date as of August 2015 for Ubuntu 14.04). This build is used in conjunction with instructions of the Cuddlebot Yocto system image.
Open up terminal and check if Go exists
go version
If version is below 1.4, or gives an error, install Go with the following steps. If not, it may be possible to proceed directly to Package Dependencies.
If Go version exists, remove it:
# Remove base directories:
sudo rm -rf /usr/lib/go
# or
sudo rm -rf /usr/local/go
# or wherever go had been stored
# Remove existing golang directories:
sudo apt-get remove golang-go
Install correct Go version:
## Install by source
# Navigate to Go build location
cd /usr/lib/
# Clone source code
sudo git clone https://go.googlesource.com/go
# Navigate in to folder
cd go
# Checkout correct version
sudo git checkout go1.4.1
# Prepare for build
cd src
# Build
sudo ./all.bash
## Setup Go environment
# Make go directory in home directory
cd ~
mkdir go
# Setup paths
# It should be of note that if the terminal is closed these may have to be set up again
export PATH=$PATH:/usr/lib/go/bin
export GOPATH=$HOME/go
export GOROOT=/usr/lib/go
# Check environment setup completion
go env
go version
## Setup build environment
# Navigate to environment setup location
cd /usr/lib/go/src/
# Setup make build environment for cuddled and cuddlespeak
GOOS=linux GOARCH=arm GOARM=7 ./make.bash --no-clean
Install the Go package dependencies:
go get github.com/codegangsta/negroni
go get github.com/phyber/negroni-gzip/gzip
go get github.com/stretchr/graceful
go get github.com/mikepb/go-crc16
These packages include the Negroni HTTP Middleware for Go and supporting packages.
To build binaries for Linux on ARM, you'll also need to install the
GNU Tools for ARM Embedded Processors. Make sure that the tools
are available on your PATH
.
A Makefile
is available with the following targets:
build
compilecuddled
andcuddlespeak
for the current platform and for Linux/ARMclean
remove the build directories
The binaries under bin-arm-linux/
are used as part of the Yocto Embedded Linux build process. More details are available as part of the Cuddlebot system image project.
bin/
compiled binaries for the current platformbin-arm-linux/
compiled binaries for the Linux/ARMcuddle
implements the control server librarycuddled
implements the control server daemoncuddlespeak
implements a command-line tool to control the motors
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, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.