Skip to content

Commit 47373e8

Browse files
authored
Merge pull request #11 from BCLab-UNM/kinetic_kame
Kinetic kame compatibility update
2 parents e562707 + 5574836 commit 47373e8

File tree

122 files changed

+6032
-2277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6032
-2277
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
[submodule "src/ublox"]
22
path = src/ublox
33
url = https://github.com/KumarRobotics/ublox.git
4+
[submodule "apriltags_ros"]
5+
path = apriltags_ros
6+
url = https://github.com/RIVeR-Lab/apriltags_ros.git
7+
[submodule "src/apriltags_ros"]
8+
path = src/apriltags_ros
9+
url = https://github.com/RIVeR-Lab/apriltags_ros.git

README.md

Lines changed: 44 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Swarmathon-ROS
1+
# SwarmBaseCode-ROS
22

3-
This repository is a ROS (Robot Operating System) controller framework for the Swarmie robots used in the [NASA Swarmathon](http://www.nasaswarmathon.com), a national swarm robotics competition. This particular framework is a ROS implementation of the CPFA (central-place foraging algorithm) developed for [iAnt robot swarms](http://swarms.cs.unm.edu) at the [University of New Mexico](http://www.unm.edu/).
3+
This repository is a ROS (Robot Operating System) controller framework for the Swarmie robots used in the [NASA Swarmathon](http://www.nasaswarmathon.com), a national swarm robotics competition.
44

55
This repository contains:
66

7-
1. Source code for ROS libraries (i.e. packages) that control different aspects of the Swarmie robot, including localization, mapping, mobility, and obstacle and target detection
7+
1. Source code for ROS libraries (i.e. packages) that control different aspects of the Swarmie robot, including robot behaviours such as search strategies and obstacle avoidance, diagnostics, and user interface elements.
88
2. 3D .STL models for the physical Swarmie build
99
3. Bash shell scripts for initializing simulated Swarmies in the Gazebo simulator, as well as physical Swarmies
1010

@@ -16,78 +16,86 @@ This repository contains:
1616

1717
- Please consult the [git scm](https://git-scm.com/) and [git best practices](https://sethrobertson.github.io/GitBestPractices/) for guidelines on the most effective approaches to maintaining code. Teams will be expected to commit new code at least every two weeks, and ideally commit one or more times per week. Consult the [NASA Swarmathon Timeline](http://www.nasaswarmathon.com) for specifics on how often code should be committed, as well as the cutoff date for final code revision before the competition.
1818

19-
### Quick Start Installation Guide
19+
Be: sure you are using the latest drivers for your video card using the "additional drivers tool" in Ubuntu. Gazebo client often does not do well with the open source drivers.
2020

21-
Swarmathon-ROS is designed and tested exclusively on the 64 bit version of Ubuntu 14.04 LTS (Trusty Tahr) and ROS Indigo Igloo. This framework may compile and run correctly under other versions of Ubuntu and ROS, but **NOTE** that these other systems are untested and are therefore not supported at this time.
21+
![Alt text](https://github.com/BCLab-UNM/SwarmBaseCode-ROS/blob/kinetic_kame/readmeImages/InstallGraphics.png "Additional Drivers")
2222

23-
##### 1. Install ROS Indigo
23+
### Quick Start Installation Guide
2424

25-
Follow the detailed instructions for installing ROS Indigo under Ubuntu 14.04 [here](http://wiki.ros.org/indigo/Installation/Ubuntu). We recommend the Desktop-Full installation, which includes the Gazebo 2 simulator.
25+
Swarmathon-ROS is designed and tested exclusively on the 64 bit version of Ubuntu 16.04 LTS (Xenial Xerus) and ROS Kinetic Kame. Other systems are untested and are therefore not supported at this time.
2626

27-
##### 2. Install additional ROS plugins
27+
##### 1. Install ROS Kinetic Kame
2828

29-
We use the [catkin_tools](https://catkin-tools.readthedocs.io/) package to build the Swarmathon-ROS code base:
29+
Detailed instructions for installing ROS Kinetic Kame under Ubuntu 16.04 [here](http://wiki.ros.org/kinetic/Installation/Ubuntu) or follow the summarized instructions below:
3030

3131
```
32-
sudo apt-get install python-catkin-tools
32+
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
33+
34+
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
35+
36+
sudo apt update
37+
sudo apt install ros-kinetic-desktop-full
38+
sudo rosdep init
39+
rosdep update # Note this is not run with sudo
3340
```
3441

35-
Our simulated and physical Swarmies use existing ROS plugins, external to this repo, to facilitate non-linear state estimation through sensor fusion and frame transforms. These plugins are contained in the [robot_localization](http://wiki.ros.org/robot_localization) package, which should be installed using the apt-get package management tool:
42+
Note: if you accidentally ran ```sudo rosdep update``` you can repair the permissions ```sudo rosdep fix-permissions```.
43+
44+
##### 2. Install additional ROS packages
45+
46+
We use the [catkin_tools](https://catkin-tools.readthedocs.io/) package to build the Swarmathon-ROS code base:
3647

3748
```
38-
sudo apt-get install ros-indigo-robot-localization
49+
sudo apt install python-rosinstall python-catkin-tools
3950
```
4051

41-
We additionally make use of an AprilTag detection plugin to decode tags within images, as well as provide pose estimates for tag positions relative to the lens of the camera. This plugin is contained in the [apriltags_ros](http://wiki.ros.org/apriltags_ros) package, which should be installed using apt-get:
52+
Our simulated and physical Swarmies use existing ROS plugins, external to this repo, to facilitate non-linear state estimation through sensor fusion and frame transforms. These plugins are contained in the [robot_localization](http://wiki.ros.org/robot_localization) package, which should be installed using the apt-get package management tool:
4253

4354
```
44-
sudo apt-get install ros-indigo-apriltags-ros
55+
sudo apt install ros-kinetic-robot-localization
4556
```
4657

47-
Finally, our physical Swarmies use a USB camera driver, contained in the [usb_cam](http://wiki.ros.org/usb_cam) package, to interface with the built-in Logitech C170 webcam:
58+
Finally, our physical Swarmies use a video stream package [video_stream](http://wiki.ros.org/video_stream_opencv), to interface with the built-in Logitech C170 webcam:
4859

4960
```
50-
sudo apt-get install ros-indigo-usb-cam
61+
sudo apt install ros-kinetic-video-stream-opencv
5162
```
5263

5364
##### 3. Install additional Gazebo plugins
5465

5566
Our simulated Swarmies use existing Gazebo plugins, external to this repo, to replicate sonar, IMU, and GPS sensors. These plugins are contained in the [hector_gazebo_plugins](http://wiki.ros.org/hector_gazebo_plugins) package, which should be installed using the apt-get package management tool:
5667

5768
```
58-
sudo apt-get install ros-indigo-hector-gazebo-plugins
69+
sudo apt install ros-kinetic-hector-gazebo-plugins
5970
```
6071

61-
Our Swarmies can receive mobility commands from the right thumb stick on a Microsoft Xbox 360 controller. The ROS [joystick_drivers](http://wiki.ros.org/joystick_drivers) package, which contains a generic Linux joystick driver compatible with this controller, should also be installed using the apt-get tool:
72+
Thw Swarmies can receive commands from the thumb sticks on a Microsoft Xbox 360 controller. The ROS [joystick_drivers](http://wiki.ros.org/joystick_drivers) package, which contains a generic Linux joystick driver compatible with this controller, should also be installed using the apt tool:
6273

6374
```
64-
sudo apt-get install ros-indigo-joystick-drivers
75+
sudo apt install ros-kinetic-joystick-drivers
6576
```
6677

6778
Joystick commands can also be simulated using the direction keys (Up=I, Down=K, Left=J, Right=L) on the keyboard. The Rover GUI window must have focus for keyboard control to work.
6879

6980
##### 4. Install git (if git is already installed, skip to step 5):
7081

7182
```
72-
sudo apt-get install git
83+
sudo apt install git
7384
```
7485

7586
##### 5. Install Swarmathon-ROS
7687

77-
1. Clone this GitHub repository to your home directory (~), renaming the repo so ROS and catkin can properly identify it:
88+
1. Clone this GitHub repository to your home directory (~), renaming the repo so ROS and catkin can properly identify it (you can name the target directory whatever you like):
7889

7990
```
8091
cd ~
81-
git clone https://github.com/BCLab-UNM/Swarmathon-ROS.git rover_workspace
92+
git clone https://github.com/BCLab-UNM/SwarmBaseCode-ROS.git SwarmBaseCode-ROS
8293
```
8394

84-
2. Change your current working directory to the root directory of the downloaded repo:
95+
2. Change your current working directory to the root directory of the downloaded repo.
8596

86-
```
87-
cd ~/rover_workspace
88-
```
8997

90-
3. Set up [ublox](http://wiki.ros.org/ublox) GPS submodule:
98+
3. Set up [ublox](http://wiki.ros.org/ublox) GPS submodule and April Tag library:
9199

92100
```
93101
git submodule init
@@ -98,9 +106,9 @@ sudo apt-get install git
98106

99107
Make sure bash is aware of the location of the ROS environment:
100108
```
101-
if ! grep -q "source /opt/ros/indigo/setup.bash" ~/.bashrc
109+
if ! grep -q "source /opt/ros/kinetic/setup.bash" ~/.bashrc
102110
then
103-
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
111+
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
104112
fi
105113
source ~/.bashrc
106114
```
@@ -110,28 +118,13 @@ sudo apt-get install git
110118
```
111119
catkin build
112120
```
113-
114-
5. Update your bash session to automatically source the setup file for Swarmathon-ROS:
115-
116-
```
117-
echo "source ~/rover_workspace/devel/setup.bash" >> ~/.bashrc
118-
source ~/.bashrc
119-
```
120-
121-
6. Update your bash session to automatically export the enviromental variable that stores the location of Gazebo's model files:
122-
123-
```
124-
echo "export GAZEBO_MODEL_PATH=~/rover_workspace/simulation/models" >> ~/.bashrc
125-
echo "export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:~/rover_workspace/devel/lib/" >> ~/.bashrc
126-
source ~/.bashrc
127-
```
128-
121+
129122
##### 6. Run the Swarmathon-ROS simulation:
130123

131-
1. Change the permissions on the simulation run script to make it exectuatable:
124+
1. Change the permissions on the simulation run script to make it exectuatable (assuming you use the target directory name SwarmBaseCode-ROS):
132125

133126
```
134-
cd ~/rover_workspace
127+
cd ~/SwarmBaseCode-ROS
135128
chmod +x ./run.sh
136129
```
137130

@@ -191,16 +184,12 @@ To close the simulation and the GUI, click the red exit button in the top left-h
191184

192185
### Software Documentation
193186

194-
Source code for Swarmathon-ROS can be found in the ```~/rover_workspace/src``` directory. This diretory contains severals subdirectories, each of which contain a single ROS package. Here we present a high-level description of each package.
187+
Source code for Swarmathon-ROS can be found in the repository /src directory. This diretory contains severals subdirectories, each of which contain a single ROS package. Here we present a high-level description of each package.
195188

196-
- ```abridge```: A serial interface between Swarmathon-ROS and the A-Star 32U4 microcontroller onboard the physical robot. In the Swarmathon-ROS simulation, ```abridge``` functionality is supplanted by [gazebo_ros_skid_steer_drive](http://docs.ros.org/indigo/api/gazebo_plugins/html/classgazebo_1_1GazeboRosSkidSteerDrive.html) (motor and encoders) and [hector_gazebo_plugins](http://wiki.ros.org/hector_gazebo_plugins) (sonar and IMU; see [step 3](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#3-install-additional-gazebo-plugins) of the Quick Start guide).
197-
- ```mobility```: The top-level controller class for the physical and simulated robots. This package receives messages on the status of targets and/or obstacles in front of the robot and autonomously makes decisions based on these factors. This packages also receives pose updates from [robot_localization](http://wiki.ros.org/robot_localization) (see [step 2](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#2-install-additional-ros-plugins) of the Quick Start guide) and commands from [joystick_drivers](http://wiki.ros.org/joystick_drivers) (see [step 3](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#3-install-additional-gazebo-plugins) of the Quick Start guide).
198-
- ```obstacle_detection```: A logic processor that converts sonar signals into a ternary collision value. This package receives sonar messages from ```abridge``` (for physical robots) or [hector_gazebo_ros_sonar](http://wiki.ros.org/hector_gazebo_plugins) (for simulated robots), and returns a status message to differentiate between three possible cases:
199-
1. No collision
200-
2. A collision on the right side of the robot
201-
3. A collision in front or on the left side of the robot
189+
- ```abridge```: A serial interface between Swarmathon-ROS and the A-Star 32U4 microcontroller onboard the physical robot. In the Swarmathon-ROS simulation, ```abridge``` functionality is supplanted by [gazebo_ros_skid_steer_drive](http://docs.ros.org/kinetic/api/gazebo_plugins/html/classgazebo_1_1GazeboRosSkidSteerDrive.html) (motor and encoders) and [hector_gazebo_plugins](http://wiki.ros.org/hector_gazebo_plugins) (sonar and IMU; see [step 3](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#3-install-additional-gazebo-plugins) of the Quick Start guide).
190+
- ```behavours```: The top-level controller class for the physical and simulated robots. This package receives messages from sensors and implements behaviours the robot should follow in response. This packages also receives pose updates from [robot_localization](http://wiki.ros.org/robot_localization) (see [step 2](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#2-install-additional-ros-plugins) of the Quick Start guide) and commands from [joystick_drivers](http://wiki.ros.org/joystick_drivers) (see [step 3](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#3-install-additional-gazebo-plugins) of the Quick Start guide).
202191
- ```rqt_rover_gui```: A Qt-based graphical interface for the physical and simulated robots. See [How to use Qt Creator](https://github.com/BCLab-UNM/Swarmathon-ROS/blob/master/README.md#how-to-use-qt-creator-to-edit-the-simulation-gui) for details on this package.
203-
- ```target_detection```: An image processor that detects [AprilTag](https://april.eecs.umich.edu/wiki/index.php/AprilTags) fiducial markers in the onboard camera's video stream. This package receives images from the ```usbCamera``` class (for physical robots) or [gazebo_ros_camera](http://docs.ros.org/indigo/api/gazebo_plugins/html/classgazebo_1_1GazeboRosCamera.html) (for simulated robots), and, if an AprilTag is detected in the image, returns the integer value encoded in the tag.
192+
- ```target_detection```: An image processor that detects [AprilTag](https://april.eecs.umich.edu/wiki/index.php/AprilTags) fiducial markers in the onboard camera's video stream. This package receives images from the ```usbCamera``` class (for physical robots) or [gazebo_ros_camera](http://docs.ros.org/kinetic/api/gazebo_plugins/html/classgazebo_1_1GazeboRosCamera.html) (for simulated robots), and, if an AprilTag is detected in the image, returns the integer value encoded in the tag.
204193
- ```ublox```: A serial interface to the ublox GPS receiver onboard the physical robot. This package is installed as a git submodule in the Swarmathon-ROS repo. See the [ublox ROS wiki page](http://wiki.ros.org/ublox) for more information.
205194

206195
### How to use Qt Creator to edit the simulation GUI

apriltags_ros/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
*.pyc

apriltags_ros/.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language:
2+
- cpp
3+
compiler:
4+
- gcc
5+
6+
branches:
7+
only:
8+
- hydro-devel
9+
10+
install:
11+
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
12+
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
13+
- sudo apt-get update -qq
14+
- sudo apt-get install python-catkin-pkg python-rosdep ros-hydro-catkin -qq
15+
- sudo rosdep init
16+
- rosdep update
17+
- mkdir -p /tmp/ws/src
18+
- ln -s `pwd` /tmp/ws/src/package
19+
- cd /tmp/ws
20+
- rosdep install --from-paths src --ignore-src --rosdistro hydro -y
21+
22+
script:
23+
- source /opt/ros/hydro/setup.bash
24+
- catkin_make
25+
- catkin_make install
26+
- source install/setup.bash

apriltags_ros/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apriltags_ros [![Build Status](https://api.travis-ci.org/RIVeR-Lab/apriltags_ros.png)](https://travis-ci.org/RIVeR-Lab/apriltags_ros)
2+
=============
3+
4+
AprilTags for ROS
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
Changelog for package apriltags
3+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
0.1.2 (2016-07-06)
6+
------------------
7+
8+
0.1.1 (2014-11-14)
9+
------------------
10+
* Updated author and website
11+
* Contributors: Mitchell Wills
12+
13+
0.1.0 (2014-11-08)
14+
------------------
15+
* Updated dependancies for indigo
16+
* Contributors: Mitchell Wills
17+
18+
0.0.3 (2014-11-08)
19+
------------------
20+
* Added info to package.xml
21+
* Added libv4l-dev as a dependancy
22+
* Contributors: Mitchell Wills
23+
24+
0.0.2 (2014-10-31)
25+
------------------
26+
* Did some small cleanup and renaming to topics
27+
Added the package ros wiki urls
28+
Added example launch file
29+
* Contributors: Mitchell Wills
30+
31+
0.0.1 (2014-10-27)
32+
------------------
33+
* Initial Commit from release r30 in https://svn.csail.mit.edu/apriltags
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(apriltags)
3+
4+
## Find catkin macros and libraries
5+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
6+
## is used, also find other catkin packages
7+
find_package(catkin REQUIRED COMPONENTS cmake_modules
8+
)
9+
10+
find_package(Eigen REQUIRED)
11+
find_package(OpenCV REQUIRED)
12+
13+
catkin_package(
14+
INCLUDE_DIRS include
15+
LIBRARIES apriltags
16+
CATKIN_DEPENDS
17+
DEPENDS Eigen OpenCV
18+
)
19+
20+
include_directories(include include/AprilTags)
21+
include_directories(
22+
${Eigen_INCLUDE_DIRS}
23+
${OpenCV_INCLUDE_DIRS}
24+
${catkin_INCLUDE_DIRS}
25+
)
26+
27+
add_library(apriltags
28+
src/Edge.cc src/FloatImage.cc src/GLine2D.cc src/GLineSegment2D.cc src/Gaussian.cc src/GrayModel.cc src/Homography33.cc src/MathUtil.cc src/Quad.cc src/Segment.cc src/TagDetection.cc src/TagDetector.cc src/TagFamily.cc src/UnionFindSimple.cc
29+
)
30+
target_link_libraries(apriltags
31+
${Eigen_LIBRARIES}
32+
${OpenCV_LIBRARIES}
33+
${catkin_LIBRARIES}
34+
)
35+
36+
#############
37+
## Install ##
38+
#############
39+
40+
## Mark executables and/or libraries for installation
41+
install(TARGETS apriltags
42+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
43+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
44+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
45+
)
46+
47+
## Mark cpp header files for installation
48+
install(DIRECTORY include/
49+
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
50+
FILES_MATCHING PATTERN "*.h"
51+
)

0 commit comments

Comments
 (0)