Skip to content

Non-deterministic result #1086

@yangyanzhe

Description

@yangyanzhe

Help needed about simulation status

Description: If I keep the inputs the same, and run the following function multiple times, I will get different results occasionally. Is it normal? From my understanding, the state of the engine is (pos, vel, acc, forces), right? Do I miss some variables containing the simulation information?

MyState forward(WorldPtr & _world, const MyState & start, const Eigen::VectorXd & torque)
{
     MyState end;

    _world->reset();
    auto biped = _world->getSkeleton("biped");
    biped->setPositions(start.qpos);
    biped->setVelocities(start.qvel);
    biped->setAccelerations(start.qacc);
    biped->setForces(torque);

    int numStep = static_cast<int>(round(1.0f / (_world->getTimeStep() * samplePerSecond)));
    for(int i = 0; i < numStep; i++)
    {
        _world->step();
    }

    end.qpos = biped->getPositions();
    end.qvel = biped->getVelocities();
    end.qacc = biped->getAccelerations();
    return end;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions