Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
sudo: required
dist: trusty

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note I don't know travis syntax so you'll have to check this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you had a look at the travis page which shows the running builds and its status? You'll see it is working 😉 . I took this script from the official ROS industrial repository. On the ROS wiki it is said that this is a very good entry point for prerelease testing. So it is tested quite well. Also you get a "build status" badge/banner which can be shown (I think I display this in the README.md).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

language: generic
compiler:
- gcc
notifications:
email:
on_success: always
on_failure: always
# recipients:
# - jane@doe
env:
matrix:
- USE_DEB=true ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- USE_DEB=true ROS_DISTRO="indigo" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- USE_DEB=true ROS_DISTRO="indigo" PRERELEASE=true
- USE_DEB=true ROS_DISTRO="jade" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- USE_DEB=true ROS_DISTRO="jade" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- USE_DEB=true ROS_DISTRO="jade" PRERELEASE=true
- USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- USE_DEB=true ROS_DISTRO="kinetic" PRERELEASE=true
matrix:
allow_failures:
- env: USE_DEB=true ROS_DISTRO="indigo" PRERELEASE=true
- env: USE_DEB=true ROS_DISTRO="jade" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- env: USE_DEB=true ROS_DISTRO="jade" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- env: USE_DEB=true ROS_DISTRO="jade" PRERELEASE=true
- env: USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu
- env: USE_DEB=true ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros-shadow-fixed/ubuntu
- env: USE_DEB=true ROS_DISTRO="kinetic" PRERELEASE=true
install:
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config
script:
- source .ci_config/travis.sh
# - source ./travis.sh # Enable this when you have a package-local script
62 changes: 49 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@ project(ratslam_ros)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)

# Enable Cxx11 support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS message_generation std_msgs roscpp sensor_msgs nav_msgs tf visualization_msgs image_transport nav_msgs) ## actionlib_msgs)

find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS serialization)
find_package(Irrlicht REQUIRED)
find_package(OpenGL REQUIRED)


## Generate messages in the 'msg' folder
add_message_files(
FILES
Expand Down Expand Up @@ -58,45 +67,53 @@ CATKIN_DEPENDS message_runtime geometry_msgs std_msgs
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
src
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)

#ratslam library
add_library(ratslam src/ratslam/experience_map.cpp src/ratslam/posecell_network.cpp src/ratslam/local_view_match.cpp src/ratslam/visual_odometry.cpp)

target_link_libraries(ratslam
${Boost_LIBRARIES}
${OpenCV_LIBRARIES}
)

# uncomment is you don't have irrlicht installed
# comment this out, if you don't have irrlicht installed
add_definitions("-DHAVE_IRRLICHT")

add_executable(ratslam_lv src/main_lv.cpp)
target_link_libraries(ratslam_lv
${catkin_LIBRARIES}
target_link_libraries(ratslam_lv
ratslam
${IRRLICHT_LIBRARIES}
${OPENGL_LIBRARIES}
${OpenCV_LIBRARIES})
${catkin_LIBRARIES}
)

add_executable(ratslam_pc src/main_pc.cpp)
target_link_libraries(ratslam_pc
${catkin_LIBRARIES}
ratslam
${IRRLICHT_LIBRARIES}
${OPENGL_LIBRARIES})
${OPENGL_LIBRARIES}
${catkin_LIBRARIES}
)

add_executable(ratslam_em src/main_em.cpp)
target_link_libraries(ratslam_em
${catkin_LIBRARIES}
ratslam
${IRRLICHT_LIBRARIES}
${OPENGL_LIBRARIES})
${OPENGL_LIBRARIES}
${catkin_LIBRARIES}
)

add_executable(ratslam_vo src/main_vo.cpp)
target_link_libraries(ratslam_vo
${catkin_LIBRARIES}
ratslam
${IRRLICHT_LIBRARIES}
${OPENGL_LIBRARIES}
${OpenCV_LIBRARIES})
${catkin_LIBRARIES}
)

#config files for devel
set(MEDIA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/media) #devel use the files in the source dir
Expand Down Expand Up @@ -145,3 +162,22 @@ install(DIRECTORY src/media/

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config)

if (CATKIN_ENABLE_TESTING)

## setup test data download target
add_custom_target(
irat_aus_test.bag
COMMAND if [ ! -e ./tests ]\; then mkdir tests\; fi
COMMAND if [ ! -e ./tests/irat_aus_test.bag ]\; then wget https://www.dropbox.com/s/ukiob6h0reavhem/irat_aus_test.bag?dl=0 -O tests/irat_aus_test.bag\; fi
WORKING_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}
)

