Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mobile_robotics/wolf_projects/wolf_lib/wolf
1 result
Show changes
Commits on Source (55)
Showing
with 292 additions and 600 deletions
...@@ -32,3 +32,4 @@ src/examples/map_apriltag_save.yaml ...@@ -32,3 +32,4 @@ src/examples/map_apriltag_save.yaml
\.vscode/ \.vscode/
build_release/ build_release/
wolf.found
...@@ -66,5 +66,5 @@ wolf_build_and_test: ...@@ -66,5 +66,5 @@ wolf_build_and_test:
- cd build - cd build
- ls # we can check whether the directory was already full - ls # we can check whether the directory was already full
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON .. - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
- make - make -j$(nproc)
- ctest - ctest
This diff is collapsed.
# Overview
# Installing
## Installing wolf(core)
```
git clone https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/core.git
cd core
mkdir build & cd build
cmake ..
make
make install
```
## Installing plugins
```
git clone https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/<plugin name>.git
cd <plugin name>
mkdir build & cd build
cmake ..
make
make install
```
# Using wolf in your applications
## Using wolf core
If you want to use the core, you just need to have it installed and in your CMakeLists.txt put the following line
`find_package(wolf REQUIRED)`.
If wolf is indeed installed, this will define two variables
`${wolf_INCLUDE_DIR}` which will contain the path to the wolf include directory
and `${wolf_LIBRARY}` which will contain the path to the wolf library.
## Using wolf plugins
If you also want to use some wolf plugin, you just follow the same procedure, changing the name
`find_package(wolf<plugin name> REQUIRED)`.
If the pluging is indeed installed, this will define two variables
`${wolf<plugin name>_INCLUDE_DIR}` which will contain the path to the plugin's include directory
and `${wolf<plugin name>_LIBRARY}` which will contain the path to the plugin's library.
As an example, suppose that we want to use the _vision_ plugin. First, we will clone and install it
```
git clone https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/vision.git
cd vision
mkdir build && cd build
cmake ..
make
sudo make install
```
Then, in the CMakeLists.txt of the application we are developing we will put the following line
```
find_package(wolfvision REQUIRED)
```
if the plugin has been correctly installed, and thus find_package succeeds, then it will define two variables
- ${wolfvision_INCLUDE_DIR} which is the path to the includes. It should have the value `/usr/local/include/iri-algorithms/wolf/plugin_vision`
- ${wolfvision_LIBRARY} which is the path to the compiled (& linked) library. It should have the value `/usr/local/lib/iri-algorithms/libwolfvision.so`
**IMPORTANT NOTE** For the time being, each plugin is only responsible for finding their own includes and library. This means that for instance wolfvision, which obviously requires
the _core_ plugin, will not find its own dependencies. It is the responsibility of the programmer to do `find_package(wolf REQUIRED)` to get the includes and library. In the future this will change and each plugin will be responsible for finding all the necessary dependencies.
# Creating your plugin
We provide a template to create your own plugin.
You can either clone it and restart the git history
```
git clone https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/Template.git
cd Template
rm -rf .git
git init
```
or directly fork*(?)* the repository.
# Contributing
## Contributing your plugin to wolf
## Contributing to existing plugins
## Contributing to wolf core
\ No newline at end of file
#edit the following line to add the librarie's header files
FIND_PATH(
wolf_INCLUDE_DIRS
NAMES wolf.found
PATHS /usr/local/include/iri-algorithms/wolf/base)
#change INCLUDE_DIRS to its parent directory
get_filename_component(wolf_INCLUDE_DIRS ${wolf_INCLUDE_DIRS} DIRECTORY)
IF(wolf_INCLUDE_DIRS)
MESSAGE("Found wolf (base) include dirs: ${wolf_INCLUDE_DIRS}")
ELSE
MESSAGE("Couldn't find wolf (base) include dirs")
ENDIF
FIND_LIBRARY(
wolf_LIBRARY
NAMES wolf
PATHS /usr/lib /usr/local/lib /usr/local/lib/iri-algorithms)
IF (wolf_INCLUDE_DIRS AND wolf_LIBRARY)
SET(wolf_FOUND TRUE)
ENDIF (wolf_INCLUDE_DIRS AND wolf_LIBRARY)
IF (wolf_FOUND)
IF (NOT wolf_FIND_QUIETLY)
MESSAGE(STATUS "Found wolf: ${wolf_LIBRARY}")
ENDIF (NOT wolf_FIND_QUIETLY)
ELSE (wolf_FOUND)
IF (wolf_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find wolf")
ENDIF (wolf_FIND_REQUIRED)
ENDIF (wolf_FOUND)
# This file was copied and adapted from the ceres_solver project #edit the following line to add the librarie's header files
# http://ceres-solver.org/ FIND_PATH(
wolf_INCLUDE_DIR
NAMES wolf.found
PATHS /usr/local/include/iri-algorithms/wolf/plugin_core)
IF(wolf_INCLUDE_DIR)
MESSAGE("Found wolf include dirs: ${wolf_INCLUDE_DIR}")
ELSE(wolf_INCLUDE_DIR)
MESSAGE("Couldn't find wolf include dirs")
ENDIF(wolf_INCLUDE_DIR)
FIND_LIBRARY(
wolf_LIBRARY
NAMES libwolf.so
PATHS /usr/local/lib/iri-algorithms)
IF(wolf_LIBRARY)
MESSAGE("Found wolf lib: ${wolf_LIBRARY}")
ELSE(wolf_LIBRARY)
MESSAGE("Couldn't find wolf lib")
ENDIF(wolf_LIBRARY)
IF (wolf_INCLUDE_DIR AND wolf_LIBRARY)
SET(wolf_FOUND TRUE)
ELSE(wolf_INCLUDE_DIR AND wolf_LIBRARY)
set(wolf_FOUND FALSE)
ENDIF (wolf_INCLUDE_DIR AND wolf_LIBRARY)
IF (wolf_FOUND)
IF (NOT wolf_FIND_QUIETLY)
MESSAGE(STATUS "Found wolf: ${wolf_LIBRARY}")
ENDIF (NOT wolf_FIND_QUIETLY)
ELSE (wolf_FOUND)
IF (wolf_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find wolf")
ENDIF (wolf_FIND_REQUIRED)
ENDIF (wolf_FOUND)
# wolf - Windowed Localization Frames
# Copyright 2016
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Google Inc. nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Authors:
#
# Config file for wolf - Find wolf & dependencies.
#
# This file is used by CMake when find_package(wolf) is invoked and either
# the directory containing this file either is present in CMAKE_MODULE_PATH
# (if wolf was installed), or exists in the local CMake package registry if
# the wolf build directory was exported.
#
# This module defines the following variables:
#
# wolf_FOUND / wolf_FOUND: True if wolf has been successfully
# found. Both variables are set as although
# FindPackage() only references wolf_FOUND
# in Config mode, given the conventions for
# <package>_FOUND when FindPackage() is
# called in Module mode, users could
# reasonably expect to use wolf_FOUND
# instead.
#
# wolf_VERSION: Version of wolf found.
#
# wolf_INCLUDE_DIRS: Include directories for wolf and the
# dependencies which appear in the wolf public
# API and are thus required to use wolf.
#
# wolf_LIBRARIES: Libraries for wolf and all
# dependencies against which wolf was
# compiled. This will not include any optional
# dependencies that were disabled when wolf was
# compiled.
#
# The following variables are also defined for legacy compatibility
# only. Any new code should not use them as they do not conform to
# the standard CMake FindPackage naming conventions.
#
# wolf_INCLUDES = ${wolf_INCLUDE_DIRS}.
# Called if we failed to find Ceres or any of its required dependencies,
# unsets all public (designed to be used externally) variables and reports
# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
macro(wolf_report_not_found REASON_MSG) macro(wolf_report_not_found REASON_MSG)
# FindPackage() only references Ceres_FOUND, and requires it to be
# explicitly set FALSE to denote not found (not merely undefined).
set(wolf_FOUND FALSE)
set(wolf_FOUND FALSE) set(wolf_FOUND FALSE)
unset(wolf_INCLUDE_DIRS) unset(wolf_INCLUDE_DIR)
unset(wolf_LIBRARIES) unset(wolf_LIBRARIES)
# Reset the CMake module path to its state when this script was called. # Reset the CMake module path to its state when this script was called.
...@@ -85,7 +47,7 @@ macro(wolf_report_not_found REASON_MSG) ...@@ -85,7 +47,7 @@ macro(wolf_report_not_found REASON_MSG)
# Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by
# FindPackage() use the camelcase library name, not uppercase. # FindPackage() use the camelcase library name, not uppercase.
if (wolf_FIND_QUIETLY) if (wolf_FIND_QUIETLY)
message(STATUS "Failed to find wolf - " ${REASON_MSG} ${ARGN}) message(STATUS "Failed to find wolf- " ${REASON_MSG} ${ARGN})
else (wolf_FIND_REQUIRED) else (wolf_FIND_REQUIRED)
message(FATAL_ERROR "Failed to find wolf - " ${REASON_MSG} ${ARGN}) message(FATAL_ERROR "Failed to find wolf - " ${REASON_MSG} ${ARGN})
else() else()
...@@ -96,126 +58,8 @@ macro(wolf_report_not_found REASON_MSG) ...@@ -96,126 +58,8 @@ macro(wolf_report_not_found REASON_MSG)
return() return()
endmacro(wolf_report_not_found) endmacro(wolf_report_not_found)
# Record the state of the CMake module path when this script was if(NOT wolf_FOUND)
# called so that we can ensure that we leave it in the same state on wolf_report_not_found("Something went wrong while setting up wolf.")
# exit as it was on entry, but modify it locally. endif(NOT wolf_FOUND)
set(CALLERS_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
# Get the (current, i.e. installed) directory containing this file.
get_filename_component(wolf_CURRENT_CONFIG_DIR
"${CMAKE_CURRENT_LIST_FILE}" PATH)
# Reset CMake module path to the installation directory of this
# script, thus we will use the FindPackage() scripts shipped with
# wolf to find wolf' dependencies, even if the user has equivalently
# named FindPackage() scripts in their project.
set(CMAKE_MODULE_PATH ${wolf_CURRENT_CONFIG_DIR})
# Build the absolute root install directory as a relative path
# (determined when wolf was configured & built) from the current
# install directory for this this file. This allows for the install
# tree to be relocated, after wolf was built, outside of CMake.
get_filename_component(CURRENT_ROOT_INSTALL_DIR
${wolf_CURRENT_CONFIG_DIR}/../../../
ABSOLUTE)
if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR})
wolf_report_not_found(
"wolf install root: ${CURRENT_ROOT_INSTALL_DIR}, "
"determined from relative path from wolfConfig.cmake install location: "
"${wolf_CURRENT_CONFIG_DIR}, does not exist. Either the install "
"directory was deleted, or the install tree was only partially relocated "
"outside of CMake after wolf was built.")
endif (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR})
# Set the include directories for wolf (itself). # Set the include directories for wolf (itself).
set(wolf_INCLUDE_DIR "${CURRENT_ROOT_INSTALL_DIR}/include/iri-algorithms") set(wolf_FOUND TRUE)
\ No newline at end of file
# if (NOT EXISTS ${wolf_INCLUDE_DIR}/wolf/wolf.h)
if (NOT EXISTS ${wolf_INCLUDE_DIR}/wolf)
wolf_report_not_found(
"wolf install root: ${CURRENT_ROOT_INSTALL_DIR}, "
"determined from relative path from wolfConfig.cmake install location: "
"${wolf_CURRENT_CONFIG_DIR}, does not contain wolf headers. "
"Either the install directory was deleted, or the install tree was only "
"partially relocated outside of CMake after wolf was built.")
# endif (NOT EXISTS ${wolf_INCLUDE_DIR}/wolf/wolf.h)
endif (NOT EXISTS ${wolf_INCLUDE_DIR}/wolf)
list(APPEND wolf_INCLUDE_DIRS ${wolf_INCLUDE_DIR}/wolf)
# Set the version.
set(wolf_VERSION 0.0.1)
# Eigen.
# Flag set during configuration and build of wolf.
set(wolf_EIGEN_VERSION @EIGEN_VERSION@)
# Append the locations of Eigen when wolf was built to the search path hints.
list(APPEND EIGEN_INCLUDE_DIR_HINTS /usr/include/eigen3)
# Search quietly to control the timing of the error message if not found. The
# search should be for an exact match, but for usability reasons do a soft
# match and reject with an explanation below.
find_package(Eigen3 ${wolf_EIGEN_VERSION} QUIET)
# Flag set with currently found Eigen version.
set(EIGEN_VERSION @EIGEN_VERSION@)
if (EIGEN3_FOUND)
if (NOT EIGEN_VERSION VERSION_EQUAL wolf_EIGEN_VERSION)
# CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
# specified version. However, only version = is supported. Improve
# usability by explaining why we don't accept non-exact version matching.
wolf_report_not_found("Found Eigen dependency, but the version of Eigen "
"found (${EIGEN_VERSION}) does not exactly match the version of Eigen "
"wolf was compiled with (${wolf_EIGEN_VERSION}). This can cause subtle "
"bugs by triggering violations of the One Definition Rule. See the "
"Wikipedia article http://en.wikipedia.org/wiki/One_Definition_Rule "
"for more details")
endif ()
message(STATUS "Found required wolf dependency: "
"Eigen version ${wolf_EIGEN_VERSION} in ${EIGEN3_INCLUDE_DIR}")
else (EIGEN3_FOUND)
wolf_report_not_found("Missing required wolf "
"dependency: Eigen version ${wolf_EIGEN_VERSION}, please set "
"EIGEN3_INCLUDE_DIR.")
endif (EIGEN3_FOUND)
list(APPEND wolf_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
# Import exported wolf targets, if they have not already been imported.
if (NOT TARGET wolf AND NOT wolf_BINARY_DIR)
include(${wolf_CURRENT_CONFIG_DIR}/wolfTargets.cmake)
endif (NOT TARGET wolf AND NOT wolf_BINARY_DIR)
# Set the expected XX_LIBRARIES variable for FindPackage().
set(wolf_LIBRARIES wolf)
# Set legacy library variable for backwards compatibility.
set(wolf_LIBRARY ${wolf_LIBRARIES})
# Make user aware of any compile flags that will be added to their targets
# which use wolf (i.e. flags exported in the wolf target). Only CMake
# versions >= 2.8.12 support target_compile_options().
if (TARGET ${wolf_LIBRARIES} AND
NOT CMAKE_VERSION VERSION_LESS "2.8.12")
get_target_property(wolf_INTERFACE_COMPILE_OPTIONS
${wolf_LIBRARIES} INTERFACE_COMPILE_OPTIONS)
set(wolf_LOCATION "${CURRENT_ROOT_INSTALL_DIR}")
# Check for -std=c++11 flags.
if (wolf_INTERFACE_COMPILE_OPTIONS MATCHES ".*std=c\\+\\+11.*")
message(STATUS "wolf version ${wolf_VERSION} detected here: "
"${wolf_LOCATION} was built with C++11. wolf target will add "
"C++11 flags to compile options for targets using it.")
endif()
endif()
# Reset CMake module path to its state when this script was called.
set(CMAKE_MODULE_PATH ${CALLERS_CMAKE_MODULE_PATH})
# As we use wolf_REPORT_NOT_FOUND() to abort, if we reach this point we have
# found wolf and all required dependencies.
message(STATUS "Found wolf version: ${wolf_VERSION} installed in: ${CURRENT_ROOT_INSTALL_DIR}")
# Set wolf_FOUND to be equivalent to wolf_FOUND, which is set to
# TRUE by FindPackage() if this file is found and run, and after which
# wolf_FOUND is not (explicitly, i.e. undefined does not count) set
# to FALSE.
set(wolf_FOUND TRUE)
File moved
File moved
//std includes //std includes
#include "base/sensor/sensor_GPS_fix.h" #include "core/sensor/sensor_GPS_fix.h"
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#include "glog/logging.h" #include "glog/logging.h"
//Wolf includes //Wolf includes
#include "base/problem/problem.h" #include "core/problem/problem.h"
#include "base/processor/processor_tracker_landmark_corner.h" #include "core/processor/processor_tracker_landmark_corner.h"
#include "base/processor/processor_odom_2D.h" #include "core/processor/processor_odom_2D.h"
#include "base/sensor/sensor_laser_2D.h" #include "core/sensor/sensor_laser_2D.h"
#include "base/sensor/sensor_odom_2D.h" #include "core/sensor/sensor_odom_2D.h"
#include "base/ceres_wrapper/ceres_manager.h" #include "core/ceres_wrapper/ceres_manager.h"
// laserscanutils // laserscanutils
#include "laser_scan_utils/line_finder_iterative.h" #include "laser_scan_utils/line_finder_iterative.h"
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
//C includes for sleep, time and main args //C includes for sleep, time and main args
#include "unistd.h" #include "unistd.h"
#include "base/capture/capture_pose.h" #include "core/capture/capture_pose.h"
//faramotics includes //faramotics includes
#include "faramotics/dynamicSceneRender.h" #include "faramotics/dynamicSceneRender.h"
#include "faramotics/rangeScan2D.h" #include "faramotics/rangeScan2D.h"
......
File moved
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
//Wolf includes //Wolf includes
#include "wolf_manager.h" #include "wolf_manager.h"
#include "base/capture/capture_void.h" #include "core/capture/capture_void.h"
#include "base/ceres_wrapper/ceres_manager.h" #include "core/ceres_wrapper/ceres_manager.h"
// EIGEN // EIGEN
//#include <Eigen/CholmodSupport> //#include <Eigen/CholmodSupport>
......