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

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

  1. Start by cloning the example package here: link text Make sure it compiles and shows up as a plugin.

  2. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

  3. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

The library that defines the Qt stuff

add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

Specify libraries to link a library or executable target against

target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

  1. Now add a library for the plugin. It links against your widget library:

    Declare a cpp library

add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

Specify libraries to link a library or executable target against

target_link_libraries(${PROJECT_NAME} qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

  1. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

  2. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

  3. You don't need to use QtCcreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

  1. A. Start by cloning the example package here: link text Make sure it compiles and shows up as a plugin.

  2. B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

  3. C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

$ ## The library that defines the Qt stuff

stuff add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against

against target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

  1. D. Now add a library for the plugin. It links against your widget library:

    $ ## Declare a cpp library

library add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

$ ## Specify libraries to link a library or executable target against

against target_link_libraries(${PROJECT_NAME} qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

  1. E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

  2. F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

  3. G. You don't need to use QtCcreator QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here: link texthere. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

$ ## The library that defines the Qt stuff add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

D. Now add a library for the plugin. It links against your widget library: $ ## Declare a cpp library add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

$ ## The library that defines the Qt stuff stuff

add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against against

target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )

D. Now add a library for the plugin. It links against your widget library: library:

$ ## Declare a cpp library library

add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

{{{ $ ## The library that defines the Qt stuff

add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against

target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} )) }}}

D. Now add a library for the plugin. It links against your widget library:

{{{ $ ## Declare a cpp library

add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

{{{

$ ## The library that defines the Qt stuff

stuff add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

src/rqt_gauges/qcgaugewidget.cpp) $ ## Specify libraries to link a library or executable target against

against target_link_libraries(qcgaugewidget ${catkin_LIBRARIES} ${qt_LIBRARIES} ) }}}

D. Now add a library for the plugin. It links against your widget library:

{{{

$ ## Declare a cpp library

library add_library(${PROJECT_NAME} ${rqt_gauges_SRCS} ${rqt_gauges_MOCS} ${rqt_gauges_UIS_H} )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's very confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp and ui files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

$ ## The library that defines the Qt stuff

add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against

target_link_libraries(qcgaugewidget
  ${catkin_LIBRARIES}
  ${qt_LIBRARIES}
)

D. Now add a library for the plugin. It links against your widget library:

$ ## Declare a cpp library

add_library(${PROJECT_NAME}
    ${rqt_gauges_SRCS}
    ${rqt_gauges_MOCS}
    ${rqt_gauges_UIS_H}
    )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.

I've just done this- it's confusing, right? Especially when the documentation is so spread out. Here are some hints (I'm assuming you're using C++):

A. Start by cloning the example package here. Make sure it compiles and shows up as a plugin.

B. Add your Qt files into that example package. You're going to compile the Widget as a library and link against it. I put the Qt headers into "include/rqt_gauges" and the cpp and ui files into "src/rqt_gauges."

C. In CMakeLists, add the Widget library (for me, it was called "qcgaugewidget":

$ ## The library that defines the Qt stuff

add_library(qcgaugewidget SHARED src/rqt_gauges/qcgaugewidget.cpp)

$ ## Specify libraries to link a library or executable target against

target_link_libraries(qcgaugewidget
  ${catkin_LIBRARIES}
  ${qt_LIBRARIES}
)

D. Now add a library for the plugin. It links against your widget library:

$ ## Declare a cpp library

add_library(${PROJECT_NAME}
    ${rqt_gauges_SRCS}
    ${rqt_gauges_MOCS}
    ${rqt_gauges_UIS_H}
    )

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

E. You'll probably run into lots of issues with CMakeLists. It's finnicky. I would just depend on the rqt_gauges example as much as possible.

F. Sorry, I didn't use signals and slots. I hacked it with a pointer instead. Somebody else will have to help you there.

G. You don't need to use QtCreator as your editor. You can use any text editor (even gedit) and compile with catkin_make, like usual for ROS.