gpt4 book ai didi

us.ihmc.robotics.screwTheory.Wrench.negate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 05:05:05 28 4
gpt4 key购买 nike

本文整理了Java中us.ihmc.robotics.screwTheory.Wrench.negate()方法的一些代码示例,展示了Wrench.negate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrench.negate()方法的具体详情如下:
包路径:us.ihmc.robotics.screwTheory.Wrench
类名称:Wrench
方法名:negate

Wrench.negate介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/IHMCStateEstimation

public void update()
  {
   for (int i = 0; i < allRigidBodies.size(); i++)
   {
     RigidBody rigidBody = allRigidBodies.get(i);
     FootSwitchInterface footSwitch = footSwitches.get(rigidBody);
     GeometricJacobian jacobian = jacobians.get(rigidBody);

     footSwitch.computeAndPackFootWrench(wrench);
     wrench.changeFrame(rigidBody.getBodyFixedFrame());
     wrench.negate();

     jacobian.compute();
     jacobian.computeJointTorques(wrench, jointTorquesMatrix);

     InverseDynamicsJoint[] joints = jacobian.getJointsInOrder();

     for (int j = 0; j < joints.length; j++)
     {
      OneDoFJoint joint = (OneDoFJoint) joints[j];
      jointTorques.get(joint).set(jointTorquesMatrix.get(j, 0));
     }
   }
  }
}

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

private void handleVirtualWrenchCommand(VirtualWrenchCommand command)
{
 virtualWrenchCommandList.addCommand(command);
 if (command.getControlledBody() == controlRootBody)
 {
   tmpExternalWrench.set(command.getVirtualWrench());
   tmpExternalWrench.negate();
   optimizationControlModule.submitExternalWrench(command.getControlledBody(), tmpExternalWrench);
 }
 optimizationControlModule.addSelection(command.getSelectionMatrix());
}

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

private void handleExternalWrenchCommand(ExternalWrenchCommand command)
{
 optimizationControlModule.submitExternalWrench(command.getRigidBody(), tmpExternalWrench);
 tmpWrench.set(command.getExternalWrench());
 tmpWrench.negate();
 VirtualWrenchCommand virtualWrenchCommand = new VirtualWrenchCommand();
 virtualWrenchCommand.set(command.getRigidBody(), tmpWrench);
 virtualWrenchCommandList.addCommand(virtualWrenchCommand);
}

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

externalWrenchSolution.get(rigidBody).negate();
virtualModelController.submitControlledBodyVirtualWrench(rigidBody, externalWrenchSolution.get(rigidBody), virtualModelControlSolution.getCentroidalMomentumSelectionMatrix());
externalWrenchSolution.get(rigidBody).negate();

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

private void handleSpatialAccelerationCommand(SpatialAccelerationCommand command)
{
 RigidBody controlledBody = command.getEndEffector();
 SpatialAccelerationVector accelerationVector = command.getSpatialAcceleration();
 accelerationVector.changeBaseFrameNoRelativeAcceleration(ReferenceFrame.getWorldFrame());
 twistCalculator.getTwistOfBody(tmpTwist, controlledBody);
 tmpWrench.setToZero(accelerationVector.getBodyFrame(), accelerationVector.getExpressedInFrame());
 conversionInertias.get(controlledBody).computeDynamicWrenchInBodyCoordinates(accelerationVector, tmpTwist, tmpWrench);
 tmpWrench.changeBodyFrameAttachedToSameBody(controlledBody.getBodyFixedFrame());
 tmpWrench.changeFrame(ReferenceFrame.getWorldFrame());
 VirtualWrenchCommand virtualWrenchCommand = new VirtualWrenchCommand();
 virtualWrenchCommand.set(controlledBody, tmpWrench, command.getSelectionMatrix());
 virtualWrenchCommandList.addCommand(virtualWrenchCommand);
 if (controlledBody == controlRootBody)
 {
   tmpExternalWrench.set(tmpWrench);
   tmpExternalWrench.negate();
   tmpExternalWrench.changeFrame(controlledBody.getBodyFixedFrame());
   optimizationControlModule.submitExternalWrench(controlledBody, tmpExternalWrench);
 }
 optimizationControlModule.addSelection(command.getSelectionMatrix());
}

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

public void control(SpatialAccelerationVector handSpatialAccelerationVector, Wrench toolWrench)
{
 if (!hasBeenInitialized)
 {
   update();
   initialize();
 }
 update();
 toolAcceleration.set(handSpatialAccelerationVector);
 toolAcceleration.changeFrameNoRelativeMotion(toolJoint.getFrameAfterJoint());
 // TODO: Take relative acceleration between uTorsoCoM and elevator in account
 toolAcceleration.changeBaseFrameNoRelativeAcceleration(elevatorFrame);
 toolAcceleration.changeBodyFrameNoRelativeAcceleration(toolJoint.getFrameAfterJoint());
 toolJoint.setDesiredAcceleration(toolAcceleration);
 inverseDynamicsCalculator.compute();
 inverseDynamicsCalculator.getJointWrench(toolJoint, toolWrench);
 toolWrench.negate();
 toolWrench.changeFrame(handFixedFrame);
 toolWrench.changeBodyFrameAttachedToSameBody(handFixedFrame);
 // Visualization
 temporaryVector.setIncludingFrame(handFixedFrame, toolWrench.getLinearPartX(), toolWrench.getLinearPartY(), toolWrench.getLinearPartZ());
 temporaryVector.changeFrame(ReferenceFrame.getWorldFrame());
 temporaryVector.scale(0.01);
 objectForceInWorld.set(temporaryVector);
}

代码示例来源:origin: us.ihmc/CommonWalkingControlModules

tmpExternalWrench.negate();
tmpExternalWrench.changeFrame(controlledBody.getBodyFixedFrame());
optimizationControlModule.submitExternalWrench(controlledBody, tmpExternalWrench);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com