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

Revision history [back]

click to hide/show revision 1
initial version

EDIT : I finally created the plugin. For people who would like to create a plugin 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
  src/rqt_mypkg/receveur.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}
 )

add_executable(receveur src/rqt_mypkg/receveur.cpp)
target_link_libraries(receveur ${catkin_LIBRARIES})
add_dependencies(receveur rqt_mypkg_generate_messages_cpp)

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

install(PROGRAMS scripts/rqt_mypkg
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

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
  src/rqt_mypkg/receveur.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}
 )

add_executable(receveur src/rqt_mypkg/receveur.cpp)
target_link_libraries(receveur ${catkin_LIBRARIES})
add_dependencies(receveur rqt_mypkg_generate_messages_cpp)

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

install(PROGRAMS scripts/rqt_mypkg
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

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
  src/rqt_mypkg/receveur.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}
 )

add_executable(receveur src/rqt_mypkg/receveur.cpp)
target_link_libraries(receveur ${catkin_LIBRARIES})
add_dependencies(receveur rqt_mypkg_generate_messages_cpp)

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

install(PROGRAMS scripts/rqt_mypkg
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

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
  src/rqt_mypkg/receveur.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}
)