This is the repository for all our Linux-based software. There are four ROS packages: spear_rover, spear_station, spear_msgs, and spear_simulator. Each of these packages fulfills a specific role.
Usage guidelines and more detailed descriptions can be found in the READMEs of each respective package.
This is the package that contains all of the ROS messages defined by us, and for use between different packages. This is a seperate package so that a node or package can depend on it without needing to build other packages.
This package is for all of the code that runs the rover. Essentially, any software that is supposed to run on the rover or is hardware-dependant (i.e. drive management or arm kinematics) should be placed in this package.
This package contains the code and configuration for the simulator. This should ideally be able to run on the TX2, but it is not necessary for it to, as simulations can be run on more powerful computers.
This package contains all of the software that will be run at the base station during competition. This includes our command and control interfaces and essentially anything that isn't run on the rover during competition.
The recommended way to run the software in this repo is with Docker.
- Any linux distro
- Docker
For instructions on how to set up Docker inside a linux virtual machine on Mac or Windows, see these pages:
Some distributions have old versions of docker. The recommended way to install is by using the convenience script, provided by docker.
To do so, run:
sudo curl -sSL https://get.docker.com/ | sh
Note: you may need to install curl if you don't have it already.
On Ubuntu: sudo apt-get install curl
If you've never used docker, you'll have to do a little bit of setup.
Create a new group called "docker":
sudo groupadd docker
Add yourself to that group:
sudo usermod -aG docker $USER
Log out and log back in for the change to take effect.
Once you have been added to the docker group you should be able to run docker containers as your user (but you will probably still need to run the docker daemon with sudo).
To test your setup, start the docker daemon in its own terminal (if it has not already been started):
sudo dockerd
Note: if you get a message like the following:
INFO[2019-10-09T18:07:23.627014728-06:00] Starting up
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
This means that the docker daemon has already been started in the background.
You do not have to run sudo dockerd
yourself.
Simply proceed to the next step.
Now install and run the test docker image in a new terminal:
sudo docker pull hello-world
docker run hello-world
You should see a welcome message from docker. If this works, your docker installation is ready to go!
More information about linux configuration of docker can be found here: https://docs.docker.com/install/linux/linux-postinstall/
First pull the base ROS docker image:
sudo docker pull ros:kinetic-robot
To build our specific docker image, run these commands in the same directory as Dockerfile
.
Note: these 2 commands may take several minutes.
docker build -t spear-env - < spear-env.Dockerfile
That one will take a few minutes so maybe go grab a coffee.
Once that is finished, run:
docker build -t spear .
This will build a docker image from our Dockerfile
and tag it as "spear".
Use the run script to start the docker container.
./run-docker.bash
You should be able to edit files in your host machine and build and run the code in the docker container.
To build in the docker container:
cd ~/ros
catkin_make
We use ROS Kinetic which requires Ubuntu 16.04. A virtual machine will work but a native install will run smoother, especially for the simulator.
You can find a .iso image of Ubuntu 16.04 here.
We use ROS for nearly everying on the rover.
To install ROS, follow the instructions here.
We recommend the "Desktop-Full Install" ROS package for best compatibility.
Install the following dependencies:
- x264:
apt-get install libx264-dev
- Cython:
python -m pip install cython --user
- Pygame:
python -m pip install pygame --user
- Kivy:
python -m pip install kivy --user
- Kivy Garden:
python -m pip install kivy-garden --user
- Kivy Knob:
garden install knob
- ROS Joy:
sudo apt-get install ros-kinetic-joy
- libqt (required by nimbro_network):
apt-get install libqt4-dev
- qmake (required by nimbro_network):
apt-get install qt4-qmake
- ROS move_base package:
apt-get install ros-kinetic-move-base
Notes:
- x264 is for encoding video and Kivy is for our user interface.
- ROS Kinetic requires the Python 2 versions of all modules.
After installing the dependencies, clone this repo and run the unpack.sh
script located within.
This will setup your catkin workspace for development.
You must source ~/.bashrc
for the changes made by unpack.sh
to take effect.
Run rosdep to install the required packages:
rosdep install --from-paths src --ignore-src -r -y
The unpack.sh
script will symlink all the source files to a catkin workspace located at ~/ros
.
You can work in this directory and when you need to build, either run catkin_make
in the ~/ros
directory or simply run ./build.bash
from this directory which will handle things for you.
Run the following 2 commands:
sudo rosdep fix-permissions
rosdep update
See this forum post for more info: https://answers.ros.org/question/60366/problem-with-roscore/.
Current status is: not working but close.
For now, just ssh into the remote and run the main launch file. Then, on the local machine, run:
export ROS_MASTER_URI=http://tegra-ubuntu:11311/
Afterward, any nodes you run on your local machine will automatically connect to the remote machine.
See this post.
clang-format-3.9 -i -style=Google <filename>
yapf -i <filename>
Note: we are linting for python 3.5.