当前位置: 首页>>代码示例>>Python>>正文


Python InstanceFileHandler.gatherCoeffs方法代码示例

本文整理汇总了Python中val_description.InstanceFileHandler.InstanceFileHandler.gatherCoeffs方法的典型用法代码示例。如果您正苦于以下问题:Python InstanceFileHandler.gatherCoeffs方法的具体用法?Python InstanceFileHandler.gatherCoeffs怎么用?Python InstanceFileHandler.gatherCoeffs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在val_description.InstanceFileHandler.InstanceFileHandler的用法示例。


在下文中一共展示了InstanceFileHandler.gatherCoeffs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testSubclassFiles

# 需要导入模块: from val_description.InstanceFileHandler import InstanceFileHandler [as 别名]
# 或者: from val_description.InstanceFileHandler.InstanceFileHandler import gatherCoeffs [as 别名]
    def testSubclassFiles(self):
        sampleInstanceFile = self.testDirectory + '/test_files/sample_instance.xml'
        instanceFileHandler = InstanceFileHandler(sampleInstanceFile)

        ankleLinearCoeffs = instanceFileHandler.gatherCoeffs('/left_leg/ankle/actuator0')
        torsoLinearCoeffs = instanceFileHandler.gatherCoeffs('/trunk/left_actuator')

        assert(torsoLinearCoeffs['ForceControl_SensorFeedback'] == 0)
        assert(ankleLinearCoeffs['ForceControl_SensorFeedback'] == 1)

        assert(torsoLinearCoeffs['ForceControl_Kp'] == 1)
        assert(torsoLinearCoeffs['ForceControl_Kd'] == 2)

        assert(ankleLinearCoeffs['ForceControl_Kp'] == 3)
        assert(ankleLinearCoeffs['ForceControl_Kd'] == 4)

        assert(torsoLinearCoeffs['EffortControl_Alpha'] == 0.99)
        assert(torsoLinearCoeffs['EffortControl_AlphaDot'] == 0.9)

        assert(ankleLinearCoeffs['EffortControl_Alpha'] == 0.93)
        assert(ankleLinearCoeffs['EffortControl_AlphaDot'] == 0.45)

        assert(torsoLinearCoeffs['SpringStiffness'] == 714000.0)

        assert(ankleLinearCoeffs['SpringStiffness'] == 1.6085e6)
开发者ID:RIVeR-Lab,项目名称:ihmc-open-robotics-software,代码行数:27,代码来源:test_InstanceFileHandler.py

示例2: testGatherCoeffsHandleKeyError

# 需要导入模块: from val_description.InstanceFileHandler import InstanceFileHandler [as 别名]
# 或者: from val_description.InstanceFileHandler.InstanceFileHandler import gatherCoeffs [as 别名]
    def testGatherCoeffsHandleKeyError(self):
        sampleInstanceFile = self.testDirectory + \
            '/test_files/sample_instance.xml'
        instanceFileHandler = InstanceFileHandler(sampleInstanceFile)

    # This next line should NOT raise a key error!
        coeffs = instanceFileHandler.gatherCoeffs("/bum_leg/j1")
开发者ID:uml-robotics,项目名称:val_description,代码行数:9,代码来源:test_InstanceFileHandler.py

示例3: testGatherCoeffs

