Skip to content

Commit 3cc0081

Browse files
committed
Merged ros-industrial-attic#63 from main repo. Fixed small warnings.
1 parent 42eb88a commit 3cc0081

File tree

15 files changed

+74
-31
lines changed

15 files changed

+74
-31
lines changed

base_placement_plugin/CMakeLists.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cmake_minimum_required(VERSION 2.8.3)
22

3+
cmake_policy(SET CMP0048 NEW)
34
project(base_placement_plugin)
45

56
# Load catkin and all dependencies required for this package
@@ -20,16 +21,25 @@ find_package(catkin REQUIRED COMPONENTS
2021
moveit_core
2122
)
2223

23-
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
24-
25-
include(${QT_USE_FILE})
2624

25+
if(rviz_QT_VERSION VERSION_LESS "5")
26+
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
27+
find_package(Qt4 ${rviz_QT_VERSION} EXACT REQUIRED QtCore QtGui)
28+
## pull in all required include dirs, define QT_LIBRARIES, etc.
29+
include(${QT_USE_FILE})
30+
else()
31+
message(STATUS "Using Qt5 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
32+
find_package(Qt5 ${rviz_QT_VERSION} EXACT REQUIRED Core Widgets Concurrent)
33+
## make target_link_libraries(${QT_LIBRARIES}) pull in all required dependencies
34+
set(QT_LIBRARIES Qt5::Widgets Qt5::Concurrent)
35+
endif()
36+
find_package(HDF5 REQUIRED)
2737

2838
add_definitions(-DQT_NO_KEYWORDS)
2939

3040

3141
add_library(create_marker src/create_marker.cpp)
32-
target_link_libraries(create_marker ${catkin_LIBRARIES} )
42+
target_link_libraries(create_marker ${QT_LIBRARIES} ${catkin_LIBRARIES} )
3343

3444
set(base_placement_plugin_SRCS
3545
src/add_way_point.cpp
@@ -77,12 +87,17 @@ catkin_package(
7787
map_creator
7888
)
7989

80-
qt4_wrap_cpp(base_placement_plugin_MOCS ${base_placement_plugin_HDRS} )
81-
qt4_wrap_ui(base_placement_plugin_UIS_H ${base_placement_plugin_UIS} )
90+
if(rviz_QT_VERSION VERSION_LESS "5")
91+
qt4_wrap_cpp(base_placement_plugin_MOCS ${base_placement_plugin_HDRS} )
92+
qt4_wrap_ui(base_placement_plugin_UIS_H ${base_placement_plugin_UIS} )
93+
else()
94+
qt5_wrap_cpp(base_placement_plugin_MOCS ${base_placement_plugin_HDRS} )
95+
qt5_wrap_ui(base_placement_plugin_UIS_H ${base_placement_plugin_UIS} )
96+
endif()
8297

83-
include_directories(${base_placement_plugin_INCLUDE_DIRECTORIES} ${catkin_INCLUDE_DIRS})
98+
include_directories(${base_placement_plugin_INCLUDE_DIRECTORIES} ${catkin_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS})
8499
add_library(${PROJECT_NAME} ${base_placement_plugin_SRCS} ${base_placement_plugin_MOCS} ${base_placement_plugin_UIS_H}) # ${base_placement_plugin_UIS_H}
85-
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} yaml-cpp -lhdf5 -lhdf5_cpp create_marker)
100+
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_LIBRARIES} yaml-cpp ${HDF5_LIBRARIES} create_marker)
86101
## target_link_libraries(${PROJECT_NAME} yaml-cpp)
87102

88103

base_placement_plugin/include/base_placement_plugin/create_marker.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@
99
#include <Eigen/Eigen>
1010
#include <eigen_conversions/eigen_msg.h>
1111

12-
#include<moveit/move_group_interface/move_group.h>
1312
#include<moveit/robot_state/robot_state.h>
1413

1514
#include<moveit/robot_model_loader/robot_model_loader.h>
1615
#include<moveit/robot_model/robot_model.h>
1716
#include<moveit/robot_model/joint_model_group.h>
1817
#include<moveit/robot_model/link_model.h>
19-
18+
#if ROS_VERSION_MINIMUM(1,12,0)
19+
#include <moveit/move_group_interface/move_group_interface.h>
20+
typedef moveit::planning_interface::MoveGroupInterface MoveGroupInterface;
21+
#else
22+
#include <moveit/move_group_interface/move_group.h>
23+
typedef moveit::planning_interface::MoveGroup MoveGroupInterface;
24+
#endif
2025

2126
typedef std::multimap<std::vector<double>,geometry_msgs::Pose> BasePoseJoint;
2227

@@ -52,7 +57,7 @@ class CreateMarker{
5257

5358
std::string group_name_;
5459
ros::AsyncSpinner spinner;
55-
boost::scoped_ptr<moveit::planning_interface::MoveGroup> group_;
60+
boost::scoped_ptr<MoveGroupInterface> group_;
5661
std::string parent_link;
5762
moveit::core::RobotModelConstPtr robot_model_; //Robot model const pointer
5863
};

