public JointData(AssemblyJoint joint, String name) {// set all the default values Name = name; jointOfType = joint; try { ReferenceKeyManager refKeyMgr = StandardAddInServer.m_inventorApplication.ActiveDocument.ReferenceKeyManager; byte[] refKey = new byte[0]; joint.GetReferenceKey(ref refKey, 0); RefKey = refKeyMgr.KeyToString(refKey); } catch (Exception e) { MessageBox.Show(e.ToString()); } Driver = DriveTypes.NoDriver; Wheel = WheelType.NotAWheel; Friction = FrictionLevel.None; Diameter = InternalDiameter.PointFive; Pressure = Pressure.psi60; Stages = Stages.SingleStageElevator; PWMport = 1; PWMport2 = 1; CANport = 1; CANport2 = 1; DriveWheel = false; PWM = true; InputGear = 1; OutputGear = 1; SolenoidPortA = 1; SolenoidPortB = 1; RelayPort = 1; HasBrake = false; BrakePortA = 1; BrakePortB = 1; if (joint.Definition.JointType == AssemblyJointTypeEnum.kCylindricalJointType || joint.Definition.JointType == AssemblyJointTypeEnum.kSlideJointType) {// if the assembly joint is linear Rotating = false; } else {// set the combo box choices to rotating Rotating = true; } HasLimits = false; JointFrictionLevel = 0; HasJointFriction = false; }
public void SetFrictionLevel(FrictionLevel level) { switch (level) { case FrictionLevel.HIGH: forwardExtremeSlip = 1; //Speed of max static friction force. forwardExtremeValue = 10; //Force of max static friction force. forwardAsympSlip = 1.5f; //Speed of leveled off kinetic friction force. forwardAsympValue = 8; //Force of leveld off kinetic friction force. if (type == WheelType.OMNI) //Set to relatively low friction, as omni wheels can move sidways. { sideExtremeSlip = 1; //Same as above, but orthogonal to the movement of the wheel. sideExtremeValue = .01f; sideAsympSlip = 1.5f; sideAsympValue = .005f; } else { sideExtremeSlip = 1; sideExtremeValue = 10; sideAsympSlip = 1.5f; sideAsympValue = 8; } break; case FrictionLevel.MEDIUM: forwardExtremeSlip = 1f; forwardExtremeValue = 7; forwardAsympSlip = 1.5f; forwardAsympValue = 5; if (type == WheelType.OMNI) { sideExtremeSlip = 1; sideExtremeValue = .01f; sideAsympSlip = 1.5f; sideAsympValue = .005f; } else { sideExtremeSlip = 1; sideExtremeValue = 7; sideAsympSlip = 1.5f; sideAsympValue = 5; } break; case FrictionLevel.LOW: forwardExtremeSlip = 1; forwardExtremeValue = 5; forwardAsympSlip = 1.5f; forwardAsympValue = 3; if (type == WheelType.OMNI) { sideExtremeSlip = 1; sideExtremeValue = .01f; sideAsympSlip = 1.5f; sideAsympValue = .005f; } else { sideExtremeSlip = 1; sideExtremeValue = 5; sideAsympSlip = 1.5f; sideAsympValue = 3; } break; } }