Gazebo | Ignition | Community
Ask Your Question

pDotGetName's profile - activity

2017-07-17 15:44:23 -0500 received badge  Famous Question (source)
2017-07-17 15:44:23 -0500 received badge  Notable Question (source)
2016-10-16 20:36:02 -0500 received badge  Popular Question (source)
2016-10-14 11:49:56 -0500 received badge  Organizer (source)
2016-10-14 11:02:17 -0500 received badge  Editor (source)
2016-10-14 11:01:19 -0500 asked a question Basic GUIPlugin causes Gazebo Client to segfault when exiting, why?


I implemented a GUIPlugin based on this tutorial:

I added some buttons and implemented the callback functions and it did what it was supposed to do, but whenever I close the client, I encounter a segmentation fault. (It's not the server, but the client.) I tried tracking down the cause for this and basically ended up removing every line of actual code and the segmentation fault still appears.

This is my GUIPlugin:


#include "PROJECT_NAME/ScenarioPlugin.h"

using namespace gazebo;

// Register this plugin with the simulator

// Constructor
ScenarioPlugin::ScenarioPlugin() {}

// Destructor
ScenarioPlugin::~ScenarioPlugin() {}


#include <gazebo/common/Plugin.hh>
#include <gazebo/gui/GuiPlugin.hh>
#ifndef Q_MOC_RUN  // See:
# include <gazebo/transport/transport.hh>
# include <gazebo/gui/gui.hh>

namespace gazebo
class GAZEBO_VISIBLE ScenarioPlugin : public GUIPlugin

  /// \brief Constructor
  /// \brief Destructor
  virtual ~ScenarioPlugin();
} // namespace gazebo

This is the corresponding passage in the CMakeLists.txt:

QT4_WRAP_CPP(headers_MOC include/${PROJECT_NAME}/ScenarioPlugin.h)
add_library(ScenarioPlugin SHARED ${headers_MOC} src/ScenarioPlugin.cpp)
target_link_libraries(ScenarioPlugin ${GAZEBO_LIBRARIES} ${QT_LIBRARIES} ${PROTOBUF_LIBRARIES})

and here how the plugin is used in the .world file:

<world name='default'>
      <plugin name='scenario_plugin' filename=''/>

The client starts normally and then shows a black frame at the top right corner of the word view. If the client is then closed, it segfaults. What causes this error? What do I have to do to close the plugin gracefully? GDB gives me the following backtrace:

#0  0x0000000000000020 in ?? ()
#1  0x00007ffff7735abe in ?? () from /usr/lib/x86_64-linux-gnu/
#2  0x00007ffff7752dbc in gazebo::gui::RenderWidget::~RenderWidget() () from /usr/lib/x86_64-linux-gnu/
#3  0x00007ffff7752e69 in gazebo::gui::RenderWidget::~RenderWidget() () from /usr/lib/x86_64-linux-gnu/
#4  0x00007ffff7781fc4 in gazebo::gui::MainWindow::closeEvent(QCloseEvent*) () from /usr/lib/x86_64-linux-gnu/
#5  0x00007ffff3cd8116 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/
#6  0x00007ffff4092a33 in QMainWindow::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/
#7  0x00007ffff3c88e2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/
#8  0x00007ffff3c8f4a0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/
#9  0x00007ffff73354dd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/
#10 0x00007ffff3cd4989 in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () from /usr/lib/x86_64-linux-gnu/
#11 0x00007ffff3cf30b2 in QApplication::x11ClientMessage(QWidget*, _XEvent*, bool) () from /usr/lib/x86_64-linux-gnu/
#12 0x00007ffff3d02892 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/
#13 0x00007ffff3d2ab32 in ?? () from /usr/lib/x86_64-linux-gnu/
#14 0x00007ffff1bebe04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/
#15 0x00007ffff1bec048 in ?? () from /lib/x86_64-linux-gnu/
#16 0x00007ffff1bec0ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/
#17 0x00007ffff73627a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/
#18 0x00007ffff3d2abe6 in ?? () from /usr/lib/x86_64-linux-gnu/
#19 0x00007ffff73340af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/ ...
2016-07-31 18:48:21 -0500 received badge  Famous Question (source)
2016-06-28 15:39:01 -0500 received badge  Student (source)
2016-06-27 06:36:21 -0500 commented answer How to add a color/material to a STL mesh in an URDF file?

Isn't this edit's material for the ROS visualization? I currently have something like this: <visual> ... <material name="Orange"/> </visual> ... <gazebo reference="link"> <material>Gazebo/Orange</material> </gazebo> In RVIZ the color is shown correctly, but in Gazebo it remains white. Could the STL file be somehow broken?

2016-06-27 03:16:01 -0500 commented answer How to add a color/material to a STL mesh in an URDF file?

Well, that's basically how I do it. But the model doesn't change color even when I switch from Gazebo/White to Gazebo/Orange.

2016-06-27 03:12:24 -0500 received badge  Notable Question (source)
2016-06-25 10:13:58 -0500 received badge  Popular Question (source)
2016-06-23 09:02:46 -0500 asked a question How to add a color/material to a STL mesh in an URDF file?

I use STL meshes and urdf files and I can't seem to set the material colors in the urdf file. I tried adding material like this (similar to what I would do in an SDF file):

 <gazebo reference="link_name">


 <gazebo reference="link_name">

But it wouldn't work.

So: How can I set material/colours for STL files in an urdf file?