0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rviz plugin用のpackage.xmlとCMakeLists.txtの書き方

Last updated at Posted at 2021-03-11

rviz2プラグインの作り方 トップページへ

pkg createで生成されたものに追記する分だけ書いておきます

package.xml

package.xml
  <depend>rclcpp</depend>
  <depend>libqt5-widgets</depend>
  <depend>rviz_common</depend>
  <depend>rviz_rendering</depend>
  <depend>rviz_ogre_vendor</depend>

この他にプラグイン内でトピックのやりとりをするなら必要なパッケージを追記(例,<depend>std_msgs<\depend>)

CMakeLists.txt

CMakeLists.txt
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_rendering REQUIRED)
find_package(rviz_ogre_vendor REQUIRED)
find_package(pluginlib REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
# find_package(std_msgs REQUIRED)
# find_package(geometry_msgs REQUIRED)

include_directories(src ${OGRE_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS}/Paging)

set(CMAKE_AUTOMOC ON)

add_library(${PROJECT_NAME} SHARED
  # src/aaa.cpp
  # src/bbb.cpp
  # src/ccc.cpp
)

ament_target_dependencies(${PROJECT_NAME} 
  rclcpp 
  rviz_common

  # std_msgs
  # geometry_msgs
)

target_link_libraries(${PROJECT_NAME} Qt5::Widgets)

pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)

install(TARGETS
  ${PROJECT_NAME}
  EXPORT ${PROJECT_NAME}  
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION bin
  INCLUDES DESTINATION include
)

package.xmlと同様に必要に応じて追記

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?