# 需要导入模块: from val_description.InstanceFileHandler import InstanceFileHandler [as 别名]
# 或者: from val_description.InstanceFileHandler.InstanceFileHandler import gatherCoeffs [as 别名]
    def testGatherCoeffs(self):
        sampleInstanceFile = self.testDirectory + \
            '/test_files/sample_instance.xml'
        instanceFileHandler = InstanceFileHandler(sampleInstanceFile)

        coeffs = instanceFileHandler.gatherCoeffs("/left_leg/j1")

        expectedCoeffs = {'TemperatureSensor_SensorLoc2': 2.0, 'TemperatureSensor_SensorLoc1': 1.0, 'JointSensors_OutputPosition': 2.0,
                          'IGainAmpsPerBit': 0.018928, 'DeltaAPSSafeLimit': 9999.0, 'TorqueControl_enablePID': 1.0,
                          'TorqueControl_FFd_fc_Hz': 25.0, 'APS1DriftSafeLimit': 9999.0, 'PositionControl_MotorTorqueDirection': 1.0,
                          'TorqueControl_Kd_fc_Hz': 50.0, 'VelocitySafeLimit': 9999.0, 'WindingResistance': 2.112, 'JointOutputAPS_MountingGain': 1.0,
                          'JointSafety_LowerLimit_Rad': -3.15, 'CommTimeoutMs': 80.0, 'PhaseACurOffset': 2048.0, 'JerkSafeLimit': 9999.0,
                          'BusVoltage_SensorGain': 0.163412, 'PositionOffset_Rad': -1.6651, 'EncMountingDir': 1.0, 'TorqueControl_TdobWindupLimit_Nm': 80.0,
                          'MotorAccFilter_fc_Hz': 50.0, 'JointOutputAPS_CountsToRad': 0.00076699038, 'PhaseCCurOffset': 2045.0, 'SpaceVector_MaxNormVoltage': 0.666,
                          'MotorWindingType': 0.0, 'TorqueControl_Tdob_fc_Hz': 50.0, 'JointSensors_OutputVelocity': 1.0, 'Renishaw_CountsToRad': 5.8516723e-09,
                          'TorqueControl_m': 1.2, 'EncoderIndexOffset': 1.16973095726, 'BusVoltage_BitOffset': 2048.0, 'SpringStiffness': 2750.0,
                          'Inductance_DAxis': 0.0009, 'MotorVelFilter_fc_Hz': 800.0, 'JointKinematicDir': -1.0, 'TorqueOffset_Nm': -9.39, 'TemperatureSensor_MaxTemp1': 125.0,
                          'TorqueControl_MotorTorqueDirection': 1.0, 'TemperatureSensor_MaxTemp2': 110.0, 'PositionControl_Kd': 1.0, 'TorqueControl_Current2MotorTorque': 0.0375,
                          'PhaseBCurOffset': 2048.0, 'TorqueControl_PD_damp': 0.95, 'EncDriftSafeLimit': 9999.0, 'DeadTimeCompensation': 0.02, 'TorqueControl_b': 70.0, 'TorqueControl_enableDOB': 0.0,
                          'SpringAPS_MountingGain': -1.0, 'PositionControl_Kd_fc_Hz': 50.0, 'Inductance_QAxis': 0.00139, 'JointVelFilter_fc_Hz': 30.0,
                          'PositionControl_Kp': 500.0, 'TorqueControl_enableFF': 1.0, 'JointGearRatio': 160.0, 'NumberOfPoles': 8.0, 'PositionControl_SensorFeedback': 4.0,
                          'PositionControl_Input_fc_Hz': 30.0, 'JointMinValue': -3.14159265359, 'FluxLinkage': 0.0444, 'TorqueControl_Kd': 0.03, 'JointTorqueLimit_Nm': 10.0,
                          'TorqueControl_Kp': 3.351, 'SpringAPS_BitOffset': 115108200.0, 'JointSensors_MotorPosition': 1.0, 'JointSafety_LimitZone_Rad': 0.07,
                          'TorqueControl_enableDynFF': 0.0, 'TorqueControl_autoKd': 0.0, 'JointSensors_OutputForce': 2.0, 'PositionControl_enableInLPF': 1.0,
                          'Commutation_Select': 2.0, 'JointMaxValue': 3.14159265359, 'CurrVelFilter_fc_Hz': 200.0, 'TorqueControl_ParallelDamping': 0.0, 'JointSafety_UpperLimit_Rad': 3.15,
                          'EncoderCPR': 544.0, 'SpaceVector_CurrentToSV': 1.0, 'CurrentSafeLimit': 13.0, 'EffortControl_Alpha': 0.0, 'EffortControl_AlphaDot': 0.5}
        import difflib
        a = '\n'.join(['%s:%s' % (key, value) for (key, value) in sorted(coeffs.items())])
        b = '\n'.join(['%s:%s' % (key, value) for (key, value) in sorted(expectedCoeffs.items())])
        for coeff in coeffs:
            assert not coeff==None
开发者ID:uml-robotics,项目名称:val_description,代码行数:33,代码来源:test_InstanceFileHandler.py


注:本文中的val_description.InstanceFileHandler.InstanceFileHandler.gatherCoeffs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。