-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build a c++ native library "grap_pose_detection" #58
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sharronliu
changed the title
Libgpd
Build a c++ native library "grap_pose_detection (GPD_LIB)"
Nov 1, 2018
sharronliu
changed the title
Build a c++ native library "grap_pose_detection (GPD_LIB)"
Build a c++ native library "grap_pose_detection"
Nov 1, 2018
sharronliu
force-pushed
the
libgpd
branch
4 times, most recently
from
December 31, 2018 06:05
35baa4a
to
4d91a1a
Compare
In this patch, ROS nodes are updated to pass "Parameters" structuer to the constructors of classes under "src/gpd". The affected ROS nodes/codes are: src/nodes/classify_candidates.cpp src/nodes/create_training_data.cpp src/nodes/grasp_detection_node.cpp::GraspDetectionNode The ROS nodes now use "ROSParameters" as helping class to get parameters from the NodeHandle, then pass the parameters to the constructors. Signed-off-by: Sharron LIU <sharron.liu@intel.com>
sharronliu
force-pushed
the
libgpd
branch
3 times, most recently
from
December 31, 2018 06:49
9c480f2
to
c479f63
Compare
This patch removed the ROS dependency from the classes under "src/gpd" It affects the constructors of the below classes: src/gpd/grasp_detector.cpp::GraspDetector src/gpd/sequential_importance_sampling.cpp::SequentialImportanceSampling src/gpd/data_generator.cpp::DataGenerator Now these classes no more take parameters from "ROS::NodeHandle". Instead, they get the parameters passed from their constructors. The ROS prints are replaced with std::cout also. Signed-off-by: Sharron LIU <sharron.liu@intel.com>
In order to separate "src/gpd" from ROS, a new class ROSParameters is created. This class help to get parameters passed from ROS NodeHandle. Under "src/gpd", there were three classes taking parameters from ROS: src/gpd/grasp_detector.cpp::GraspDetector src/gpd/sequential_importance_sampling.cpp::SequentialImportanceSampling src/gpd/data_generator.cpp::DataGenerator ROS parameters passed to these classes were redefined and encapsulated as a specific "Parameter" structure passed to the constructor of each class. Signed-off-by: Sharron LIU <sharron.liu@intel.com>
"CV_RGB2BGR" is replaced with a more generic interface used in OpenCV version 3 and 4 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This patch added a new cmake file "src/gpd/CMakeLists.txt" to build library "libgrasp_pose_detection (GPD_LIB)" independent on ROS. The cmake file is designed for being invoked in two scenarios: 1. Invoked from parent cmake file via "add_subdirectory(src/gpd)". In this way, build options inherit from parent cmake file 2. Invoked from command line via "cmake <build options> path" $ cd src/gpd $ mkdir build && cd build $ cmake -DUSE_CAFFE=OFF -DUSE_OPENVINO=ON .. The cmake file performs: 1. Set the shared library name "GPD_LIB", visible to parent cmake file 2. Find dependent packages required by "GPD_LIB" 3. Identify source files per build options like OPENVINO or CAFFE 4. Install the built library and headers The top-level cmake file (CMakeLists.txt) is updated accordingly: 1. While build with ROS catkin, trigger "GPD_LIB" via add_subdirectory() 2. Not necessary to build library for each single souce under "src/gpd" 3. Add "GPD_LIB" as a dependency for the executable targets. This will garantee "GPD_LIB" built prior to the executable targets. Signed-off-by: Sharron LIU <sharron.liu@intel.com>
Added launch option "plane_remove" (default 'false') to remove planes (e.g. tabletop) from PCL inputs. Signed-off-by: Sharron LIU <sharron.liu@intel.com>
sharronliu
force-pushed
the
libgpd
branch
2 times, most recently
from
March 18, 2019 06:29
eab315d
to
fdd6993
Compare
PR atenpas#50 atenpas#50 Signed-off-by: Sharron LIU <sharron.liu@intel.com>
GPD is now a C++14 library. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR intents to build a c++ native library "grasp_pose_detection" that is independent on ROS. This serves as a common library in either ROS or ROS2.
Fix issue #52
Key changes include:
How to build the library:
An automatic way is to build the "gpd" package from catkin workspace:
$ catkin_make -DCMAKE_BUILD_TYPE=Release --pkg gpd
# or "catkin_make -DCMAKE_BUILD_TYPE=Release -DUSE_OPENVINO=ON --pkg gpd"
Alternatively, manually kick off the build is supported:
$ cd src/gpd
$ mkdir build && cd build
$ cmake -DUSE_CAFFE=ON ..
# or "cmake -DUSE_OPENVINO=ON .."
$ sudo make install
By default "libgrasp_pose_detection.so" shall be installed to "/usr/local/install".
There are NO changes on build options or launch options :)
This PR is tested working with "USE_CAFFE=ON (default)" or "USE_OPENVINO=ON".
This PR is also tested with "Ubuntu 16.04 + ROS Kinetic" or "Ubuntu 18.04 + ROS Melodic".