ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Impossible to make a plugin with the tutorial

asked 2016-06-27 19:17:32 -0600

Piero-31 gravatar image

updated 2016-07-11 16:39:06 -0600

Hi,

I am following the 'Writing and Using a Simple Plugin' tutorial (here) but I can't compile my code. I am on Ubuntu 14.04 and I use ROS indigo. I use C++.

When I use catkin_make the terminal returns :

/home/pierre/catkin_ws/src/pluginlib_tutorials_/src/polygon_plugins.cpp:2:47: fatal error: pluginlib_tutorials_/polygon_base.h: Aucun fichier ou dossier de ce type (No files or folders of this type)

and

make[2]: *** [pluginlib_tutorials_/CMakeFiles/polygon_plugins.dir/src/polygon_plugins.cpp.o] Erreur 1
make[1]: *** [pluginlib_tutorials_/CMakeFiles/polygon_plugins.dir/all] Erreur 2

make: *** [all] Erreur 2
Invoking "make -j2 -l2" failed

I have followed every steps of the tutorials and I have tried to re start from the beginning twice. Does someone know what I must do ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-07-11 16:35:11 -0600

Piero-31 gravatar image

updated 2016-07-12 16:57:43 -0600

EDIT : I finally created the plugin. For people who would like to create a plugin for rqt with the tutorial, here is part of my code.

My directories are : in /catkin_ws/src/rqt_mypkg : src, plugin.xml, package.xml, CMakeLists.txt, include, script, setup.py

In /catkin_ws/src/rqt_mypkg/src/rqt_mypkg : my_plugin.cpp, my_plugin.ui, receveur.cpp

In /catkin_ws/src/rqt_mypkg/include/rqt_mypkg : my_plugin.h

package.xml :

<?xml version="1.0"?>
<package>
  <name>rqt_mypkg</name>
  <version>0.0.0</version>
  <description>The rqt_mypkg package</description>

  <maintainer email="pierre@todo.todo">pierre</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
<build_depend>roscpp</build_depend>
  <build_depend>rqt_gui</build_depend>
  <build_depend>rqt_gui_cpp</build_depend>
  <build_depend>rqt_gui_py</build_depend>
  <build_depend>std_msgs</build_depend>
<run_depend>roscpp</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>rqt_gui</run_depend>
  <run_depend>rqt_gui_cpp</run_depend>
  <run_depend>rqt_gui_py</run_depend>
 <run_depend>std_msgs</run_depend>

  <export>
<rqt_gui plugin="/home/pierre/catkin_ws/src/rqt_mypkg/plugin.xml"/>

  </export>
</package>

My CMakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)
project(rqt_mypkg)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  rospy
roscpp
roslint
  rqt_gui
  rqt_gui_cpp
  rqt_gui_py
std_msgs
genmsg
)

## System dependencies are found with CMake's conventions
 find_package(Qt4 COMPONENTS QtCore QtGUi REQUIRED)

include(${QT_USE_FILE})

 catkin_python_setup()


roslint_cpp()

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs  # Or other packages containing msgs
 )

###################################
## catkin specific configuration ##
###################################
catkin_package(
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS rospy rqt_gui rqt_gui_cpp rqt_gui_py
)

set (rqt_mypkg_SRCS
  src/rqt_mypkg/my_plugin.cpp
)

set(rqt_mypkg_HDRS
  include/rqt_mypkg/my_plugin.h
)

set(rqt_mypkg_UIS
  src/rqt_mypkg/my_plugin.ui
)

qt4_wrap_cpp(rqt_mypkg_MOCS ${rqt_mypkg_HDRS})
qt4_wrap_ui(rqt_mypkg_UIS_H ${rqt_mypkg_UIS})
###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
include
${CMAKE_CURRENT_BINARY_DIR}/..
  ${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
add_library(${PROJECT_NAME}
    ${rqt_mypkg_SRCS}
    ${rqt_mypkg_MOCS}
   ${rqt_mypkg_UIS_H}
)


## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}
   ${catkin_LIBRARIES}
  ${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
 )


install(FILES plugin.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(PROGRAMS scripts/rqt_mypkg
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
edit flag offensive delete link more
0

answered 2016-06-28 01:57:59 -0600

gvdhoorn gravatar image
/home/pierre/catkin_ws/src/pluginlib_tutorials_/src/polygon_plugins.cpp:2:47: fatal error: pluginlib_tutorials_/polygon_base.h: Aucun fichier ou dossier de ce type

From the error message I'd say either

  1. your include path isn't setup correctly, or
  2. there really is no polygon_base.h in the pluginlib_tutorials_ directory

What is the output of:

ls -al /home/pierre/catkin_ws/src/pluginlib_tutorials_/include

or, failing that, of:

tree /home/pierre/catkin_ws/src/pluginlib_tutorials_

?

edit flag offensive delete link more

Comments

I have edited my post

Piero-31 gravatar image Piero-31  ( 2016-06-28 19:37:01 -0600 )edit

Could you also add the contents of your CMakeLists.txt? Please remove all the comments from it before you post it.

gvdhoorn gravatar image gvdhoorn  ( 2016-06-29 03:13:38 -0600 )edit

I finally succeeded in creating it ;)

Piero-31 gravatar image Piero-31  ( 2016-07-06 20:39:03 -0600 )edit

So? What was the problem in the end?

gvdhoorn gravatar image gvdhoorn  ( 2016-07-07 01:45:24 -0600 )edit

I had to modify the package.xml and the CMakeList.txt with a lot of things, Which is not indicated in the tutorial at all. Hopefully I spent hours searching on the internet and find some similar files of people to help me.

Piero-31 gravatar image Piero-31  ( 2016-07-07 16:43:37 -0600 )edit

It would help future readers if you could describe what changes you had to make to CMakeLists.txt and package.xml ..

gvdhoorn gravatar image gvdhoorn  ( 2016-07-08 02:28:54 -0600 )edit

I will. Especially when I see that none of my 5 questions on this forum have been answered. Just some told me to search by myself and to try things. Woua thank you so much for your help ROS community.

Piero-31 gravatar image Piero-31  ( 2016-07-10 17:12:34 -0600 )edit

From your updated OP, it appears you were attempting to create an RQT plugin. Those require quite a bit more than what is described in the tutorial you linked (generic pluginlib tutorial). Have you seen wiki/rqt/Tutorials? They give much more details.

gvdhoorn gravatar image gvdhoorn  ( 2016-07-11 02:55:17 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-27 19:17:32 -0600

Seen: 331 times

Last updated: Jul 12 '16