Skip to content

Commit

Permalink
Merge pull request ANYbotics#140 from ethz-asl/fix/opencv3_compilation
Browse files Browse the repository at this point in the history
Adds in dependencies on OpenCV.
  • Loading branch information
pfankhauser authored Nov 16, 2017
2 parents c8af983 + fa712a6 commit bd8e407
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions grid_map_cv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ find_package(catkin REQUIRED COMPONENTS
filters
)

find_package(OpenCV REQUIRED
COMPONENTS
opencv_photo
)

###################################
## catkin specific configuration ##
###################################
Expand All @@ -29,6 +34,7 @@ catkin_package(
cv_bridge
filters
DEPENDS
OpenCV
)

###########
Expand All @@ -50,6 +56,7 @@ add_library(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)

add_dependencies(${PROJECT_NAME}
Expand Down
5 changes: 5 additions & 0 deletions grid_map_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ find_package(catkin REQUIRED COMPONENTS
filters
)

find_package(OpenCV REQUIRED
COMPONENTS
opencv_highgui)

find_package(octomap REQUIRED)

###################################
Expand Down Expand Up @@ -148,6 +152,7 @@ target_link_libraries(
target_link_libraries(
opencv_demo
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)

target_link_libraries(
Expand Down
3 changes: 2 additions & 1 deletion grid_map_ros/src/GridMapRosConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ bool GridMapRosConverter::saveToBag(const grid_map::GridMap& gridMap, const std:
{
grid_map_msgs::GridMap message;
toMessage(gridMap, message);
ros::Time time(gridMap.getTimestamp());
ros::Time time;
time.fromNSec(gridMap.getTimestamp());

if (!time.isValid() || time.isZero()) {
if (!ros::Time::isValid()) ros::Time::init();
Expand Down

0 comments on commit bd8e407

Please sign in to comment.