Skip to content

Commit

Permalink
Merge pull request #73 from avidbots/opencv-3-1-support
Browse files Browse the repository at this point in the history
Opencv 3 1 support for Ros Noetic
  • Loading branch information
josephduchesne authored Jul 17, 2020
2 parents ce5b367 + c86e7fa commit 75ff614
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cache:
env:
matrix:
- ROS_DISTRO="kinetic" ROS_REPO=ros AFTER_SETUP_TARGET_WORKSPACE='./scripts/ci_prebuild.sh' AFTER_SCRIPT='./scripts/ci_postbuild.sh'
- ROS_DISTRO="noetic" ROS_REPO=ros AFTER_SETUP_TARGET_WORKSPACE='./scripts/ci_prebuild.sh'
install:
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci -b master

Expand Down
8 changes: 7 additions & 1 deletion flatland_server/src/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
#include <iostream>
#include <memory>
#include <opencv2/opencv.hpp>
#if CV_MAJOR_VERSION < 3
#define GREYSCALE CV_LOAD_IMAGE_GRAYSCALE
#else
#include <opencv2/imgcodecs.hpp>
#define GREYSCALE cv::ImreadModes::IMREAD_GRAYSCALE
#endif
#include <sstream>

namespace flatland_server {
Expand Down Expand Up @@ -162,7 +168,7 @@ Layer *Layer::MakeLayer(b2World *physics_world, CollisionFilterRegistry *cfr,
ROS_INFO_NAMED("Layer", "layer \"%s\" loading image from path=\"%s\"",
names[0].c_str(), image_path.string().c_str());

cv::Mat map = cv::imread(image_path.string(), CV_LOAD_IMAGE_GRAYSCALE);
cv::Mat map = cv::imread(image_path.string(), GREYSCALE);
if (map.empty()) {
throw YAMLException("Failed to load " + Q(image_path.string()) +
" in layer " + Q(names[0]));
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function print_er {
}


apt-get install clang-3.8 clang-format-3.8 clang-tidy-3.8 -y
apt-get install clang clang-format clang-tidy -y

# change to the file's directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down

0 comments on commit 75ff614

Please sign in to comment.