From: jungle <ag...@co...> - 2008-11-16 17:40:46
|
It's a pretty straight-forward problem. I'm using a slightly modified version of the example libgazebo factory.cc The following is the relevant part. stream << "<model:physical name='box1_model_" << i << "'>"; stream << " <xyz>" << i << " " << i << " " << 0.5 << " </xyz>"; stream << " <body:box name='box1_body'>"; stream << " <geom:box name='box1_geom'>"; stream << " <size>1 1 1</size>"; stream << " <mass>0.1</mass>"; stream << " <visual>"; stream << " <size>1 1 1</size>"; stream << " <mesh>unit_box</mesh>"; stream << " <material>Gazebo/Rocky</material>"; stream << " </visual>"; stream << " </geom:box>"; stream << " </body:box>"; stream << "</model:physical>"; printf("Creating[%d]\n",i); strcpy((char*)factoryIface->data->newModel, stream.str().c_str()); ... and later stream << "box1_model_" << i; printf("Deleting[%d]\n",i); strcpy((char*)factoryIface->data->deleteModel, stream.str().c_str()); These are the only changes to the original code. The problem is the following. The program factory executes and exits without a problem. The blocks show up in the simulation as they are created. However, they do not disappear when they are deleted. When I click on a block that should have been deleted, gazebo segfaults (understandably) with no error messages. Backtrace follows: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1210378512 (LWP 16610)] 0x48889c0d in __dynamic_cast () from /usr/lib/libstdc++.so.6 (gdb) bt #0 0x48889c0d in __dynamic_cast () from /usr/lib/libstdc++.so.6 #1 0x080ea07e in gazebo::OgreAdaptor::GetEntityAt (this=0x821e3c8, camera=0x8ce2c20, mousePos=@0xbfa8c394) at server/rendering/OgreAdaptor.cc:487 #2 0x0812b144 in gazebo::GLWindow::HandleMouseRelease (this=0x82d3190) at server/gui/GLWindow.cc:204 #3 0x0812b25e in gazebo::GLWindow::handle (this=0x82d3190, event=2) at server/gui/GLWindow.cc:407 #4 0xb7ddff4a in Fl::pushed () from /usr/lib/libfltk.so.1.1 #5 0xb7de1a03 in Fl::handle () from /usr/lib/libfltk.so.1.1 #6 0xb7e30b10 in fl_handle () from /usr/lib/libfltk.so.1.1 #7 0xb7e31b47 in fl_handle () from /usr/lib/libfltk.so.1.1 #8 0xb7e31d9b in fl_wait () from /usr/lib/libfltk.so.1.1 #9 0xb7de0827 in Fl::wait () from /usr/lib/libfltk.so.1.1 #10 0xb7de0866 in Fl::check () from /usr/lib/libfltk.so.1.1 #11 0x08128a62 in gazebo::Gui::Update (this=0x8238580) at server/gui/Gui.cc:146 #12 0x08150a21 in gazebo::Simulator::MainLoop (this=0x82111e0) at server/Simulator.cc:329 #13 0x08134eb8 in main (argc=1221596980, argv=0xb7f23558) at server/main.cc:293 Is this a bug, or am I doing something wrong? Thanks, Bill -- View this message in context: http://www.nabble.com/Factory-delete-model-segfaults-tp20527833p20527833.html Sent from the playerstage-gazebo mailing list archive at Nabble.com. |