From a5e74c9fd8ae3f1ec3049d5710c8163cc3123a73 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Wed, 13 Jul 2022 17:10:49 -0700 Subject: [PATCH] Finale: Source hard-tocks Signed-off-by: methylDragon --- Changelog.md | 6 +-- dartsim/src/CustomHeightmapShape.cc | 4 +- dartsim/src/SimulationFeatures.cc | 74 ++++++++++++++--------------- dartsim/src/SimulationFeatures.hh | 8 ++-- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Changelog.md b/Changelog.md index 52461ab0d..a2154cae1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,7 +9,7 @@ ### Gazebo Physics 5.1.0 (2021-11-12) -1. Remove unused ign_auto_headers.hh.in +1. Remove unused gz_auto_headers.hh.in * [Pull request #305](https://github.com/gazebosim/gz-physics/pull/305) 1. Added DART feature for setting joint limits dynamically. @@ -69,7 +69,7 @@ ### Gazebo Physics 4.3.0 (2021-11-11) -1. Remove unused ign_auto_headers.hh.in +1. Remove unused gz_auto_headers.hh.in * [Pull request #305](https://github.com/gazebosim/gz-physics/pull/305) 1. Added DART feature for setting joint limits dynamically. @@ -323,7 +323,7 @@ ### Gazebo Physics 2.5.0 (2021-11-09) -1. Remove unused ign_auto_headers.hh.in +1. Remove unused gz_auto_headers.hh.in * [Pull request #305](https://github.com/gazebosim/gz-physics/pull/305) 1. Added DART feature for setting joint limits dynamically. diff --git a/dartsim/src/CustomHeightmapShape.cc b/dartsim/src/CustomHeightmapShape.cc index 630221aaf..0ae3e370a 100644 --- a/dartsim/src/CustomHeightmapShape.cc +++ b/dartsim/src/CustomHeightmapShape.cc @@ -47,10 +47,10 @@ CustomHeightmapShape::CustomHeightmapShape( else scale.Z(fabs(_size(2)) / heightmapSizeZ); - auto sizeIgn = gz::math::eigen3::convert(_size); + auto sizeGz = gz::math::eigen3::convert(_size); std::vector heightsFloat; - _input.FillHeightMap(_subSampling, vertSize, sizeIgn, scale, flipY, + _input.FillHeightMap(_subSampling, vertSize, sizeGz, scale, flipY, heightsFloat); this->setHeightField(vertSize, vertSize, heightsFloat); diff --git a/dartsim/src/SimulationFeatures.cc b/dartsim/src/SimulationFeatures.cc index 8bf336d8a..ebe0360c7 100644 --- a/dartsim/src/SimulationFeatures.cc +++ b/dartsim/src/SimulationFeatures.cc @@ -172,7 +172,7 @@ void SimulationFeatures::AddContactPropertiesCallback( { auto *world = this->ReferenceInterface(_worldID); - auto handler = std::make_shared(); + auto handler = std::make_shared(); handler->surfaceParamsCallback = _callback; handler->convertContact = [this](const dart::collision::Contact& _contact) { return this->convertContact(_contact); @@ -202,7 +202,7 @@ bool SimulationFeatures::RemoveContactPropertiesCallback( } } -dart::constraint::ContactSurfaceParams IgnContactSurfaceHandler::createParams( +dart::constraint::ContactSurfaceParams GzContactSurfaceHandler::createParams( const dart::collision::Contact& _contact, const size_t _numContactsOnCollisionObject) const { @@ -214,40 +214,40 @@ dart::constraint::ContactSurfaceParams IgnContactSurfaceHandler::createParams( typedef SetContactPropertiesCallbackFeature F; typedef FeaturePolicy3d P; - typename F::ContactSurfaceParams

pIgn; + typename F::ContactSurfaceParams

