Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paloma Carrasco committed Apr 13, 2020
2 parents 29c7dc3 + 9a982ff commit 80ed554
Show file tree
Hide file tree
Showing 35 changed files with 1,745 additions and 761 deletions.
26 changes: 26 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
41 changes: 38 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ before_install:
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt-get update -qq
- sudo apt-get install python-wstool ros-$ROS_DISTRO-ros-base
- sudo apt-get update
- sudo apt-get install python-catkin-pkg python-catkin-tools python-rosdep python-wstool ros-$ROS_DISTRO-catkin
- sudo apt-get install -y python-rosinstall python-rosinstall-generator build-essential
- sudo apt-get install python-pip python-dev
- sudo apt-get install -y ros-$ROS_DISTRO-octomap-msgs
- source /opt/ros/$ROS_DISTRO/setup.bash
- echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
Expand All @@ -53,6 +55,7 @@ install:
# Add the package under integration to the workspace using a symlink.
- cd ~/catkin_ws/src
- ln -s $CI_SOURCE_PATH .
- pip install codecov --user

# Install all dependencies, using wstool first and rosdep second.
# wstool looks for a ROSINSTALL_FILE defined in the environment variables.
Expand All @@ -65,6 +68,24 @@ before_script:
# package depdencies: install using rosdep.
- cd ~/catkin_ws
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
# Gmock
- sudo apt-get install libgtest-dev
- sudo apt-get install google-mock
- cd /usr/src/gmock
- sudo mkdir build
- cd build
- sudo cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
- sudo make -j
- sudo cp libgmock* /usr/local/lib/.
- sudo cp gtest/libgtest* /usr/local/lib/.
#- sudo git clone https://github.com/google/googletest.git
#- cd googletest
#- sudo cp -a googlemock/include/gmock /usr/include
#- sudo cp -a googletest/include/gtest /usr/include
#- sudo mkdir build
#- cd build
#- sudo cmake -DBUILD_SHARED_LIBS=ON -DBUILD_GTEST=ON -DBUILD_GMOCK=ON -DINSTALL_GTEST=ON -DINSTALL_GMOCK=ON ..
#- sudo make install

# Compile and test (mark the build as failed if any step fails). If the
# CATKIN_OPTIONS file exists, use it as an argument to catkin_make, for example
Expand All @@ -77,7 +98,21 @@ before_script:
script:
- source /opt/ros/$ROS_DISTRO/setup.bash
- cd ~/catkin_ws
- catkin_make $( [ -f $CATKIN_OPTIONS ] && cat $CATKIN_OPTIONS )
- sudo cp src/amcl3d/FindGMock.cmake /usr/share/cmake-3.5/Modules/
- cd ~/catkin_ws/src/amcl3d/amcl3d/
- mkdir -p data/map
- cd data/map
- wget https://github.com/fada-catec/amcl3d/releases/download/v1.1.0/mapfile_complete.bt
- wget https://github.com/fada-catec/amcl3d/releases/download/v1.1.0/mapfile_complete_ot.ot
- cd ~/catkin_ws
- catkin_make
# Run the tests, ensuring the path is set correctly.
- source devel/setup.bash
- catkin_make run_tests && catkin_test_results
- catkin_make tests

- rm -rf build devel
- catkin config --cmake-args -DCMAKE_CXX_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_C_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXE_LINKER_FLAGS="-lgcov"
- catkin build
- catkin run_tests -i && catkin_test_results
- cd src/amcl3d
- codecov --gcov-root ~/catkin_ws/build/
130 changes: 130 additions & 0 deletions FindGMock.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Locate the Google C++ Mocking Framework.
# (This file is almost an identical copy of the original FindGTest.cmake file,
# feel free to use it as it is or modify it for your own needs.)
#
#
# Defines the following variables:
#
# GMOCK_FOUND - Found the Google Testing framework
# GMOCK_INCLUDE_DIRS - Include directories
#
# Also defines the library variables below as normal
# variables. These contain debug/optimized keywords when
# a debugging library is found.
#
# GMOCK_BOTH_LIBRARIES - Both libgmock & libgmock-main
# GMOCK_LIBRARIES - libgmock
# GMOCK_MAIN_LIBRARIES - libgmock-main
#
# Accepts the following variables as input:
#
# GMOCK_ROOT - (as a CMake or environment variable)
# The root directory of the gmock install prefix
#
# GMOCK_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
# "MD" or "MT" to enable searching a gmock build tree
# (defaults: "MD")
#
#-----------------------
# Example Usage:
#
# find_package(GMock REQUIRED)
# include_directories(${GMOCK_INCLUDE_DIRS})
#
# add_executable(foo foo.cc)
# target_link_libraries(foo ${GMOCK_BOTH_LIBRARIES})
#
#=============================================================================
# This file is released under the MIT licence:
#
# Copyright (c) 2011 Matej Svec
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#=============================================================================


