Skip to content

Commit

Permalink
make sure pre-existing models are not mistaken to be insertions
Browse files Browse the repository at this point in the history
  • Loading branch information
chapulina committed Jun 2, 2017
1 parent 63cd51d commit fabd662
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gazebo/physics/World.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ void World::SetState(const WorldState &_state)
{
boost::mutex::scoped_lock lock(this->dataPtr->factoryDeleteMutex);

// FIXME: We need to publish a light facotry message to update the client,
// FIXME: We need to publish a light factory message to update the client,
// see issue #2288
// LightPtr light = this->LoadLight(elem, this->dataPtr->rootElement);
// light->Init();
Expand Down Expand Up @@ -2551,8 +2551,16 @@ void World::LogWorker()
// moving link may never be captured if only diff state is recorded.
boost::mutex::scoped_lock bLock(this->dataPtr->logBufferMutex);

auto insertions = diffState.Insertions();
this->dataPtr->prevStates[currState].SetInsertions(insertions);
static bool firstUpdate = true;
if (!firstUpdate)
{
// The first update thinks there are entities being inserted,
// but they're already present in the first world dump
auto insertions = diffState.Insertions();
this->dataPtr->prevStates[currState].SetInsertions(insertions);
}
else
firstUpdate = false;
auto deletions = diffState.Deletions();
this->dataPtr->prevStates[currState].SetDeletions(deletions);

Expand Down

0 comments on commit fabd662

Please sign in to comment.