## add download target to test target dependencies
add_dependencies(tests irat_aus_test.bag)

## add rostests
find_package(rostest REQUIRED)
add_rostest(tests/irat_aus.test)

endif()
173 changes: 173 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# RatSLAM ROS (OpenRatSLAM)

[![Build Status](https://travis-ci.org/sem23/ratslam.svg?branch=ratslam_ros)](https://travis-ci.org/sem23/ratslam)

## Package Summary

This package contains the RatSLAM sources including ROS wrappers. The package provides a biological inspired monocular
vision SLAM (Simultaneous Localization and Mapping) system. Using this system you can create a topological map of the
environment, which means there are just paths and **no** gridmap, like an occupancy grid. As a gimmick, the system is
able to perfom pathplanning on the current map.

Authors Documentation:<br>
The ROS version of RatSLAM has been designed as a more modular version than the other library in this project - the algorithm has been divided into 3 individual RatSLAM ROS nodes and one visual odometry node. This version is referred to as OpenRatSLAM.

OpenRatSLAM is based on the RatSLAM C++ library written by David Ball and Scott Heath, with support and additions by Michael Milford. The RatSLAM algorithm was originally designed and implemented by Michael Milford and Gordon Wyeth.

OpenRatSLAM has only been tested on Ubuntu and as ROS support for platforms other than Linux is still limited, this will probably not change.

* Maintainer status: maintained
* Maintainers: David M. Ball \<davidmichaelball AT gmail DOT com\>, Peter Rudolph \<semael23 AT gmail DOT com\>
* Authors: Michael Milford and Gordon Wyeth (RatSLAM), David Ball and Scott Heath (RatSLAM C++), David M. Ball (OpenRatSLAM)
* License: GNU General Public License v3.0
* Source: git https://github.com/sem23/ratslam.git (branch: ratslam_ros)

## 1. External Documentation

[David Ball, Scott Heath, Janet Wiles, Gordon Wyeth, Peter Corke, Michael Milford: OpenRatSLAM: an open source brain-based SLAM system, Autonomous Robots, 2013](https://link.springer.com/article/10.1007%2Fs10514-012-9317-9).

## 2. Hardware Requirements

To get RatSLAM working you need a properly setup monocular camera and an odometry source. The odometry can be generated
using the visual odometry node, which is provided by the package. But note, that a wheel based odometry is much more
accurate in most cases.

## 3. Example

Several examples are provided [here](https://github.com/davidmball/ratslam/blob/wiki/RatSLAMROS.md#running-ratslam).

## 4. Nodes

### 4.1 ratslam_em

The experience map is used to store the experiences made by the robot. This node provides a topological map, loop closing capabilites
and a dijkstra pathplanning algorithm.

#### 4.1.1 Subscribed Topics

"odom" ([nav_msgs/Odometry](http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html))
> The current odometry.

topic_root + "/PoseCell/TopologicalAction" (ratslam_ros/TopologicalAction)
> The topological action.

topic_root + "/ExperienceMap/SetGoalPose" ([geometry_msgs/PoseStamped](http://docs.ros.org/api/geometry_msgs/html/msg/PoseStamped.html))
> The goal pose to where path will be planned.

#### 4.1.2 Published Topics

topic_root + "/ExperienceMap/Map" (ratslam_ros/TopologicalMap)
> The experience map in RatSLAM format.

topic_root + "/ExperienceMap/MapMarker" ([visualization_msgs/Marker](http://docs.ros.org/api/visualization_msgs/html/msg/Marker.html))
> The experience map as ROS visualization markers for displaying puposes.

topic_root + "/ExperienceMap/RobotPose" ([geometry_msgs/PoseStamped](http://docs.ros.org/api/geometry_msgs/html/msg/PoseStamped.html))
> The current pose of the robot in map.

topic_root + "/ExperienceMap/PathToGoal" ([nav_msgs/Path](http://docs.ros.org/api/nav_msgs/html/msg/Path.html))
> The current planned path (published if triggered to plan).

#### 4.1.3 Parameters

**Note:** Only ROS parameters are mentioned. All others are explained in external documentation. The parameter "topic_root" can be found there!

"map_frame" (Default: "map")
> The name of the map frame.

"odom_frame" (Default: "odom")
> The name of the odometry frame.

"base_frame" (Default: "base_link")
> The name of the base frame.

"tf_update_rate" (Default: 20.0)
> The update rate [hz] of the map_frame -> odom_frame transformation broadcaster.

"map_save_period" (Default: 10.0)
> The period [seconds] after which a map is saved.

"map_file_path" (Default: "ratslam-latest.bmap")
> The file path where map is saved.

#### 4.1.4 Required tf Transforms

odom_frame -> base_frame

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally odom -> base_link?

@sem23 sem23 May 22, 2017

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transform tree given by SLAM or localization should be <map_frame> --> <odom_frame> --> <base_frame>, e.g. "map" -> "odom" -> "base_footprint" / "base_link". The explanation is for the parameters the node takes.

> Usually provided by the odometry system (e.g., the driver for the mobile base).

#### 4.1.5 Provided tf Transforms

map_frame -> odom_frame

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally map to odom frame?

> The current estimate of the robot's pose within the map frame.

### 4.2 ratslam_pc

The pose cell network is used to track odometry information based on movement, vision and recognition.

#### 4.2.1 Subscribed Topics

"odom" ([nav_msgs/Odometry](http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html))
> The current odometry.

topic_root + "/LocalView/Template" (ratslam_ros/ViewTemplate)
> The current matched template.

#### 4.2.2 Published Topics

topic_root + "/PoseCell/TopologicalAction" (ratslam_ros/TopologicalMap)
> The topological action performed by network.

#### 4.2.3 Parameters

**Note:** Only ROS parameters are mentioned. All others are explained in external documentation.

"pcn_save_period" (Default: 10.0)
> The period [seconds] after which a pose cell network state is saved.

"pcn_file_path" (Default: "ratslam-latest.bpcn")
> The file path where pose cell network state is saved.

### 4.3 ratslam_lv

The local view matcher is used to match the camera templates against previous experienced ones. This node provides the matching of images.

#### 4.3.1 Subscribed Topics

"image" ([sensor_msgs/Image](http://docs.ros.org/api/sensor_msgs/html/msg/Image.html))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this work with the bag files it needs a topic root name_space. Maybe this should be an additional issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The topic_root parameter can be replaced by correct usage of the namespace of the node I think. I will try to setup some example launch file, so that you can get what I mean. 😃

> ImageTransport image subscriber.

"camera_info" ([sensor_msgs/CameraInfo](http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html))
> ImageTransport camera info subscriber.

#### 4.3.2 Published Topics

topic_root + "/LocalView/Template" (ratslam_ros/ViewTemplate)
> The current matched template.

#### 4.3.3 Parameters

**Note:** Only ROS parameters are mentioned. All others are explained in external documentation. The parameter "topic_root" can be found there!

"lvm_save_period" (Default: 10.0)
> The period [seconds] after which a local view matcher state is saved.

"lvm_file_path" (Default: "ratslam-latest.blvm")
> The file path where local view matcher state is saved.

### 4.4 ratslam_vo

The visual odometry node. This node can be used to generate an odometry source from monocular camera input.
**Note:** Using wheel based odometry is more accurate in most cases.

#### 4.4.1 Subscribed Topics

"image" ([sensor_msgs/Image](http://docs.ros.org/api/sensor_msgs/html/msg/Image.html))
> ImageTransport image subscriber.

"camera_info" ([sensor_msgs/CameraInfo](http://docs.ros.org/api/sensor_msgs/html/msg/CameraInfo.html))
> ImageTransport camera info subscriber.

#### 4.4.2 Published Topics

"odom" ([nav_msgs/Odometry](http://docs.ros.org/api/nav_msgs/html/msg/Odometry.html))
> The current odometry generated from vision source.
28 changes: 28 additions & 0 deletions config/config_irataus_test.txt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[general]
topic_root=irat_red

[ratslam]
image_crop_y_max=150
template_x_size=60
template_y_size=20
vt_shift_match = 4
vt_step_match = 1
vt_match_threshold = 0.03
vt_active_decay = 1.0

pc_dim_xy = 11
pc_vt_inject_energy = 0.1
pc_cell_x_size = 0.015

exp_delta_pc_threshold = 2
exp_loops=20
exp_initial_em_deg=140

[draw]
enable=0
vt_window_width=416
vt_window_height=480
exp_map_size=500
posecells_size=250
media_path=@MEDIA_PATH@
image_file=irat_sm.tga
Loading