Commit 97aab042 authored by Daniel Müller's avatar Daniel Müller
Browse files

Disabled search and include of Qt5 as default

parent 3ba8113d
......@@ -29,21 +29,34 @@ if(NOT EIGEN3_INCLUDE_DIRS)
endif()
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
set(WITH_QT5 0)
if(WITH_QT5)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
message("Found Qt5.")
endif()
add_compile_options(-DUSE_QT5=${WITH_QT5})
message("Building with Qt5: ${WITH_QT5}")
# Install python imports of this package using catkin
catkin_python_setup()
set(CMAKE_BUILD_TYPE Release)
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
)
if(WITH_QT5)
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
)
else()
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)
endif()
catkin_package(
INCLUDE_DIRS
......@@ -66,13 +79,21 @@ add_library(homerOccupancyMap
)
target_link_libraries(
homerOccupancyMap
${catkin_LIBRARIES}
${tf_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Widgets_LIBRARIES}
)
if(WITH_QT5)
target_link_libraries(
homerOccupancyMap
${catkin_LIBRARIES}
${tf_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Widgets_LIBRARIES}
)
else()
target_link_libraries(
homerOccupancyMap
${catkin_LIBRARIES}
${tf_LIBRARIES}
)
endif()
set(
ParticleFilter_SRC
src/ParticleFilter/HyperSlamFilter.cpp
......
......@@ -2,7 +2,9 @@
#define OCCUPANCYMAP_H
#include <Eigen/Geometry>
#if USE_QT5
#include <QtGui/QImage>
#endif
#include <cmath>
#include <fstream>
#include <homer_mapnav_msgs/ModifyMap.h>
......@@ -210,6 +212,7 @@ public:
*/
float computeScore(const Pose& robotPose, const std::vector<MeasurePoint>& measurePoints) const;
#if USE_QT5
/**
* @return QImage of size m_metaData.width, m_metaData.height with values of
* m_OccupancyProbability scaled to 0-254
......@@ -217,7 +220,7 @@ public:
// TODO (DM): This is the only reference to Qt functionality! Seperate from basic class if still
// needed somewhere.
QImage getProbabilityQImage(int trancparencyThreshold, bool showInaccessible) const;
#endif
// puma2::ColorImageRGB8* getUpdateImage( bool withMap=true ); TODO
/**
......@@ -301,13 +304,13 @@ protected:
void scaleDownCounts(int maxCount);
/**
* This function paints a line from a start pixel to an end pixel.
* The computation is made with the Bresenham algorithm.
* @param data array on which the line shall be painted
* @param startPixel starting coordinates of the beam
* @param endPixel ending coordinates of the beam
* @param value The value with which the lines are marked.
*/
* This function paints a line from a start pixel to an end pixel.
* The computation is made with the Bresenham algorithm.
* @param data array on which the line shall be painted
* @param startPixel starting coordinates of the beam
* @param endPixel ending coordinates of the beam
* @param value The value with which the lines are marked.
*/
void drawLine(Eigen::Vector2i& startPixel, Eigen::Vector2i& endPixel, char value);
/**
......@@ -340,7 +343,7 @@ protected:
/**
* This method sets all values of m_MinChangeX, m_MaxChangeX, m_MinChangeY
* and m_MaxChangeY
* to initial values so that the complete map will be processed.
* to initial values so that the complete map will be processed.
*/
void maximizeChangedRegion();
......
......@@ -23,10 +23,10 @@
<build_depend>homer_mapnav_msgs</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>eigen</build_depend>
<build_depend>libqt5-core</build_depend>
<!--build_depend>libqt5-core</build_depend>
<build_depend>libqt5-gui</build_depend>
<build_depend>libqt5-widgets</build_depend>
<build_depend>qtbase5-dev</build_depend>
<build_depend>qtbase5-dev</build_depend-->
<build_depend>uuid</build_depend>
......@@ -40,9 +40,9 @@
<run_depend>homer_mapnav_msgs</run_depend>
<run_depend>eigen</run_depend>
<run_depend>explore_lite</run_depend>
<run_depend>libqt5-core</run_depend>
<!--run_depend>libqt5-core</run_depend>
<run_depend>libqt5-gui</run_depend>
<run_depend>libqt5-widgets</run_depend>
<run_depend>libqt5-widgets</run_depend-->
<run_depend>uuid</run_depend>
</package>
......@@ -47,9 +47,7 @@ OccupancyMap::OccupancyMap(const OccupancyMap& occupancyMap)
*this = occupancyMap;
}
OccupancyMap::~OccupancyMap()
{
}
OccupancyMap::~OccupancyMap() {}
void OccupancyMap::initMembers()
{
......@@ -844,7 +842,7 @@ void OccupancyMap::markRobotPositionFree()
m_ChangedRegion.enclose(robotBox);
m_ExploredRegion.enclose(robotBox);
}
#if USE_QT5
QImage OccupancyMap::getProbabilityQImage(int trancparencyThreshold, bool showInaccessible) const
{
QImage retImage(m_metaData.width, m_metaData.height, QImage::Format_RGB32);
......@@ -868,6 +866,7 @@ QImage OccupancyMap::getProbabilityQImage(int trancparencyThreshold, bool showIn
}
return retImage;
}
#endif
void OccupancyMap::getOccupancyProbabilityImage(
vector<int8_t>& data, nav_msgs::MapMetaData& metaData) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment