gpt4 book ai didi

us.ihmc.yoVariables.variable.YoEnum.getOrdinal()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 17:04:40 28 4
gpt4 key购买 nike

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

YoEnum.getOrdinal介绍

[英]Retrieves #valueOrdinal.
[中]检索#valueOrdinal。

代码示例

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

private TrajectoryColorType getCurrentColorType()
{
 return TrajectoryColorType.values[currentColorType.getOrdinal()];
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

private TrajectoryGraphicType getCurrentGraphicType()
{
 return TrajectoryGraphicType.values[currentGraphicType.getOrdinal()];
}

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

@Override
  public void notifyOfVariableChange(YoVariable<?> v)
  {
   try
   {
     int currentIndex = requestControlModeComboBox.getSelectedIndex();
     int newIndex = fromEnumOrdinalToComboBoxIndexMap.get(requestHighLevelControlMode.getOrdinal());
     if (currentIndex != newIndex)
      requestControlModeComboBox.setSelectedIndex(newIndex);
   }
   catch (NullPointerException e)
   {
   }
  }
});

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

@Override
  public void actionPerformed(ActionEvent e)
  {
   int newOrdinal = fromComboBoxIndexToEnumOrdinalMap.get(requestControlModeComboBox.getSelectedIndex());
   int currentOrdinal = requestHighLevelControlMode.getOrdinal();
   if (newOrdinal != currentOrdinal)
   {
     requestHighLevelControlMode.set(newOrdinal);
   }
  }
});

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void updateListeners(final YoEnum<?> yoEnum)
  {
   T enumValue = enumValues[yoEnum.getOrdinal()];
   
   for (Joystick joystick : joysticks)
   {
     joystick.clearEventListeners();
     if(joystickEventListeners.containsKey(enumValue))
     {
      for(JoystickEventListener eventListener : joystickEventListeners.get(enumValue))
      {
        joystick.addJoystickEventListener(eventListener);
      }
     }
   }
   
   if (sliderBoardConfigurationManager != null && sliderBoardConfigurations.containsKey(enumValue))
   {
     sliderBoardConfigurations.get(enumValue).activateConfiguration(sliderBoardConfigurationManager);
   }
  }
}

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

@Override
public void notifyOfVariableChange(YoVariable<?> v)
 ValkyrieSliderBoardJointHolder selected = jointHolders.get(selectedJoint.getOrdinal());
 qDesiredSelected.set(selected.q_d.getDoubleValue());
 qdDesiredSelected.set(selected.qd_d.getDoubleValue());
 if (previousSelectedJoint.getOrdinal() != YoEnum.NULL_VALUE)
   jointHolders.get(previousSelectedJoint.getOrdinal()).jointCommand_function.set(0.0);
 if (RESET_FUNCTIONS_ON_JOINT_CHANGE || selectedJoint.getOrdinal() != secondaryJoint.getOrdinal() || previousSelectedJoint.getOrdinal() != YoEnum.NULL_VALUE)
   secondaryJoint.set(previousSelectedJoint.getOrdinal());
   double previousAmplitude = selectedFunctionGenerator.getAmplitude();
   double previousFrequency = selectedFunctionGenerator.getFrequency();
 previousSelectedJoint.set(selectedJoint.getOrdinal());

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

ValkyrieSliderBoardJointHolder selected = jointHolders.get(selectedJoint.getOrdinal());
selected.q_d.set(MathTools.clamp(qDesiredSelected.getDoubleValue(), selected.joint.getJointLimitLower(), selected.joint.getJointLimitUpper()));
selected.qd_d.set(qdDesiredSelected.getDoubleValue());
selected.tau_offset.set(tauOffsetSelected.getDoubleValue());
if (secondaryJoint.getOrdinal() != YoEnum.NULL_VALUE)
  ValkyrieSliderBoardJointHolder secondary = jointHolders.get(secondaryJoint.getOrdinal());
  if (secondaryJoint.getOrdinal() != selectedJoint.getOrdinal())
   secondary.jointCommand_function.set(secondaryFunctionGenerator.getValue());
  tauFunctionSecondary.set(secondary.jointCommand_function.getDoubleValue());

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