How to call tabletop_object_detector from my own node?
Hi all, I am new in ROS. I need to call the tabletopsegmentation service from my client program in my ROS workspace. I call it from the terminal correctly. But when I add the service header file in my src, the following error appears after catkinmake:
"fatal error: tabletopobjectdetector/TabletopSegmentation.h: No such file or directory" I know that the CMakeLists.txt and package.xml of my own package should be modified but I don't know how! I need the best practise to call the service from my client and get the position of the segmented objects.
Regards,
Asked by Haitham El-Hussieny on 2014-08-08 03:07:15 UTC
Answers
Add tabletop_object_detector as build and run depend to your package.xml:
<build_depend>tabletop_object_detector</build_depend>
<run_depend>tabletop_object_detector</run_depend>
And in your CMakeLists.txt add it to find_package(catkin REQUIRED COMPONENTS ...
Edit:
The tabletop_object_detector package is still using rosbuild. You are using catkin and unfortunately a catkin package can't depend on a rosbuild package.
Either you also use rosbuild or you port tabletop_object_detector to catkin.
Asked by BennyRe on 2014-08-08 03:29:15 UTC
Comments
Thanks for your reply But Now I have the following error after catkin_make: -- +++ processing catkin package: 'myTutorials' -- ==> add_subdirectory(myTutorials) CMake Error at /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package): Could not find a configuration file for package tabletop_object_detector.
Set tabletop_object_detector_DIR to the directory containing a CMake configuration file for tabletop_object_detector. The file will have one of the following names:
tabletop_object_detectorConfig.cmake
tabletop_object_detector-config.cmake
Call Stack (most recent call first): myTutorials/CMakeLists.txt:7 (find_package)
Asked by Haitham El-Hussieny on 2014-08-08 03:51:32 UTC
Do you have this package installed? Which ROS distro do you use?
Asked by BennyRe on 2014-08-08 04:14:36 UTC
Yes it is allready installed as I can call it from terminal:
roslaunch tabletop_object_detector tabletop_segmentation.launch
and also, can call the segmentation service from terminal as: rosservice call /tabletop_segmentation "table: {}"
and every things work fine. I am on ubuntu 12.04 32 bit, ROS groovy
Asked by Haitham El-Hussieny on 2014-08-08 04:34:09 UTC
Did you source the correct setup.bash in the terminal you run your node?
Asked by BennyRe on 2014-08-08 05:23:27 UTC
Yes. still the same error.
Asked by Haitham El-Hussieny on 2014-08-08 06:52:13 UTC
when I search for the tabletop_object_detector package, the path appears as follows. Is this matter ?
rospack find tabletop_object_detector
/opt/ros/groovy/stacks/pr2_object_manipulation/perception/tabletop_object_detector
Asked by Haitham El-Hussieny on 2014-08-08 07:05:52 UTC
Thanks for your reply, Now it is running after do the following:
in my node code:
#include </opt/ros/groovy/stacks/pr2_object_manipulation/perception/tabletop_object_detector/srv_gen/cpp/include/tabletop_object_detector/TabletopSegmentation.h>
In the CMakeLists.txt:
include_directories(/opt/ros/groovy/stacks/pr2_object_manipulation/perception/tabletop_object_detector/srv_gen/cpp/include/
/opt/ros/groovy/stacks/pr2_object_manipulation/perception/tabletop_object_detector/msg_gen/cpp/include/)
Asked by Haitham El-Hussieny on 2014-08-11 05:09:55 UTC
Comments
dirty hack
Asked by BennyRe on 2014-08-11 06:57:57 UTC
Dirty but surely ;)
Asked by Haitham El-Hussieny on 2014-08-11 13:35:21 UTC
Comments