function(_gmock_append_debugs _endvar _library)
if(${_library} AND ${_library}_DEBUG)
set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
else()
set(_output ${${_library}})
endif()
set(${_endvar} ${_output} PARENT_SCOPE)
endfunction()

function(_gmock_find_library _name)
find_library(${_name}
NAMES ${ARGN}
HINTS
$ENV{GMOCK_ROOT}
${GMOCK_ROOT}
PATH_SUFFIXES ${_gmock_libpath_suffixes}
)
mark_as_advanced(${_name})
endfunction()


if(NOT DEFINED GMOCK_MSVC_SEARCH)
set(GMOCK_MSVC_SEARCH MD)
endif()

set(_gmock_libpath_suffixes lib)
if(MSVC)
if(GMOCK_MSVC_SEARCH STREQUAL "MD")
list(APPEND _gmock_libpath_suffixes
msvc/gmock-md/Debug
msvc/gmock-md/Release)
elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
list(APPEND _gmock_libpath_suffixes
msvc/gmock/Debug
msvc/gmock/Release)
endif()
endif()

find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
HINTS
$ENV{GMOCK_ROOT}/include
${GMOCK_ROOT}/include
)
mark_as_advanced(GMOCK_INCLUDE_DIR)

if(MSVC AND GMOCK_MSVC_SEARCH STREQUAL "MD")
# The provided /MD project files for Google Mock add -md suffixes to the
# library names.
_gmock_find_library(GMOCK_LIBRARY gmock-md gmock)
_gmock_find_library(GMOCK_LIBRARY_DEBUG gmock-mdd gmockd)
_gmock_find_library(GMOCK_MAIN_LIBRARY gmock_main-md gmock_main)
_gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_main-mdd gmock_maind)
else()
_gmock_find_library(GMOCK_LIBRARY gmock)
_gmock_find_library(GMOCK_LIBRARY_DEBUG gmockd)
_gmock_find_library(GMOCK_MAIN_LIBRARY gmock_main)
_gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY)

if(GMOCK_FOUND)
set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
_gmock_append_debugs(GMOCK_LIBRARIES GMOCK_LIBRARY)
_gmock_append_debugs(GMOCK_MAIN_LIBRARIES GMOCK_MAIN_LIBRARY)
set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES})
endif()

