diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp index 00c18c8b3c323c22a4cedd8028b285e75457a5fe..1c0a4e2a2a0329568be8fc33f57cb5f4f3f43f07 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.cpp @@ -33,9 +33,9 @@ namespace SimDynamics { BulletRobot::BulletRobot(VirtualRobot::RobotPtr rob, bool enableJointMotors) : DynamicsRobot(rob) + // should be enough for up to 10ms/step + , bulletMaxMotorImulse(5) { - bulletMaxMotorImulse = 800.0f; - buildBulletModels(enableJointMotors); // activate force torque sensors @@ -1374,4 +1374,14 @@ Eigen::VectorXf BulletRobot::getJointForceTorqueGlobal(const BulletRobot::LinkIn return result; } +void BulletRobot::setMaximumMotorImpulse(double maxImpulse) +{ + bulletMaxMotorImulse = maxImpulse; +} + +double BulletRobot::getMaximumMotorImpulse() const +{ + return static_cast<double>(bulletMaxMotorImulse); +} + } // namespace VirtualRobot diff --git a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.h b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.h index bb20b3493124dedddd39e6c8bd529d338c4fd33d..43be94cf91ac4d7c113fe5b90a6844c14491d7f1 100644 --- a/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.h +++ b/SimDynamics/DynamicsEngine/BulletEngine/BulletRobot.h @@ -183,6 +183,17 @@ public: */ std::vector<LinkInfo> getLinks(BulletObjectPtr node); + /*! + * Sets the maxium motor impulse. Since this value + * is used as limit *per simulation step* it depends heavily + * on the duration of the simulation step. + */ + void setMaximumMotorImpulse(double maxImpulse); + + /*! + * Returns the currently used maxium motor impulse. + */ + double getMaximumMotorImpulse() const; protected: void buildBulletModels(bool enableJointMotors);