pGz; - pIgn.frictionCoeff = pDart.mFrictionCoeff; - pIgn.secondaryFrictionCoeff = pDart.mSecondaryFrictionCoeff; - pIgn.slipCompliance = pDart.mSlipCompliance; - pIgn.secondarySlipCompliance = pDart.mSecondarySlipCompliance; - pIgn.restitutionCoeff = pDart.mRestitutionCoeff; - pIgn.firstFrictionalDirection = pDart.mFirstFrictionalDirection; - pIgn.contactSurfaceMotionVelocity = pDart.mContactSurfaceMotionVelocity; + pGz.frictionCoeff = pDart.mFrictionCoeff; + pGz.secondaryFrictionCoeff = pDart.mSecondaryFrictionCoeff; + pGz.slipCompliance = pDart.mSlipCompliance; + pGz.secondarySlipCompliance = pDart.mSecondarySlipCompliance; + pGz.restitutionCoeff = pDart.mRestitutionCoeff; + pGz.firstFrictionalDirection = pDart.mFirstFrictionalDirection; + pGz.contactSurfaceMotionVelocity = pDart.mContactSurfaceMotionVelocity; auto contactInternal = this->convertContact(_contact); if (contactInternal) { this->surfaceParamsCallback(contactInternal.value(), - _numContactsOnCollisionObject, pIgn); - - if (pIgn.frictionCoeff) - pDart.mFrictionCoeff = pIgn.frictionCoeff.value(); - if (pIgn.secondaryFrictionCoeff) - pDart.mSecondaryFrictionCoeff = pIgn.secondaryFrictionCoeff.value(); - if (pIgn.slipCompliance) - pDart.mSlipCompliance = pIgn.slipCompliance.value(); - if (pIgn.secondarySlipCompliance) - pDart.mSecondarySlipCompliance = pIgn.secondarySlipCompliance.value(); - if (pIgn.restitutionCoeff) - pDart.mRestitutionCoeff = pIgn.restitutionCoeff.value(); - if (pIgn.firstFrictionalDirection) - pDart.mFirstFrictionalDirection = pIgn.firstFrictionalDirection.value(); - if (pIgn.contactSurfaceMotionVelocity) + _numContactsOnCollisionObject, pGz); + + if (pGz.frictionCoeff) + pDart.mFrictionCoeff = pGz.frictionCoeff.value(); + if (pGz.secondaryFrictionCoeff) + pDart.mSecondaryFrictionCoeff = pGz.secondaryFrictionCoeff.value(); + if (pGz.slipCompliance) + pDart.mSlipCompliance = pGz.slipCompliance.value(); + if (pGz.secondarySlipCompliance) + pDart.mSecondarySlipCompliance = pGz.secondarySlipCompliance.value(); + if (pGz.restitutionCoeff) + pDart.mRestitutionCoeff = pGz.restitutionCoeff.value(); + if (pGz.firstFrictionalDirection) + pDart.mFirstFrictionalDirection = pGz.firstFrictionalDirection.value(); + if (pGz.contactSurfaceMotionVelocity) pDart.mContactSurfaceMotionVelocity = - pIgn.contactSurfaceMotionVelocity.value(); + pGz.contactSurfaceMotionVelocity.value(); static bool warnedRollingFrictionCoeff = false; - if (!warnedRollingFrictionCoeff && pIgn.rollingFrictionCoeff) + if (!warnedRollingFrictionCoeff && pGz.rollingFrictionCoeff) { gzwarn << "DART doesn't support rolling friction setting" << std::endl; warnedRollingFrictionCoeff = true; @@ -255,7 +255,7 @@ dart::constraint::ContactSurfaceParams IgnContactSurfaceHandler::createParams( static bool warnedSecondaryRollingFrictionCoeff = false; if (!warnedSecondaryRollingFrictionCoeff && - pIgn.secondaryRollingFrictionCoeff) + pGz.secondaryRollingFrictionCoeff) { gzwarn << "DART doesn't support secondary rolling friction setting" << std::endl; @@ -263,7 +263,7 @@ dart::constraint::ContactSurfaceParams IgnContactSurfaceHandler::createParams( } static bool warnedTorsionalFrictionCoeff = false; - if (!warnedTorsionalFrictionCoeff && pIgn.torsionalFrictionCoeff) + if (!warnedTorsionalFrictionCoeff && pGz.torsionalFrictionCoeff) { gzwarn << "DART doesn't support torsional friction setting" << std::endl; @@ -271,36 +271,36 @@ dart::constraint::ContactSurfaceParams IgnContactSurfaceHandler::createParams( } } - this->lastIgnParams = pIgn; + this->lastGzParams = pGz; return pDart; } dart::constraint::ContactConstraintPtr -IgnContactSurfaceHandler::createConstraint( +GzContactSurfaceHandler::createConstraint( dart::collision::Contact& _contact, const size_t _numContactsOnCollisionObject, const double _timeStep) const { - // this call sets this->lastIgnParams + // this call sets this->lastGzParams auto constraint = dart::constraint::ContactSurfaceHandler::createConstraint( _contact, _numContactsOnCollisionObject, _timeStep); typedef SetContactPropertiesCallbackFeature F; typedef FeaturePolicy3d P; - typename F::ContactSurfaceParams

& p = this->lastIgnParams; + typename F::ContactSurfaceParams

& p = this->lastGzParams; - if (this->lastIgnParams.errorReductionParameter) + if (this->lastGzParams.errorReductionParameter) constraint->setErrorReductionParameter(p.errorReductionParameter.value()); - if (this->lastIgnParams.maxErrorAllowance) + if (this->lastGzParams.maxErrorAllowance) constraint->setErrorAllowance(p.maxErrorAllowance.value()); - if (this->lastIgnParams.maxErrorReductionVelocity) + if (this->lastGzParams.maxErrorReductionVelocity) constraint->setMaxErrorReductionVelocity( p.maxErrorReductionVelocity.value()); - if (this->lastIgnParams.constraintForceMixing) + if (this->lastGzParams.constraintForceMixing) constraint->setConstraintForceMixing(p.constraintForceMixing.value()); return constraint; diff --git a/dartsim/src/SimulationFeatures.hh b/dartsim/src/SimulationFeatures.hh index 3a27f90cf..3806db25d 100644 --- a/dartsim/src/SimulationFeatures.hh +++ b/dartsim/src/SimulationFeatures.hh @@ -60,7 +60,7 @@ struct SimulationFeatureList : FeatureList< > { }; #ifdef DART_HAS_CONTACT_SURFACE -class IgnContactSurfaceHandler : public dart::constraint::ContactSurfaceHandler +class GzContactSurfaceHandler : public dart::constraint::ContactSurfaceHandler { public: dart::constraint::ContactSurfaceParams createParams( const dart::collision::Contact& _contact, @@ -81,10 +81,10 @@ class IgnContactSurfaceHandler : public dart::constraint::ContactSurfaceHandler > convertContact; public: mutable typename Feature::ContactSurfaceParams - lastIgnParams; + lastGzParams; }; -using IgnContactSurfaceHandlerPtr = std::shared_ptr; +using GzContactSurfaceHandlerPtr = std::shared_ptr; #endif class SimulationFeatures : @@ -127,7 +127,7 @@ class SimulationFeatures : const Identity &_worldID, const std::string &_callbackID) override; private: std::unordered_map< - std::string, IgnContactSurfaceHandlerPtr> contactSurfaceHandlers; + std::string, GzContactSurfaceHandlerPtr> contactSurfaceHandlers; #endif };