| 332 | } |
| 333 | |
| 334 | void RobotControlExample::initPhysics() |
| 335 | { |
| 336 | ///for this testing we use Z-axis up |
| 337 | int upAxis = 2; |
| 338 | m_guiHelper->setUpAxis(upAxis); |
| 339 | |
| 340 | /* createEmptyDynamicsWorld(); |
| 341 | //todo: create a special debug drawer that will cache the lines, so we can send the debug info over the wire |
| 342 | m_guiHelper->createPhysicsDebugDrawer(m_dynamicsWorld); |
| 343 | btVector3 grav(0,0,0); |
| 344 | grav[upAxis] = 0;//-9.8; |
| 345 | this->m_dynamicsWorld->setGravity(grav); |
| 346 | */ |
| 347 | m_physicsServer.connectSharedMemory( m_guiHelper); |
| 348 | |
| 349 | if (m_guiHelper && m_guiHelper->getParameterInterface()) |
| 350 | { |
| 351 | bool isTrigger = false; |
| 352 | |
| 353 | createButton("Load URDF",CMD_LOAD_URDF, isTrigger); |
| 354 | createButton("Step Sim",CMD_STEP_FORWARD_SIMULATION, isTrigger); |
| 355 | createButton("Send Bullet Stream",CMD_SEND_BULLET_DATA_STREAM, isTrigger); |
| 356 | createButton("Get State",CMD_REQUEST_ACTUAL_STATE, isTrigger); |
| 357 | createButton("Send Desired State",CMD_SEND_DESIRED_STATE, isTrigger); |
| 358 | createButton("Create Box Collider",CMD_CREATE_BOX_COLLISION_SHAPE,isTrigger); |
| 359 | createButton("Set Physics Params",CMD_SEND_PHYSICS_SIMULATION_PARAMETERS,isTrigger); |
| 360 | createButton("Init Pose",CMD_INIT_POSE,isTrigger); |
| 361 | } else |
| 362 | { |
| 363 | /* |
| 364 | m_userCommandRequests.push_back(CMD_LOAD_URDF); |
| 365 | m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE); |
| 366 | m_userCommandRequests.push_back(CMD_SEND_DESIRED_STATE); |
| 367 | m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE); |
| 368 | //m_userCommandRequests.push_back(CMD_SET_JOINT_FEEDBACK); |
| 369 | m_userCommandRequests.push_back(CMD_CREATE_BOX_COLLISION_SHAPE); |
| 370 | //m_userCommandRequests.push_back(CMD_CREATE_RIGID_BODY); |
| 371 | m_userCommandRequests.push_back(CMD_STEP_FORWARD_SIMULATION); |
| 372 | m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE); |
| 373 | m_userCommandRequests.push_back(CMD_SHUTDOWN); |
| 374 | */ |
| 375 | } |
| 376 | |
| 377 | if (!m_physicsClient.connect()) |
| 378 | { |
| 379 | b3Warning("Cannot eonnect to physics client"); |
| 380 | } |
| 381 | |
| 382 | } |
| 383 | |
| 384 | |
| 385 | bool RobotControlExample::wantsTermination() |
no test coverage detected