|
The simulator can be configured as follows:
ArmarX.ArmarXPhysicsWorld.LongtermMemory.SnapshotName = <name of snapshot>
ArmarX.ArmarXPhysicsWorld.SceneFileName = <name of scene.xml file>
ArmarX.ArmarXPhysicsWorld.RobotFileName = <robot.xml file> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.x = <x (mm)> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.y = <y (mm)> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.z = <z (mm)> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.roll = <roll (rad)> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.pitch = <pitch (rad)> ArmarX.ArmarXPhysicsWorld.InitialRobotPose.yaw = <yaw (rad)>
ArmarX.ArmarXPhysicsWorld.LogRobot = <0/1>
ArmarX.ArmarXPhysicsWorld.FloorTexture = <floor texture file> ArmarX.ArmarXPhysicsWorld.FloorPlane = <0/1>
ArmarX.ArmarXSimulationControl.ShowBaseCoordSystem = <0/1> ArmarX.ArmarXSimulationControl.AntiAliasingRenderPasses = <0/1/...> ArmarX.ArmarXSimulationControl.ReportFrequency = <f, default: 30>
ArmarX.ArmarXPhysicsWorld.FixedTimeStepStepTimeMS = <ms of one timestep, the lower the better the simualtion (1 is a good value)> ArmarX.ArmarXPhysicsWorld.FixedTimeStepLoopNrSteps = <number of internal simulation loops per simulation step>
The basic setup of the simulated scene can be found here: How to setup the simulated environment
If you need to adjust a default scene (e.g. to customize a scenario for testing), you may want to use a SceneModifier in your scenario startup code. An exemplary configuration file is provided in the following code snippet. The object must be available in the memoryx::PriorKnowledge. See memoryx::PriorMemoryEditorPlugin for further details on how to add objects to the prior memory. Note, that the objects are not loaded to the working memory, you need to have a recognizer component doing this.
If you need more than one object, you only have to modify your SceneModifier. There you have to number consecutively (from 0 to 9) the properties of your objects like:
Attention: The "ObjectInstanceName" have always a prefix, like "_0". Don't forget to increment this prefix. If you only need one object you don't need the numbers.
The simulator is capable of showing a debug drawing layer (see armarx::DebugDrawerComponent). An exemplary usage looks like this:
DebugDrawerInterfacePrx prxDD = getTopic<DebugDrawerInterfacePrx>("DebugDrawerUpdates"); if (prxDD) { // draw in global coordinate system Eigen::Matrix4f p; p.setIdentity(); p(2,3) = 1000.0f; PosePtr gp(new Pose(p)); prxDD->setPoseDebugLayerVisu("testPose",gp); armarx::Vector3Ptr p1(new armarx::Vector3()); p1->x = 0; p1->y = 0; p1->z = 0; armarx::Vector3Ptr p2(new armarx::Vector3()); p2->x = 1000.0f; p2->y = 1000.0f; p2->z = 1000.0f; armarx::DrawColor c; c.r = 1.0f; c.g = 0; c.b = 0; c.a = 1; prxDD->setLineDebugLayerVisu("testLine", p1, p2, 2.0f, c); }
The ArmarXSimulator can be used to simulate an abstracted model of the human body as defined by the Master Motor Map framework (see http://mmm.humanoids.kit.edu/ for details). The model is located at the RobotAPI data directory. Internally the model is represented as a robot, which means it can be accessed similarily (e.g. the KinemticUnit gui can be used to control the poseture of the model).
An exemplary usage is provided in the MMMSimulation scenario which is located in the Tutorials/TutorialSimulation package.
The model can be added to the simulater in a kinematic mode, which means that no gravity or other forces act on the bodies. In this mode the model can be actuated in position control mode, e.g. via the KinemticUnitGui.
Motion files are stored in the MMM reference format, which is also used to store captured human motions in the KIT human motion database (https://motion-database.humanoids.kit.edu/).
To play back an MMM motion file, you need the MMMPlayer component which is located in the RobotComponents package and depends on the MMMCore and MMMTools packages (see http://mmm.humanoids.kit.edu/ for details). First you need to start the MMM simulation as described above. Then you can start the PlayMMMMotion scenario in the RobotCompoennts package. Finally you can control the palyback via the MMMPlayerGUI.
The documentation has been moved to ArmarX VirtualTime.