Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Delete a rigid object on-the-fly #5


I have updated the ODESimulator class to provide a function to delete rigid objects from the simulation.

void ODESimulator::RemoveObject(ODERigidObject* object)
  for ( size_t i=0; i<objects.size(); ++i )
    if ( object == objects[i] )
      delete object;

One also has to delete the RigidObject from the RobotWorld object by calling RobotWorld::DeleteRigidObject().

A functional deletion procedure could then look like this:

void disposeRigidObject(ODERigidObject* object)
	world_->DeleteRigidObject(object->;  // RobotWorld* world_
	simulation_->odesim.RemoveObject(object);     // WorldSimulation* simulation_

I wonder tho if this is safe to do?

  • solved #2
  • replies 2
  • views 3.8K
  • likes 0

This is fairly safe to do... if you know what you’re doing. The simulation visualization might be messed up, somewhat, and the state saving and logging routines will definitely not work properly. But if you’re just simulating forward this should work just fine.

ipa-rmb-mr accepted post #2 as the answer