diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp index c4cb3fa9ed3f138aff2f31b48bf6f4424a38dd73..8302203bae8ad3e669c3933fa99fe60e13ec61b4 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.cpp @@ -27,37 +27,6 @@ BulletOpenGLViewer::BulletOpenGLViewer(DynamicsWorldPtr world) setCameraUp(up); clientResetScene(); - - // register callback - m_dynamicsWorld->setInternalTickCallback(motorPreTickCallback,this,true); -} - -void BulletOpenGLViewer::updateRobotConstraints() -{ - // does not work as expected.... - std::vector<DynamicsRobotPtr> robots = bulletEngine->getRobots(); - for (size_t i=0;i<robots.size();i++) - { - robots[i]->ensureKinematicConstraints(); - } -} - -void BulletOpenGLViewer::motorPreTickCallback (btDynamicsWorld *world, btScalar timeStep) -{ - BulletOpenGLViewer* glViewer = (BulletOpenGLViewer*)world->getWorldUserInfo(); - - glViewer->updateMotors(timeStep); - -} - -void BulletOpenGLViewer::updateMotors(float dt) -{ - std::vector<DynamicsRobotPtr> robots = bulletEngine->getRobots(); - for (size_t i=0;i<robots.size();i++) - { - robots[i]->actuateJoints(dt); - robots[i]->updateSensors(); - } } void BulletOpenGLViewer::clientMoveAndDisplay() diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.h b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.h index f720ecad7495f837e65bdd9a62d01775137284aa..89e37076ef6ce2f4bca58b8d23f43471b536e2b7 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.h +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletOpenGLViewer.h @@ -64,12 +64,6 @@ public: virtual void enableContraintsDebugDrawing(); protected: - static void motorPreTickCallback (btDynamicsWorld *world, btScalar timeStep); - - /*! - Move all joints which are actuated by motors. - */ - void updateMotors(float dt); /*static DemoApplication* Create() { diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp index c074cd22a7d3d9189754ecce9b4968a27258c220..fba48342c213f3f1185ef6d88bc2055e9f109c61 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp @@ -954,12 +954,6 @@ void BulletRobot::actuateJoints(btScalar dt) continue; } - if (it->second.node->getName() == "LeftLeg_Joint3") - { - std::cout << "Mode: " << (int) actuation.mode << " : " << posTarget << " " << posActual << std::endl; - controller.debug(); - } - if (actuation.modes.position && actuation.modes.velocity) { hinge->enableAngularMotor(true, diff --git a/SimDynamics/examples/BulletDebugViewer/BulletDebugViewerGlut.cpp b/SimDynamics/examples/BulletDebugViewer/BulletDebugViewerGlut.cpp index 6fe778bc4ab6d6e05b3e5c5f043b56c9afb70b6a..febf13c2f199b8145ab0b04dd153389232cd6b47 100644 --- a/SimDynamics/examples/BulletDebugViewer/BulletDebugViewerGlut.cpp +++ b/SimDynamics/examples/BulletDebugViewer/BulletDebugViewerGlut.cpp @@ -178,10 +178,12 @@ int main(int argc,char* argv[]) { Eigen::Matrix4f gp = Eigen::Matrix4f::Identity(); //gp(2,3) = 35.0f; - gp(2,3) = 800.0f; - robot->setGlobalPose(gp); + //gp(2,3) = 800.0f; + //robot->setGlobalPose(gp); DynamicsRobotPtr dynRob = world->CreateDynamicsRobot(robot); - dynRob->disableActuation(); + ActuationMode mode; + mode.modes.position = 1; + dynRob->enableActuation(mode); world->addRobot(dynRob); } BulletOpenGLViewer viewer(world);