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

tuser's profile - activity

2021-10-29 07:35:18 -0500 received badge  Student (source)
2020-02-03 17:36:09 -0500 received badge  Famous Question (source)
2020-01-29 08:09:27 -0500 received badge  Supporter (source)
2020-01-29 05:57:42 -0500 received badge  Scholar (source)
2020-01-29 05:57:41 -0500 commented answer Custom panel plugin not being found when running rviz2

Thanks for looking into this, saw that you managed to get the documentation updated as well. I will try it and get back,

2020-01-29 05:57:29 -0500 commented answer Custom panel plugin not being found when running rviz2

Thanks for looking into this, saw that you managed to get the documentation updated as well. I will try it and get back,

2020-01-29 05:07:46 -0500 commented answer Custom panel plugin not being found when running rviz2

Thanks for looking into this, saw that you managed to get the documentation updated as well. I will try it and get back,

2020-01-29 05:07:04 -0500 commented answer Custom panel plugin not being found when running rviz2

Thanks for looking into this, I will try it and get back.

2020-01-24 12:45:54 -0500 received badge  Favorite Question (source)
2020-01-15 06:34:14 -0500 commented question Custom panel plugin not being found when running rviz2

I will proceed with an alternative solution not using rviz plugins for now. But thanks for the help, if I have time to r

2020-01-15 06:34:14 -0500 received badge  Enthusiast
2020-01-13 08:46:00 -0500 received badge  Notable Question (source)
2020-01-13 00:47:41 -0500 commented question Custom panel plugin not being found when running rviz2

I'm using debian packages so trying to install from source could be worth trying. Do you have any idea why using a sourc

2020-01-10 02:56:36 -0500 received badge  Popular Question (source)
2020-01-10 00:51:16 -0500 marked best answer Custom panel plugin not being found when running rviz2

I have tried to create a custom ros2 package that will be a panel plugin for rivz2, by following information from "User's Guide to plugin development" as well as "Creating a ROS 2 package" but when running rviz2 it is not finding my custom plugin. I expect to find the custom panel in the rviz GUI under Panels --> Add New Panel but there is nothing there. How can I ensure that the plugin is found by rviz when it is running, any suggestions would be helpful!

The package is successfully built with colcon and when running ros2 pkg list I have verified that ros2 finds the custom package, my_panel_plugin, but I haven't found any other way of troubleshooting what the issue could be.

I also tried running rviz with debug flag

ros2 run rviz2 rviz2 __log_level:=debug

but my only conclusion from that is that my custom plugin is not being found by the plugin loader in the same way as eg. the rviz_default_plugins.

According to the documentation linked above I need to invoke the PLUGINLIB_EXPORT_CLASS macro for the plugin loader to find the plugin. I believe I have done this correctly but see the related files for reference, CMakeLists.txt, package.xml and plugin_description.xml.

ROS enviroment variables

ROS_PYTHON_VERSION=3
ROS_VERSION_NAME=dashing
ROS_DISTRO=dashing
ROS_VERSION=2

File structure

├── rviz_plugins
│   └── my_panel_plugin
│       ├── CMakeLists.txt
│       ├── my_panel_plugin.cpp
│       ├── my_panel_plugin.h
│       ├── package.xml
│       └── plugin_description.xml

I've added

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(sf::rviz_plugins::my_panel_plugin, rviz_common::Panel)

at the end of my_panel_plugin.cpp.

CMakeLists.txt

cmake_minimum_required(VERSION 3.5)
project(my_panel_plugin)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(pluginlib REQUIRED)

include_directories(include)

# Qt5 boilerplate options from http://doc.qt.io/qt-5/cmake-manual.html
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

add_library(${PROJECT_NAME} SHARED
            my_panel_plugin.cpp
            )

# Link ament packages
ament_target_dependencies(${PROJECT_NAME} rclcpp rviz_common)

# Link non ament packages
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)

# prevent pluginlib from using boost
target_compile_definitions(my_panel_plugin PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

install(TARGETS my_panel_plugin
  DESTINATION lib/${PROJECT_NAME}
  )

pluginlib_export_plugin_description_file(my_panel_plugin plugin_description.xml)

# replaces catkin_package(LIBRARIES ${PROJECT_NAME}) 
ament_export_libraries(${PROJECT_NAME})

ament_package()

package.xml

<package format="2">
  <name>my_panel_plugin</name>
  <version>0.0.1</version>
  <description>This package adds a plugin to rviz2</description>
  <maintainer email="you@example.com">Your Name</maintainer>
  <license>Proprietary</license>

  <buildtool_depend>ament_cmake</buildtool_depend>
  <depend>rclcpp</depend>
  <depend>rviz_common</depend>
  <depend>libqt5-widgets</depend>
  <depend>rviz2</depend>

  <export>
    <rviz plugin="plugin_description.xml"/>
    <build_type>ament_cmake</build_type>
  </export>
</package>

plugin_description.xml

<library path="lib/libmy_panel_plugin">
  <class name="my_panel_plugin/My_panel_plugin"
         type="sf::rviz_plugins::My_panel_plugin"
         base_class_type="rviz_common::Panel">
    <description>
      My_panel_plugin
    </description>
  </class>
</library>
2020-01-10 00:32:33 -0500 answered a question Custom panel plugin not being found when running rviz2

It seems that custom plugins of panel type are not supported in rviz2 currently according to issue reported here: https

2020-01-10 00:32:33 -0500 received badge  Rapid Responder (source)
2020-01-10 00:26:23 -0500 edited question Custom panel plugin not being found when running rviz2

Custom plugin not being found when running rviz2 I have tried to create a custom ros2 package that will be a panel plugi

2020-01-08 07:14:21 -0500 edited question Custom panel plugin not being found when running rviz2

Custom plugin not being found when running rviz2 I have tried to create a custom ros2 package that will be a panel plugi

2020-01-08 07:14:21 -0500 received badge  Editor (source)
2020-01-08 07:13:41 -0500 edited question Custom panel plugin not being found when running rviz2

Custom plugin not being found when running rviz2 I have tried to create a custom ros2 package that will be a panel plugi

2020-01-08 01:59:57 -0500 asked a question Custom panel plugin not being found when running rviz2

Custom plugin not being found when running rviz2 I have tried to create a custom ros2 package that will be a panel plugi