base_placement_plugin/include/base_placement_plugin/place_base.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
#include<base_placement_plugin/create_marker.h>
99

1010
#include<moveit/planning_scene_monitor/planning_scene_monitor.h>
11-
#include<moveit/move_group_interface/move_group.h>
1211
#include<moveit/robot_model_loader/robot_model_loader.h>
12+
#if ROS_VERSION_MINIMUM(1,12,0)
13+
#include <moveit/move_group_interface/move_group_interface.h>
14+
typedef moveit::planning_interface::MoveGroupInterface MoveGroupInterface;
15+
#else
16+
#include <moveit/move_group_interface/move_group.h>
17+
typedef moveit::planning_interface::MoveGroup MoveGroupInterface;
18+
#endif
1319
#include<moveit/robot_model/robot_model.h>
1420
#include<moveit/robot_model/joint_model_group.h>
1521
#include<moveit/robot_state/robot_state.h>
@@ -19,7 +25,12 @@
1925

2026
#include <QObject>
2127
#include <QTimer>
28+
#if QT_VERSION < 0x050000
29+
#error oh dear
2230
#include <QtConcurrentRun>
31+
#else
32+
#include <QtConcurrent>
33+
#endif
2334
#include <QFuture>
2435

2536
#ifndef PLACE_BASE_H_

base_placement_plugin/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<library path="lib/libbase_placement_plugin">
22
<class name="base_placement_plugin/Base Placement Plug-in"
33
type="base_placement_plugin::AddWayPoint"
4-
base_class_type="rviz::Panel">
4+
base_class_type="rviz::Panel"/>
55
<description>
66
Tool for visualizing base placement methods
77
</description>

base_placement_plugin/src/create_marker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ double unifRand()
1010
CreateMarker::CreateMarker(std::string group_name) : spinner(1), group_name_(group_name)
1111
{
1212
spinner.start();
13-
group_.reset(new moveit::planning_interface::MoveGroup(group_name_));
13+
group_.reset(new MoveGroupInterface(group_name_));
1414
//ROS_INFO_STREAM("Selected planning group: "<< group_->getName());
1515
robot_model_ = group_->getRobotModel();
1616
}

base_placement_plugin/src/widgets/base_placement_widget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#include <map_creator/hdf5_dataset.h>
66

7-
#include <H5Cpp.h>
8-
#include <hdf5.h>
7+
#include <hdf5/serial/H5Cpp.h>
8+
#include <hdf5/serial/hdf5.h>
99

1010
namespace base_placement_plugin
1111
{

map_creator/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ find_package(catkin REQUIRED COMPONENTS
1717
)
1818

1919
find_package(octomap REQUIRED)
20-
20+
find_package(HDF5 REQUIRED)
21+
find_package(MPI REQUIRED)
22+
find_package(LAPACK REQUIRED)
2123
add_message_files(
2224
FILES
2325
capShape.msg
@@ -44,15 +46,16 @@ catkin_package(
4446
CATKIN_DEPENDS message_runtime
4547
)
4648

47-
include_directories(include ${catkin_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR} ${PCL_INCLUDE_DIR})
49+
include_directories(include ${catkin_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS} ${HDF5_INCLUDE_DIRS} ${PCL_INCLUDE_DIR}
50+
${MPI_CXX_INCLUDE_DIRS})
4851

4952
add_library(sphere_discretization src/sphere_discretization.cpp)
5053
add_library(kinematics src/kinematics.cpp )
5154
add_library(hdf5_dataset src/hdf5_dataset.cpp)
5255

5356
target_link_libraries(sphere_discretization ${catkin_LIBRARIES} ${OCTOMAP_LIBRARIES} ${PCL_LIBRARY_DIRS})
54-
target_link_libraries(kinematics ${catkin_LIBRARIES} -llapack)
55-
target_link_libraries(hdf5_dataset ${catkin_LIBRARIES} -lhdf5 -lhdf5_cpp)
57+
target_link_libraries(kinematics ${catkin_LIBRARIES} ${LAPACK_LIBRARIES})
58+
target_link_libraries(hdf5_dataset ${catkin_LIBRARIES} ${HDF5_LIBRARIES} ${MPI_CXX_LIBRARIES})
5659

5760
install(TARGETS sphere_discretization kinematics hdf5_dataset
5861
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}

map_creator/include/map_creator/hdf5_dataset.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef HDF5_DATASET_H
22
#define HDF5_DATASET_H
3-
#include "H5Cpp.h"
4-
#include <hdf5.h>
3+
#include <hdf5/serial/H5Cpp.h>
4+
#include <hdf5/serial/hdf5.h>
55
#include <iostream>
66
#include <ros/ros.h>
77

map_creator/include/map_creator/mh5_ikfast.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#define IKFAST_HAS_LIBRARY
2121
#include "ikfast.h" // found inside share/openrave-X.Y/python/ikfast.h
2222
using namespace ikfast;
23+
using namespace std;
2324

2425
// check if the included ikfast version matches what this file was compiled with
2526
#define IKFAST_COMPILE_ASSERT(x) extern int __dummy[(int)x]
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)