plumb URDF/SDF audio_source into PhysicsServerCommandProcessor, allow to play sounds on collision !

See also https://youtu.be/eppOjTfx5Jg for a first test, and this modified URDF how to add sounds:
https://github.com/bulletphysics/bullet3/blob/master/data/plane_with_collision_audio.urdf
Add the --audio flag to enable sound in pybullet/Bullet-C-API
This commit is contained in:
Erwin Coumans
2017-05-01 11:14:09 -07:00
parent 3a330c4280
commit af6bf8ddc8
22 changed files with 389 additions and 108 deletions

View File

@@ -2,6 +2,7 @@
#include "b3RobotSimulatorClientAPI.h"
#include "Bullet3Common/b3HashMap.h"
#include "../Utils/b3HashString.h"
struct MinitaurSetupInternalData
{

View File

@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
//sim->connect(eCONNECT_UDP, "localhost", 1234);
sim->configureDebugVisualizer( COV_ENABLE_GUI, 0);
// sim->configureDebugVisualizer( COV_ENABLE_SHADOWS, 0);//COV_ENABLE_WIREFRAME
sim->setTimeOut(10);
sim->setTimeOut(12345);
//syncBodies is only needed when connecting to an existing physics server that has already some bodies
sim->syncBodies();
b3Scalar fixedTimeStep = 1./240.;
@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
//b3BodyInfo bodyInfo;
//sim->getBodyInfo(blockId,&bodyInfo);
sim->loadURDF("plane.urdf");
sim->loadURDF("plane_with_collision_audio.urdf");
b3RobotSimulatorLoadUrdfFileArgs args;
args.m_startPosition.setValue(0,0,2);