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

StefanFabian's profile - activity

2019-08-20 14:09:23 -0500 received badge  Good Answer (source)
2018-10-11 16:21:22 -0500 commented question Ipython with ROS (kinetic)

I don't really understand your question. What is hard? In my experience jupyter notebooks work just fine with ROS. The p

2018-10-11 15:47:43 -0500 edited answer Conflict anaconda vs ROS, catking_pkg not found

Gavran already explained the problem very well. Here's just another way to solve the issue. The easiest solutions like

2018-01-09 13:50:21 -0500 received badge  Nice Answer (source)
2018-01-09 06:43:10 -0500 received badge  Self-Learner (source)
2018-01-09 06:42:52 -0500 received badge  Necromancer (source)
2018-01-09 06:42:52 -0500 received badge  Teacher (source)
2018-01-09 05:07:32 -0500 answered a question Conflict anaconda vs ROS, catking_pkg not found

Gavran already explained the problem very well. Here's just another way to solve the issue. The easiest solutions like

2017-10-20 17:55:10 -0500 received badge  Popular Question (source)
2017-10-20 17:55:10 -0500 received badge  Notable Question (source)
2017-10-20 17:55:10 -0500 received badge  Famous Question (source)
2016-08-27 15:46:58 -0500 answered a question Get main RenderPanel from Display

Okay, I just accidentally found out how to get it while searching for a way to get the ViewController.
You get it as follows:

Your class should have a DisplayContext property called context_*.
Through this property we can access the ViewManager by calling context_->getViewManager() that can give us a reference to the RenderPanel by calling getRenderPanel().

So in short to grab the RenderPanel you simply call:

rviz::RenderPanel* panel = context_->getViewManager()->getRenderPanel();

2016-08-18 15:55:52 -0500 asked a question Get main RenderPanel from Display

Hey,

I need to grab a pointer to rviz main RenderPanel - the one that renders the scene - from a Display plugin.
I've managed to grab a RenderPanel but in some cases there are more than one and I haven't found a way to identify them yet.

2016-08-13 05:16:06 -0500 received badge  Enthusiast
2016-08-02 06:07:18 -0500 asked a question Adding library to plugin

Hey,

probably an easy task but I'm just starting with ROS and I can't figure out how to correctly link my plugin library with another library I've written.

They are both catkin packages. It compiles just fine and catkin seems to understand the depend on build time because it builds test_tools first when building test_plugins. However when running rviz and adding the plugin that uses a class from test_tools it fails with a symbol lookup error:

/opt/ros/indigo/bin/rviz: symbol lookup error: /home/stefan/ros_ws/devel_isolated/lib/libtest_plugins.so: undefined symbol: _ZN21test_tools9TestToolC1Ev

Please note that I've tried a lot of stuff that I found when trying to find a solution myself, so you might shake your head when looking at the CMakeLists.txt.

This is the non-plugin library:

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(test_tools)

find_package(catkin REQUIRED)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
)

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

# We also use Ogre
include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(OGRE OGRE)

include(${QT_USE_FILE})
include_directories(
  include
  ${QT_INCLUDE_DIRS}
  ${OGRE_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} src/test_tool.cpp)

target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES} ${OGRE_LIBRARIES})

install(DIRECTORY include/${PROJECT_NAME}/
        DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
        FILES_MATCHING PATTERN "*.h")

install(TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})

package.xml

<?xml version="1.0"?>
<package>
  <name>test_tools</name>
  <version>1.0.0</version>
  <description>...</description>

  <maintainer email="....">Stefan Fabian</maintainer>
  <license>BSD</license>

  <buildtool_depend>catkin</buildtool_depend>
</package>

And I'm trying to use classes from that library in the following library that exports some test plugins for rviz:

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)

project(test_plugins)

find_package(catkin REQUIRED COMPONENTS
  rviz
  test_tools
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES test_plugins
  DEPENDS rviz
  CATKIN_DEPENDS test_tools
)

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

# We also use Ogre
include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(OGRE OGRE)

include(${QT_USE_FILE})
include_directories(
  include
  ${QT_INCLUDE_DIRS}
  ${OGRE_INCLUDE_DIRS}
  ${catkin_INCLUDE_DIRS}
)

qt4_wrap_cpp(QT_MOC include/plant_flag_tool.h include/mouse_view_controller.h include/test_display.h)
set(SOURCES
src/plant_flag_tool.cpp
src/mouse_view_controller.cpp
src/test_display.cpp
${QT_MOC}
)

add_library(test_plugins ${SOURCES})

target_link_libraries(test_plugins ${QT_LIBRARIES} ${OGRE_LIBRARIES} ${catkin_LIBRARIES})

package.xml

<?xml version="1.0"?>
<package>
  <name>test_plugins</name>
  <version>1.0.0</version>
  <description>The test_plugins package</description>
  <maintainer email="...">Stefan Fabian</maintainer>
  <license>BSD</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rviz</build_depend>
  <build_depend>test_tools</build_depend>
  <run_depend>rviz</run_depend>
  <run_depend>test_tools</run_depend>

  <export>
    <rviz plugin="${prefix}/plugin_description.xml"/>
  </export>
</package>

plugin_description.xml

<library path="libtest_plugins">
    <class name="test_plugins/PlantFlag"
           type="test_plugins::PlantFlagTool"
           base_class_type="rviz::Tool">
        <description>
            ...
        </description>
    </class>
    <class name="test_plugins/MouseViewController"
           type="test_plugins::MouseViewController"
           base_class_type="rviz::ViewController">
        <description>
           ...
        </description>
    </class>
    <class name="test_plugins/TestDisplay"
           type="test_plugins::TestDisplay"
           base_class_type="rviz::Display">
        <description>
            ...
        </description>
    </class>
</library>