45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/fada-catec/amcl3d.svg?branch=master)](https://travis-ci.org/fada-catec/amcl3d)
[![License](https://img.shields.io/badge/License-Apache%202-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![codecov](https://codecov.io/gh/fada-catec/amcl3d/branch/kinetic-test/graph/badge.svg)](https://codecov.io/gh/fada-catec/amcl3d)

### Overview

Expand All @@ -15,14 +16,14 @@ It takes information from an odometry source, point-clouds from an onboard senso

Apache 2.0

**Author: Paloma Carrasco Fernández (pcarrasco@catec.aero),
Francisco Cuesta Rodríguez (fcuesta@catec.aero),
**Author: Paloma Carrasco Fern�ndez (pcarrasco@catec.aero),
Francisco Cuesta Rodr�guez (fcuesta@catec.aero),
Francisco J.Perez-Grau (fjperez@catec.aero)**

**Affiliation: [FADA-CATEC](https://http://www.catec.aero//)**

**Maintainer: Paloma Carrasco Fernández (pcarrasco@catec.aero),
Francisco Cuesta Rodríguez (fcuesta@catec.aero)**
**Maintainer: Paloma Carrasco Fern�ndez (pcarrasco@catec.aero),
Francisco Cuesta Rodr�guez (fcuesta@catec.aero)**

The amcl3d package has been tested under [ROS] Kinetic and Ubuntu 16.04.

Expand All @@ -40,6 +41,7 @@ To know in more detail the behavior of the package:

* **[amcl3d (Wiki-ROS)](http://wiki.ros.org/amcl3d#preview)**


### Installation

#### Building from Source
Expand All @@ -53,23 +55,38 @@ To build from source, clone the latest version from this repository into your ca
cd ../
catkin build

### Tests

Run the test with

roslaunch ouster_ros os1.launch os1_hostname:=10.5.5.94 replay:=true
roslaunch amcl3d amcl3d_test.launch

### Launch files

* **amcl3d.launch:** it contains the start of amcl3d node with a standard configuration of parameters.

roslaunch amcl3d amcl3d.launch
* **amcl3d_test.launch:** this roslaunch allows you to start the RViz with the aforementioned configuration, the amcl3d node, the test-amcl3d node, the bag player and creates a transformation to relate the point-cloud frame of test-amcl3d node with the robot frame of amcl3d node.
* **amcl3d_rosin.launch:** it contains the initial pose, particle number, 'alpha' parameter, 'take_off_height' parameter and the correctly map to run the algorithm with the correcly data of the rosbag.

roslaunch amcl3d amcl3d_test.launch
roslaunch amcl3d amcl3d_rosin.launch

### Gmoke Tests

This branch contains differents tests to evaluate the correct behaviour of the algorithm. To run these tests it is necessary to have the rosbag of the 'Version 1.1.0' release.

To compile:

catkin_make tests

To run:

rosrun amcl3d amcl3d_tests


### Doxygen
The code has been commentes to offert the posibility to generate a Doxygen documentation. To generate it:

rosdoc_lite /path/to/workspace/src/amcl3d/amcl3d

To install the rosdoc_lite package:

apt-get install ros-kinetic-rosdoc_lite
### Bugs & Feature Requests

Please report bugs and request features using the [Issue Tracker](https://github.com/fada-catec/amcl3d/issues).
Expand All @@ -80,4 +97,4 @@ Please report bugs and request features using the [Issue Tracker](https://github


Supported by ROSIN - ROS-Industrial Focused Technical Projects (FTP).
More information: [rosin-project.eu](http://rosin-project.eu)
More information: [rosin-project.eu](http://rosin-project.eu)
50 changes: 41 additions & 9 deletions amcl3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,54 @@ catkin_package(
rosinrange_msg
)

#######################
## Configuring GMock ##
#######################

find_package(GMock)

###########
## Build ##
###########

include_directories(SYSTEM ${catkin_INCLUDE_DIRS})

file(GLOB_RECURSE UTILS_SRCS "src/*.c*")
file(GLOB_RECURSE UTILS_HDRS "src/*.h*")
add_library(${PROJECT_NAME}
src/Grid3d.cpp
src/Grid3d.h
src/ParticleFilter.cpp
src/ParticleFilter.h
src/PointCloudTools.cpp
src/PointCloudTools.h)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

add_executable(${PROJECT_NAME}_node ${UTILS_SRCS} ${UTILS_HDRS})
add_executable(${PROJECT_NAME}_node
src/main.cpp
src/Node.cpp
src/Node.h
src/Parameters.cpp
src/Parameters.h)
add_dependencies(${PROJECT_NAME}_node ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} ${PROJECT_NAME})

#############
## Testing ##
#############

if(GMOCK_FOUND)
include_directories(src)
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})

file(GLOB_RECURSE TEST_SRCS "test/*.c*")
file(GLOB_RECURSE TEST_HDRS "test/*.h*")
file(GLOB_RECURSE TESTS_SRCS "tests/*.c*")
file(GLOB_RECURSE TESTS_HDRS "tests/*.h*")

add_executable(${PROJECT_NAME}_testnode ${TEST_SRCS} ${TEST_HDRS})
add_dependencies(${PROJECT_NAME}_testnode ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME}_testnode ${catkin_LIBRARIES})
catkin_add_gtest(${PROJECT_NAME}_tests
${TESTS_SRCS} ${TESTS_HDRS})
if(TARGET ${PROJECT_NAME}_tests)
target_compile_definitions(${PROJECT_NAME}_tests PRIVATE
PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
target_link_libraries(${PROJECT_NAME}_tests
${GMOCK_BOTH_LIBRARIES} ${PROJECT_NAME})
endif()
endif()
Loading

0 comments on commit 80ed554

Please sign in to comment.