*.@ #u :MƇ/h .NoneVectorUSARBotCoreEngineKInertiaTensor GetArgValSystem DrawScale3D StaticMesh DrawScaleParent ParentAxis ParentPosSelfPos SelfAxis SelfAxis2 PackageType BrakeTorquebSuspensionLockedbSteeringLocked PackageName JointClass PartClass PartName ParentAxis2bHighDetailOnly bClientOnlyKParamsbKDoubleTickRateKAngularDampingKLinearDampingKCar KFrictionInValOutVal SendLine GetConfDataGetDataKUpdateConstraintParams ItemType ConvertParam VehiclesProcessCarInput JointPartKStartEnabledTickPostNetBeginPlayUSARCarisTypeMassSet KCOMOffset GetRangeTimer RightFWheelisName LeftFWheelInit JointParts Destroyed InterpCurve Unregister Register PackStatePoints TireSoftness TireSlipRateKVehicleUpdateParamsBegin HiddenSensorSegment GetGeoData GetGeoHead GetConfHead VectLenSq MaxRangeBotAPI KUpdateState FindPart StartFlip LeftRWheel OutputCurve toVector RightRWheelFindJointPartIdrRotJointParentrLocJointParentDrawHUDGetHead UpdateDustTireRollFrictionTireLateralFriction DrawType AmbientGlowRotatorReset getGroupData myEngine Softness LightingSuspHighLimit CollisionForce nextPoint RemoteRole LightColor SuspDampingSuspStiffness ChassisMassKRobot Movement toPVector normalAngleKarmarTurn SuspLowLimitdamp ScanInterval CrossPapers bSpecialHUD KRestitutionAttachProjectorLateralFriction bUseGroup VictRFIDTagWheelFrontAcross WheelVertCollisionRadius KMaxSpeed bNoDelete pidEngine2 pidEngine msgTimerRadiusParseRotAsVecTireLateralSlip TireRollSliprRotPartJointrLocPartJoint SlipRatePostBeginPlayMaxNetUpdateIntervalDetachProjectorKMass Position TTRadiusTrackTireClass ATRadiusATPos AuxTireClass UnrealGame uuDirectiontag_pos direction RollFrictionUpdate RearWheel MotorTorque ResolutionScanFov SetScale ItemClass DifferentialConverterClassSetFOV batteryLifeKCarWheelJointgetDetectedTag CameraMaxFov CameraMinFov CameraDefFov ItemNameVictimTypeUSARBcSpecialMaterialRFIDTag nextValue setOffsetbDebugKDHinge'WheelFrontAlongMaxBrakeTorqueCollisionHeight TorqueCurveUserFindMisPackage PreBeginPlayFOV EndState SoundRadius BeginState FindChildrenFrontTireClassHeadlightOffsetLeftBarFactoryHitSoundThreshold RightBarKUpdateParams HeadlightOn MinRange ParseVectorEnginePitchScalePhysicsDustSlipThreshbUnlit DustSlipRate DustDropPhysicsVolumeChangeBump TireMinSlip SteerSpeed SteerTorque SteerPropGapKDPart DumpPackagesnewMisPackage DumpJointsTargetMaterial GetCameragetJointAngleResetCarInput bMultiViewExpPathPush FlipTime FlipTorqueDump bHardAttachgetSegmentVelisTouchKPpvectorgetFovinFOVWeight USARRobot GetRobot HLRotationKTireXGameHeadlightItensity FindRadiusKImpactThresholdgetSegmentLocation initVictim FindTiresDrawMultiLineSSensor ServerCheckIpDrvSensors Gameplay KApplyForceNoise ExpTimer UndateState setJoint ExpTarget RightMWheelExpTargetScale LeftMWheelKiCrossMinOutgetTickclimb ClimbStairMaxOut bMountByUUVehicleStateReceivedHealth AirSpeedMaxTraceDistance SoundPitchFrameBufferBlendingOpRange bClipBSP bGradientbProjectOnAlphabProjectOnParallelBSP MaxSpeedHorizontalResolutioncontrolEngineSkinsVerticalResolution BeamAngleEncoderResolutionHorizontalFOV VerticalFOVSetInitialState RowsAtTimePlayerCalcView StructureidRFidLFNextNumTagsbRotateToDesiredbExpHARD MaxTTiresNumFellOutOfWorldSenName SensorClassUSAR ExpControlKScalebProjectOnUnlitbClipStaticMesh ProjTexture bNoRepMeshPanTilt KVehicleMaterialBlendingOp VictMinRangeGameReplicationInfoClassPlayerControllerClassNamebAutoIdHokuyoLisa ZergTireZergTalonUpperArmTalonTrackTire TalonTrack TalonTireTalonRightFingerTalonLowerArmTalonLeftFingerTalonGripperBaseTalonGripper FPMinRangeVictStatusRange USARVictimUSARStaticMeshActor GameNameUSARReplicationInfoUSARRemoteBot USARObstacleHUDTypeUSARHudUSARDeathMatchUSARConverterRFIDFOVUSARBotServerUSARBotConnection USARBcSmall MisPackage TrackTire TouchSensorTestBarTarantulaTrackTireTarantulaSmallTireTarantulaRearTrackTarantulaFrontTrack TarantulaArm Tarantula JointControl Diameter MaxTorque HingePropGap SoundSensor SonarSensor SICKLMSrSICKLMSUSARHeadlightRoverHeadlightRover RobotCameraRobotBRobotARFIDVictSensor KNActorClass RFIDSensor RFIDReleaserRangeScanner3D PGCameraTilt PGCameraPan bSingleShot PGCameraBasePERTire PERMTire SegmentRotPERMBar PERCamTilt PERCamPanPERBar RangeScannerbLightChangedPB911rsPapaGooseTire PapaGoosebAbsorb SoundVolumeNumberPrecision P2DXTireTireDrawScale3DP2DXSmallTirebDrawVehicleShadowP2DX P2ATTire GetValueP2ATOdometrySensor MotorSpeed FloatStringbVehicleShadowssItemmyCameraTextureClient MisPkgSensor KurtTireRKurtTireOutdoor KurtTireLKurtStructurebAllowVehiclesKurtCameraTiltKurtCameraPanHeatKurtCameraBaseIpAddrToStringKurt3DScannerSides GetLocalIP AcceptClassKurt3DKurt2D KTwoWheelsKNBrickKNActorFactory VectorStringKNActorKDTrackStr_LengthFromUUKDCarWheelJoint RangeSensor IRScanner IRSensor IRCameraStr_SpeedFromUU INUSensorHumanMotionSensor safeDistancestereoSpacingsensorEncoderSensor Effecter CameraTiltMode CameraPanScaleYScaleXbPathColliding CameraBaseBcTire BcSmallTire USARTire AtrvTireStr_AngleFromUUStr_AngleFromDeg MaterialMeshStr_SpinSpeedFromUUPathCountStr_RotatorFromUUWheelRearAlongWheelRearAcrossStr_LengthVectorFromUUMaxSteerAngleStr_VelocityVectorFromUU TorqueSplitItem LengthFromUUbHiddenStopThreshold LengthToUUTireHandbrakeFrictionTireHandbrakeSlip bNetNotify SpeedFromUU SpeedToUUTextureVelocityVectorToUU AngleFromUU AngleToUUVelocityVectorFromUU AngleFromDeg AngleToDegSpinSpeedFromUUDied TireMassHandbrakeThresh PlayerTickRearTireClassbBlockPlayersGearATRVJr KCarStateTouch XInterfacebStasisSetName FovAnglebAlwaysRelevantSpinSpeedToUU AddRemoteBotRemoteBotClassBotServerClass monitoringObjectProcessActionRotatorFromUUbCollideWorld RotatorToUUTireRestitution InitRecievedViewTestPlayerControllerLengthVectorFromUUFlipper MaxAngleARM StereoP2ATRunningLengthVectorToUUChassisLinVelChassisAngVel WheelHeightFrontWheelAng WheelVertVelServerSteering ServerTorque ServerBrakeServerHandbrakeOn bNewState ChassisState CarState bNewCarState ChassisYSteerY ChassisZcalcPosWheelYlPos chassisPos WheelLinVelwPosRelrelQWheelQwPos ChassisX oldLinVel WheelState worldForward worldRightPushertanasFactorBulldogMeshes S_Chassis S_RearWheel HeadlightChassisQuaternionDust EnginePitch KParams0TurnLaserChassisPositiontireOutputHandbrakeOn OutputTorquesNamelidxridxNextNetUpdateTime IsDriving bIsInvertedBotConnectionBotDeathMatch BotServer RemoteBot ForwardVeltheBotWheelSpinSpeed clientNamestartRotationcmdType TireAdhesionSuspRef rearRightvec rearLeft frontRight frontLeftRotXRotYRotZ myConnectionbotDR BulldogTire OutputBrake BulldogDustForwardbInit OutStringPName bChanged TmpString ScreenPosHudBDeathMatchFinalRotationres increasecamlistRobotsxPlayer xIntroPawnSimple fbBombFocusJuggMaleAHeadAZoomFX PlayerSkinsScreenNoisePan XGameShaders TeamStringInterfaceContentbReadyPVCameraTextureClientIpAddr InternetLink torqueScaleworldUp torqueAxisTestParamssTag FlipTimeLeftdiffFlipSetType ChildrenSteer UnrealPawnTagsbotnameOwnerLine bDeleteMeSizeYSizeX bTearOff Instigator QuaternionLinVelAngVel eKillZTypeDelta NewLocation NewRotationlocRBstateoffsetOtherTorque DeltaTime HitNormal NewVolume KillType HitLocation LoudnessVictimsYLXL S_LookTarget Distancestr RangeDataStatus DurationValue LastTimeIP StartTime ProjectedMIndexTeamNum PawnClassKiller ViewTarget LastLocationbDuck S_KVehFactVel TimeSecondsNetModeGametmpKCurrentAngleKDesiredAngle KMaxTorqueKDesiredAngVel KHingeType KBraking KMotorTorque KSteerAngleKPos2KPos1KConstraintActor2KConstraintActor1bReceiveStateNew ReceiveStatecltIP cltRobot cltCameragInfourBot converter RFIDTags VictRFIDTags SpinSpeedbTireOnGround LeftThrottleRightThrottle Adhesion CameraZoom PanSpeed TiltSpeed WheelJoint PushSoundbPushSoundPlayingdegCameraDefFovdegCameraMinFovdegCameraMaxFov bPushablebNoTeamBeaconOldZCameraLocationStartLocationCameraRotation Steering SensorListProcessedSensors ThrottlemyLifeDriver bInitExptExp bAutoDriveexpXexpYePathOldPosIdbSpeedControlbAbsoluteCameramyStateSetViewTargetKd DrawIconSetPospidErrpidIntpidDerlastErrpidErr2pidInt2pidDer2 lastErr2 GraphData WrapTextbDisplayTeamBeaconcClass FontScaleY FontScaleX ViewActor desiredPV currentPVCOutSpeedgeoType confTypeJid RollSlipdvavactVel LateralSlipMinSlip Restitution KPriAxis1 KSecAxis1 KPriAxis2 KSecAxis2KMaxSteerTorqueKMaxSteerSpeedbKSteeringLockedKSuspLowLimitKSuspHighLimitKSuspStiffness KSuspDampingKRBVecKRigidBodyState LocationNamebDestroyOnSimError SetPositionDynamicProjector PlayerName PartsNamePartsId Packages SetDrawScalelastCommandId startAngJointsControlSetDrawScale3DRS_ChassisPositionRS_ChassisQuaternionRS_ChassisLinVelRS_ChassisAngVel RS_PartsPos RS_PartsQuatRS_PartsLinVelRS_PartsAngVelRS_JointsSteerRS_JointsOrderRS_JointsValueRS_JointsCommandId RS_UpdateIdCacheUpdateIdbNewRobotState bNewCommand bNeedUpdateParentsJoints bHideHUDSetRelativeRotationGetSoundDuration KIsAwake uuMotorSpeedPayloadKWakeKSetImpactThreshold Effecters EffecterList myHeadLight bHeadlightOnCameras myCamera CurrentPart bRobotBuilt KSetMass UsarGameKRBVecFromVectorKRBVecToVectorKGetRigidBodyStatePartKGetRBQuaternionSetBoneRotationmPkg SetBoneScaleGetBoneCoordstheTypetheNameWorldToScreenKProportionalGapmpNameJointHingeJOrderjname DrawColormyNameClearupwarddifidx pForwardpRightpUpward jForwardjRightjUpwardm00m01m02m10m11m12m20m21m22kH TexPropCubeWheelJcurQaxis11axis12axis21axis22 newAxis11difCosdifSigncurAngJIdxTopspinAngdifAngslowAngcachedLeftValuecachedRightValuecachedCameraRotinitCameraRotbGetInitCameraRot LeftValue RightValueStephalfXBaseuuStereoSpacing halfSizeXstereoRotatedlastAng steerAngTransXTransZbarLenbThetaaThetatLen1tLen2bAdjustexpQSides leftBarX rightBarX leftBarYdiffAngWidthhalfYTireDrawScaleTextposSegName InitRotation PitchRateYawRate RollRatebStopcurRot HelpSound Segments AnimTimerSoundTSoundDTAnimTSegRotSegPosSegVel NewStateAngle ScriptTextPartsexpTime expIntroutTimeexpX1expY1expX2expY2vTargetrTargetA TextCopyltpxTopxLeftBPERBar2PERBar1oldDuckrRobotmyRobot lastRobotmyIPrIP rCameraName rRobotNamerCamerarCamLoc myCamLocrCamRot myCamRotrCamFov myCamFov dummyLinkCmyCameraRotationmyCameraRotationOrder myCameraZoom Normalized bNewThrottleJointControlIdxJSteerJOrderJValuemyTurn myDistanceGeoName ConfNameOpCode RangeScan IRCameraScanSetOrientation SetEncoder MPRotationMPTranslationMPOrderbGripXjiAuxTireYTTirestZ TTiresNumlastKMotorTorquelastKMaxSpeed lastKBrakingATRatioTTRatio RS_TiresPosRS_TiresLinVellast_RS_UpdateId sinValue cosValueWOriginKJointGkcKState KRepState StateCountLastStateCountR ItemMount myPosition myDirection PlatformiNameXPlaneargsvehmountYPlaneZPlaneWPlane Location Rotation Velocity ReturnValuetagList MinAngle LeftFinger RightFingerV RandRangerobotAsinAcosBoxbWithTimeStampOrthoRotationLenrBotLeft uuResolution tickDatamyTickaxis1axis2 lastBaseAng curBaseAng totalAngmyAngbaseAngparBaseRight newAxis1 newAxis2 lastAxisInterpCurveEvalang uuMaxRange uuMaxSpeedSegLoc CosAngleProb QuatProduct compassDatainiRot uuMinRangelocTmpmtrlHorResolutionVerResolution QuatInvertuuFovuuHorResolutionuuVerResolution rowCountbScanQuatRotateVectorbYawbPitch uuScanFovQuatFindBetween rHeading rTurnAngle vForwardvRightvUpward vForward2vRight2 vUpward2TimeQuatFromAxisAndAngleDynamicLoadObjectScalebScannerStarted uuVerFOV uuHorFOV uuVerStep uuHorStepMatrix uuBeamAngle rangeTmpyawOSpitchOS nrCirclestracesPerCircledegreesPerCirclerotWOS mySubType mySubNamesTypeuType RadianToUUCoords LeftTire RightTirelTirerTire odometryData old_left old_rightold_pos base_width wheel_radius pLenUnitlenUnitltDisrtDis bGetRadius last_radiusKHingekrmaxOffminOffmyOff KConstraintlVecrVeclDisrDisuuMaxRangeSquare detectedTagsKarmaParamsRBFull KarmaParamsKActoraTag robot_posVXVYVZ robot_rotPXPYPZPWLight LevelInfo GameInfouuVictMinRangeSquareuuFPMinRangeSquareuuVictStatusRangeSquare DecorationHUD CameraFovzoomPlayerReplicationInfo tmpLoudness tmpDuration TouchRange ScanStepPointsPerCircleGameReplicationInfo uuRadius nCircles CircleStep ControllerBumper startVecPlayerControllermyActor DamageTypePhysicsVolumeoffXoffYVolumeCanvasx0y0mxmyFont C_MeterToUU C_UUToMeterC_RadianToDegreeC_DegreeToRadianC_RadianToURotC_URotToRadianLevel TexPanner PrecisionIntPart FloatPart IntString FinalBlend Modifieruu SkeletalMeshPawnVehicledegActorHeightStyle ClassNameYawRollPitchSoundRoleClassradPackageConstRot TextBufferEnum FunctionStateQuatPlaneColorStructNameEditor USAR_RobotsPERBody PERCameraPanLMS200PERCameraTiltCameraPanFrameCameraTiltFrameCorky TestBody TestBar1 StrPropertyStructPropertyArrayPropertyClassProperty NamePropertyObjectPropertyFloatProperty BoolProperty Kurt_MeshesKurtOutdoorWithStuffTires SimpleTireR SimpleTireL 3DScanner OutdoorTire2LaptopStructure IUB_meshes robot_testchassischassis_final camera_base1 camera_tilt1 camera_pan1 IntProperty BytePropertyFreiburgRescueUsarSimtarantulaBody2 ArmFrameSimpleChariot TalonMeshes UpperArm LowerArm GripperBaseIntro_gorgefan KarmaParams1 KarmaParams0}VB ̪KMWMj@oPa#[r@EOPD!"n?9:9:$9:9:$GB Y7du>eee3}rrr̪O^Gzeee̪O^Gze3}$wawawawawawawawawawawawawawawawawawawawawawawawawawawawawawa$/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g/=g̪̪̪̪ F F F F F F F̪3}%pW%pW̪̪̪̪̪̪̪3}̪Z_Z_Z_̪̪̪O^Gz F F F̪̪̪ F̪O^Gzeee̪̪̪O^Gz̪O^Gz̪̪eee̪O^GzeZ_Z_Z_̪O^GzZ_ F F F̪O^Gz F̪O^Gz̪O^Gz̪̪eee̪O^Gze F F F̪O^Gz FZ_Z_Z_̪O^GzZ_̪O^Gz̪O^Gz̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪r̪̪r̪r̪̪waʁ)wawawaʁ)wawaʁ)ʁ)ʁ)ʁ)ʁ)ʁ)7Kڄʁ)ʁ)ʁ)ʁ)ʁ)ʁ)ʁ)$ʁ)̪$wawawawawawawawawawawawawawa$/=g/=g/=g/=g/=g7KڅWWWWWWWWWҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽeZ_ F%pW$7Kڄʁ)ʁ)ʁ)ʁ)ʁ)7Kڡ$$$$$$$$$$WWwa67Kڮʁ)ʁ)%pW%pWʁ)ʁ) F Fʁ)ʁ)eʁ)ʁ)Z_3}3} F3}3}7K7KڅWWWWWWW7K66666663}>B>B>BǛ3}>B>B>BrrrrrrrrrrrN$L=X$zDW$zDV$`jFl$Ck$pAe$?t$l$pBm$C^$AY$!2>[$pA\$pAI$u=H$u=U$o:C$o:m$?G$Ae$Cd$@@E$L>f"d]USARBot.USARConverter[SSSx] ^0f#{FGV u9:9:$G Ferrrrrrrrk$Di_?j$<>i$e?(]Cameraiu@nB x] eB u"1jʁ)ʁ)rʁ)rʁ)3}FA$o:(]Sensor@@jTOEb OdZ6>BPk>,eHk*MWMofdjrgAw~cX]USARBot.USARHUD@]"!USARBot.ViewTestPlayerControllercT]USAR Remote Bot DemoY!MY@67Knvn$? BSx{^0m2$=}#|w ZBY%Y9:|)YY&Mw 9?%y -w 9?{9Dw `w 9?{y py 9S{v9S9D`9?, 9?Y}vYvp0vppy .v G xcK@guY冬*nv $1,=@$u#\Lf kh@A r@Lvd"GNVr`%pWqnv}Vy~"T"xXxwYZ[Ige@B^B@DG@Sh!m|@m \!Yu@/=gطʁ)BShmAA[@@L@@us@@qib @Zz@@G J@Q^ho 9D^"F G wmC e" +z7_-$(O.jL.L{O{OJOINT(ppppppRES {Time 9U} {Type O} {Name .L} % 7bv b 1O b 8LBpp{Status  b,3.m.X}   7b.$(B % 7  1O  8LBpp{Status  ,3.m.X} %.L9?%l   7.$(B % 7: : 1O : 8LBpp{Status  :,3.m.X}   7:.$(B.$({Status Failed}O.pL.g{O( % 76 : 1O)zL : 8L(( :H sI{(."$p:I(( % 7B b 1O)zL b 8L(( bH X.{(."$pbI(( % 77  1O)zL  8L(( H ={(."$pI(y{L.1$ppppGEO {Type O} {Name L}.$ppGEO {Type O}O.qL.^C {O( % 76 : 1O)zL : 8L(( :% {(."$p:J(( %| 77r   1O)zL  8L(( %  {(."$pJ(( %a 7BW  b 1O)zL b 8L(( b%   {(."$pbJ(C  {L.2$ppppCONF {Type O} {Name L}C .$ppCONF {Type O}{.H |.H %W  6rW!{ 76-W%9:76-W&6-W6 $6F6.Z69?6. | 9:6,6F6F 76-W&9:76-W,6-W6 $6F6.Z69?6. | 9:6,6F6F-$'6rW!J % 76-W9: 6-W6 $6F6.Z69?6. |9:6,6F6F  -$'Invalid Package Name.H>9:.j%{.jJOINT F-$' %/ 9:.jU .Px%6 $6F .@p6 .t6 .@v x9:6,6F6F%-稨Input <<9R.j .P9U .@p9R .t9U .@v 9S>> M\z.jJOINTU.L\%6 $z.m0z.mANGLE6$8z.m1"z.mVELOCITY6$z.m2 z.mTORQUE6$ ~.X,I 6F 9:6,69?1>9L.XF69L.X6F9?1%>9L.X &9:6,69?1">9L.X 69L.X \9:6,6F6F Gb@@lM qL|.9DL"F G oUI K ]@a (@b c @@c!L@U{%2pp{Name <} GSj@g@Y@@s P-@lB c"YAZ_B u"1jʁ)ʁ)rʁ)rʁ)(] Effecterp f @qY] @n|P U6ce,Ht- =1ofdjrgp @n/Pg `UYz__ zRB G @as @raGqOoSg9:9:$GBY6ruZ!`G<WWWWWWWWWwaWwabQ bQ bQ ee3}WW̪O^Gzeee̪O^Gze̪̪̪̪3}WW̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪WWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWWwaWWwaWwaWwaWwaWWWWWWWW̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪3}%pW%pW%pW%pWO KO K̪ee̪O^Gze̪̪ee̪O^Gze̪̪WwaWwaWwaWwaҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽWWwaҽҽҽҽWWwa3}O KO Ke%pWWW%pW%pWe3}O KO KO KO KWW3}3}>B>B>BǛ3}>B>B>Brrrrrq:_0k$I?j$<>i$ @D:(AJtdQ:?>?R$AQ$333@O$=]M$`IG$AtE$L>f"j$L>I$333?K$O$Bd]USARBot.USARConverterCfw$~$8A$x$Bl$Ck$hAe$?t$[$@\$ @I$u=H$ #=C$B`;B$m$?zZ=:AY5"$#$ A"$|H#$ A"$PCH#$@"$|H#$xS$@ER" ]  $>^0@$Ct#[~@D F@vN dB_T!q @kʁ)3}>B>B>BǛ3}>B>B>B>B>B@k] N: #< #i$ @D:AJtdR$AQ$333@O$=]M$`IG$AE$L>~YCsJr]FrontQ:HBHBZ:X:_f"B" EG$?j$L>I$333?K$O$Bd]USARBot.USARConverterCqw$(A~$8AU$33AV$8A$Ix$BZ$l$Ck$hAe$?t$[$@\$)\=I$u=H$ #=C$B`;B$m$?zZ=GAYB"$#$A"$PCG#$A"$|H#$A"$PCH#$A"$|H#$xS$@ER" ]  $1,=:??^0@$Ce#,J"z!bj)@EbRY k"F$?E$?aG~&Y#ypp{Name <}y GL@_"JTK x^JK G i| [ P ,k %n VjnNWO xnNY G cS [|hWf B ~%qOR9:9:$GB,Y6EPȠ 3}3}3}3},e3}3}3}3}>B>B>BǛ3}>B>B>BsW{P $?NU@$@@$By$BrzSt@n` OM_6H 6` RB6H 6` RB6H 6` RBH  G wLvJ-TerrrrrrL$@@K$=RZ= AY"$#$"$zD#$zD(]Rangeb#~a,@Ygb DPdokww9Do.eB G M@kV@Zu\[. u < G i W O[]tx  D W@wG@m[ u L@^o Ekc6D 9D6o "F6D 9D6o "F6D 9D6o "FD  G vX@Q ACK@d@b S@qo3r Failed Gl,qq3Qpppp6qo,6qo,6qo G M y @|  o_!} }ʺԄʁ)3}>B>B>BǛ3}>B>B>B] : #< #Q<}3|3}̪O^Gzҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽҽ̪%pW%pW%pW̪̪̪3}3}j)j)j)j)j)%pW%pW%pW%pWuD:BnB" EG$?E$=xN:@@@@_)@$ By$AwD~z c)1= GNGP@6 m%ly } |`2ff!eXS`fcP] e`e$ee<a 9?e9?eCCe@e@6e9=,6e$6e$6e9=,e29?e,,P9?e,eaNO POWER! GJ@{H cR!J-Trrʁ)rr3}rrrr_$-=`$H@(] RangeScannerY@jc X @iI{xGo@T]Sg@^@@Rti{B@UFH ) [BwH *KH pFC H pmXKFC m G}@BY NqWBW@o_@AHJK\ [C @D@jg$feXYYvZ[m @IVz/aK@b4YguY* $<\ pbp@kN zH lr]r x\rmh"Kn@JIW@^@@{"G.xC GX9?%@9:9:$+`@P] P] %76$6aP9D9?_-$ %z 79:6 %p &a/!g0.&9:6,06079:6,060`I69?%0406N?9:6&0669?%00C06N?09:6%6E9?_0DGj?9:6 &6m 9DE6BS00C'69?%6D0C$0jpZ6D0p0j6 $FSE9?6m S9?S9?S9?S9?6BS6m 9DE69?%*6B6D66B9? G0C0Da69?%*6B6DM66B9?HG0a0F69?%#6B6=69?%#6B600?066 $-稨Order_09S9UE9S6m <-->9US9U6B9U69R6 6F9?06F39:6%6 $0'-稨Tick <<9S9U09U09U09U0>>p p &a/!uh./&6 q $h$hChjhh6h\] $h$hCh6h\] Z $h$h64 69?%hHH hh\] 6 $ 9:9:$-m.-V .-nP* .L9?% w*b9D.L( b%bq W bibi  bpbp eb% eb.L 9:9:$ wY*YO -mYz> X9?%XGXX  GVz CI:4z IJKLMN--C GgR!bs/69:9:$GBII҅yW3}3}3}wawawaWwawaWwawaWwawaWwawaWwawaWwawawawawaWWWWWWWWWWW3}3}WWwaWWwaWWwaWwaWWwaWwaʁ)WwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWWwaWwaʁ)WwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWWwaWwaʁ)WwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaF$@VU:PT$@SUR$)\?p"e$D;t$Dl$Ck$HBN$>[$A{$AL$RI9  $1,={#Sr@Q@^ @@QsT^E@wRn @F"l ]PK @w,O w @EzjR@`@nr`jk oF qNC PnR@CxHO RB@\g0SOjYkFDOE~FTOw SRUWXZCP_V[ `GbGcGaefgO@hl@G"} tisIv \v{`yBMwl }zM@_@bc { J cm@XJWR{\@ Xe{osT @'[@|Q ]@G defY@@  zk5lyw AsuIj u @nkD@n@A @B Gl  K@hz@l@K @`I F@@mM UE@\O d@V @jZ@dd_@s@@KN@kB@\@E_e cf \Ih PW@p@oj r \D V@@ ^vF: [J(u!]!o3]u<Fa*Gw{H~ w[a/!n.[1[a/!0.h[L [a/!o.u[[ *) G@rq @a y!  E `@B ^'guY*  $)w>al ^\%pp{Name <} GM @s M"[@n_@Ukp,gP"@@ZJV GY hng+!mQ@^_ @d e X"f Yj q n @\"Jtb @Ys @VA _ @{ Nk Ly x@B C M@ @| @@F  I  s g^ S \ @kR g[ 0` HQ!Ar 9:9:$G@V # 7Kڛ3}3} ibK$G@j,V Y A0] ^ f]b @Cd@AF@@Ok!d lAkHn lJe!Qxq F=J-TrrL$L?FSRZ= AY"$#$"$L?#$L?|(-IRS@r @su dF@Yv @v@Tz ~e S"^M?bQ^_ G Zd!Q[B u"1jʁ)>u>h$>uZ!`(]Itemn$>] i $=gs{@OA c#OPXT ^#_#YutX @VY#L@[ NguY* $P=@@l}YoH-d ] ppppSEN {Time 9U} {Type J}f] ppSEN {Type J}]  G[#S@W#@d @k@@g @@NJ@~ {V@US#@uO#@jk pu z K#{[|XUAE E#A CF G#J F @lDN&*4PLJpppp{Name < Range  5}J G]U~ @|T @Z j@Q W P sZ  @]T Rc } ~h p"Gz] o j n o vp j {q t y@Mz @C@@I| u Aw@Fa"IhK@~ Mz p@R,,T@ym VXy_|~YQK @ } EFcc@` f] f O kmN"lopBsd f j J  O  x G `} Z \@YX@o @@F@FI&@cnusdG~cr@R@\hAXCZ[`ztegU _ @kqqU@lUguY* $L=e _@nguY*  $-0>pktQ G!Mv@w@q@F a@xŤguY*  $-0>@ysL@T ^ j NDj iCQ@KIJqi faTP gQ [D: -( s l j-(slj b a e cbaec ''a G G o H _ h [ X S R MoH_h[XSRM G R h| Wbb<9K aa aa G \#^{ H/^1HIJ au MH[IlJ #???au MH[IlJ#??6qM6q[6ql a   q9?,2  #?  #?   #  #?  #?   o$ 6q[a  q9?,2 #? #? # #? #?o$ D G@l \N%679:9:$ -S(\e-S(' G fWagj@k@v@@@vpiO\ql_ @wx0O 0@ID@]~@B@yv@E @HC \)3r\*jR5j9?\ DR-m w\*%76w\ I6w6X \ I6X T'{6SW6EW\ I6EW6UW\ k6oW%776E7\ I6E76U7\ k6o7.%)766E6\ I6E66U6\ k6o6%7B6EB\ I6EB6UB\ k6oB0!{6SW66UW9D66oW66UW9D66oW66UW9D66oW%7766U79D66o766U79D66o766U79D66o7(%q7666U69D66o666U69D66o666U69D66o6%7B66UB9D66oB66UB9D66oB66UB9D66oBx G@| ^nh 9:9:$9:9:$GB Y7TG<>WWWwaWwaWwaWwaWwaWwaWwaWwaWWWWWWWWWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWwaWWWWWWWWWWWWWWWWWWWWWwaWwaWWWWWWwaWwaWwaWwaWwaWwaWwaWwaWwaWWwaWwaWwaWwaWwaWwaWwaWwaWwa3}3}WWWWWWWWWWWWWWWW{w$4~$ C$X$sEx$HBX$zDW$zDV$`jFl$HBk$@e$?t$[$?\$?I${=H$u=U$o:C$o:B$Q9n$?o$zDa$u=`$m$@^$BzZ=-AY("$#$C"$oH#$C"$H#$e$Cd$@@N$>s"uU#h @c1@@LjnTR@S@H @fGZ@mYJo jq]^[ @@PQ#R@s]#WB Y6bqu F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i9l:$  :ff@33@ff :?:::?:7l:$  :ff@33ff :?:::?:]l:$  :33I :?:::?:B$ŧ7 j#u @`L @@gP@gR guY* $w=XG@hTC6 @$d@i@V@}@@kw B@GFscJqv|B@E@h@tIjyI55<raHgK99L'*_Fu_Huw*_ Y_76D%_D__^^__F_F_m_m_ G`bg@LuL @}h M S[&APLUpppp{Name < Range  5}U Gaq@RgM R[_a m` @{Oe@e @BpschIlm@ipqLr?txmK f ~Kb@ v @z Wr cvqD:cR!FS  $?@H@S ~ @CJymk )jyk Mwk *~ k >x u k >v g~ 9Dx u 9Dv  GG GQe@Oߢ@guY*c$'7 $ ?<2$>v#G@d@QבguY*[$A{$AL$8c$'7 $ #<2$=w#M R @CU S PSX }@@j@h y H" a b v c u q@ute @j notX ,Q,l gM Oxet7SYea G @K"L@ { 6erʁ)ʁ)rʁ)ʁ)ʁ)ʁ)t_$MavRO^Gz̪r̪̪̪̪̪r̪r̪̪̪̪̪r̪̪̪̪̪̪̪̪̪̪̪̪r̪̪̪̪̪̪̪̪̪̪̪̪r̪̪̪̪̪̪̪̪̪̪̪̪̪ce,Htce,Htce,Ht̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪̪r̪̪̪̪r̪̪̪uh$uZ!`rr3}Pk3}ڬRpM}MofdjrgS] >wejKv M}Mofdjrgkvi@b"xL~K%f `L`pppp`{Resolution  x } {Fov  v }`pppp`{Paning 9T-F} {Tilting 9T-H}` GA"@} @@M DH&u zd]pppppppppppppppppppp{Name <} {Time 9Up } {Location 9X} {Rotation 9Ya< ~ } {Resolution  x } {FOV  v } {Range d}d] GG@A WDEHB@*SBKf"L~6*Sp d~u ,~u ,Y-F6A~r-H6A~LsA 5zdd  dppd,  ~~ + G!YW@PQA  x @DtpUTkD::??w}X@j"y_YS8 xa_d G }k"[dx o z n"ii v!@M!mjkln|QCqkm @HwC@q"E_I@vXguY*c$'7 $d;_=2$>y#oVGt"FkGzG@}guY*[$A{$AL$8c$'7 $ ף<2$=z#rpBcc B < G u"bw"`AHn@MLR@Ndg! NRB G VSz"M@XKTgkq 9?T8 G WV}"\XSYZVX^M@#A#@PT>fjs 9?f5< G LC#_iVo @ |uEGlF#Uxl{9?x8 G Gd@@uEI#y@~ @z}~@A@Z!@yG@Hwtu@L#a@UO15jzJO G`@D@NR8:z<R G_@TU@X@@}@v Xo:@k}L!Ds Cc6C 9?6s 86C 9?6s 86C 9?6s 8C  G W@m}iR@aG']eguY* $;pN<]@c@7P#I@fdguY* $%=V q@V H!o@iPGV # BS $?L$l @FV O@r@kc I_6E 6c  <6E 6c  <6E 6c  <E  G KFB!H b@q-pc6  $>#D Q@@@z@wuZ@x{G@}@C@] ;@A0b 0z @D@|@z0E0@{J@KLMNHT#J@PguY* $%=P @8@[  ^ |J+(lppCONF {Type J}l GHY{oi [PzI9{'cppGEO {Type J}c G^@m ZwHB1r*\ pppppppp{Name < Location 9X  Orientation 9Ya=  Mount 9W]}(\ pppppppp{Name < Location y  Orientation na=  Mount 9W]}\  G_`.{zR`u 9?,H|9?%d9:9:$+@ ?d?d-} H H , V@9?hG GV@?GGV@?GH-p' H  hA H hA  H hHh|9?%|`|| Gr ]+HL]a#^a#?\]-y 6^L>{-y \@or*-'i&-}(>?i%-}'3 #<\o i&i%-}'-^(0i&-}(-^' #}\o -^(i-}(-^(i%-}'-^'\oi%-}'-^(-p(i%-}(-^(0\S -p' #< -}'-p'8-p(d GIU ic_6I 6U  <6I 6U  <6I 6U  <I  G @`o v s PE|9?% |z GUMj@Q@Nk jQt@Guo:?GotnQc`u99Qt99a<Q"@ywt*wtwt*wtw* G@VW @Y Up_)-8(w_*X _ >Y 5X 9DY  G\ @vyL:HL HuA Htl L uZl A nZtn9?9Dn9?'9?,@Fn?n?nn`Ztu `9?%``?Q 9D`n9?I@g9?Q RRQ g9?gg9?g9?gg9?Qg}ww*HwL HuA Htl L uZl A nZtn9?9Dn9?'9?,@Fn?n?nn`Ztu`9?%``?P 9D`n9?I@g9?P PPP Lg9?gg9?qqg9?gg9?TgOqQTOQTQqQTqTO^^OW 9DqO9?X W  GL c@@l@] @y@W @E F%L<W E W ppW {MaxAngle 9Uj }W  G@0xLq GL9?L9?>L9?L9?L Gr@vB{3g L@z{RESETQTOW %OKFailed GvK|3+)k aFailedz|OPENr9L}erj rj rJrJ6 k=$6Fk=6k=$>w*6k=./k=&9?>r9?,6k=./k=&r9?,6 a=$6Fa=6a=$Fw*6a=./a=&9?>r9?,6a=./a=&r9?,=-$'OKFailed GH@@lEJ&)7Apppp{Name < Tick 9SL}A GA@z j t: 69z t@vwy=.tw=*"zh  zg Z%"Z7=&rZ=G@66wZ=9?% zh kZ66wZ=9?% zg aZZ`Kkk= Uh taa= Ug k aError LeftFinger/RightFinger name or incorrect Robot class6ppppUse 9W6tk=/9W6ta= as Left/Right Finger; GPIM%KG PG ppG {Resolution  Y }G  GG @Pa <"<a %3a 7M a M aa  G T @E SO%@;T E T ppT {NumTags 9SF }T  Gp @Q@vF a3 yzaRELEASE F %p a @ #p -j(7M M p F &OKzaTAGSREMAINING9SF Failed GUm r ) [Bwr *o r pm @r KZXo m @Z G@lTW&^G.G_%_7GI%eI,P_G hI6P9?%6P9?%6P9?%[m _G wIk m k o [v m 99k 4v V@[{ aYXm 'ww{ *w{ _G[IP99I6P6P6P6P6P6PIII@I@r?k o I@v ^pp{Prob  r}eIHuI9?%_1{^^l^^ G^@t @[XH1r*t pppppppp{Name < Location 9X  Orientation 9Ya=  Mount 9W]}(t pppppppp{Name < Location y  Orientation na=  Mount 9W]}t  Gl@E ZI/'lppGEO {Type J}l G@m@]Jh(mppCONF {Type J}m GqEGMp mB%hB7{qB{^zqMB{B* GVx}bM--Wxf L  x)L  G PVg%@jJ PJ ppppJ {MaxRange  m } {Fov  V}J  GJ @@P }@h@i/N)E&P aP ' GGmB:*;GBA~}z}   Gl@eT)m /rT*u jD il du 9?T UjD 9?T Uil 9?T Ud-_ wT*f%f786^f8T I6^f86Of8T k6K f8ff%f7866Of89D66K f866Of89D66K f866Of89D66K f8f& G<@y%<@ G@pW/ WXY4-OF jK"ua % 6q W6q X6q Yua*u Ka9Du Y%Y78Ysa6YY8 66^Y8W66^Y8X66^Y8YYs=:6[Y86^Y86OY8!Ys $Y79:9:$%]a  WXկN Y%]a*&]a  WXկN Y&]a*,]a  WXկN Y,]a*,]a  WXկN Y,]a*A9:9:$.-(.-(.-(.-(.-(aS'S9Du!. GsJ<H9:9:$J%HJ,J]aJ J%{J78JsaJOuaL * G n\6+E\a= } 6\>@I@6\9D9?6\9?>@I@6\ >I@6\>@I@6\9D^^9?6\6\9D^^9?6\6\9D^^9?6\w*Epppppp{Orientation  6\, 6\, 6\}(Epppppp{Orientation 9S6\,9S6\,9S6\} Gvuy3:SGzyRESET}  E{Orientation 0,0,0}OKFailed Gt.X7e|r .`.$..<a 9?.9?.CC.@.@6.9=,6.$6.$6.9=,.29?.,,P9?.,.aNO POWER! -b .$.@.@6.9=,6.$6.$6.9=,..?aѨLeft9UH9U9U6.$6.9=,.A.@aѨRight9UI9U9U4-OD-TF s%,dF a,d, Ff-T'R X|BIFhi d  .; 9?|9?i B9?d Ii 9D6 d 9D6 R %.9?i 9?d .OHR  Gz@@lw|&FWP 6$zE}ppp{Name <} EE} G}@P{%T@L PL ppL {ScanInterval 9UP }L  GL @ED}qD-'o$-' G R~BK ~~ YCAMERA{RotationG_pwT* T k_6 9D6_6 9D6_6 9D6_$"{ZoomL9?TU9LZoomV{Order9=9JOrder TURN`{RotationG_wT*ET k_6E9D6_6E9D6_6E9D6_6 ]6E6 ]6 6E6 ]6Eq9LDistanceqwT*p T pqp q DRIVE-x(+{Left#9LLeft-x'n{Right"9LRight-x'{Normalized-d9KNormalized-d({Light-V9KLight#{Flip-n9KFlip{Steer{SteerNone{SteernonewT*9:j@p9?T>9LSteer9:j@p9LSteer9:j@pGU{Order9:jt9=9JOrder+{Value9:9:jt%%9:9:jt&9:j@v 9?T>9LValue+9:j@v 9LValue{Name9:jPName9:j,j$j9=& SENSORLName{Scan-V9KScan IGETGEOpTypegName GETCONFqType^Name SET{Clientg ~ Robotg q Nameg P Client jTypeLNamemOpcodeXParamszjRangeScanner{Scan-V9KScan  zjIRCamera {Scan-U9KScan f zjINUc {Reset-D9KReset  zjOdometry {Reset-C9KReset  zjEncoder {Reset-E9KReset MISPKGHName {RotationG_ wT* |T k_ 6 |9D6_6 |9D6_6 |9D6_[ {TranslationL_TranslationG wT* Y T I_[  Y _Z$ {OrderZ9=9JOrder  GECT> G FU@+k  N-U-U,6N6J?-U-U,6N6JL>-U-U,6N6JL>-UJNI   GHp. y-p*9:9:$@ GNmNK09:9:$9:I 9:F(mJFI ' G HI xD4  r* -'-'-'-''''' G OeN% -O (eb-O (' G J@bcD`c G@Z @WMG<MNameL TeamLA LocationGU{ClassNamerzL F ,F 9JL -InitRecieved|{{D{ aD T DL |?aD hT hDf ||aD uT uD^ wT*@ T IA XT kU@ A 6X9D6U6X9D6U6X9D6U. }MF @ X{.-w*added bot, now runningERROR ADDING BOTq!@!N GDT5XMXKvraN ]MK99LM'#P*XFXN w*X YX~9VPTransMN MC 99LXFXF+XmXmR76D%XDXX^^XXFXFXmXmX GN `KPbM#V\ PXSpinSpeedXTorque\ \  Gg M +g .c GZ[NK% -S([W-S(' G W\ ' GU@RUN% -W(UR-W(' G / G8class Hokuyo extends RangeScanner config (USARBot); ec_Ba, DcR!FS  $?e`. r* ,9:9:$@`9:9:$9:j9:l Cvtr 55q5e%e7 e e pe e.Ivtr Gq7class Lisa extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { if (myCamera!=None) initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*690; RightValue = USARRemoteBot(Controller).RightThrottle*690; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; //JointsControl[3].state = 1; // new command //JointsControl[3].order = 1; //JointsControl[3].value = LeftValue; bNewCommand = true; cachedLeftValue=LeftValue; } if (cachedRightValue!=RightValue) { //JointsControl[0].state = 1; // new command //JointsControl[0].order = 1; //JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; bNewCommand = true; cachedRightValue=RightValue; } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[5].state = 1; //JointsControl[5].steer = 65535; JointsControl[5].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[5].value = CameraPan; } if (JointsControl[5].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[6].state = 1; //JointsControl[6].steer = 65535; JointsControl[6].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[6].value = CameraTilt; } if (JointsControl[6].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } cQ"CB Y6ddu F̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i'7B :???$  :AA33 :?:?::?:?9B :???$  :A33 :?:?::?:?TB :???$  :A33 :?:?::?:?QB :???$  :33 :?:?::?:?B$ŧ7 s#moC<G554654S%i654%@ 5-'o%9o7 o o 46o 4So&i6o 4o&@ o -'o}jl  G#class ZergTire extends USARTire; \ R X /Os%X %8X ,X gX Lj,j, GfD@i$EguY* $%<yhv )xbwv *Mv >9?R U v >9?T Q v >9?jMR U T Q j GSclass Zerg extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; function ProcessCarInput() { local float LeftValue,RightValue; Super.ProcessCarInput(); if (!USARRemoteBot(Controller).bNewThrottle) return; if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*2712; RightValue = USARRemoteBot(Controller).RightThrottle*2712; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = RightValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = RightValue; bNewCommand = true; cachedLeftValue = LeftValue; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = LeftValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = LeftValue; bNewCommand = true; cachedRightValue = RightValue; } //bReady = true; if (JointsControl[3].value==JointsControl[1].value) cachedLeftValue=JointsControl[3].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[0].value==JointsControl[2].value) cachedRightValue=JointsControl[2].value; else cachedRightValue=1000000; // a big value to force updating } vjG3++zGSCAN-[ 'OKFailed Gu\@O5 R\6R[S%i[\9?&hhs %ip6R%@ 6Rg%Bg7 g Rg&ip6Rg&@ 6Rgl 9=& Go@@Qlq&8:-[ y pppp{Name <} {Time 9U} La< ~ _ %)_ Osg6L6M,sMQ T M,T M,6L6T ` 9D5Azsgsg 9?` usgppsg, 9?` T MU y pppppy {Row 9Ss Range sg} ssMQ s%rX *X .[X -U(_ j-[ (y  Gy @kU"EB Y6 rLau̪̪̪̪r̪r̪ ^r#VDD]%xDA\\xbCxHbHxn}x\~CBnE nE n@ n@ n G(class TalonUpperArm extends KDPart; yT<x5a5aT%oT7 T aT aT( G Lpw%\dLdppd{Fov  9?R }dppppd{HorResolution  9?T } {VerResolution  9?j}d Gd@tF@xe6 J$|X IZ5'X %WX 7 X  'X  G +class TalonTrackTire extends USARTire; nA)/LVw ,w ,5aW }5a 55  }9?,25 #?5 #?555 #5 #?5 #?5u 5t 5q 5p 5o$ D6}6}@n@nyw 9D9?,Dr9?,6}9?%DDd @nDc 6}D6R@rd 6R@rc 6b @D9?yc 6b 9?,D9?yd )%)y,Rb ) aA R) a ) )   R9?,2)  #?)  #?) ) )  #)  #?)  #?) u ) t ) q ) p ) o$ 6R6R)& aA R)& a )& )&   R9?,2)&  #?)&  #?)& )& )&  #)&  #?)&  #?)& u )& t )& q )& p )& o$ 6R6R),RIq@np@r GswCn&uwo]]ukPuTkTut}u]~PBtE tE t@ t@ t GE z&class TalonTrack extends KDTrack; IHB@I҅yF$= @VvU:T$= @S}R$)\/@ $d;_=2$>Hf p@H6nE 6f 6mE 6f 6lE 6f E  Ga/S)~&a=aa' GyC@ )jy@ Mw@ *e @ >` } @ >b ge 9D` } 9Db  GRclass TalonTire extends USARTire; simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); SetDrawScale3D(vect(1,0.63,1)); } Dm6*Kf~m} ,m} ,Y-d6o mr-e6o mLso k 5z~~ k ~pp~, k me + GD zi S7 H6D 6ni 6D 6mi 6D 6li D  GtF`sD'`ljn6P6x x99Po6xl6xjF 6xj6xlsn6P6x x99Pl6xo6xsjF n6xs6xo6P6x x99PolF 6xj6xns6xn6xjPoF sP G}+(y .p{y zC%C78Cs 1y zzCsHB CC4."$pB sIz.pz .q{z zC%C78uCs 1z zzCs%B CC{z."$pB sJz.qa#@a#?-6@L>U-@H #<I #<-'-(-'-( Gl+class TalonRightFinger extends KDPart; NJ@Og=6 I$(class TalonLowerArm extends KDPart; PK@Q-4|6 H$*class TalonLeftFinger extends KDPart; RL@S4X6 G$+class TalonGripperBase extends KDPart; TM@U)<6 F$vJX3^1 )zXSCAN6OKFailed GKa^:/^aQ GaaQ 9?%Q a #<[Q a= GY@@^ V[Yi f?-d { ppppSEN {Time 9Uf} {Type J}]{ ppSEN {Type J}{  G{ @QZ^&t z~Eppppppppppp{Name <} {Resolution  ` } {FOV  b } {Range ~}~E GE@/O#?G!?? GL]a%M hLhpppph{Resolution  ` } {Fov  b }hpppph{Paning 9T-d} {Tilting 9T-e}h Gh@Qclass Talon extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var config bool bMultiView; simulated function DrawHud(Canvas C) { local int halfX, halfY; if (!bMultiView || Cameras.length<4) { Super.DrawHud(C); return; } C.Reset(); C.Clear(); //Clears frame & Z buffers halfX = C.SizeX/2; halfY = C.SizeY/2; C.DrawPortal( 0, 0, halfX, halfY, CamList[0], CamList[0].Location, CamList[0].Rotation, CamList[0].CameraFov); C.DrawPortal(halfX, 0, halfX, halfY, CamList[1], CamList[1].Location, CamList[1].Rotation, CamList[1].CameraFov); C.DrawPortal( 0, halfY, halfX, halfY, CamList[2], CamList[2].Location, CamList[2].Rotation, CamList[2].CameraFov); C.DrawPortal(halfX, halfY, halfX, halfY, CamList[3], CamList[3].Location, CamList[3].Rotation, CamList[3].CameraFov); super.DrawHud(C); } function ProcessCarInput() { local float LeftValue,RightValue; Super.ProcessCarInput(); if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*690; RightValue = USARRemoteBot(Controller).RightThrottle*690; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; bNewCommand = true; } //bReady = true; cachedLeftValue = JointsControl[1].value; cachedRightValue = JointsControl[0].value; } } bY"NB Y6dTu̪̪̪̪r̪r̪ҽҽҽҽҽ F F Fҽ F F Fҽ F F Fҽ F F Fa;i#9:S$  :A B :?:::?:7:S$  :A :?:::?:Q:S$  : B :?:::?:T:S$  : :?:::?:[$A\$AC$RI9 q#V%class Gripper extends Effecter; var config float MaxAngle; var config float MinAngle; var config string LeftFinger, RightFinger; var int idLF, idRF; var KRobot robot; function Init(String SName, Actor parent, vector position, rotator direction, KVehicle platform, name mount) { local int i; Super.Init(SName,parent,position,direction,platform,mount); robot = KRobot(platform); if (robot!=None) { if (LeftFinger=="" || RightFinger=="") { // find the left and right fingers for (i=0;i0 && RightFinger=="") idRF = i; } } } if (idLF==-1) idLF = robot.FindJointPartId(LeftFinger); if (idRF==-1) idRF = robot.FindJointPartId(RightFinger); } if (idLF==-1 || idRf==-1) log("Error LeftFinger/RightFinger name or incorrect Robot class"); else log("Use "$robot.JointParts[idLF].PartName$"/"$robot.JointParts[idRF].PartName$" as Left/Right Finger;"); } function string Set(String opcode, String args) { local float angle; if (idLF==-1 || idRf==-1) return "Failed"; if (Caps(opcode)=="OPEN") { angle = float(args); if (angle>MaxAngle) angle = MaxAngle; else if (angle(.}  GZe@Oi?ȵZ_uuuuu/=gruu/=guuuuu/=gruu/=guuuuuuuuuK$?j"i"(] GripperP@class ViewTestPlayerController extends xGame.xPlayer config(USARBot); var byte mode; var byte oldDuck; var actor rRobot, myRobot, lastRobot; var String myIP, rIP, rCameraName, rRobotName; var RobotCamera rCamera; var vector rCamLoc, myCamLoc; var rotator rCamRot, myCamRot; var int rCamFov, myCamFov; var USARReplicationInfo gInfo; replication { reliable if( RoleSoundDT) { PlaySound(HelpSound,SLOT_None,SoundVolume,true,SoundRadius,SoundPitch,false); SoundT=Level.TimeSeconds; } if (Level.TimeSeconds-AnimT0) { dif=abs(SegRot[i].curRot.Pitch-Segments[i].FinalRotation.Pitch); if (dif>32768.0) dif=65535.0-dif; if (dif0) { dif=abs(SegRot[i].curRot.Yaw-Segments[i].FinalRotation.Yaw); if (dif>32768) dif=65535-dif; if (dif0) { dif=abs(SegRot[i].curRot.Roll-Segments[i].FinalRotation.Roll); if (dif>32768) dif=65535-dif; if (dif. K6. 3 9?6K6. B 6. 6K6K9DB0  6. 6K6K9DB0 6K9DV 6K6.  9?6K6. B 6. 6K6K9DB  6. 6K6K9DB 6K9D; 6K6. x B}u B} a>K. x 9?6. }u 9?6. }-k .-V.-nP*.L9?% wu*a9D.Lba%a9Du 9?aD a9DD 9?al a9Dl .L9:9:$u Kua<KKuO.-k uz%]ZS [ &]ZS [ ,]ZS [ ,]ZS [ NB@9?,,@9CN~C GB:class USARTire extends BulldogTire; var name Type; M//class USARStaticMeshActor extends Decoration; class USARStaticMeshActor extends KTire; simulated function PostNetBeginPlay() { } y^S@zEW |#jeclass USARRobot extends Pawn config(ExpControl); /* #exec MESH IMPORT MESH=zsu23 ANIVFILE=MODELS\zsu23_a.3d DATAFILE=MODELS\zsu23_d.3d X=0 Y=0 Z=0 MLOD=0 #exec MESH ORIGIN MESH=zsu23 X=0 Y=0 Z=0 #exec MESH LODPARAMS MESH=zsu23 STRENGTH=0.25 ZDISP=10000000000000 #exec MESHMAP NEW MESHMAP=zsu23 MESH=zsu23 #exec MESHMAP SCALE MESHMAP=zsu23 X=0.3 Y=0.3 Z=0.6 #exec TEXTURE IMPORT NAME=Jtex1 FILE=textures\btr800.bmp GROUP=Skins FLAGS=2 #exec TEXTURE IMPORT NAME=Jtex1 FILE=textures\btr800.bmp GROUP=Skins PALETTE=Jtex1 #exec MESHMAP SETTEXTURE MESHMAP=zsu23 NUM=0 TEXTURE=Jtex1 */ /* FMP commented out #exec MESH IMPORT MESH=t80 ANIVFILE=MODELS\t80_a.3d DATAFILE=MODELS\t80_d.3d X=0 Y=0 Z=0 MLOD=0 #exec MESH ORIGIN MESH=t80 X=0 Y=0 Z=0 YAW=0 #exec MESH LODPARAMS MESH=t80 STRENGTH=0.25 ZDISP=10000000000000 #exec MESHMAP NEW MESHMAP=t80 MESH=t80 #exec MESHMAP SCALE MESHMAP=t80 X=0.1 Y=0.1 Z=0.2 #exec TEXTURE IMPORT NAME=Jtex1 FILE=textures\btr800.bmp GROUP=Skins FLAGS=2 #exec TEXTURE IMPORT NAME=Jtex1 FILE=textures\btr800.bmp GROUP=Skins PALETTE=Jtex1 #exec MESHMAP SETTEXTURE MESHMAP=t80 NUM=0 TEXTURE=Jtex1 */ var const vector HeadlightOffset; var USARHeadlight Headlight; var rotator HLRotation; var bool HeadlightOn; var float CameraZoom; var bool bExp; var bool bInitExp; var int tExp; var config int ExpTimer; var config float expTime; var config string expIntro; var float startTime; var float utTime; var int expX, expY; var int expX1, expY1; var int expX2, expY2; var ExpPath ePath; var texture ExpTarget; var config float ExpTargetScale; var vector vTarget; var rotator rTarget; var float msgTimer; replication { reliable if(Role == ROLE_Authority) HLRotation, CameraZoom, expX, expY, utTime; } simulated function PostBeginPlay() { local vector RotX, RotY, RotZ; super.PostBeginPlay(); // Create headlight projector. We make sure it doesn't project on the vehicle itself. GetAxes(Rotation,RotX,RotY,RotZ); Headlight = spawn(class'USARHeadlight', self,, Location + HeadlightOffset.X * RotX + HeadlightOffset.Y * RotY + HeadlightOffset.Z * RotZ); if (Headlight!=None) { Headlight.SetBase(self); Headlight.SetRelativeRotation(rot(0, 0, 0)); } if (bExp) ePath=new class'USARBot.ExpPath'; CameraZoom=1.0; SetTimer(msgTimer,true); } simulated event Destroyed() { Headlight.Destroy(); super.Destroyed(); } simulated function Tick( float DeltaTime ) { local vector RotX, RotY, RotZ; if (Headlight == None) Return; if (Role==ROLE_Authority) HLRotation +=USARRemoteBot(Controller).myCameraRotation; Headlight.SetRelativeRotation(HLRotation); Headlight.DetachProjector(); if(HeadlightOn) Headlight.AttachProjector(); if (bExp) { if ((startTime==0)&&(USARRemoteBot(Controller).myCameraRotation.Pitch!=0||USARRemoteBot(Controller).myCameraRotation.Yaw!=0||USARRemoteBot(Controller).botDR!=none)) startTime=Level.TimeSeconds; if (startTime>0) utTime=Level.TimeSeconds-startTime; if (!bInitExp) { //ePath.setOffset((C.SizeX-ExpTarget.MaterialUSize()*ExpTargetScale)/2,(C.SizeY-ExpTarget.MaterialVSize()*ExpTargetScale)/2); //ePath.setScale(C.SizeX,C.SizeY); ePath.setOffset(0,-50); ePath.setScale(100,100); //ePath.dump(); bInitExp=true; ePath.nextPoint(expX1,expY1); ePath.nextPoint(expX2,expY2); } if (tExp>ExpTimer) { expX1=expX2; expY1=expY2; ePath.nextPoint(expX2,expY2); tExp=0; } expX=expX1+(expX2-expX1)*tExp/ExpTimer; expY=expY1+(expY2-expY1)*tExp/ExpTimer; GetAxes(Rotation,RotX,RotY,RotZ); vTarget=Headlight.Location + 400*RotX+expX*RotY+expY*RotZ; rTarget=rotator(400*RotX+expX*RotY+expY*RotZ)-Rotation; tExp++; } //log("X="$expX$" Y="$expY$" tExp="$tExp); //log("DR_V:"$(USARRemoteBot(Controller)).botDR.current.DR_V@(USARRemoteBot(Controller)).botDR.cache.DR_V); } // For drawing targetting reticule simulated function DrawHud(Canvas C) { local vector ScreenPos; if (bExp) { C.Style = ERenderStyle.STY_Masked; ScreenPos = C.WorldToScreen( vTarget); C.SetPos(ScreenPos.X, ScreenPos.Y); C.DrawIcon(ExpTarget,ExpTargetScale); C.Style = ERenderStyle.STY_Normal; C.DrawColor.R = 255; C.DrawColor.G = 255; C.DrawColor.B = 255; C.DrawColor.A = 255; C.FontScaleX=3; C.FontScaleY=3; C.SetPos(C.SizeX-320,0); C.DrawText("LeftTime:"$(expTime-utTime)); C.FontScaleX=2; C.FontScaleY=2; C.SetPos(C.SizeX-50,7); C.DrawText("sec"); if (utTime<15) DrawMultiLine(C,0.1,0.05,0.9,0.8,expIntro); if (utTime>expTime) { C.FontScaleX=3; C.FontScaleY=3; C.DrawColor.G = 0; C.DrawColor.B = 0; C.SetPos(150,250); C.DrawText("Time Out! Please Alert Your Experimentor."); } } } simulated function DrawMultiLine(Canvas Canvas, float top, float left, float width, float height, string text) { local string TextCopy, Line; local int ltp; local float XL, YL, xTop, xLeft; Canvas.TextSize(text, XL, YL); ltp = (height * Canvas.SizeY) / YL; // Max lines xTop = top * Canvas.SizeY; xLeft = left * Canvas.SizeX; TextCopy = text; Canvas.WrapText(TextCopy, Line, width * Canvas.SizeX, Canvas.Font, Canvas.FontScaleX); while (ltp > 0) { if (Len(Line) > 0) { Canvas.SetPos(xLeft,xTop); Canvas.DrawText(Line); } xTop += YL; Canvas.WrapText(TextCopy, Line, width * Canvas.SizeX, Canvas.Font, Canvas.FontScaleX); if (TextCopy == "" && Line == "") break; } } function timer() { local string outstring; outstring="STA {Time "$Level.TimeSeconds$"}"$ " {Location "$Location$"}"$ " {Rotation "$Rotation$"}"$ " {Velocity "$Velocity$"}"$ " {Camera "$HLRotation$"}"$ " {Target "$rTarget$"}"$ " {Trace "$(HLRotation-rTarget)$"}"; USARRemoteBot(Controller).myConnection.SendLine(outstring); } /* Modification history: $Log: USARRobot.uc,v $ Revision 1.3 2005/10/29 16:59:26 jjmlcn clear warning fix unit converting bud in input command Add USARRemotBot and USARBotConnection. Now we can add our new command in these two files. Revision 1.2 2005/10/25 20:08:10 jjmlcn *** empty log message *** Revision 1.1.1.1 2005/09/09 14:22:26 proctor Initial import. Revision 1.2 2005/09/08 20:18:36 proctor make.bat,sh: added -ini=USARSim.ini USARRobot.uc: commented out unused textures */ H//============================================================================= // USARReplicationInfo. //============================================================================= //class USARReplicationInfo extends. It's used to store global game information class USARReplicationInfo extends GameReplicationInfo; var string cltIP; var string cltRobot; var string cltCamera; tclass USARRemoteBot extends RemoteBot; //CAMERA parameters var rotator myCameraRotation; var byte myCameraRotationOrder; var float myCameraZoom; //DRIVE middle level parameters var float LeftThrottle; var float RightThrottle; var bool Normalized; var bool bNewThrottle; //DRIVE low level parameters var byte JointControlIdx; var string JName[16]; var float JSteer[16]; var byte JOrder[16]; var float JValue[16]; //DRIVE auxiliary parameters var bool Light; var bool Flip; //Turn parameters (obsolete) var rotator myTurn; var float myDistance; //GETGEO parameters var string GeoType; var string GeoName; //FETCONF parameters var string ConfType; var string ConfName; //SET parameters var string SetType; var string SetName; var String OpCode; var String Params; var bool RangeScan; var bool IRCameraScan; var bool SetPosition, SetOrientation, SetEncoder; //MISPKG parameters var string MPName; var rotator MPRotation; var vector MPTranslation; var byte MPOrder; //Needed for the gripper var bool bGrip; _class USARObstacle extends Decoration; function Bump( actor Other ) { if( bPushable && (Pawn(Other)!=None) && (Other.Mass > 40) ) { Push(Other); } else Cross(Other); } function Push( actor Other ) { local float speed, oldZ; oldZ = Velocity.Z; speed = VSize(Other.Velocity); Velocity = Other.Velocity * FMin(480.0, 20 + speed)/speed; if ( Physics == PHYS_None ) { Velocity.Z = 25; if (!bPushSoundPlaying) { PlaySound(PushSound, SLOT_Misc); bPushSoundPlaying = True; } } else Velocity.Z = oldZ; SetPhysics(PHYS_Falling); SetTimer(0.3,False); Instigator = Pawn(Other); } function Cross( actor Other ) { } /* defaultproperties { bPushable=True DrawType=DT_StaticMesh StaticMesh=StaticMesh'USAR_World.Stuff.brick' bStatic=False bNoDelete=True bStasis=False CollisionRadius=60.000000 CollisionHeight=45.000000 bCollideActors=True bCollideWorld=True bBlockActors=True bBlockPlayers=True bProjTarget=True bBlockKarma=True bNetNotify=True } */ ~gWBz?4ʁ)ʁ)ʁ)vtF3_P )zFSCAN6OKFailed Gvz6SzppppppppppppppppppppppppppppppppppppppppSTA {Time 9U} {State 9R]} {Camera 9YK} {Zoom 9Sa} {CameraVel 9Uu ,9Ux ,0.0} {Attitude 9Y} {Location 9X} {LeftWheel 9X } {RightWheel 9X } {Velocity 9X} {LightToggle 9T-k } {LightIntensity 9R~} {Battery 9Sr |}. $zz}%}789:}s %C}s-f za}sJ^z}s&{z."$}sYz}}%}78}s $} GC@@^ @EYj f?-d CppppSEN {Time 9Up } {Type J}]CppSEN {Type J}C GC@AaW` N%wN78mzNsJ` ` Ns&Ns $N`  G` @]@Fj SYj ppVolume:j State:9Wa^zj Papersq!w!Ezj Stairq!N!E G IWw!x]IuaL>/zPapers !Eq!0 EG8`@}class USARHud extends HudBDeathMatch; simulated event PostBeginPlay() { Super.PostBeginPlay(); bHideHud = true; } LrY>MǽkFp3:w{#exec OBJ LOAD FILE=USAR.utx class USARHeadlight extends DynamicProjector; var name Type; // Empty tick here - do detach/attach in Bulldog tick function Tick(float Delta) { } Jclass USARDeathMatch extends BotDeathMatch; var array Victims; var array Vehicles; var array RFIDTags; var array VictRFIDTags; var bool bAutoId; function actor GetRobot(String name) { local string botName; local int i; for (i=0;i SensorClass; var string SenName; var vector Position; var vector Direction; var rotator uuDirection; }; var config array Sensors; var array SensorList; var array ProcessedSensors; // USAR Battery var config int batteryLife; var int startTime; var int myLife; var bool bExp; var bool bInitExp; var int tExp; var int ExpTimer; var int expX; var int expY; var ExpPath ePath; var texture ExpTarget; var float ExpTargetScale; var config bool bSpeedControl; var config bool bAbsoluteCamera; var vector oldPos; var byte myState; // pid control loop var config float Kp,Ki,Kd; var config float MinOut,MaxOut; var float pidErr; var float pidInt; var float pidDer; var float lastErr; var float pidErr2; var float pidInt2; var float pidDer2; var float lastErr2; var config string ConverterClass; var USARConverter converter; var config bool bMountByUU; var config bool bDisplayTeamBeacon; replication { unreliable if(Role == ROLE_Authority) LeftThrottle, RightThrottle, HLRotation, HeadlightOn, HeadLightItensity, CameraZoom, myState; } simulated event PreBeginPlay() { local class cClass; Super.PreBeginPlay(); bNoTeamBeacon=!bDisplayTeamBeacon; cClass = class(DynamicLoadObject(ConverterClass, class'Class')); converter = new cClass; ConvertParam(converter); } simulated function ConvertParam(USARConverter converter) { local int i; if (converter==None) { degCameraDefFov = CameraDefFov; degCameraMinFov = CameraMinFov; degCameraMaxFov = CameraMaxFov; } else { degCameraDefFov = converter.AngleToDeg(CameraDefFov); degCameraMinFov = converter.AngleToDeg(CameraMinFov); degCameraMaxFov = converter.AngleToDeg(CameraMaxFov); } if (!bMountByUU && converter!=None) { for (i=0;iExpTimer) { GetAxes(Rotation,RotX,RotY,RotZ); ePath.nextPoint(expX,expY); ScreenPos = C.WorldToScreen( Location + 400*RotX+expX*RotY+expY*RotZ); expX=ScreenPos.X; expY=ScreenPos.Y; tExp=0; } C.SetPos(expX, expY); C.DrawIcon(ExpTarget,ExpTargetScale); tExp++; //log("X="$expX$" Y="$expY$" tExp="$tExp); } /* local int XPos, YPos; local vector ScreenPos; local float RatioX, RatioY; local float tileX, tileY; local float SizeX, SizeY; SizeX = 64.0; SizeY = 64.0; ScreenPos = C.WorldToScreen( Location ); RatioX = C.SizeX / 640.0; RatioY = C.SizeY / 480.0; tileX = sizeX * RatioX; tileY = sizeY * RatioX; XPos = ScreenPos.X; YPos = ScreenPos.Y; C.Style = ERenderStyle.STY_Additive; C.DrawColor.R = 255; C.DrawColor.G = 255; C.DrawColor.B = 255; C.DrawColor.A = 255; C.SetPos(XPos - tileX*0.5, YPos - tileY*0.5); C.DrawTile( TargetMaterial, tileX, tileY, 0.0, 0.0, 256, 256); //--- TODO : Fix HARDCODED USIZE */ } simulated event KVehicleUpdateParams() { if (frontLeft==NONE) return; Super.KVehicleUpdateParams(); frontLeft.WheelJoint.bKSteeringLocked = true; frontRight.WheelJoint.bKSteeringLocked = true; rearLeft.WheelJoint.bKSteeringLocked = true; rearRight.WheelJoint.bKSteeringLocked = true; /* rearLeft.RollFriction = TireLateralFriction; rearLeft.LateralFriction = TireLateralFriction; rearRight.RollFriction = TireLateralFriction; rearRight.LateralFriction = TireLateralFriction; */ frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); rearLeft.WheelJoint.KUpdateConstraintParams(); rearRight.WheelJoint.KUpdateConstraintParams(); } function float myEngine(float Throttle, float SpinSpeed) { local float torque; torque = Throttle * InterpCurveEval(TorqueCurve, SpinSpeed); GraphData("SpinSpeed", SpinSpeed); GraphData("Torque", torque); return -1 * torque; } ////////////////////////////////////////////// // pid control loop // W(s) = Kp + Ki*(1/s) + KD*s ////////////////////////////////////////////// function float pidEngine(float desiredPV, float currentPV, float delta) { local float COut; pidErr = desiredPV - currentPV; pidInt = pidInt + pidErr * delta; pidDer = (pidErr - lastErr) / delta; lastErr = pidErr; COut = Kp*pidErr+pidInt*Ki+pidDer*Kd; if (COutMaxOut) COut=MaxOut; return -1*COut; } function float pidEngine2(float desiredPV, float currentPV, float delta) { local float COut; pidErr2 = desiredPV - currentPV; pidInt2 = pidInt2 + pidErr2 * delta; pidDer2 = (pidErr2 - lastErr2) / delta; lastErr2 = pidErr2; COut = Kp*pidErr2+pidInt2*Ki+pidDer2*Kd; if (COutMaxOut) COut=MaxOut; return -1*COut; } function ProcessCarInput() { local vector worldForward, worldUp; local string outstring, geoType, confType; local int i, Jid; // Return sensor geo info geoType = USARRemoteBot(Controller).GeoType; if (geoType!="") { outstring = ""; for (i=0;i> Rotation; worldUp = vect(0, 0, 1) >> Rotation; ForwardVel = Velocity Dot worldForward; bIsInverted = worldUp.Z < 0.2; // 'ForwardVel' isn't very helpful if we are inverted, so we just pretend its positive. if(bIsInverted) ForwardVel = 2 * StopThreshold; //if (abs(LeftThrottle)<0.01&&abs(RightThrottle)<0.01&&(frontLeft.SpinSpeed>StopThreshold||frontRight.SpinSpeed>StopThreshold)) if (abs(LeftThrottle)<0.01&&abs(RightThrottle)<0.01) OutputBrake = true; else OutputBrake = false; IsDriving = true; OutputHandbrakeOn = false; KWake(); // currently, never let the car go to sleep whilst being driven. } // simple control loop // type=1: frontLeft // type=2: frontRight function float controlEngine(float dv, float av) { if (dv == av) return 0.0; //if (dv > av) return -0.02; //else return 0.02; if (dv*(dv-av)>0) return (av-dv)*0.01; else return (av-dv)*0.1; } function StartFlip(Pawn Pusher) { //local vector toPusher, worldUp; // if we are already flipping the car - dont do it again! if(FlipTimeLeft > 0) return; FlipTimeLeft = FlipTime; // Start the flip on the server USARRemoteBot(Controller).Flip = false; } // Car Simulation simulated function Tick(float Delta) { local float EnginePitch; local float actVel; // Battery if (myLife>=batteryLife) { myLife=batteryLife; USARRemoteBot(Controller).LeftThrottle=0; USARRemoteBot(Controller).RightThrottle=0; USARRemoteBot(Controller).myTurn.roll=0; USARRemoteBot(Controller).Light=false; } else myLife = Level.TimeSeconds - startTime; WheelSpinSpeed = (rearLeft.SpinSpeed + rearRight.SpinSpeed)/2; //log("WheelSpinSpeed:"$WheelSpinSpeed); // if we are in the process of flipping the car, keep it enabled! if( FlipTimeLeft > 0 ) KWake(); // If the server, process input and pack updated car info into struct. if(Role == ROLE_Authority) { ProcessCarInput(); PackState(); if (bSpeedControl && myState==0) { if (LeftThrottle != USARRemoteBot(Controller).LeftThrottle*6) pidInt=0; LeftThrottle = USARRemoteBot(Controller).LeftThrottle*6; if (RightThrottle != USARRemoteBot(Controller).RightThrottle*6) pidInt2=0; RightThrottle = USARRemoteBot(Controller).RightThrottle*6; } else { LeftThrottle = USARRemoteBot(Controller).LeftThrottle; RightThrottle = USARRemoteBot(Controller).RightThrottle; } if (LeftThrottle*RightThrottle>0) { LeftThrottle = -LeftThrottle; RightThrottle = -RightThrottle; } Throttle = (LeftThrottle+RightThrottle)/2.0; if (USARRemoteBot(Controller).myTurn.roll>0) { if (abs(USARRemoteBot(Controller).myTurn.Yaw-Rotation.Yaw)<200 || myState==2) { if (USARRemoteBot(Controller).myTurn.pitch>=0) { USARRemoteBot(Controller).myTurn.pitch=-10; oldPos=Location; } if (abs(vsize(Location-oldPos)-USARRemoteBot(Controller).myDistance)<50) { USARRemoteBot(Controller).myTurn.roll=-10; LeftThrottle=0; RightThrottle=0; myState=0; } else { myState=2; LeftThrottle=-3; RightThrottle=-3; } } else { myState=1; if (USARRemoteBot(Controller).myTurn.Yaw>0) { LeftThrottle=-3; RightThrottle=3; } else { LeftThrottle=3; RightThrottle=-3; } } } } if (bSpeedControl||myState==2||myState==1) { // Left actVel = frontLeft.Velocity dot (vect(-1, 0, 0) >> Rotation); if (actVel>0.01||actVel<-0.01||LeftThrottle>0.5||LeftThrottle<-0.5) frontLeft.WheelJoint.KMotorTorque=pidEngine(LeftThrottle,actVel,Delta); else frontLeft.WheelJoint.KMotorTorque=0.0; if (LeftThrottle*(LeftThrottle-actVel)>0) { if (LeftThrottle>0&&frontLeft.WheelJoint.KMotorTorque>0) frontLeft.WheelJoint.KMotorTorque=-0.01; if (LeftThrottle<0&&frontLeft.WheelJoint.KMotorTorque<0) frontLeft.WheelJoint.KMotorTorque=0.01; } if (frontLeft.WheelJoint.KMotorTorque>40) frontLeft.WheelJoint.KMotorTorque=40; if (frontLeft.WheelJoint.KMotorTorque<-40) frontLeft.WheelJoint.KMotorTorque=-40; if (bDebug) log("-LEFT DV:"$LeftThrottle@" V:"$actVel@" Er:"$pidErr@" IER:"$pidInt@" Out:"$frontLeft.WheelJoint.KMotorTorque); //Right actVel = frontRight.Velocity dot (vect(-1, 0, 0) >> Rotation); if (actVel>0.01||actVel<-0.01||RightThrottle>0.5||RightThrottle<-0.5) frontRight.WheelJoint.KMotorTorque=pidEngine2(RightThrottle,actVel,Delta); else frontRight.WheelJoint.KMotorTorque=0.0; if (RightThrottle*(RightThrottle-actVel)>0) { if (RightThrottle>0&&frontRight.WheelJoint.KMotorTorque>0) frontRight.WheelJoint.KMotorTorque=-0.01; if (RightThrottle<0&&frontRight.WheelJoint.KMotorTorque<0) frontRight.WheelJoint.KMotorTorque=0.01; } if (frontRight.WheelJoint.KMotorTorque>40) frontRight.WheelJoint.KMotorTorque=40; if (frontRight.WheelJoint.KMotorTorque<-40) frontRight.WheelJoint.KMotorTorque=-40; if (bDebug) log("-RIGHT DV:"$RightThrottle@" V:"$actVel@" Er:"$pidErr2@" IER:"$pidInt2@" Out:"$frontRight.WheelJoint.KMotorTorque); }else { frontLeft.WheelJoint.KMotorTorque = myEngine(LeftThrottle,frontLeft.SpinSpeed); frontRight.WheelJoint.KMotorTorque = myEngine(RightThrottle,frontRight.SpinSpeed); } // REAR //rearLeft.WheelJoint.KMotorTorque = 0.5 * OutputTorque * TorqueSplit; //rearRight.WheelJoint.KMotorTorque = 0.5 * OutputTorque * TorqueSplit; rearLeft.WheelJoint.KMotorTorque = 0; rearRight.WheelJoint.KMotorTorque = 0; // Braking if(OutputBrake) { frontLeft.WheelJoint.KBraking = MaxBrakeTorque; frontRight.WheelJoint.KBraking = MaxBrakeTorque; } else { frontLeft.WheelJoint.KBraking = 0.0; frontRight.WheelJoint.KBraking = 0.0; rearLeft.WheelJoint.KBraking = 0.0; rearRight.WheelJoint.KBraking = 0.0; } if(OutputHandbrakeOn == true) { //Log("HANDBRAKE!!"); rearLeft.LateralFriction = TireLateralFriction + TireHandbrakeFriction; rearLeft.LateralSlip = TireLateralSlip + TireHandbrakeSlip; rearRight.LateralFriction = TireLateralFriction + TireHandbrakeFriction; rearRight.LateralSlip = TireLateralSlip + TireHandbrakeSlip; } else { rearLeft.LateralFriction = TireLateralFriction; rearLeft.LateralSlip = TireLateralSlip; rearRight.LateralFriction = TireLateralFriction; rearRight.LateralSlip = TireLateralSlip; } // Flipping if(FlipTimeLeft > 0) { FlipTimeLeft -= Delta; FlipTimeLeft = FMax(FlipTimeLeft, 0.0); // Make sure it doesn't go negative } if (Role==ROLE_Authority) { // log("*****PITCH:" $USARRemoteBot(Controller).uuCameraRotation.pitch $ " - " $ HLRotation.pitch); //log("*****YAW:" $USARRemoteBot(Controller).uuCameraRotation.yaw $ " - " $ HLRotation.yaw); if (USARRemoteBot(Controller).myCameraRotationOrder==0) { if (!bAbsoluteCamera&&USARRemoteBot(Controller).myCameraRotation.roll==0) { USARRemoteBot(Controller).myCameraRotation+=HLRotation; USARRemoteBot(Controller).myCameraRotation.roll=-1; } if (abs(HLRotation.pitch - USARRemoteBot(Controller).myCameraRotation.pitch) > 100.00) { if (USARRemoteBot(Controller).myCameraRotation.pitch > HLRotation.pitch) HLRotation.pitch += 100.00; else if (USARRemoteBot(Controller).myCameraRotation.pitch < HLRotation.pitch) HLRotation.pitch -= 100.00; else HLRotation.pitch += 0.0; } else HLRotation.pitch = USARRemoteBot(Controller).myCameraRotation.pitch; if (abs(HLRotation.yaw - USARRemoteBot(Controller).myCameraRotation.yaw) > 100.00) { if (USARRemoteBot(Controller).myCameraRotation.yaw > HLRotation.yaw) HLRotation.yaw += 100.00; else if (USARRemoteBot(Controller).myCameraRotation.yaw < HLRotation.yaw) HLRotation.yaw -= 100.00; else HLRotation.yaw += 0.0; } else HLRotation.yaw = USARRemoteBot(Controller).myCameraRotation.yaw; PanSpeed = 100.0/Delta; TiltSpeed = 100.0/Delta; }else { HLRotation+=USARRemoteBot(Controller).myCameraRotation; PanSpeed = USARRemoteBot(Controller).myCameraRotation.Yaw/Delta; TiltSpeed = USARRemoteBot(Controller).myCameraRotation.Pitch/Delta; } /* r.Pitch=(USARRemoteBot(Controller).myCameraRotation).Pitch+default.HLRotation.Pitch; r.Yaw=HLRotation.Yaw+(USARRemoteBot(Controller).myCameraRotation).Yaw; r.Roll=HLRotation.Roll+(USARRemoteBot(Controller).myCameraRotation).Roll; HLRotation=r; */ HeadlightOn=USARRemoteBot(Controller).Light; if (USARRemoteBot(Controller).Flip) StartFlip(None); if (USARRemoteBot(Controller).myCameraZoom>=0&&HeadLight!=NONE) { CameraZoom = USARRemoteBot(Controller).myCameraZoom; if (CameraZoom==0) CameraZoom = degCameraDefFov; // reset else if (CameraZoom<=degCameraMinFov) CameraZoom = degCameraMinFov; // low bound else if (CameraZoom>degCameraMaxFov) CameraZoom = degCameraMaxFov; // upper bound USARRemoteBot(Controller).myCameraZoom=-1; } } if(Level.NetMode != NM_DedicatedServer) { // Set headlight projector state. if (Headlight.Rotation!=HLRotation) Headlight.SetRelativeRotation(HLRotation+default.HLRotation); Headlight.DetachProjector(); if(HeadlightOn) Headlight.AttachProjector(); // Update dust kicked up by wheels. Dust[0].UpdateDust(frontLeft, DustSlipRate, DustSlipThresh); Dust[1].UpdateDust(frontRight, DustSlipRate, DustSlipThresh); Dust[2].UpdateDust(rearLeft, DustSlipRate, DustSlipThresh); Dust[3].UpdateDust(rearRight, DustSlipRate, DustSlipThresh); } // This assume the sound is an idle-ing sound, and increases with pitch // as wheels speed up. EnginePitch = 64 + ((WheelSpinSpeed/EnginePitchScale) * (255-64)); SoundPitch = FClamp(EnginePitch, 0, 254); //Log("Engine Pitch:"$SoundPitch); //SoundVolume = 255; } function timer() { local string outstring; local int i; outstring="STA {Time "$Level.TimeSeconds$"}"$ " {State "$myState$"}"$ " {Camera "$(HLRotation)$"}"$ " {Zoom "$CameraZoom$"}"$ " {CameraVel "$TiltSpeed$","$PanSpeed$",0.0}"$ " {Attitude "$Rotation$"}"$ " {Location "$Location$"}"$ " {LeftWheel "$frontLeft.Velocity$"}"$ " {RightWheel "$frontRight.Velocity$"}"$ " {Velocity "$Velocity$"}"$ " {LightToggle "$HeadlightOn$"}"$ " {LightIntensity "$HeadlightItensity$"}"$ " {Battery "$(batteryLife-myLife)$"}"; USARRemoteBot(Controller).myConnection.SendLine(outstring); outstring = ""; for (i=0;i0.3) { frontLeft.RollFriction = TireRollFriction*0.5; frontLeft.LateralFriction = TireLateralFriction*0.0; } else { frontLeft.RollFriction = TireRollFriction; frontLeft.LateralFriction = TireLateralFriction; } if (FRand()>0.3) { frontRight.RollFriction = TireRollFriction*0.5; frontRight.LateralFriction = TireLateralFriction*0.0; } else { frontRight.RollFriction = TireRollFriction*FRand(); frontRight.LateralFriction = TireLateralFriction*FRand(); } frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); } function EndState() { log("Leave state: CrossPapers"); KVehicleUpdateParams(); } Begin: damp(); Sleep(0.2); if ( PhysicsVolume.LocationName=="Papers") goto('Begin'); GotoState('USARCar'); } state ClimbStair{ function BeginState() { log("Enter state: ClimbStair"); } function EndState() { log("Leave state: ClimbStair"); KVehicleUpdateParams(); } function climb() { if (frontLeft.RollFriction>TireRollFriction) return; frontLeft.RollFriction = TireRollFriction*100; frontLeft.LateralFriction = TireRollFriction*150; frontRight.RollFriction = TireRollFriction*100; frontRight.LateralFriction = TireRollFriction*150; frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); // The large rear wheel friction is used to protect the vehicle from slipping rearLeft.RollFriction = TireRollFriction*100; rearLeft.LateralFriction = TireRollFriction*150; rearRight.RollFriction = TireRollFriction*100; rearRight.LateralFriction = TireRollFriction*150; rearLeft.WheelJoint.KUpdateConstraintParams(); rearRight.WheelJoint.KUpdateConstraintParams(); } Begin: climb(); Sleep(0.2); if ( PhysicsVolume.LocationName=="Stair") goto('Begin'); GotoState('USARCar'); } +class USARBotServer extends BotServer; AAZEnter state: CrossPapers GTuZE>?m>?'' GLu _)L_w_*Z _ >u Y _ >s G_ >b I_ >_ Z 9Du Y 9Ds G9Db I9D_  GU5]%Leave state: CrossPapersD GLVW 6-p dW Z ,W Z ,V Y ,V Y ,6KV 6KW LsKJ5zdd Jdppd, JV IQW G- GTpclass USARBotConnection extends BotConnection; var USARReplicationInfo gInfo; var USARRemoteBot urBot; var USARConverter converter; function PostBeginPlay() { super.PostBeginPlay(); gInfo = USARReplicationInfo(Level.Game.GameReplicationInfo); } //InitRecieved from client event InitRecieved() { local string clientName; local string teamString; local int teamNum; local vector startLocation; local vector startRotation; local vector newLocation; local rotator newRotation; local string className; local class pawnClass; clientName = GetArgVal("Name"); teamString = GetArgVal("Team"); ParseVector(startLocation,"Location"); ParseRotAsVec(startRotation); className = GetArgVal("ClassName"); if( teamString == "" ) teamNum = 255; else teamNum = int(teamString); if(bDebug) log("InitRecieved"); if (className!="") { pawnClass = class(DynamicLoadObject(className, class'Class')); if (ClassIsChildOf(pawnClass,class'KRobot')) converter = new class(DynamicLoadObject(class(pawnClass).default.ConverterClass, class'Class')); else if (ClassIsChildOf(pawnClass,class'USARCar')) converter = new class(DynamicLoadObject(class(pawnClass).default.ConverterClass, class'Class')); else if (ClassIsChildOf(pawnClass,class'USARBc')) converter = new class(DynamicLoadObject(class(pawnClass).default.ConverterClass, class'Class')); } if (converter!=None) { newLocation = converter.LengthVectorToUU(startLocation); newRotation = converter.RotatorToUU(startRotation); } else { newLocation = startLocation; newRotation.Roll = startRotation.X; newRotation.Pitch = startRotation.Y; newRotation.Yaw = startRotation.Z; } theBot = BotDeathMatch(Level.Game).AddRemoteBot(self, clientName, teamNum, newLocation, newRotation, className); urBot = USARRemoteBot(theBot); if(bDebug) if(theBot != None) log("added bot, now running"); else log("ERROR ADDING BOT"); gotoState('monitoring','Running'); } function ProcessAction(string cmdType) { local rotator r; local vector v; local float distance; super.ProcessAction(cmdType); switch(cmdType) { case "CAMERA": if (GetArgVal("Rotation")!="") { ParseRotAsVec(v); if (converter!=None) { urBot.myCameraRotation = converter.RotatorToUU(v); } else { urBot.myCameraRotation.Pitch=v.Y; urBot.myCameraRotation.Yaw=v.Z; urBot.myCameraRotation.Roll=v.X; } } urBot.myCameraRotationOrder=0; // default 0 if (GetArgVal("Zoom")!="") urBot.myCameraZoom=converter.AngleToDeg(float(GetArgVal("Zoom"))); if (GetArgVal("Order")!="") urBot.myCameraRotationOrder=byte(int(GetArgVal("Order"))); break; case "TURN": // old command. Ignore it! if (GetArgVal("Rotation")!="") { ParseRotAsVec(v); if (converter!=None) { r = converter.RotatorToUU(v); } else { r.Pitch=v.Y; r.Yaw=v.Z; r.Roll=v.X; } urBot.myTurn.Pitch=r.Pitch; urBot.myTurn.Yaw=urBot.Rotation.Yaw+r.Yaw; urBot.myTurn.Roll=r.Roll; } distance = float(GetArgVal("Distance")); if(distance != 0.0) { if (converter!=None) urBot.myDistance = converter.LengthToUU(distance); else urBot.myDistance = distance; } break; case "DRIVE": // two wheel vehicle urBot.bNewThrottle = false; if (GetArgVal("Left")!="") { urBot.LeftThrottle = float(GetArgVal("Left")); urBot.bNewThrottle = true; } if (GetArgVal("Right")!="") { urBot.RightThrottle = float(GetArgVal("Right")); urBot.bNewThrottle = true; } if (GetArgVal("Normalized")!="") urBot.Normalized = bool(GetArgVal("Normalized")); else urBot.Normalized = false; // head light on'off if (GetArgVal("Light")!="") urBot.Light = bool(GetArgVal("Light")); // flip the vehicle if (GetArgVal("Flip")!="") urBot.Flip = bool(GetArgVal("Flip")); // general joint control if (GetArgVal("Steer")!="" && GetArgVal("Steer")!="None" && GetArgVal("Steer")!="none") { if (converter!=None) urBot.JSteer[urBot.JointControlIdx] = converter.AngleToUU(float(GetArgVal("Steer"))); else urBot.JSteer[urBot.JointControlIdx] = float(GetArgVal("Steer")); } else urBot.JSteer[urBot.JointControlIdx] = 65535; // 65535 means do not steer if (GetArgVal("Order")!="") urBot.JOrder[urBot.JointControlIdx] = byte(int(GetArgVal("Order"))); if (GetArgVal("Value")!="") { if (urBot.JOrder[urBot.JointControlIdx]==0 || urBot.JOrder[urBot.JointControlIdx]==1) urBot.JValue[urBot.JointControlIdx] = converter.AngleToUU(float(GetArgVal("Value"))); else urBot.JValue[urBot.JointControlIdx] = float(GetArgVal("Value")); } if (GetArgVal("Name")!="") { urBot.JName[urBot.JointControlIdx] = GetArgVal("Name"); if (urBot.JointControlIdx==15) urBot.JointControlIdx=0; else urBot.JointControlIdx+=1; } break; case "SENSOR": urBot.SetName = GetArgVal("Name"); if (GetArgVal("Scan")!="") urBot.RangeScan = bool(GetArgVal("Scan")); break; case "GETGEO": urBot.GeoType = GetArgVal("Type"); urBot.GeoName = GetArgVal("Name"); break; case "GETCONF": urBot.ConfType = GetArgVal("Type"); urBot.ConfName = GetArgVal("Name"); break; case "SET": if (GetArgVal("Client")!="") { gInfo.cltRobot = GetArgVal("Robot"); gInfo.cltCamera = GetArgVal("Name"); gInfo.cltIP = GetArgVal("Client"); break; } urBot.SetType = GetArgVal("Type"); urBot.SetName = GetArgVal("Name"); urBot.Opcode = GetArgVal("Opcode"); urBot.Params = GetArgVal("Params"); if (urBot.SetType=="RangeScanner") { if (GetArgVal("Scan")!="") urBot.RangeScan = bool(GetArgVal("Scan")); } else if (urBot.SetType=="IRCamera") { if (GetArgVal("Scan")!="") //urBot.IRCameraScan = true; urBot.IRCameraScan = bool(GetArgVal("Scan")); } else if (urBot.SetType=="INU") { if (GetArgVal("Reset")!="") urBot.SetOrientation = bool(GetArgVal("Reset")); } else if (urBot.SetType=="Odometry") { if (GetArgVal("Reset")!="") urBot.SetPosition = bool(GetArgVal("Reset")); } else if (urBot.SetType=="Encoder") { if (GetArgVal("Reset")!="") urBot.SetEncoder = bool(GetArgVal("Reset")); } break; case "MISPKG": urBot.MPName = GetArgVal("Name"); if (GetArgVal("Rotation")!="") { ParseRotAsVec(v); if (converter!=None) { urBot.MPRotation = converter.RotatorToUU(v); } else { urBot.MPRotation.Pitch=v.Y; urBot.MPRotation.Yaw=v.Z; urBot.MPRotation.Roll=v.X; } } if (GetArgVal("Translation")!="") { ParseVector(v,"Translation"); if (converter!=None) urBot.MPTranslation = converter.LengthVectorToUU(v); else urBot.MPTranslation=v; } urBot.MPOrder=0; // default 0 if (GetArgVal("Order")!="") urBot.MPOrder=byte(int(GetArgVal("Order"))); break; } } J_NHaIMaL>.zStair !Eq!0 EG8A,$^Enter state: ClimbStair G[1g^$Leave state: ClimbStairD G~X^&@zdkppppppppppppppp{Name <} {Resolution  b , _ } {FOV  u , s } {Range d}dk Gk@\M7^M 9?,d9?,9?,d9?,''9?,d9?,9?,d9?,'' G{]a%Q7xpppppppppppppp{Name <}{MaxRange  F}{MinRange  m}{VerticalResolution  b }{HorizontalResolution  _ }{VerticalFOV  u }{HorizontalFOV  s }x Gx@cvgCF:w*a/!|vOH ]wR* wu*uRur*-w*-9:O% 9:&\9=9:\&9:\,\$Ova/!0w.hu*O.hu 9:\,6O9?,PH.hu 9:\,6H6H%9?.haa/!ow.uD*O.uD f9:\,6O9?,PH.uD 9:\,6H6H%9?.ub]a/!oZw.QX*O.QX H.QX .QWa/!nr.*G &ru*w.*]. \. G .bO]@9:\,6O9?,PH\u9:\,6H6H%9?G  Gddp7Od|Lzi`ut ]C\~G | Gf|$u-r{*{.c+w{*J{J{~ {`{P {K{q t .p{~ w.t *r.t ^{q J{~ `{P K{q rwr*Cr ~r |rl GySW)CyW3wW*TW >S@T9DS G\UM_89:9:${.cUa U jyiU hyii}i,pMyIP=i G Deh5/C ,a@9?9?,M9D9?TatraU ZK99L'*yKyU } &} M_9?} ar%rC Q_9?r,I@9?C N_9?r,I@9?C sL6s9DQ6s9DN~raU ZK99s'*[U IZ99s[y I¸2>y[r} w*y Yy;76D%yDyy^^yuyFyFymymy GU @class USARBcSmall extends USARBc placeable config(USARBot); rui_BY6kyu uZ!`CP~$p@$ff $>@klmclass USARBc extends KTwoWheels placeable config(USARBot); var float LeftThrottle; var float RightThrottle; var rotator HLRotation; var int CameraZoom; var float PanSpeed, TiltSpeed; var config float CameraDefFov, CameraMinFov, CameraMaxFov; var float degCameraDefFov, degCameraMinFov, degCameraMaxFov; // headlight projector var const vector HeadlightOffset; var USARHeadlight Headlight; var bool HeadlightOn; var byte HeadlightItensity; // Wheel Draw Scale var float TireDrawScale; var vector TireDrawScale3D; // Wheel dirt emitter var BulldogDust Dust[2]; // FL, FR // Distance below centre of tire to place dust. var float DustDrop; // Ratio between dust kicked up and amount wheels are slipping var (USARCar) float DustSlipRate; var (USARCar) float DustSlipThresh; var (USARCar) Material TargetMaterial; // USARCar sound things var (USARCar) float EnginePitchScale; var (USARCar) float HitSoundThreshold; var config bool bDebug; // USAR Message var config float msgTimer; // USAR Sensors struct SSensor { var class SensorClass; var string SenName; var vector Position; var vector Direction; var rotator uuDirection; }; var config array Sensors; var array SensorList; var array ProcessedSensors; // USAR Battery var config int batteryLife; var int startTime; var int myLife; var config bool bSpeedControl; var config bool bAbsoluteCamera; var vector oldPos; var byte myState; // pid control loop var config float Kp,Ki,Kd; var config float MinOut,MaxOut; var float pidErr; var float pidInt; var float pidDer; var float lastErr; var float pidErr2; var float pidInt2; var float pidDer2; var float lastErr2; var config string ConverterClass; var USARConverter converter; var config bool bMountByUU; var config bool bDisplayTeamBeacon; replication { unreliable if(Role == ROLE_Authority) LeftThrottle, RightThrottle, HLRotation, HeadlightOn, HeadLightItensity, CameraZoom, myState; } simulated event PreBeginPlay() { local class cClass; Super.PreBeginPlay(); bNoTeamBeacon=!bDisplayTeamBeacon; cClass = class(DynamicLoadObject(ConverterClass, class'Class')); converter = new cClass; ConvertParam(converter); } simulated function ConvertParam(USARConverter converter) { local int i; if (converter==None) { degCameraDefFov = CameraDefFov; degCameraMinFov = CameraMinFov; degCameraMaxFov = CameraMaxFov; } else { degCameraDefFov = converter.AngleToDeg(CameraDefFov); degCameraMinFov = converter.AngleToDeg(CameraMinFov); degCameraMaxFov = converter.AngleToDeg(CameraMaxFov); } if (!bMountByUU && converter!=None) { for (i=0;iMaxOut) COut=MaxOut; return -1 * COut; } function float pidEngine2(float desiredPV, float currentPV, float delta) { local float COut; pidErr2 = desiredPV - currentPV; pidInt2 = pidInt2 + pidErr2 * delta; pidDer2 = (pidErr2 - lastErr2) / delta; lastErr2 = pidErr2; COut = Kp*pidErr2+pidInt2*Ki+pidDer2*Kd; if (COutMaxOut) COut=MaxOut; return -1 * COut; } function StartFlip(Pawn Pusher) { //local vector toPusher, worldUp; // if we are already flipping the car - dont do it again! if(FlipTimeLeft > 0) return; FlipTimeLeft = FlipTime; // Start the flip on the server USARRemoteBot(Controller).Flip = false; } function ProcessCarInput() { local vector worldForward, worldUp; local string outstring, geoType, confType; local int i, Jid; // Return sensor geo info geoType = USARRemoteBot(Controller).GeoType; if (geoType!="") { outstring = ""; for (i=0;i> Rotation; worldUp = vect(0, 0, 1) >> Rotation; ForwardVel = Velocity Dot worldForward; bIsInverted = worldUp.Z < 0.2; // 'ForwardVel' isn't very helpful if we are inverted, so we just pretend its positive. if(bIsInverted) ForwardVel = 2 * StopThreshold; //if (abs(LeftThrottle)<0.01&&abs(RightThrottle)<0.01&&(frontLeft.SpinSpeed>StopThreshold||frontRight.SpinSpeed>StopThreshold)) if (abs(LeftThrottle)<0.01&&abs(RightThrottle)<0.01) OutputBrake = true; else OutputBrake = false; IsDriving = true; OutputHandbrakeOn = false; KWake(); // currently, never let the car go to sleep whilst being driven. } // Car Simulation simulated function Tick(float Delta) { local float EnginePitch; local float actVel; // Battery if (myLife>=batteryLife) { myLife=batteryLife; USARRemoteBot(Controller).LeftThrottle=0; USARRemoteBot(Controller).RightThrottle=0; USARRemoteBot(Controller).myTurn.roll=0; USARRemoteBot(Controller).Light=false; } else myLife = Level.TimeSeconds - startTime; WheelSpinSpeed = (frontLeft.SpinSpeed + frontRight.SpinSpeed)/2; //log("WheelSpinSpeed:"$WheelSpinSpeed); // if we are in the process of flipping the car, keep it enabled! if( FlipTimeLeft > 0 ) KWake(); // If the server, process input and pack updated car info into struct. if(Role == ROLE_Authority) { ProcessCarInput(); PackState(); if (bSpeedControl && myState==0) { if (LeftThrottle != USARRemoteBot(Controller).LeftThrottle*6) pidInt=0; LeftThrottle = USARRemoteBot(Controller).LeftThrottle*6; if (RightThrottle != USARRemoteBot(Controller).RightThrottle*6) pidInt2=0; RightThrottle = USARRemoteBot(Controller).RightThrottle*6; } else { LeftThrottle = USARRemoteBot(Controller).LeftThrottle; RightThrottle = USARRemoteBot(Controller).RightThrottle; } if (LeftThrottle*RightThrottle>0) { LeftThrottle = -LeftThrottle; RightThrottle = -RightThrottle; } Throttle = (LeftThrottle+RightThrottle)/2.0; // If new 'drive' command is coming, stop the current tunring state. if ( (bSpeedControl && (LeftThrottle != USARRemoteBot(Controller).LeftThrottle*30 || RightThrottle != USARRemoteBot(Controller).RightThrottle*30)) || (!bSpeedControl && (LeftThrottle != USARRemoteBot(Controller).LeftThrottle || RightThrottle != USARRemoteBot(Controller).RightThrottle)) ) { myState=0; USARRemoteBot(Controller).myTurn.roll=0; // Stop the turning action } if (USARRemoteBot(Controller).myTurn.roll>0) { if (abs(USARRemoteBot(Controller).myTurn.Yaw-Rotation.Yaw)<200 || myState==2) { if (USARRemoteBot(Controller).myTurn.pitch>=0) { USARRemoteBot(Controller).myTurn.pitch=-10; oldPos=Location; } if (abs(vsize(Location-oldPos)-USARRemoteBot(Controller).myDistance)<50) { USARRemoteBot(Controller).myTurn.roll=-10; LeftThrottle=0; RightThrottle=0; myState=0; } else { myState=2; LeftThrottle=5; RightThrottle=5; } } else { myState=1; if (USARRemoteBot(Controller).myTurn.Yaw>0) { LeftThrottle=5; RightThrottle=-5; } else { LeftThrottle=-5; RightThrottle=5; } } } else myState=0; } if (bSpeedControl||myState==2||myState==1) { //Left actVel = frontLeft.Velocity dot (vect(-1, 0, 0) >> Rotation); if (actVel>0.01||actVel<-0.01||LeftThrottle>0.5||LeftThrottle<-0.5) frontLeft.WheelJoint.KMotorTorque=pidEngine(LeftThrottle,actVel,Delta); else frontLeft.WheelJoint.KMotorTorque=0.0; if (LeftThrottle*(LeftThrottle-actVel)>0) { if (LeftThrottle>0&&frontLeft.WheelJoint.KMotorTorque>0) frontLeft.WheelJoint.KMotorTorque=-0.01; if (LeftThrottle<0&&frontLeft.WheelJoint.KMotorTorque<0) frontLeft.WheelJoint.KMotorTorque=0.01; } if (frontLeft.WheelJoint.KMotorTorque>40) frontLeft.WheelJoint.KMotorTorque=40; if (frontLeft.WheelJoint.KMotorTorque<-40) frontLeft.WheelJoint.KMotorTorque=-40; if (bDebug) log("-LEFT DV:"$LeftThrottle@" V:"$actVel@" Er:"$pidErr@" IER:"$pidInt@" Out:"$frontLeft.WheelJoint.KMotorTorque); //Right actVel = frontRight.Velocity dot (vect(-1, 0, 0) >> Rotation); if (actVel>0.01||actVel<-0.01||RightThrottle>0.5||RightThrottle<-0.5) frontRight.WheelJoint.KMotorTorque=pidEngine2(RightThrottle,actVel,Delta); else frontRight.WheelJoint.KMotorTorque=0.0; if (RightThrottle*(RightThrottle-actVel)>0) { if (RightThrottle>0&&frontRight.WheelJoint.KMotorTorque>0) frontRight.WheelJoint.KMotorTorque=-0.01; if (RightThrottle<0&&frontRight.WheelJoint.KMotorTorque<0) frontRight.WheelJoint.KMotorTorque=0.01; } if (frontRight.WheelJoint.KMotorTorque>40) frontRight.WheelJoint.KMotorTorque=40; if (frontRight.WheelJoint.KMotorTorque<-40) frontRight.WheelJoint.KMotorTorque=-40; if (bDebug) log("-RIGHT DV:"$RightThrottle@" V:"$actVel@" Er:"$pidErr2@" IER:"$pidInt2@" Out:"$frontRight.WheelJoint.KMotorTorque); }else { frontLeft.WheelJoint.KMotorTorque = myEngine(LeftThrottle,frontLeft.SpinSpeed); frontRight.WheelJoint.KMotorTorque = myEngine(RightThrottle,frontRight.SpinSpeed); } // Braking if(OutputBrake) { frontLeft.WheelJoint.KBraking = MaxBrakeTorque; frontRight.WheelJoint.KBraking = MaxBrakeTorque; } else { frontLeft.WheelJoint.KBraking = 0.0; frontRight.WheelJoint.KBraking = 0.0; } if(OutputHandbrakeOn == true) { //Log("HANDBRAKE!!"); frontLeft.LateralFriction = TireLateralFriction + TireHandbrakeFriction; frontLeft.LateralSlip = TireLateralSlip + TireHandbrakeSlip; frontRight.LateralFriction = TireLateralFriction + TireHandbrakeFriction; frontRight.LateralSlip = TireLateralSlip + TireHandbrakeSlip; } else { frontLeft.LateralFriction = TireLateralFriction; frontLeft.LateralSlip = TireLateralSlip; frontRight.LateralFriction = TireLateralFriction; frontRight.LateralSlip = TireLateralSlip; } // Flipping if(FlipTimeLeft > 0) { FlipTimeLeft -= Delta; FlipTimeLeft = FMax(FlipTimeLeft, 0.0); // Make sure it doesn't go negative } if (Role==ROLE_Authority) { // log("*****PITCH:" $USARRemoteBot(Controller).uuCameraRotation.pitch $ " - " $ HLRotation.pitch); //log("*****YAW:" $USARRemoteBot(Controller).uuCameraRotation.yaw $ " - " $ HLRotation.yaw); if (USARRemoteBot(Controller).myCameraRotationOrder==0) { if (!bAbsoluteCamera&&USARRemoteBot(Controller).myCameraRotation.roll==0) { USARRemoteBot(Controller).myCameraRotation+=HLRotation; USARRemoteBot(Controller).myCameraRotation.roll=-1; } if (abs(HLRotation.pitch - USARRemoteBot(Controller).myCameraRotation.pitch) > 100.00) { if (USARRemoteBot(Controller).myCameraRotation.pitch > HLRotation.pitch) HLRotation.pitch += 100.00; else if (USARRemoteBot(Controller).myCameraRotation.pitch < HLRotation.pitch) HLRotation.pitch -= 100.00; else HLRotation.pitch += 0.0; } else HLRotation.pitch = USARRemoteBot(Controller).myCameraRotation.pitch; if (abs(HLRotation.yaw - USARRemoteBot(Controller).myCameraRotation.yaw) > 100.00) { if (USARRemoteBot(Controller).myCameraRotation.yaw > HLRotation.yaw) HLRotation.yaw += 100.00; else if (USARRemoteBot(Controller).myCameraRotation.yaw < HLRotation.yaw) HLRotation.yaw -= 100.00; else HLRotation.yaw += 0.0; } else HLRotation.yaw = USARRemoteBot(Controller).myCameraRotation.yaw; PanSpeed = 100.0/Delta; TiltSpeed = 100.0/Delta; }else { HLRotation+=USARRemoteBot(Controller).myCameraRotation; PanSpeed = USARRemoteBot(Controller).myCameraRotation.Yaw/Delta; TiltSpeed = USARRemoteBot(Controller).myCameraRotation.Pitch/Delta; } /* r.Pitch=(USARRemoteBot(Controller).myCameraRotation).Pitch+default.HLRotation.Pitch; r.Yaw=HLRotation.Yaw+(USARRemoteBot(Controller).myCameraRotation).Yaw; r.Roll=HLRotation.Roll+(USARRemoteBot(Controller).myCameraRotation).Roll; HLRotation=r; */ HeadlightOn=USARRemoteBot(Controller).Light; if (USARRemoteBot(Controller).Flip) StartFlip(None); if (USARRemoteBot(Controller).myCameraZoom>=0&&HeadLight!=NONE) { CameraZoom = USARRemoteBot(Controller).myCameraZoom; if (CameraZoom==0) CameraZoom = degCameraDefFov; // reset else if (CameraZoom<=degCameraMinFov) CameraZoom = degCameraMinFov; // low bound else if (CameraZoom>degCameraMaxFov) CameraZoom = degCameraMaxFov; // upper bound USARRemoteBot(Controller).myCameraZoom=-1; } } if(Level.NetMode != NM_DedicatedServer) { // Set headlight projector state. if (Headlight.Rotation!=HLRotation) Headlight.SetRelativeRotation(HLRotation+default.HLRotation); Headlight.DetachProjector(); if(HeadlightOn) Headlight.AttachProjector(); // Update dust kicked up by wheels. Dust[0].UpdateDust(frontLeft, DustSlipRate, DustSlipThresh); Dust[1].UpdateDust(frontRight, DustSlipRate, DustSlipThresh); } // This assume the sound is an idle-ing sound, and increases with pitch // as wheels speed up. EnginePitch = 64 + ((WheelSpinSpeed/EnginePitchScale) * (255-64)); SoundPitch = FClamp(EnginePitch, 0, 254); //Log("Engine Pitch:"$SoundPitch); //SoundVolume = 255; } function timer() { local string outstring; local int i; outstring="STA {Time "$Level.TimeSeconds$"}"$ " {State "$myState$"}"$ " {Camera "$(HLRotation)$"}"$ " {Zoom "$CameraZoom$"}"$ " {CameraVel "$TiltSpeed$","$PanSpeed$",0.0}"$ " {Attitude "$Rotation$"}"$ " {Location "$Location$"}"$ " {LeftWheel "$frontLeft.Velocity$"}"$ " {RightWheel "$frontRight.Velocity$"}"$ " {Velocity "$Velocity$"}"$ " {LightToggle "$HeadlightOn$"}"$ " {LightIntensity "$HeadlightItensity$"}"$ " {Battery "$(batteryLife-myLife)$"}"; USARRemoteBot(Controller).myConnection.SendLine(outstring); outstring = ""; for (i=0;i0.3) { frontLeft.RollFriction = TireRollFriction*0.5; frontLeft.LateralFriction = TireLateralFriction*0.0; } else { frontLeft.RollFriction = TireRollFriction; frontLeft.LateralFriction = TireLateralFriction; } if (FRand()>0.3) { frontRight.RollFriction = TireRollFriction*0.5; frontRight.LateralFriction = TireLateralFriction*0.0; } else { frontRight.RollFriction = TireRollFriction*FRand(); frontRight.LateralFriction = TireLateralFriction*FRand(); } frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); } function EndState() { log("Leave state: CrossPapers"); KVehicleUpdateParams(); } Begin: damp(); Sleep(0.2); if ( PhysicsVolume.LocationName=="Papers") goto('Begin'); GotoState('USARCar'); } /* state ClimbStair{ function BeginState() { log("Enter state: ClimbStair"); } function EndState() { log("Leave state: ClimbStair"); KVehicleUpdateParams(); } function climb() { if (frontLeft.RollFriction>TireRollFriction) return; frontLeft.RollFriction = TireRollFriction*100; frontLeft.LateralFriction = TireRollFriction*150; frontRight.RollFriction = TireRollFriction*100; frontRight.LateralFriction = TireRollFriction*150; frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); } Begin: climb(); Sleep(0.2); if ( PhysicsVolume.LocationName=="Stair") goto('Begin'); GotoState('USARCar'); } */ Vp.  G&class TrackTire extends USARTire; kclass TouchSensor extends Sensor config (USARBot); Const TouchRange = 0.16; // 3mm Const ScanStep = 0.25; // 4.7mm Const PointsPerCircle = 6; var config float Diameter; var float uuRadius; var int nCircles; var float CircleStep; function ConvertParam(USARConverter converter) { if (converter!=NONE) { uuRadius = converter.LengthToUU(Diameter)/2; } else { uuRadius = Diameter/2; } nCircles = int(uuRadius/ScanStep)+1; CircleStep = 2*pi/PointsPerCircle; } function bool isTouch() { local vector HitLocation,HitNormal; local actor Bumper; local vector RotX,RotY,RotZ; local rotator curRot; local vector startVec; local float radius; local int i,j; curRot = Rotation; startVec = Location; GetAxes(Rotation,RotX,RotY,RotZ); // send one Trace straight ahead Bumper = Trace(HitLocation, HitNormal, startVec + touchRange*vector(curRot), startVec, true); if (Bumper!=NONE) { //log("Bump with "$Bumper); return true; } // detect along the circle from the edge to the center with step ScanStep; for (i=0;ix . X x XOs-AXz-} 9?%W6. %6. %w.*}  } 9?% } -Yf s%f a,d,d-Y'fhO \ fh] ^ P~O ] \ ^ fh] ^ P%yO ] O P~x\ ^ \ P~rpliX 9?r9?yp9?xlta=9P9?r9?yp9?xlP GF<M Xa G @mM>umnoXa % 6@m6@n6@owX*Xa*X"-f jW?as' GJ^ AIY#BTMIST GT@P ZHLI,T-zcAppGEO {Type J}KAppGEO {Type c}A GA@NKW1:= r *(cx~W.WWx%x}W&BWxo W}Wx&BJo W{BJ(zo J'{%8{7 .z9W6r{ o c9W6r{ '{( GRMvZVictim: I was touched! Gx/class TarantulaSmallTire extends USARTire; V`xn`%c`,Y6k`+!`6x`+6k`+66V`+%66V`+%66V`+%6k`+6V`+&Y6d`+%6c`+%6b`+%6Q`?6V`+6g`?#???`-u' G.class TarantulaRearTrack extends KDTrack; QNO8W WA%~A7 tz9W6aA OW9W6aA 'A( GeM.^-uxu9:9:$Msa^ $9<'9<(MLh L!%!,6d!+%6c!+%6b!+%66Q!?9D9?6d!+66g!?66g!?9?%v9?66Q!?66N!+vGvGvv9?6d!+66g!?YY9?66Q!?66V!+9?6d!+66g!??66Q!?9D9?6c!+66g!?M66g!?9?%v9?66Q!?66N!+v9?vGvJv9?6c!+66g!?9?66Q!?66V!+9?6c!+66g!??66Q!?9D9?6b!+66g!?66g!?9?%v9?66Q!?66N!+iv9?vGvv9?6b!+66g!?  9?66Q!?66V!+9?6b!+66g!??6k!+6Q!?&!x!w66k!+M!w66k!+! GAITfBXI҅yF$I@VOU:4AT$?SQR$? $j<2$>lUZ&eC "r *T%T7 zsspppp{Type 9W6rT }{Name 9W6aT }spppps{Type 9W6rT }{Name 9W6aT }P%P76YT spppppps{Part 9WP6YT  Location 6y ' K9:P6-T  Orientation 6n ' J9:P6-T }PTs GT@/class TarantulaFrontTrack extends KDTrack; I[gB\sJI҅yF$I@VOU:4T$?SQR$? $j<2$>'class TarantulaArm extends KDPart; ]Y_H~ r *hzc3%e37 EzWWpppppppp{PackageType 9W6r3 }{Name 9W6a3  Location 2y # W9:%6-3  Orientation 2n # V9:%6-3 }HWppppppppW{PackageType 9W6r3 }{Name 9W6a3  Location 2y # W9:%6-3  Orientation 2n # V9:%6-3 }A%[A76Y3 WppppppW{Part 9WA6Y3  Location 6y ' K9:A6-3  Orientation 6n ' J9:A6-3 }AO3!3%37 z9W6r3 c1zW#zW9W6a3 zWWpppppp{Name 9W6a3  Location 2y # W9:%6-3  Orientation 2n # V9:%6-3 }WppppppW{Name 9W6a3  Location 2y # W9:%6-3  Orientation 2n # V9:%6-3 }A%A76Y3 WppppppW{Part 9WA6Y3  Location 6y ' K9:A6-3  Orientation 6n ' J9:A6-3 }A3oW G3@]h@`^6 2$?D$Y=class Tarantula extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { if (myCamera!=None) initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*690; RightValue = USARRemoteBot(Controller).RightThrottle*690; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[5].state = 1; // new command JointsControl[5].order = 1; JointsControl[5].value = LeftValue; JointsControl[7].state = 1; // new command JointsControl[7].order = 1; JointsControl[7].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[4].state = 1; // new command JointsControl[4].order = 1; JointsControl[4].value = RightValue; JointsControl[6].state = 1; // new command JointsControl[6].order = 1; JointsControl[6].value = RightValue; bNewCommand = true; } if (JointsControl[5].value==JointsControl[7].value) cachedLeftValue=JointsControl[5].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[4].value==JointsControl[6].value) cachedRightValue=JointsControl[4].value; else cachedRightValue=1000000; // a big value to force updating } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[8].state = 1; //JointsControl[8].steer = 65535; JointsControl[8].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[8].value = CameraPan; } if (JointsControl[8].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[9].state = 1; //JointsControl[9].steer = 65535; JointsControl[9].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[9].value = CameraTilt; } if (JointsControl[9].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } a`"iB Y6bX"u F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i#9:S$  :A B :?:::?:7:S$  :A :?:::?:Q:S$  : B :?:::?:T:S$  : :?:::?:N$L>[$A\$AC$RI9 p#U^dJUV.zcCppCONF {Type J}MCppCONF {Type c}C GC@oRmWg]稨9VRhit a victim at9XPat time9Uby9VQ GPcg%r *zcVpp{ScanInterval 9Ue}G%G7 VppppV{PackageType 9W6rG }{Name 9W6aG }U%U76YG VpV{Part 9WU6YG g 'B9:U6-G w%Yw7gVpppppppVMount M_9WU6YG _9W6twg  Location  y  Wwg Orientation  n  VwgwhVppVParent 9W6a9:U6-G  }UGEG%G7 z9W6rG c1zW#zW9W6aG zVVpppp{ScanInterval 9Ue}{Name 9W6aG }VppppV{ScanInterval 9Ue}{Name 9W6aG }U%U76YG VppV{Part 9WU6YG Parent 9W6a9:U6-G  g 'B9:U6-G w%w7gVpppppppVMount M_9WU6YG _9W6twg  Location  y  Wwg Orientation  n  VwgwVpV}UGV GG@Sclass StereoP2AT extends P2AT; var config vector stereoSpacing; //(eye to eye)/2 spacing in UU var vector uuStereoSpacing; simulated function ConvertParam(USARConverter converter) { Super.ConvertParam(converter); if (converter!=None) { uuStereoSpacing = converter.LengthVectorToUU(stereoSpacing); } else { uuStereoSpacing = stereoSpacing; } } simulated function DrawHud(Canvas C) { local int halfSizeX; local vector stereoRotated; halfSizeX = C.SizeX/2.0; stereoRotated = uuStereoSpacing >> myCamera.Rotation; C.Reset(); C.Clear(); //Clears frame & Z buffers //left Eye: C.DrawPortal(0, 0, halfSizeX, C.SizeY, myCamera, myCamera.Location - stereoRotated, myCamera.Rotation, CameraZoom); //Right Eye: C.DrawPortal(halfSizeX, 0, halfSizeX, C.SizeY, myCamera, myCamera.Location + stereoRotated, myCamera.Rotation, CameraZoom); super.DrawHud(C); } bhX#MB Y6iIbqҽ Fҽҽҽҽ F Fҽҽ F Fr~: #=Aclass SpecialMaterial extends Modifier editinlinenew; var() editinlineuse int heat; var() editinlineuse bool bAbsorb; j`!p@0knAOf" MCclass SoundSensor extends Sensor config (USARBot); function String GetData() { local string Outstring; local float Distance,tmpLoudness,tmpDuration; local float Loudness,Duration; local array Victims; local int i; Outstring=""; Victims = USARDeathMatch(Level.Game).Victims; for (i=0;iVictims[i].SoundRadius*100) Continue; // get loudness Distance = Distance/Victims[i].SoundRadius/50; if (Distance<1) tmpLoudness=Victims[i].SoundVolume; else tmpLoudness = Victims[i].SoundVolume / (Distance*Distance); // get duration tmpDuration = GetSoundDuration(Victims[i].HelpSound); // find the loudest sound if (Loudness0) Outstring=super.GetData()@"{Loudness "$converter.FloatString(Loudness)$"} {Duration "$converter.FloatString(Duration)$"}"; return Outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); return outstring; }  10430.3783505u<R > G ld n pTe3}>BEPEPEPEPEPEPEPrrRZ= AY"$#$"$zD#$zD(]SoundI:// // author: Erik Winter // created: 2005-02-22 Created the class from the USARSim RangeSensor class // // modified: 2005-02-24 // 2005-02-28 Made the sonar send out the traces within a cone // 2005-03-03 Added functionality so the getRange fctn doesn't care if it hits a surface with a to big angle // 2005-04-04 (Jijun Wang) Added BeamAngle, so we specify Beam Angle from the configuration file // Todo: Make sure that the sonar returns the closest object in a cone-shaped volume instead of along a line class SonarSensor extends RangeSensor config (USARBot); var config float BeamAngle; var int uuBeamAngle; function ConvertParam(USARConverter converter) { super.ConvertParam(converter); if (converter!=NONE) { uuBeamAngle = converter.AngleToUU(BeamAngle); } else { uuBeamAngle = BeamAngle; } } // GetRange should look for objects within a cone // The idea is to send out Trace's along a number of different circles. // Todo: the sensor shouldn't measure a wall it hits with a normal different than 90 deg +/- some const DONE! Right now with 10 as const function float GetRange() { local vector HitLocation,HitNormal; local float range, rangeTmp,radius,yawOS,pitchOS; local int nrCircles, tracesPerCircle; local float degreesPerCircle; local int i,j; local Rotator rotWOS; // the current rotator with added offset //local string debugStr; //local vector A,B; local float angle; // tracesPerCircle = 8; // send out a Trace every 360/tracesPerCircle degree degreesPerCircle = 4*32768/180; // how much wider will the cone be for each new circle, nrCircles = uuBeamAngle/degreesPerCircle; // OBS In one direction. The cone will be degreesPerCircle*2*nrCircles degrees wide // send one Trace straight ahead if (Trace(HitLocation, HitNormal, Location + uuMaxRange*vector(curRot), Location, true)==NONE) range=uuMaxRange; else range=VSize(HitLocation-Location); // send out Trace's along cones for(i=1;i<=nrCircles;i++){ radius = i*degreesPerCircle; // i*degreesPerCircle*DegreeToRadian*RadianToURot for(j=0;j0) range=InterpCurveEval(OutputCurve, range); range += RandRange(-Noise,Noise)*range; if (range>MaxRange) range=MaxRange; if (rangeL$@FSRZ= AY"$#$"$@#$@|(]SonarV5class SICKLMSr extends SICKLMS config (USARBot); z/JfIs^ ?ML? G9class SICKLMS extends RangeScanner config (USARBot); {class Sensor extends Item abstract; var config bool HiddenSensor; var config InterpCurve OutputCurve; var config float Noise; // Whether the sensor data will be sent out in group style or not. Right now, // all the sensor in the same type are treated as a group var config bool bUseGroup; var config bool bWithTimeStamp; function Init(String SName, Actor parent, vector position, rotator direction, KVehicle platform, name mount) { Super.Init(SName,parent,position,direction,platform,mount); bHidden = HiddenSensor; } function String GetData() { local string outstring; outstring="{Name "$ItemName$"}"; return outstring; } function String GetHead() { local string outstring; if (bWithTimeStamp) outstring="SEN {Time "$Level.TimeSeconds$"} {Type "$ItemType$"}"; else outstring="SEN {Type "$ItemType$"}"; return outstring; } function String GetConfHead() { local string outstring; outstring="CONF {Type "$ItemType$"}"; return outstring; } function String GetConfData() { return "{Name "$ItemName$"}"; } function string GetGeoHead() { local string outstring; outstring="GEO {Type "$ItemType$"}"; return outstring; } function string GetGeoData() { local string outstring; if (converter==None) outstring="{Name "$ItemName$" Location "$(Location-Base.Location)$" Orientation "$(Rotation-Base.Rotation)$" Mount "$ItemMount$"}"; else outstring="{Name "$ItemName$" Location "$(converter.Str_LengthVectorFromUU(Location-Base.Location)) $" Orientation "$(converter.Str_RotatorFromUU(Rotation-Base.Rotation)) $" Mount "$ItemMount$"}"; return outstring; } ]class RoverHeadlight extends USARHeadlight; // Empty tick here - do detach/attach in Bulldog tick function Tick(float Delta) { } ~VwD66kV+ G%yrs`{:y=%pW~"dT"5Twclass Rover extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; var bool bAdjust; var Quat expQ; var config float safeDistance; replication { reliable if(Role == ROLE_Authority) expQ; } // The following simulate the differential of Rover. The differential ensures // that the main body angle always averages the left and right wheel rocker angles. simulated function Differential() { local Quat relQ; local vector leftBarX,rightBarX,leftBarY,chassisX; local float diffAng; if (Role == ROLE_Authority) { leftBarX = QuatRotateVector(Parts[0].KGetRBQuaternion(),vect(1,0,0)); leftBarY = QuatRotateVector(Parts[0].KGetRBQuaternion(),vect(0,1,0)); rightBarX = QuatRotateVector(Parts[1].KGetRBQuaternion(),vect(1,0,0)); if (VSize(leftBarX-rightBarX)<0.01) diffAng=0.0; else diffAng = -ACos(leftBarX Dot rightBarX)/2; chassisX = QuatRotateVector(QuatFromAxisAndAngle(leftBarY,diffAng),leftBarX); relQ = QuatFindBetween(QuatRotateVector(KGetRBQuaternion(),vect(1,0,0)),chassisX); expQ = QuatProduct(relQ,KGetRBQuaternion()); } if (Role == ROLE_Authority) KGetRigidBodyState(ChassisState); if (ChassisState.Quaternion != expQ) { if (!KIsAwake()) KWake(); ChassisState.Quaternion = expQ; bAdjust = true; } } // This only update the chassis. The wheels update themselves. simulated event bool KUpdateState(out KRigidBodyState newState) { // This should never get called on the server - but just in case! if(!bAdjust && (Role == ROLE_Authority || !bNewRobotState)) return false; // Apply received data as new position of car chassis. newState = ChassisState; bNewRobotState = false; bAdjust = false; return true; //return false; } function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt,i; local bool bStop; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*20000; RightValue = USARRemoteBot(Controller).RightThrottle*20000; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[5].state = 1; // new command JointsControl[5].order = 1; JointsControl[5].value = LeftValue; JointsControl[7].state = 1; // new command JointsControl[7].order = 1; JointsControl[7].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[4].state = 1; // new command JointsControl[4].order = 1; JointsControl[4].value = RightValue; JointsControl[6].state = 1; // new command JointsControl[6].order = 1; JointsControl[6].value = RightValue; bNewCommand = true; } if (JointsControl[5].value==JointsControl[7].value) cachedLeftValue=JointsControl[5].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[4].value==JointsControl[6].value) cachedRightValue=JointsControl[4].value; else cachedRightValue=1000000; // a big value to force updating } // turn if (abs(LeftValue)>1000 && LeftValue==-RightValue) { JointParts[0].BrakeTorque = MotorTorque*1.2; JointParts[1].BrakeTorque = MotorTorque*1.2; JointsControl[4].steer = -8000; JointsControl[5].steer = 8000; JointsControl[6].steer = 8000; JointsControl[7].steer = -8000; } else if (abs(LeftValue)>1000) { JointParts[0].BrakeTorque = 0; JointParts[1].BrakeTorque = 0; JointsControl[4].steer = 0; JointsControl[5].steer = 0; JointsControl[6].steer = 0; JointsControl[7].steer = 0; } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[10].state = 1; //JointsControl[10].steer = 65535; JointsControl[10].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[10].value = CameraPan; } if (JointsControl[10].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[11].state = 1; //JointsControl[11].steer = 65535; JointsControl[11].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[11].value = CameraTilt; } if (JointsControl[11].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; //restrict the camera tilting angle if (abs(myCamera.Rotation.Pitch - initCameraRot.Pitch - JointsControl[11].value)>11000) { JointsControl[11].value=0; JointsControl[11].state=0; KCarWheelJoint(Joints[11]).KMotorTorque = 0.0; KCarWheelJoint(Joints[11]).KBraking = 1.0; KCarWheelJoint(Joints[11]).KMaxSpeed = 1310700; } } // range sensor guard. If close to wall, stop me bStop=false; if (RangeSensor(SensorList[0]).GetRange()0.0) { bStop=true; break; } if (bStop) { log("blocking..."); JointParts[0].BrakeTorque = 0; JointParts[1].BrakeTorque = 0; for (i=4; i<=7; i++) { JointsControl[i].state = 1; // new command JointsControl[i].order = 1; JointsControl[i].value = 0.0; } } } //bReady = true; } simulated function Tick(float Delta) { local int i; local bool bStop; Super.Tick(Delta); Differential(); // range sensor guard. If close to wall, stop me bStop=false; if (RangeSensor(SensorList[0]).GetRange()0.0) { bStop=true; break; } if (bStop) { log("blocking..."); JointParts[0].BrakeTorque = 0; JointParts[1].BrakeTorque = 0; for (i=4; i<=7; i++) { JointsControl[i].state = 1; // new command JointsControl[i].order = 1; JointsControl[i].value = 0.0; } } } } A\h?\x G|d"t 9:9:$GB Y6&@-T>uJ-T F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪ FwawawaJ-T7K7K7K}$Q8>^$AC$Q9B$75t o#Et >4xt .Y%uY7t GkrYt GAt GY&uY  GD/)L&D=aD' GUCc)(&F9?c >F8 G^ q ?(\q .J7q G@q GJ&Jq G GDpy30[a/!nNot KRobot!a( p.[~zM z^ q%zq7ppa6P qp O66wqp$z^  iOi66wqpqpzM cOc66wqp~qqw%ppOdometry: Use 9W6tp as Right wheel.~%ppOdometry: Use 9W6t~p as Left wheel.;{M~p UMq~%Invalid LeftTire NameMa( V.~p*{^ p U^ %Invalid RightTire NameMa( M.p*[ C`mB9?9DV M `QV RM  Ghclass RobotCamera extends Sensor config (USARBot); var config float CameraDefFov, CameraMinFov, CameraMaxFov; var int degCameraDefFov, degCameraMinFov, degCameraMaxFov, CameraFov; replication { reliable if(Role == ROLE_Authority) CameraFov; } function ConvertParam(USARConverter converter) { if (converter!=NONE) { degCameraDefFov = converter.AngleToDeg(CameraDefFov); degCameraMinFov = converter.AngleToDeg(CameraMinFov); degCameraMaxFov = converter.AngleToDeg(CameraMaxFov); } else { degCameraDefFov = CameraDefFov; degCameraMinFov = CameraMinFov; degCameraMaxFov = CameraMaxFov; } CameraFov = degCameraDefFov; } function String GetData() { return ""; } function string Set(String opcode, String args) { local int zoom; if (Caps(opcode)=="ZOOM") { zoom=converter.AngleToDeg(Float(args)); if (Zoom>degCameraMaxFov) CameraFov = degCameraMaxFov; else if (zoom o? Hm o H>o?HoH '' Ghclass RobotB extends KRobot config(USARBot); var bool bAdjust; var Quat expQ; replication { reliable if(Role == ROLE_Authority) expQ; } // The following simulate the differential of Rover. The differential ensures // that the main body angle always averages the left and right wheel rocker angles. simulated function Differential() { local Quat relQ; local vector leftBarX,rightBarX,leftBarY,chassisX; local float diffAng; if (Role == ROLE_Authority) { leftBarX = QuatRotateVector(Parts[0].KGetRBQuaternion(),vect(1,0,0)); leftBarY = QuatRotateVector(Parts[0].KGetRBQuaternion(),vect(0,1,0)); rightBarX = QuatRotateVector(Parts[1].KGetRBQuaternion(),vect(1,0,0)); if (VSize(leftBarX-rightBarX)<0.01) diffAng=0.0; else diffAng = -ACos(leftBarX Dot rightBarX)/2; chassisX = QuatRotateVector(QuatFromAxisAndAngle(leftBarY,diffAng),leftBarX); relQ = QuatFindBetween(QuatRotateVector(KGetRBQuaternion(),vect(1,0,0)),chassisX); expQ = QuatProduct(relQ,KGetRBQuaternion()); } if (Role == ROLE_Authority) KGetRigidBodyState(ChassisState); if (ChassisState.Quaternion != expQ) { if (!KIsAwake()) KWake(); ChassisState.Quaternion = expQ; bAdjust = true; } } // This only update the chassis. The wheels update themselves. simulated event bool KUpdateState(out KRigidBodyState newState) { // This should never get called on the server - but just in case! if(!bAdjust && (Role == ROLE_Authority || !bNewRobotState)) return false; // Apply received data as new position of car chassis. newState = ChassisState; bNewRobotState = false; bAdjust = false; return true; //return false; } simulated function Tick(float Delta) { Super.Tick(Delta); //Differential(); } Ks"vc9:9:$GB Y6L(xu7K7K7K;i;Eh:S$  :B :?::A:?:Hh:S$  : :?::A:?:9:S$ E :4B A@ :?:::?:7:S$ H :4B @ :?:::?:Q:S$ E :4 A@ :?:::?:T:S$ H :4 @ :?:::?:B$o;F$L?n#Qclass RobotA extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; var float TransX, TransZ; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; local int i, Jidx; local float barLen, bTheta, aTheta, tLen1, tLen2; local MisPackage mPkg; Super.ProcessCarInput(); barLen = 10; if (USARRemoteBot(Controller).MPName!="") { i = FindMisPackage(USARRemoteBot(Controller).MPName); if (i>=0) { mPkg = Packages[i]; if (mPkg.Type=='Arm') { TransX += USARRemoteBot(Controller).MPTranslation.X; TransZ += USARRemoteBot(Controller).MPTranslation.Z; tLen1 = TransX*TransX + TransZ*TransZ; tLen2 = 2*barLen*barLen; if (tLen165535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[5].state = 1; //JointsControl[5].steer = 65535; JointsControl[5].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[5].value = CameraPan; } if (JointsControl[5].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[6].state = 1; //JointsControl[6].steer = 65535; JointsControl[6].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[6].value = CameraTilt; } if (JointsControl[6].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } AREnter state: CrossPapers GPIw&VIuaL>/zPapers !Eq!0 EG8SPSQaPppVolume:PState:9Wa^zPPapersq!w!E G FIumd .rM* rV*Can't find tires M-V-稨Left tire on ground is9TM- Right tire on ground is9TV- [ ILV7raRaM 9?,dVM '*Can't find the ground!a( WM ReWFE9?9DW9?,F9?,-|KW ף;K9?%QV RM KW GJ @TJaPJ [%w[7;mz[zJJJ J [z&[~$[J  GUl61LlppppppppppppppppppppppppppppppppppppppppSTA {Time 9U} {State 9Rn} {Camera 9YM} {Zoom 9Sb} {CameraVel 9UC,9UD,0.0} {Attitude 9Y} {Location 9X} {LeftWheel 9X  } {RightWheel 9X } {Velocity 9X} {LightToggle 9T-~} {LightIntensity 9RT} {Battery 9SA c}. $llo%o7;9:o~%Coz-f laozJ^loz&{l."$ozYloo%o7;o~$o G^Zm.*cA cA .#."6. ]%.-V(c9D9?Ku 9?,|9?%y9:9:$+@-G  9:n%=@.#9?,V@.#9?,C."9?,SC."9?,@.#C." @C9?%@@CC@C@-G F@.#9?,!C."9?,G-G :@.#C."n$6. ]%q6. ]%9?6. ]69?, 9:n,6. ]%6. ]OO.p 9?,26. ]@Cn$n$@@C@nn$X6. ]%@@Cn@C@yn$a -G  9:n, 9:n&q  a#>q #< q # @? @ D@qm[  @@q9?%@9?% 9?%  # @9?% 9?%  #<I 9?,(  B 9?  -zppppp-LEFT DV:9U@ V:9Uq Er:9UF IER:9UV Out:9U q a#q #< q # C? CCCqmjCCq9?%C9?%9?% #jC9?%9?% #<9?,( B9? ^ -zppppp-RIGHT DV:9UC V:9Uq Er:9UJ IER:9US Out:9U  b@ bC -} H H C   -p' H  hA H hA   H hHh9 |9?%|m||9:9:$ 9:.% -l6. %a>. M6.  9?6M6. B7 6. 6M6M9DB t 6. 6M6M9DB 6M9D 6M6. o 9?6M6. B 6. 6M6M9DBl Y 6. 6M6M9DBl 6M9D 6M6. DBmCBm"a>M. D9?6. mC9?6. m-~.-V[.-nP*.L9?% wD*b9D.Lb%b9Dv9?bub9Du9?bsb9Ds.L9:9:$^D MDa<MMDO-~Dz%lZ wx&lZwxTBuF9?,,@9CT~C Gc@QR 6srV* rM*y/-|u>e9?% R V QO M R[ UhiR U9?%AR AR O U9?%BO BO FAIBA9?9DFe9DFAeEB9?9DIe9DIBeEVAB9?,6c6{V6{6c6{V6{WABWo:XWB(X6c6{Xo6cI@6c9?,I@6cI@6c9?,I@{cQV RM Tw*Lpppppp{Pose w6c,w6c, 9D6c"F}pLpp{Pose 9Xc} GMB#wB Y6$Xku̪̪̪̪̪ F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i#9:S$  :A B :?:::?:7:S$  :A :?:::?:Q:S$  : B :?:::?:T:S$  : :?:::?:m#OP// =============================================================== // USARBot.RFIDVictSensor // // Added additional functionality for the Automatic Referee // Mentar Mahmudi - International University Bremen - m.mahmudi@iu-bremen.de // =============================================================== class RFIDVictSensor extends sensor config(USARBot); //distance for the ranges var config float VictMinRange; var config float FPMinRange; var config float MaxRange; var config float VictStatusRange; var float uuVictMinRangeSquare; var float uuFPMinRangeSquare; var float uuMaxRangeSquare; var float uuVictStatusRangeSquare; var config float RFIDFOV; // default value is around 30 deg. function ConvertParam(USARConverter converter) { if (converter != None) { uuMaxRangeSquare = converter.LengthToUU(MaxRange) * converter.LengthToUU(MaxRange); uuVictMinRangeSquare = converter.LengthToUU(VictMinRange) * converter.LengthToUU(VictMinRange); uuFPMinRangeSquare = converter.LengthToUU(FPMinRange) * converter.LengthToUU(FPMinRange); uuVictStatusRangeSquare = converter.LengthToUU(VictStatusRange) * converter.LengthToUU(VictStatusRange); } else { uuMaxRangeSquare = MaxRange*MaxRange; uuVictMinRangeSquare = VictMinRange*VictMinRange; uuFPMinRangeSquare = FPMinRange*FPMinRange; uuVictStatusRangeSquare = VictStatusRange * VictStatusRange; } } function float VectLenSq(vector v) { return v.x * v.x + v.y * v.y + v.z * v.z; } function String GetData() { local string Outstring; local int i; local vector diff, pos; local array tags; Outstring=""; tags = USARDeathMatch(Level.Game).VictRFIDTags; //Prints the position of the tag(s) in terms of the coordinate system with //the robot tag sensor being at the origin. for (i = 0; i < tags.length; i++) { diff = tags[i].Location - Location; if (VectLenSq(diff) < uuMaxRangeSquare) { pos = tag_pos(tags[i]); if(inFOV(pos)) { //checks whether the tag is in the FOV of the robot if(tags[i].id == -1) { //false positive if(VectLenSq(diff) < uuFPMinRangeSquare) Outstring = Outstring$" {ID FalsePositive} {Status None} {Location "$converter.VectorString(pos, 2)$"}"; else Outstring = Outstring$" {ID None} {Status None} {Location "$converter.VectorString(pos, 2)$"}"; } else { //victim positive if ( (VectLenSq(diff) < uuVictMinRangeSquare) && (VectLenSq(diff) > uuVictStatusRangeSquare ) ) Outstring = Outstring$" {ID "$tags[i].name$"} {Status None} {Location "$converter.VectorString(pos, 2)$"}"; else if ( VectLenSq(diff) < uuVictStatusRangeSquare ) Outstring = Outstring$" {ID "$tags[i].name$"} {Status "$tags[i].status$"} {Location "$converter.VectorString(pos, 2)$"}"; else Outstring = Outstring$" {ID None} {Status None} {Location "$converter.VectorString(pos, 2)$"}"; } } } } if (Outstring != "") Outstring = "{Name "$ItemName$"}"$OutString; //log(Outstring); return Outstring; } function vector tag_pos(VictRFIDTag aTag) { local vector tag_pos, robot_pos, VX, VY, VZ, tmp, pos; local Rotator robot_rot; local Matrix T; local Plane PX, PY, PZ, PW; tag_pos = aTag.Location; robot_pos = Location; robot_rot = Rotation; // calculating the position of the tag GetUnAxes (robot_rot, VX, VY, VZ); PX.x = VX.x; PX.y = VX.y; PX.z = VX.z; PX.W = 0; PY.x = VY.x; PY.y = VY.y; PY.z = VY.z; PY.W = 0; PZ.x = VZ.x; PZ.y = VZ.y; PZ.z = VZ.z; PZ.W = 0; tmp.x = VX.x; tmp.y = VY.x; tmp.z = VZ.x; PW.x = - ( tmp Dot robot_pos ); tmp.x = VX.y; tmp.y = VY.y; tmp.z = VZ.y; PW.y = - ( tmp Dot robot_pos); tmp.x = VX.z; tmp.y = VY.z; tmp.z = VZ.z; PW.z = - ( tmp Dot robot_pos); PW.W = 1; T.XPlane = PX; T.YPlane = PY; T.ZPlane = PZ; T.WPlane = PW; //use converter here pos.x = converter.LengthFromUU(T.XPlane.X * tag_pos.x + T.YPlane.x * tag_pos.y + T.zplane.x * tag_pos.z + T.wplane.x); pos.y = converter.LengthFromUU(T.XPlane.Y * tag_pos.x + T.YPlane.Y * tag_pos.y + T.zplane.Y * tag_pos.z + T.wplane.Y); pos.z = converter.LengthFromUU(-(T.XPlane.Z * tag_pos.x + T.YPlane.Z * tag_pos.y + T.zplane.Z * tag_pos.z + T.wplane.Z)); return pos; //yaw = robot_rot.yaw*2*Pi/65536; //the calculation is correct. //x = ((tag_pos.x - robot_pos.x) * cos(yaw) + (tag_pos.y - robot_pos.y) * sin(yaw))/52.5; //y = (-(tag_pos.x - robot_pos.x) * sin(yaw) + (tag_pos.y - robot_pos.y) * cos(yaw))/52.5; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{MaxRange "$MaxRange$"} {VictMinRange "$VictMinRange$"} {FPMinRange "$FPMinRange$"}"; return outstring; } function bool inFOV(vector pos) { local float angle; angle = ATan(pos.x, pos.y); if((angle < (pi/2 - RFIDFOV/2)) || (angle > (pi/2 + RFIDFOV/2))) return false; angle = ATan(pos.x, pos.z); if((angle < (pi/2 - RFIDFOV/2)) || (angle > (pi/2 + RFIDFOV/2))) return false; return true; } _\K+a#S.p{Sur%r7;rz 1SuurzH| rr4."$p| zIu.pR.q{Rur%r7;urz 1Ruurz%| rr{u."$p| zJu.qKa#La#?\K-y 6LL>U-y \@o@ #<C #<-}'-}(-^'-p( Gea[PSU"3|9?% |z.-n( G`#N#tB Y6]bu F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i9[ :$  :ff@33@ff :?:::?:7[ :$  :ff@33ff :?:::?:][ :$  :33I :?:::?:C$o:B$ŧ7 g#Y~x^e}ʺԄrrr3}>B}ʺԄ}ʺԄrr}ʺԄr}ʺԄ}ʺԄrrrrrrrrrr~$?P$?L$?Q$?\$?(] VictRFID\// =============================================================== // USARBot.RFIDTag // // This class simulates the RFID tag. The variable 'id' is the tag's // id number. The tag automatically registers to the game to help // the RFID reader quickly search all the tags and decide which tag // should be detected. // // Original created by: Alexander Kleiner and Christian // Modified by: Jijun Wang -- 12/15/2005 // =============================================================== class RFIDTag extends Actor placeable; var () int id; var () bool bSingleShot; // Register to the game function Register() { local USARDeathMatch UsarGame; local int Index; UsarGame = USARDeathMatch(Level.Game); Index = UsarGame.RFIDTags.length; UsarGame.RFIDTags.Insert(Index, 1); UsarGame.RFIDTags[Index] = self; if(UsarGame.bAutoId) UsarGame.RFIDTags[Index].id = Index+1000; } // Unregister from the game function Unregister() { local USARDeathMatch UsarGame; local int i; UsarGame = USARDeathMatch(Level.Game); for (i = 0; i < UsarGame.RFIDTags.length; i++) { if (UsarGame.RFIDTags[i] == self) { UsarGame.RFIDTags.Remove(i, 1); break; } } } simulated function PostNetBeginPlay() { super.PostNetBeginPlay(); Register(); } simulated event Destroyed() { Unregister(); Super.Destroyed(); } CmnCA JnlSSJE\J]E]JCQJSR\SCH CH CK CK C GvWs3rfzsRESETc#{#QV RM OKFailed Ge@e@@lbg&BzL@ppp{Name <} LL@ G@@XPfj%}P}pppp}{ScanInterval  D}{EncoderResolution  F}} G}@A>// =============================================================== // USARBot.RFIDSensor // // This class simulates the RFID reader. It iterates all the // registered RFID tags and reports the tags that are within the // detecting range. Single transmission is applied in tag info // transfer. // // Original created by: Alexander Kleiner and Christian // Modified by: Jijun Wang -- 12/15/2005 // Mentar Mahmudi - IUB - m.mahmudi@iu-bremen.de -- 14/02/2006 // =============================================================== class RFIDSensor extends sensor config(USARBot); var config float MaxRange; var float uuMaxRangeSquare; var array detectedTags; function ConvertParam(USARConverter converter) { if (converter != None) { uuMaxRangeSquare = converter.LengthToUU(MaxRange) * converter.LengthToUU(MaxRange); } else { uuMaxRangeSquare = MaxRange*MaxRange; } } function int getDetectedTag(int idx) { local int i; for (i = 0; i < detectedTags.length; i++) { if (detectedTags[i] == idx) return i; } return -1; } function float VectLenSq(vector v) { return v.x * v.x + v.y * v.y + v.z * v.z; } function String GetData() { local string Outstring; local int i, idx; local vector diff, pos; local array tags; Outstring=""; tags = USARDeathMatch(Level.Game).RFIDTags; //Prints the position of the tag(s) in terms of the coordinate system with //the robot tag sensor being at the origin. for (i = 0; i < tags.length; i++) { diff = tags[i].Location - Location; if (VectLenSq(diff) < uuMaxRangeSquare) { //if (!tags[i].bSingleShot || getDetectedTag(i) == -1) { if (getDetectedTag(i) == -1) { Outstring = Outstring$" {ID "$tags[i].id$"}"; pos = tag_pos(tags[i]); Outstring = Outstring$" {Location "$converter.VectorString(pos, 2)$"}"; if (tags[i].bSingleShot) { detectedTags.Insert(detectedTags.length, 1); detectedTags[detectedTags.length - 1] = i; } } } else if (!tags[i].bSingleShot) { idx = getDetectedTag(i); if (idx >= 0) detectedTags.Remove(idx, 1); } } if (Outstring!="") Outstring = "{Name "$ItemName$"}"$OutString; //if (Outstring!="") //log(Outstring); return Outstring; } function vector tag_pos(RFIDTag aTag) { local vector tag_pos, robot_pos, VX, VY, VZ, tmp, pos; local Rotator robot_rot; local Matrix T; local Plane PX, PY, PZ, PW; tag_pos = aTag.Location; robot_pos = Location; robot_rot = Rotation; // calculating the position of the tag GetUnAxes (robot_rot, VX, VY, VZ); PX.x = VX.x; PX.y = VX.y; PX.z = VX.z; PX.W = 0; PY.x = VY.x; PY.y = VY.y; PY.z = VY.z; PY.W = 0; PZ.x = VZ.x; PZ.y = VZ.y; PZ.z = VZ.z; PZ.W = 0; tmp.x = VX.x; tmp.y = VY.x; tmp.z = VZ.x; PW.x = - ( tmp Dot robot_pos ); tmp.x = VX.y; tmp.y = VY.y; tmp.z = VZ.y; PW.y = - ( tmp Dot robot_pos); tmp.x = VX.z; tmp.y = VY.z; tmp.z = VZ.z; PW.z = - ( tmp Dot robot_pos); PW.W = 1; T.XPlane = PX; T.YPlane = PY; T.ZPlane = PZ; T.WPlane = PW; //use converter here pos.x = converter.LengthFromUU(T.XPlane.X * tag_pos.x + T.YPlane.x * tag_pos.y + T.zplane.x * tag_pos.z + T.wplane.x); pos.y = converter.LengthFromUU(T.XPlane.Y * tag_pos.x + T.YPlane.Y * tag_pos.y + T.zplane.Y * tag_pos.z + T.wplane.Y); pos.z = converter.LengthFromUU(-(T.XPlane.Z * tag_pos.x + T.YPlane.Z * tag_pos.y + T.zplane.Z * tag_pos.z + T.wplane.Z)); return pos; //yaw = robot_rot.yaw*2*Pi/65536; //the calculation is correct. //x = ((tag_pos.x - robot_pos.x) * cos(yaw) + (tag_pos.y - robot_pos.y) * sin(yaw))/52.5; //y = (-(tag_pos.x - robot_pos.x) * sin(yaw) + (tag_pos.y - robot_pos.y) * cos(yaw))/52.5; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{MaxRange "$MaxRange$"}"; return outstring; } kRzlـe@krrr3}>B@k@kr@k@krrL$?(]RFIDsvD/DFvuVVFXFYYFXQFVRXSXH XH XK XK X Gz class RFIDReleaser extends Effecter; var config int NumTags; var array tagList; function string Set(String opcode, String args) { local RFIDTag stag; if (Caps(opcode)=="RELEASE" && NumTags>0) { stag=spawn(class'RFIDTag',self,,Location+vect(0,-1,0)); stag.bSingleShot=false; tagList[tagList.length]=stag; NumTags -= 1; //stag.id=Level.TimeSeconds*1000+1000; return "OK"; } else if (Caps(opcode)=="TAGSREMAINING") { return String(NumTags); } return "Failed"; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{NumTags "$default.NumTags$"}"; return outstring; } simulated event Destroyed() { local int i; for (i=0;iwa*Ya pha phPYhh G^pIh!Ej%<j7C2jCIjj G}EbV^E}ySpinSpeedyTorque^^ GjZnN{u2_Z_@k@kl"d(] RFIDReleaserrwK)vJ6w6w6w6w6w6w Gcclass RangeSensor extends Sensor config (USARBot) abstract; var config float MaxRange,MinRange; var Rotator curRot; var float uuMaxRange,uuMinRange; function ConvertParam(USARConverter converter) { if (converter!=NONE) { uuMaxRange = converter.LengthToUU(MaxRange); uuMinRange = converter.LengthToUU(MinRange); } else { uuMaxRange = MaxRange; uuMinRange = MinRange; } } // get range data in Meter function float GetRange() { local vector HitLocation,HitNormal; local float range; if (Trace(HitLocation, HitNormal, Location + uuMaxRange*vector(curRot), Location, true)==NONE) range=MaxRange; else { range=VSize(HitLocation-Location); if (converter!=None) range=converter.LengthFromUU(range); } if (OutputCurve.Points.length>0) range=InterpCurveEval(OutputCurve, range); range += RandRange(-Noise,Noise)*range; if (range>MaxRange) range=MaxRange; if (range=0.1) SetTimer(ScanInterval,true); } function ConvertParam(USARConverter converter) { super.ConvertParam(converter); if (converter!=None) { uuResolution = converter.AngleToUU(Resolution); uuScanFov = converter.AngleToUU(ScanFov); } else { uuResolution = Resolution; uuScanFov = ScanFov; } } function timer() { local int i; local float range; local rotator turn; time = Level.TimeSeconds; rangeData=""; //from right to left for (i=uuScanFov/2;i>-uuScanFov/2;i-=uuResolution) { if (bYaw) turn.Yaw = i; if (bPitch) turn.Pitch = i; curRot = rTurn(Rotation,turn); range = GetRange(); if (rangeData == "") rangeData = converter.FloatString(range); else rangeData = rangeData$","$converter.FloatString(range); //log("i="$i@"rot="$rot@"Rotation="$Rotation@"range="$range); } } function rotator rTurn(rotator rHeading,rotator rTurnAngle) { // Generate a turn in object coordinates // this should handle any gymbal lock issues local vector vForward,vRight,vUpward; local vector vForward2,vRight2,vUpward2; local rotator T; local vector V; GetAxes(rHeading,vForward,vRight,vUpward); // rotate in plane that contains vForward&vRight T.Yaw=rTurnAngle.Yaw; V=vector(T); vForward2=V.X*vForward + V.Y*vRight; vRight2=V.X*vRight - V.Y*vForward; vUpward2=vUpward; // rotate in plane that contains vForward&vUpward T.Yaw=rTurnAngle.Pitch; V=vector(T); vForward=V.X*vForward2 + V.Y*vUpward2; vRight=vRight2; vUpward=V.X*vUpward2 - V.Y*vForward2; // rotate in plane that contains vUpward&vRight T.Yaw=rTurnAngle.Roll; V=vector(T); vForward2=vForward; vRight2=V.X*vRight + V.Y*vUpward; vUpward2=V.X*vUpward - V.Y*vRight; T=OrthoRotation(vForward2,vRight2,vUpward2); return(T); } function string Set(String opcode, String args) { if (Caps(opcode)=="SCAN") { timer(); return "OK"; } return "Failed"; } function String GetHead() { local string outstring; if (bWithTimeStamp) outstring="SEN {Time "$time$"} {Type "$ItemType$"}"; else outstring="SEN {Type "$ItemType$"}"; return outstring; } function String GetData() { local string outstring; if (rangeData == "") return ""; outstring = "{Name "$ItemName$"} " $"{Time "$time$"} " $"{Location "$Location$"} " $"{Rotation "$(base.Rotation + myDirection)$"} " $"{Resolution "$converter.FloatString(Resolution)$"} " $"{FOV "$converter.FloatString(ScanFov)$"} " $"{Range "$rangeData$"}"; rangeData = ""; return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{Resolution "$converter.FloatString(Resolution)$"} {Fov "$converter.FloatString(ScanFov)$"}"; outstring = outstring@"{Paning "$bYaw$"} {Tilting "$bPitch$"}"; return outstring; } @yPY] eP wnnIJK6g6I6g6I6g6I6g6f6J6f6J6f6J6f6e6K6e6K6e6K6e66I66J66K6dw66I66J66K6dw66I66J66K6dw6d?6kg6kf6ke6kd6|lY66k6e66k6e66k6e66k6|lY66k6e66k6e66k6e66k6|nY66k6e66k6e66k6e66k| G[Yt <59:9:$%la&lat %ht 7;t zat <Da[ *>[ G e'class PGCameraTilt extends KDPart; E}@FC6  $Zd;>&class PGCameraPan extends KDPart; G~@H"QZ6  $Zd;>'class PGCameraBase extends KDPart; I@@Je 6  $Zd;>$class PERTire extends USARTire; @s KA@M0guY* $@_<%class PERMTire extends USARTire; NB@O]leguY* $;pN<"class PERMBar extends KDPart; PD@Q=76 C$PBS%<F PF ppF {MaxRange 9Uh}F  GF @%class PERCamTilt extends KDPart; TE@UrB6 B$$class PERCamPan extends KDPart; VF@WD6 A$!class PERBar extends KDPart; b[D/obDzy ta(t#??M"Da % 6AD6Az6AyDa*D Mb9Dv`%`7;`za6x`; 66z`;D66z`;z66z`;y`z=:6u`;6z`;6k`;!`~$`9:9:$%la  MD[zկlvy%la*%l = W>&la  MD[zկlvy&la*&l = W>E@9:9:$.-(. -(.-(?a'K9Du!. Ghd >+xd .E%uE7d {krEd {Ad {E&uE  GOclass PB911rs extends RangeScanner config (USARBot); //defines default params for the rangescanner that should be placed on the IUB robot Ub|)w|*g| p[| p[d| pb| pbe| p]| p]U | pT | pT g[[dbbe]]U T T  Gc]J_9ZcR!_$I=`$/4@FS  $= W>^fK%J6f6f6f6f6f6f G*class PapaGooseTire extends USARTire; l`d&/k2qe.P%7e`e K`gVYemV|e\*K`eqpppq {ID FalsePositive} {Status None} {Location  xV,}yqpppq {ID None} {Status None} {Location  xV,}K`dK`U qpppppq {ID ek} {Status None} {Location  xV,}K`U qpppppppq {ID ek} {Status eV} {Location  xV,}qpppq {ID None} {Status None} {Location  xV,}1){qqppp{Name <}qq Gq@x?class PapaGoose extends KRobot config(USARBot); //defines a model of the IUB robot PapaGoose var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*7000; RightValue = USARRemoteBot(Controller).RightThrottle*7000; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; JointsControl[5].state = 1; // new command JointsControl[5].order = 1; JointsControl[5].value = RightValue; bNewCommand = true; } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = LeftValue; JointsControl[4].state = 1; // new command JointsControl[4].order = 1; JointsControl[4].value = LeftValue; bNewCommand = true; } if (JointsControl[3].value==JointsControl[1].value && JointsControl[3].value==JointsControl[4].value) cachedLeftValue=JointsControl[3].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[0].value==JointsControl[2].value && JointsControl[0].value==JointsControl[5].value) cachedRightValue=JointsControl[2].value; else cachedRightValue=1000000; // a big value to force updating } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[7].state = 1; //JointsControl[7].steer = 65535; JointsControl[7].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[7].value = CameraPan; } if (JointsControl[7].order==1) PanSpeed = CameraPan; else PanSpeed = 1000; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[8].state = 1; //JointsControl[8].steer = 65535; JointsControl[8].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[8].value = CameraTilt; } if (JointsControl[8].order==1) TiltSpeed = CameraTilt; else TiltSpeed = 1000; bNewCommand = true; } //bReady = true; } eH#LB Y6f;u F̪̪̪̪̪̪̪r̪r̪̪̪̪̪ F̪̪ F̪̪̪̪;i;7b:???$  :BT :?:::?:9b:???$  :BA :?:::?:Tb:???$  :T :?:::?:Qb:???$  :A :?:::?:Hb:???$  :A :?:::?:Fb:???$  :T :?:::?:m$@t := W>= W>= W>Pl#%class P2DXTire extends USARTire; ra ?* \a .k7a {@a {k&ka { G*class P2DXSmallTire extends USARTire; }c`Y\ Z` i WW\[Z66\66\66\66}6[6}6[6}6[6}6w6Z6w6Z6w6Z6w6v6\6v6[6v6Z6vvi 6v6\6v6[6v6Z6vvi 6v6\6v6[6v6Z6vvi 6v?6m6m}6mw6mv6n lY66m6Z66m6Z66m6Z66m6n lY66m6Z66m6Z66m6Z66m6n nY66m6Z66m6Z66m6Z66mn  G@s ZZ@Cclass P2DX extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; var float lastAng; var float steerAng; var byte count; replication { reliable if(Role == ROLE_Authority) steerAng; } function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*2360; RightValue = USARRemoteBot(Controller).RightThrottle*2360; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; bNewCommand = true; } cachedLeftValue=JointsControl[1].value; cachedRightValue=JointsControl[0].value; } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[4].state = 1; //JointsControl[4].steer = 65535; JointsControl[4].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[4].value = CameraPan; } if (JointsControl[4].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[5].state = 1; //JointsControl[5].steer = 65535; JointsControl[5].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[5].value = CameraTilt; } if (JointsControl[5].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } simulated function Tick(float Delta) { local KRigidBodyState WheelState; local vector wheelLinVel,ChassisX; Super.Tick(Delta); if (Role == ROLE_Authority) { Parts[2].KGetRigidBodyState(WheelState); wheelLinVel = KRBVecToVector(WheelState.LinVel); if (VSize(wheelLinVel)<0.2) return; ChassisX = QuatRotateVector(KGetRBQuaternion(), vect(1, 0, 0)); steerAng = (ACos(Normal(wheelLinVel) Dot ChassisX))*32768/3.14; if (abs(lastAng-steerAng)>16384) { if (steerAng>16384) steerAng-=32768; else if (steerAng<-16384) steerAng+=32768; } } count++; if (abs(lastAng-steerAng)>200 || count==4) { lastAng = steerAng; KCarWheelJoint(Joints[2]).KSteerAngle = steerAng; } if (count==4) count=0; } oM#T 9:9:$GB Y6p4뗡u7Kڇwa F̪̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i9g:$  :ff@33@ff :?:::?:7g:$  :ff@33ff :?:::?:]a:$  :33I :?:::?:C$8B$ŧ7 ^k#%class P2ATTire extends USARTire; tv)g_ /rv*viujskv9?v Uiu9?v Ujs9?v Uk-d wv*i%i7;6zi;v I6zi;6ki;v k6mi;ii%i7;66ki;9D66mi;66ki;9D66mi;66ki;9D66mi;i& GS=class P2AT extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { if (myCamera!=None) initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*690; RightValue = USARRemoteBot(Controller).RightThrottle*690; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; bNewCommand = true; } if (JointsControl[3].value==JointsControl[1].value) cachedLeftValue=JointsControl[3].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[0].value==JointsControl[2].value) cachedRightValue=JointsControl[2].value; else cachedRightValue=1000000; // a big value to force updating } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[5].state = 1; //JointsControl[5].steer = 65535; JointsControl[5].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[5].value = CameraPan; } if (JointsControl[5].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[6].state = 1; //JointsControl[6].steer = 65535; JointsControl[6].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[6].value = CameraTilt; } if (JointsControl[6].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } zc}\BM--cc^ [  c)[  G @s Wbclass OdometrySensor extends sensor config (USARBot); /* * Wheel encoder based odometry used for skid-steer vehicles. * * It assumes that the tire distribution is the same for the left and right side. * Data are represented in the vehicle coordinate (SAE J670) in the format (x,y,theta)! * The odometry erros come from 1) Encoder error from sensor resolution, 2) Wheel * radius error in measure, and 3) Theta calculation error. */ const RadianToUU = 10430.3783505; var config float ScanInterval; var config float EncoderResolution; var config string LeftTire, RightTire; var USARRemoteBot rBot; var KTire lTire, rTire; var string odometryData; var vector old_left, old_right, old_pos; var float base_width, wheel_radius, pLenUnit, lenUnit; var float ltDis, rtDis; var vector pos; var bool bGetRadius; var float last_radius; simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); odometryData=""; if (ScanInterval>=0.1) SetTimer(ScanInterval,true); } function ConvertParam(USARConverter converter) { // convert EncoderResolution to radian. If we are using SI units, // the following is totally unnecessary! EncoderResolution = converter.AngleToUU(EncoderResolution)*0.000095873799; } // Find the leftest and rightest tire function FindTires() { local KRobot kr; local float maxOff, minOff, myOff; local int lIdx,rIdx,i; local vector RotX, RotY, RotZ; if (!Platform.IsA('KRobot')) { log("Not KRobot!"); SetTimer(0,false); return; } kr = KRobot(Platform); //Try to find the tires lIdx = -1; rIdx = -1; if (LeftTire=="" || RightTire=="") { for (i=0;imyOff) { minOff = kr.JointParts[i].ParentPos.Y; lIdx = i; } } } if (rIdx>=0) log("Odometry: Use "$kr.JointParts[rIdx].PartName$" as Right wheel."); if (lIdx>=0) log("Odometry: Use "$kr.JointParts[lIdx].PartName$" as Left wheel."); } if (LeftTire!="") lIdx = kr.FindJointPartId(LeftTire); if (lIdx<0) { log("Invalid LeftTire Name"@LeftTire); SetTimer(0,false); return; } lTire = KTire(kr.Parts[lIdx]); if (RightTire!="") rIdx = kr.FindJointPartId(RightTire); if (rIdx<0) { log("Invalid RightTire Name"@LeftTire); SetTimer(0,false); return; } rTire = KTire(kr.Parts[rIdx]); GetAxes(Platform.Rotation,RotX,RotY,RotZ); base_width = int(Abs((lTire.Location - rTire.Location) Dot RotY)); old_left = lTire.Location; old_right = rTire.Location; } // calculate the wheel radius function FindRadius() { local vector RotX, RotY, RotZ; local vector HitLocation,HitNormal; if (rTire==None || lTire==None) { log("Can't find tires"); return; } if (!rTire.bTireOnGround || !lTire.bTireOnGround) { log("Left tire on ground is"@rTire.bTireOnGround@" Right tire on ground is"@lTire.bTireOnGround); return; } GetAxes(Platform.Rotation,RotX,RotY,RotZ); if (Trace(HitLocation, HitNormal, rTire.Location-100*RotZ, rTire.Location, true)==NONE) { log("Can't find the ground!"); SetTimer(0,false); return; } wheel_radius = VSize(rTire.Location-HitLocation); pLenUnit = wheel_radius*EncoderResolution; // used for compute ticks lenUnit = int(wheel_radius*5)*EncoderResolution/5; // used for calculate the len bGetRadius = abs(last_radius - wheel_radius)<0.005; if (last_radius==0) { old_left = lTire.Location; old_right = rTire.Location; } last_radius = wheel_radius; //log(wheel_radius); } function timer() { local vector lVec, rVec; local vector RotX, RotY, RotZ; local float distance, lDis, rDis, diff, delta; // try to find the tires untill we really get them if (lTire==None || rTire==None) FindTires(); // try to find the radius untill we get stable value if (!bGetRadius) FindRadius(); if (pLenUnit==0) return; // The following simulates using encoder to calculate the wheel's movement lVec = lTire.Location - old_left; rVec = rTire.Location - old_right; GetAxes(Platform.Rotation,RotX,RotY,RotZ); if ((lVec Dot RotX)>0) lDis = VSize(lVec); else lDis = -VSize(lVec); if ((rVec Dot RotX)>0) rDis = VSize(rVec); else rDis = -VSize(rVec); // total tick ltDis += lDis; rtDis += rDis; // (current_tick-last_tick)*pLenUnit lDis = (int(ltDis/pLenUnit)-int((ltDis-lDis)/pLenUnit))*lenUnit; rDis = (int(rtDis/pLenUnit)-int((rtDis-rDis)/pLenUnit))*lenUnit; // The following does the odometry calculation distance = (lDis + rDis)/2; pos.x = old_pos.x + distance*Cos(old_pos.z); pos.y = old_pos.y + distance*Sin(old_pos.z); diff = lDis - rDis; if (abs(diff)>0.001) delta = Atan(diff,base_width); else delta = 0; pos.z = old_pos.z + delta; // theta in radian if (pos.z > Pi) pos.z -= 2*Pi; if (pos.z < -Pi) pos.z += 2*Pi; // store these data for the next calculation old_pos = pos; old_left = lTire.Location; old_right = rTire.Location; // generate the data string if (converter!=None) { odometryData="{Pose "$converter.Str_LengthFromUU(pos.x) $","$converter.Str_LengthFromUU(pos.y) $","$converter.Str_AngleFromUU(pos.z*RadianToUU)$"}"; } else odometryData="{Pose "$pos$"}"; } function string Set(String opcode, String args) { if(Caps(opcode)=="RESET") { pos = vect(0,0,0); old_pos = vect(0,0,0); old_left = lTire.Location; old_right = rTire.Location; return "OK"; } return "Failed"; } function String GetData() { local string outstring; if (odometryData == "") return ""; outstring = "{Name "$ItemName$"} "$odometryData; odometryData = ""; //log(Platform.Location@pos); return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{ScanInterval "$converter.FloatString(ScanInterval)$"}" @"{EncoderResolution "$converter.FloatString(EncoderResolution)$"}"; return outstring; } viX*w["errWWWW>WWrrrWWWW>WWWWW>uuuuuuuuuuu>WWWWrv$L>b$ #<(] Odometry2$=Jclass myCameraTextureClient extends CameraTextureClient placeable; x]2yHofdjrgiH// ================================================================ // This is a PSEUDO sensor that provides the mission package info. // This 'sensor' is very special since it represents ALL the mission // packages. For a mission package, it has its own type and name. So // here, we introduce subType to represent the mission package type. // Note, a MissionSensor may have multiple subTypes. A local variable // is used in this class to track what subType is currently under // concern. // // I know a better solution may exist. If anybody has any good idea // about how to represent the mission packages, please email me at // jiw1@pitt.edu -- Jijun Wang // ================================================================ class MisPkgSensor extends Sensor config (USARBot); var config float ScanInterval; var string mySubType; var string mySubName; var KRobot robot; function Init(String SName, Actor parent, vector position, rotator direction, KVehicle platform, name mount) { Super.Init(SName,parent,position,direction,platform,mount); if (platform.IsA('KRobot')) robot = KRobot(platform); } // This is harcked to only contain the head "MIS". The real type // info is in the GetData() result which provides the subType info. function String GetHead() { local string outstring; outstring="MIS"; return outstring; } function string GetGeoHead() { local string outstring; if (mySubType=="") outstring="GEO {Type "$ItemType$"}"; else //outstring="GEO {Type "$ItemType$"."$mySubType$"}"; outstring="GEO {Type "$mySubType$"}"; return outstring; } function bool isType(String type) { local int idx,i; local String sType, uType; if (robot==None) return false; mySubType=""; idx = InStr(type,"."); type = Caps(type); if (idx>0 && idx children; if (robot==None) return ""; if (mySubType=="") { outstring = "{ScanInterval "$ScanInterval$"}"; for (i=0;iv$L>(]MisPkg{x m h6x 6x dhI@9?,V 9?, hI@9?,V 9?,(h6x 6x hI@9?,V 9?, hI@9?,V 9?,(' G&class KurtTireR extends USARTire; h s F}g--hFL 1 F)1dCFCF G ,class KurtTireOutdoor extends USARTire; &class KurtTireL extends USARTire; @z(class KurtStructure extends KDPart; UuN ):\wN *qN UuiN UvpN Uwq9Dui9Dvp9Dwlq GDp?@^'\p.y7p{@p{y&yp{ GlI L & G@vK s3#CzsZOOMi U9LQKiplphiilii%lqli `l-1 GJ o>L_(xo.l%ul7o{krlo{Ao{l&ul  GF0i@)class KurtCameraTilt extends KDPart; M Re4lR GN SX])H6t6A6t6@6t6zt GR U l9 l GPT W %?vS PS ppppppS {CameraDefFov  u}{CameraMinFov  v}{CameraMaxFov  w}S  GS @Q d@X ?6  $>lZ & %}t.Gd%td7t^rdt^ *jLdt Ldt9?,djLLdt9?,2L9?&\ 9<dt%\ 9<dtLLndt^ jv\ v\ r nd1v^^vr ^^r v9?%}ppppl{Loudness  v} {Duration  r }} G}@t(class KurtCameraPan extends KDPart; \ e@] o6  $>t)class KurtCameraBase extends KDPart; _ g@`  ˑ6  $>-class Kurt3DScannerSides extends KDPart; Ea i@c  <6  $= W>~#PY e %,mPm Gm@S Bpa)H6Ax6B6@x6B6zx6Bx G 0.16g  0.25h  6xj KCclass Kurt3D extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; var config bool bMultiView; simulated function DrawHud(Canvas C) { local int halfX; if (!bMultiView || Cameras.length<2) { Super.DrawHud(C); return; } C.Reset(); C.Clear(); //Clears frame & Z buffers halfX = C.SizeX/2; C.DrawPortal( 0, 0, halfX, C.SizeY, CamList[0], CamList[0].Location, CamList[0].Rotation, CamList[0].CameraFov); C.DrawPortal(halfX, 0, halfX, C.SizeY, CamList[1], CamList[1].Location, CamList[1].Rotation, CamList[1].CameraFov); super.DrawHud(C); } function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*4000; RightValue = USARRemoteBot(Controller).RightThrottle*4000; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = LeftValue; JointsControl[5].state = 1; // new command JointsControl[5].order = 1; JointsControl[5].value = LeftValue; bNewCommand = true; cachedLeftValue=LeftValue; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; JointsControl[4].state = 1; // new command JointsControl[4].order = 1; JointsControl[4].value = RightValue; bNewCommand = true; cachedRightValue=RightValue; } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[7].state = 1; //JointsControl[5].steer = 65535; JointsControl[7].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[7].value = CameraPan; } if (JointsControl[7].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[8].state = 1; //JointsControl[6].steer = 65535; JointsControl[8].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[8].value = CameraTilt; } if (JointsControl[8].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } f _Q~.aG-M2%?27*5r2** 2-M'\9:Z9:} 6ej6ef6eu6ed2%K27*2*a/!r_.2*__46_4S2v6_42f6_42c6_42w_-'2*a/!Y`.2*``4b6`4bS2v6`4b2f6`4b2c6`4b2w`-O 'A9:6P29:2|6F22J 622I 622F 6 2$6P22|2Z}-S' G UEZ)*q.wZ*QZ pE9?,?QE9?,F9DQ>&K@I@9?, GLn q i"J{ykNa| aXWy #>99{y'gw| *'D %ED Fr9?FD >M%;M,yիQ9?MKNիQ9?MKa| aXWy #>99{y'1w| *'MD n( GXedGaLd9?i}uSpinSpeeduTorqueLL Gk d#lB Y6)t .a&u F̪̪̪̪̪̪r̪r̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪ҽҽҽҽҽ F F Fҽҽ F F FaP  $= W>i#iSu @C|9?% ga#Ma#?fa#?UM#?QM#?I@iիbQU G de@'8ie6if6iW6ig -$ ojpuoe9?&pf9?&-$PPG j6if6iu6id6i,%,7*,* i,vp6i,f6i,c6i,w6i,J 6F,,I 6,,F 6,Y9:6 ,&,|9=&-稨Pack<<9S,9U6,c9U6,c9U6,c9U6,f9U6,f9U6,f9U6,f9U,J 9R,I 9U,F >>稨Pack<<9S,S:9U6F,9R6,9U6,稨 D:9U,J 9R,I 9U,F >>,C}9=& Gw B^[@T_%K_7Az_<B__ GH8class Kurt2D extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } LeftValue = USARRemoteBot(Controller).LeftThrottle*4000; RightValue = USARRemoteBot(Controller).RightThrottle*4000; if (cachedLeftValue!=LeftValue) { //left wheels JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = LeftValue; JointsControl[5].state = 1; // new command JointsControl[5].order = 1; JointsControl[5].value = LeftValue; bNewCommand = true; cachedLeftValue=LeftValue; } if (cachedRightValue!=RightValue) { //right wheels JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; JointsControl[4].state = 1; // new command JointsControl[4].order = 1; JointsControl[4].value = RightValue; bNewCommand = true; cachedRightValue=RightValue; } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[7].state = 1; //JointsControl[5].steer = 65535; JointsControl[7].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[7].value = CameraPan; } if (JointsControl[7].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[8].state = 1; //JointsControl[6].steer = 65535; JointsControl[8].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[8].value = CameraTilt; } if (JointsControl[8].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } _ y V#mB Y6{ }A~au F̪̪̪̪̪̪̪̪̪̪̪̪ F̪̪ F̪̪̪̪;i7n:???$  :AA( :?:?::?:?9x:???$  :A( :?:?::?:?Fn:???$  :A( :?:?::?:?Hx:???$  :( :?:?::?:?Tn:???$  :A( :?:?::?:?Qx:???$  :( :?:?::?:?hq:???$B  : :?:?: A:?:?^$ B~YbU l] Scanner1Q:RAAZ:GX:_b{ 9l]ECLeftQ:Z:X:_b{ 7l] ECRightQ:Z:X:_P  $>Ph#{// Base class for 2-wheeled vehicles using Karma // Assumes negative-X is forward, negative-Y is right class KTwoWheels extends KVehicle abstract; var KTire frontLeft, frontRight; var (KCar) class FrontTireClass; // Wheel positions var const float WheelFrontAlong; var const float WheelFrontAcross; var const float WheelVert; var (KCar) float MaxSteerAngle; // (65535 = 360 deg) var (KCar) float MaxBrakeTorque; // Braking torque applied to all four wheels. Positive only. // KCarWheelJoint setting for steering (see KCarWheelJoint). Duplicated here for handiness. var (KCar) float SteerPropGap; var (KCar) float SteerTorque; var (KCar) float SteerSpeed; // KCarWheelSuspension setting var (KCar) float SuspStiffness; var (KCar) float SuspDamping; var (KCar) float SuspHighLimit; var (KCar) float SuspLowLimit; var (KCar) float SuspRef; // KTire settings. Duplicated here for handy tuning. var (KCar) float TireRollFriction; var (KCar) float TireLateralFriction; var (KCar) float TireRollSlip; var (KCar) float TireLateralSlip; var (KCar) float TireMinSlip; var (KCar) float TireSlipRate; var (KCar) float TireSoftness; var (KCar) float TireAdhesion; var (KCar) float TireRestitution; var (KCar) float TireMass; var (KCar) float HandbrakeThresh; // speed above which handbrake comes on =] var (KCar) float TireHandbrakeSlip; // Additional lateral slip when handbrake engaged var (KCar) float TireHandbrakeFriction; // Additional lateral friction when handbrake engaged var (KCar) float ChassisMass; var (KCar) float StopThreshold; // Forward velocity under which brakes become drive. var (KCar) InterpCurve TorqueCurve; // Engine RPM in, Torque out. var (KCar) float FlipTorque; var (KCar) float FlipTime; var (KCar) float MaxNetUpdateInterval; var int Gear; // 1 is forward, -1 is backward. Currently symmetric power/torque curve // Car output var float WheelSpinSpeed; // Current (averaged) RPM of front wheels var float ForwardVel; // Component of cars velocity in its forward direction. var bool bIsInverted; // Updated in Tick - indicates if car is not upright. // Internal var bool IsDriving; var float FlipTimeLeft; var float NextNetUpdateTime; // Next time we should force an update of vehicles state. // Low-level drive data (this is replicated) var bool OutputBrake; var float OutputTorque; var bool OutputHandbrakeOn; // Networking struct KCarState { //var KRigidBodyState ChassisState; var KRBVec ChassisPosition; var Quat ChassisQuaternion; var KRBVec ChassisLinVel; var KRBVec ChassisAngVel; var float WheelHeight[2]; // FL, FR var float FrontWheelAng[2]; // FL, FR var float WheelVertVel[2]; //var float WheelSpinVel[4]; var float ServerSteering; var float ServerTorque; var bool ServerBrake; var bool ServerHandbrakeOn; var bool bNewState; // Set to true whenever a new state is received and should be processed }; var KRigidBodyState ChassisState; var KCarState CarState; // This is replicated to the car, and processed to update all the parts. var bool bNewCarState; // Indicated there is new data processed, and chassis RBState should be updated. replication { // We replicate the Gear for brake-lights etc. unreliable if(Role == ROLE_Authority) CarState, Gear; reliable if(Role == ROLE_Authority) FlipTimeLeft; } // When new information is received, see if its new. If so, pass bits off the the wheels. // Each part will then update its rigid body position via the KUpdateState event. // JTODO: This is where clever unpacking would happen. simulated event VehicleStateReceived() { local vector ChassisY, SteerY, ChassisZ, calcPos, WheelY, lPos; local vector chassisPos, chassisLinVel, chassisAngVel, WheelLinVel, wPosRel; local Quat relQ, WheelQ; if(!CarState.bNewState) return; // Don't do anything if car isn't started up. if(frontLeft == None || frontRight == None) return; // Get root chassis info ChassisState.Position = CarState.ChassisPosition; ChassisState.Quaternion = CarState.ChassisQuaternion; ChassisState.LinVel = CarState.ChassisLinVel; ChassisState.AngVel = CarState.ChassisAngVel; chassisPos = KRBVecToVector(CarState.ChassisPosition); chassisLinVel = KRBVecToVector(CarState.ChassisLinVel); chassisAngVel = KRBVecToVector(CarState.ChassisAngVel); // Calc chassis state axes ChassisY = QuatRotateVector(CarState.ChassisQuaternion, vect(0, 1, 0)); ChassisZ = QuatRotateVector(CarState.ChassisQuaternion, vect(0, 0, 1)); // Get root chassis info ChassisState.Position = CarState.ChassisPosition; ChassisState.Quaternion = CarState.ChassisQuaternion; ChassisState.LinVel = CarState.ChassisLinVel; ChassisState.AngVel = CarState.ChassisAngVel; // Figure out new state of wheels // Wheel positions are only supplied with a chassis-space Z (vertical) value - X and Y are assumed no to change // Rear wheel orientations are not supplied. The only constraint is their Y-axis (axle) is parallel to // the chassis Y-axis. A quaternion is calculated to go from current orientation to fulfil that criteria, which // should produce minimum difference to the 'roll' of the wheel - which is allowed to differ on server and client. // For front wheel we do send the current 'steering' angle. That is added after the above process as a quaternion // around chassis Z (up). // For linear velocity of wheels - calculate based on linear and angular velocity of chassis, and add on vertical // component sent over the net. ////////////////////////// FRONT LEFT ////////////////////////// frontLeft.KGetRigidBodyState(frontLeft.ReceiveState); // Position lPos.X = WheelFrontAlong; lPos.Y = WheelFrontAcross; lPos.Z = CarState.WheelHeight[0]; calcPos = chassisPos + QuatRotateVector(CarState.ChassisQuaternion, lPos); // Convert from chassis state to world space frontLeft.ReceiveState.Position = KRBVecFromVector(calcPos); // Rotation wheelQ = frontLeft.KGetRBQuaternion(); WheelY = QuatRotateVector(wheelQ, vect(0, 1, 0)); SteerY = QuatRotateVector( QuatFromAxisAndAngle(ChassisZ, CarState.FrontWheelAng[0]), ChassisY ); relQ = QuatFindBetween(WheelY, SteerY); frontLeft.ReceiveState.Quaternion = QuatProduct(relQ, wheelQ); // Velocity wPosRel = calcPos - chassisPos; WheelLinVel = chassisLinVel + (chassisAngVel Cross wPosRel); WheelLinVel += CarState.WheelVertVel[0] * ChassisZ; frontLeft.ReceiveState.LinVel = KRBVecFromVector(WheelLinVel); //frontLeft.ReceiveState.AngVel = KRBVecFromVector(chassisAngVel + (WheelY * CarState.WheelSpinVel[0])); frontLeft.bReceiveStateNew = true; ////////////////////////// FRONT RIGHT ////////////////////////// frontRight.KGetRigidBodyState(frontRight.ReceiveState); // Position lPos.X = WheelFrontAlong; lPos.Y = -WheelFrontAcross; lPos.Z = CarState.WheelHeight[1]; calcPos = chassisPos + QuatRotateVector(CarState.ChassisQuaternion, lPos); frontRight.ReceiveState.Position = KRBVecFromVector(calcPos); // Rotation wheelQ = frontRight.KGetRBQuaternion(); WheelY = QuatRotateVector(wheelQ, vect(0, 1, 0)); SteerY = QuatRotateVector( QuatFromAxisAndAngle(ChassisZ, CarState.FrontWheelAng[1]), ChassisY ); relQ = QuatFindBetween(WheelY, SteerY); frontRight.ReceiveState.Quaternion = QuatProduct(relQ, wheelQ); // Velocity wPosRel = calcPos - chassisPos; WheelLinVel = chassisLinVel + (chassisAngVel Cross wPosRel); WheelLinVel += CarState.WheelVertVel[1] * ChassisZ; frontRight.ReceiveState.LinVel = KRBVecFromVector(WheelLinVel); //frontRight.ReceiveState.AngVel = KRBVecFromVector(chassisAngVel + (WheelY * CarState.WheelSpinVel[1])); frontRight.bReceiveStateNew = true; ////// OTHER ////// // Update control inputs Steering = CarState.ServerSteering; OutputTorque = CarState.ServerTorque; OutputBrake = CarState.ServerBrake; OutputHandbrakeOn = CarState.ServerHandbrakeOn; // Update flags CarState.bNewState = false; bNewCarState = true; // For debugging... //KDrawRigidBodyState(ChassisState, false); //KDrawRigidBodyState(frontLeft.ReceiveState, false); //KDrawRigidBodyState(frontRight.ReceiveState, false); } // This only update the chassis. The wheels update themselves. simulated event bool KUpdateState(out KRigidBodyState newState) { // This should never get called on the server - but just in case! if(Role == ROLE_Authority || !bNewCarState) return false; // Apply received data as new position of car chassis. newState = ChassisState; bNewCarState = false; return true; //return false; } // Pack current state of whole car into the state struct, to be sent to the client. // Should only get called on the server. function PackState() { local vector lPos, wPos, chassisPos, chassisLinVel, chassisAngVel, wPosRel, WheelLinVel; local vector ChassisX, ChassisZ, WheelY, oldPos, oldLinVel; local KRigidBodyState RBState, WheelState; // Get chassis state. KGetRigidBodyState(RBState); chassisPos = KRBVecToVector(RBState.Position); chassisLinVel = KRBVecToVector(RBState.LinVel); chassisAngVel = KRBVecToVector(RBState.AngVel); // Last position we sent oldPos = KRBVectoVector(CarState.ChassisPosition); oldLinVel = KRBVectoVector(CarState.ChassisLinVel); // See if state has changed enough, or enough time has passed, that we // should send out another update by updating the state struct. if( !KIsAwake() ) { return; // Never send updates if physics is at rest } if( VSize(oldPos - chassisPos) > 5 || VSize(oldLinVel - chassisLinVel) > 1 || Abs(CarState.ServerTorque - OutputTorque) > 0.1 || Abs(CarState.ServerSteering - Steering) > 0.1 || Level.TimeSeconds > NextNetUpdateTime ) { NextNetUpdateTime = Level.TimeSeconds + MaxNetUpdateInterval; } else { return; //NextNetUpdateTime = Level.TimeSeconds + MaxNetUpdateInterval; } CarState.ChassisPosition = RBState.Position; CarState.ChassisQuaternion = RBState.Quaternion; CarState.ChassisLinVel = RBState.LinVel; CarState.ChassisAngVel = RBState.AngVel; ChassisX = QuatRotateVector(CarState.ChassisQuaternion, vect(1, 0, 0)); ChassisZ = QuatRotateVector(CarState.ChassisQuaternion, vect(0, 0, 1)); // Get each wheel state. ////////////////////////// FRONT LEFT ////////////////////////// frontLeft.KGetRigidBodyState(WheelState); wPos = KRBVecToVector(WheelState.Position); lPos = QuatRotateVector(QuatInvert(CarState.ChassisQuaternion), wPos - chassisPos); // Convert from world to chassis state space CarState.WheelHeight[0] = lPos.Z; // X should be WheelFrontAlong, Y should be WheelFrontAcross // For front wheels - we store their current angle around Z as well. WheelY = QuatRotateVector(WheelState.Quaternion, vect(0, 1, 0)); CarState.FrontWheelAng[0] = -ASin(ChassisX Dot WheelY); // Find component of relative wheel linear velocity along suspension travel (chassisZ). wPosRel = KRBVecToVector(WheelState.Position) - chassisPos; WheelLinVel = chassisLinVel + (chassisAngVel Cross wPosRel); CarState.WheelVertVel[0] = ((WheelState.LinVel.X - WheelLinVel.X)* ChassisZ.X) + ((WheelState.LinVel.Y - WheelLinVel.Y)* ChassisZ.Y) + ((WheelState.LinVel.Z - WheelLinVel.Z)* ChassisZ.Z); //CarState.WheelSpinVel[0] = KRBVecToVector(WheelState.AngVel) Dot WheelY; ////////////////////////// FRONT RIGHT ////////////////////////// frontRight.KGetRigidBodyState(WheelState); wPos = KRBVecToVector(WheelState.Position); lPos = QuatRotateVector(QuatInvert(CarState.ChassisQuaternion), wPos - chassisPos); CarState.WheelHeight[1] = lPos.Z; WheelY = QuatRotateVector(WheelState.Quaternion, vect(0, 1, 0)); CarState.FrontWheelAng[1] = -ASin(ChassisX Dot WheelY); CarState.WheelVertVel[1] = ((WheelState.LinVel.X - WheelLinVel.X)* ChassisZ.X) + ((WheelState.LinVel.Y - WheelLinVel.Y)* ChassisZ.Y) + ((WheelState.LinVel.Z - WheelLinVel.Z)* ChassisZ.Z); //CarState.WheelSpinVel[1] = KRBVecToVector(WheelState.AngVel) Dot WheelY; // OTHER CarState.ServerSteering = Steering; CarState.ServerTorque = OutputTorque; CarState.ServerBrake = OutputBrake; CarState.ServerHandbrakeOn = OutputHandbrakeOn; // This flag lets the client know this data is new. CarState.bNewState = true; } simulated function PostNetBeginPlay() { local vector RotX, RotY, RotZ, lPos; Super.PostNetBeginPlay(); // Set up suspension graphics GetAxes(Rotation,RotX,RotY,RotZ); // Spawn wheels, and flip graphics where necessary frontLeft = spawn(FrontTireClass, self,, Location + WheelFrontAlong*RotX + WheelFrontAcross*RotY + WheelVert*RotZ, Rotation); //frontLeft.SetDrawScale(1); frontLeft.SetDrawScale3D(vect(1, 1, 1)); frontRight = spawn(FrontTireClass, self,, Location + WheelFrontAlong*RotX - WheelFrontAcross*RotY + WheelVert*RotZ, Rotation); frontRight.SetDrawScale3D(vect(1, -1, 1)); // Create joints lPos.X = WheelFrontAlong; lPos.Y = WheelFrontAcross; lPos.Z = WheelVert; frontLeft.WheelJoint = spawn(class'KCarWheelJoint', self); frontLeft.WheelJoint.KPos1 = lPos/50; frontLeft.WheelJoint.KPriAxis1 = vect(0, 0, 1); frontLeft.WheelJoint.KSecAxis1 = vect(0, 1, 0); frontLeft.WheelJoint.KConstraintActor1 = self; frontLeft.WheelJoint.KPos2 = vect(0, 0, 0); frontLeft.WheelJoint.KPriAxis2 = vect(0, 0, 1); frontLeft.WheelJoint.KSecAxis2 = vect(0, 1, 0); frontLeft.WheelJoint.KConstraintActor2 = frontLeft; frontLeft.WheelJoint.SetPhysics(PHYS_Karma); lPos.Y = -WheelFrontAcross; frontRight.WheelJoint = spawn(class'KCarWheelJoint', self); frontRight.WheelJoint.KPos1 = lPos/50; frontRight.WheelJoint.KPriAxis1 = vect(0, 0, 1); frontRight.WheelJoint.KSecAxis1 = vect(0, 1, 0); frontRight.WheelJoint.KConstraintActor1 = self; frontRight.WheelJoint.KPos2 = vect(0, 0, 0); frontRight.WheelJoint.KPriAxis2 = vect(0, 0, 1); frontRight.WheelJoint.KSecAxis2 = vect(0, 1, 0); frontRight.WheelJoint.KConstraintActor2 = frontRight; frontRight.WheelJoint.SetPhysics(PHYS_Karma); // Initially make sure parameters are sync'ed with Karma KVehicleUpdateParams(); } // Clean up wheels etc. simulated event Destroyed() { // Destroy joints holding wheels to car frontLeft.WheelJoint.Destroy(); frontRight.WheelJoint.Destroy(); // Destroy wheels themselves. frontLeft.Destroy(); frontRight.Destroy(); Super.Destroyed(); } // Call this if you change any parameters (tire, suspension etc.) and they // will be passed down to each wheel/joint. simulated event KVehicleUpdateParams() { Super.KVehicleUpdateParams(); frontLeft.WheelJoint.bKSteeringLocked = false; frontLeft.WheelJoint.KProportionalGap = SteerPropGap; frontLeft.WheelJoint.KMaxSteerTorque = SteerTorque; frontLeft.WheelJoint.KMaxSteerSpeed = SteerSpeed; frontRight.WheelJoint.bKSteeringLocked = false; frontRight.WheelJoint.KProportionalGap = SteerPropGap; frontRight.WheelJoint.KMaxSteerTorque = SteerTorque; frontRight.WheelJoint.KMaxSteerSpeed = SteerSpeed; frontLeft.WheelJoint.KSuspHighLimit = SuspHighLimit; frontLeft.WheelJoint.KSuspLowLimit = SuspLowLimit; frontLeft.WheelJoint.KSuspStiffness = SuspStiffness; frontLeft.WheelJoint.KSuspDamping = SuspDamping; frontRight.WheelJoint.KSuspHighLimit = SuspHighLimit; frontRight.WheelJoint.KSuspLowLimit = SuspLowLimit; frontRight.WheelJoint.KSuspStiffness = SuspStiffness; frontRight.WheelJoint.KSuspDamping = SuspDamping; // Sync params with Karma. frontLeft.WheelJoint.KUpdateConstraintParams(); frontRight.WheelJoint.KUpdateConstraintParams(); // Mass KSetMass(ChassisMass); frontLeft.KSetMass(TireMass); frontRight.KSetMass(TireMass); // Tire params handy tuning frontLeft.RollFriction = TireRollFriction; frontLeft.LateralFriction = TireLateralFriction; frontLeft.RollSlip = TireRollSlip; frontLeft.LateralSlip = TireLateralSlip; frontLeft.MinSlip = TireMinSlip; frontLeft.SlipRate = TireSlipRate; frontLeft.Softness = TireSoftness; frontLeft.Adhesion = TireAdhesion; frontLeft.Restitution = TireRestitution; frontRight.RollFriction = TireRollFriction; frontRight.LateralFriction = TireLateralFriction; frontRight.RollSlip = TireRollSlip; frontRight.LateralSlip = TireLateralSlip; frontRight.MinSlip = TireMinSlip; frontRight.SlipRate = TireSlipRate; frontRight.Softness = TireSoftness; frontRight.Adhesion = TireAdhesion; frontRight.Restitution = TireRestitution; } // Possibly apply force to flip car over. simulated event KApplyForce(out vector Force, out vector Torque) { local float torqueScale; local vector worldForward, worldUp, worldRight, torqueAxis; if(FlipTimeLeft == 0) return; worldForward = vect(-1, 0, 0) >> Rotation; worldUp = vect(0, 0, 1) >> Rotation; worldRight = vect(0, 1, 0) >> Rotation; torqueAxis = Normal(worldUp Cross vect(0, 0, 1)); // Torque scaled by how far over we are. // This will be between 0 and PI - so convert to between 0 and 1. torqueScale = Acos(worldUp Dot vect(0, 0, 1))/3.1416; Torque = FlipTorque * torqueScale * torqueAxis; } function StartFlip(Pawn Pusher) { //local vector toPusher, worldUp; // if we are already flipping the car - dont do it again! if(FlipTimeLeft > 0) return; // Dont let you push the car if you are going to be underneath it! //worldUp = vect(0, 0, 1) >> Rotation; //toPusher = Pusher.Location - Location; //if( (worldUp Dot toPusher) < 0) // return; FlipTimeLeft = FlipTime; // Start the flip on the server } // Tell it your current throttle, and it will give you an output torque // This is currently like an electric motor function float Engine(float Throttle) { local float torque; torque = Abs(Throttle) * Gear * InterpCurveEval(TorqueCurve, WheelSpinSpeed); GraphData("SpinSpeed", WheelSpinSpeed); GraphData("Torque", torque); return -1 * torque; } function ProcessCarInput() { local vector worldForward, worldUp; //Log("PCI S:"$Steering$" T:"$Throttle); worldForward = vect(-1, 0, 0) >> Rotation; worldUp = vect(0, 0, 1) >> Rotation; ForwardVel = Velocity Dot worldForward; bIsInverted = worldUp.Z < 0.2; // 'ForwardVel' isn't very helpful if we are inverted, so we just pretend its positive. if(bIsInverted) ForwardVel = 2 * StopThreshold; //Log("F:"$ForwardVel$"IsI:"$bIsInverted); if( Driver == None ) { if(bAutoDrive == true) { Gear = 1; OutputBrake = false; Throttle = 0.4; Steering = 1; //log("Thr:"$Throttle); KWake(); } else { Gear = 0; OutputBrake = true; } } else { if(Throttle > 0.01) // pressing forwards { if(ForwardVel < -StopThreshold && Gear != 1) // going backwards - so brake first { //Log("F - Brake"); Gear = 0; OutputBrake = true; IsDriving = false; } else // stopped or going forwards, so drive { //Log("F - Drive"); Gear = 1; OutputBrake = false; IsDriving = true; } } else if(Throttle < -0.01) // pressing backwards { // We have to release the brakes and then press reverse again to go into reverse if(ForwardVel < StopThreshold && IsDriving == false) { //Log("B - Drive"); Gear = -1; OutputBrake = false; IsDriving = false; } else // otherwise, we are going forwards, or still holding brake, so just brake { //Log("B - Brake"); Gear = 0; OutputBrake = true; IsDriving = true; } } else // not pressing either { // If stationary, stick brakes on if(Abs(ForwardVel) < StopThreshold) { //Log("B - Brake"); Gear = 0; OutputBrake = true; IsDriving = false; OutputHandbrakeOn = false; // force handbrake off if stopped. } else // otherwise, coast { //Log("Coast"); Gear = 0; OutputBrake = false; IsDriving = false; } } KWake(); // currently, never let the car go to sleep whilst being driven. } // If we are going forwards, steering, and pressing the brake, // enable extra-slippy handbrake. if((ForwardVel > HandbrakeThresh || OutputHandbrakeOn == true) && Abs(Steering) > 0.01 && OutputBrake == true) OutputHandbrakeOn = true; else OutputHandbrakeOn = false; // Engine model OutputTorque = Engine(Throttle); } // Car Simulation simulated function Tick(float Delta) { local float tana, sFactor; Super.Tick(Delta); WheelSpinSpeed = (frontLeft.SpinSpeed + frontRight.SpinSpeed)/2; //log("WheelSpinSpeed:"$WheelSpinSpeed); // if we are in the process of flipping the car, keep it enabled! if( FlipTimeLeft > 0 ) KWake(); // If the server, process input and pack updated car info into struct. if(Role == ROLE_Authority) { ProcessCarInput(); PackState(); } // Motor // FRONT frontLeft.WheelJoint.KMotorTorque = 0.5 * OutputTorque; frontRight.WheelJoint.KMotorTorque = 0.5 * OutputTorque; // Braking if(OutputBrake) { frontLeft.WheelJoint.KBraking = MaxBrakeTorque; frontRight.WheelJoint.KBraking = MaxBrakeTorque; } else { frontLeft.WheelJoint.KBraking = 0.0; frontRight.WheelJoint.KBraking = 0.0; } // Steering tana = Tan(6.283/65536 * Steering * MaxSteerAngle); sFactor = tana; frontLeft.WheelJoint.KSteerAngle = 65536/6.283 * Atan(tana, (1-sFactor)); frontRight.WheelJoint.KSteerAngle = 65536/6.283 * Atan(tana, (1+sFactor)); // Handbrake if(OutputHandbrakeOn == true) { //Log("HANDBRAKE!!"); frontLeft.LateralFriction = TireLateralFriction + TireHandbrakeFriction; frontLeft.LateralSlip = TireLateralSlip + TireHandbrakeSlip; frontRight.LateralFriction = TireLateralFriction + TireHandbrakeFriction; frontRight.LateralSlip = TireLateralSlip + TireHandbrakeSlip; } else { frontLeft.LateralFriction = TireLateralFriction; frontLeft.LateralSlip = TireLateralSlip; frontRight.LateralFriction = TireLateralFriction; frontRight.LateralSlip = TireLateralSlip; } // Flipping if(FlipTimeLeft > 0) { FlipTimeLeft -= Delta; FlipTimeLeft = FMax(FlipTimeLeft, 0.0); // Make sure it doesn't go negative } } lp ~ &A8Epppp{Name < Touch 9Ti}E GE@C!J @v$a`6a|6as6ah6|g6~ +h`9?,g|9?&6`d=6_=NNf- 6|6a6M6a6~6a6l 6a@6M#?N6M#? fI 6fJ 6MI `%6h 6J C 6f#?%6f @C q6f`O|sq%6e 66f6O6N66f6O6N66f6O6N fI 6fJ 6MI `&6h 6J C 6f#?&6f @C &6e 66f6O6N66f6O6N66f6O6N6_6`d-6z-}-6v-p-6c' GP} A!%IIH PH ppH {Diameter  E}H  GH @U!pN'"79:9:$ -f(pA-f(' G tclass KRobot extends KVehicle config(USARBot) abstract; //////////////////////////////////////////////// // PHYSICAL ROBOT //////////////////////////////////////////////// // Part Definiens struct JointPart { // Part var() name PartName; var() class PartClass; var() vector DrawScale3D; // Joint var() class JointClass; var() bool bSteeringLocked; var() bool bSuspensionLocked; var() float BrakeTorque; var() name Parent; var() vector ParentPos; //var() rotator ParentRot; var() vector ParentAxis; var() vector ParentAxis2; var() vector SelfPos; var() vector SelfAxis; var() vector SelfAxis2; //Mission Package var() name PackageName; var() name PackageType; }; var config array JointParts; // Mission Package struct MisPackage { var name Type; var name Name; var array PartsName; var array PartsId; }; var array Packages; // Joint Control struct JointControl { var byte state; // Control state. 1: new command; 2: finished; var float steer; // Steer angle var byte order; // specify the followed value. var float value; // control value. order=0,value=angle; order=1,value=speed; order=2,value=torque var byte lastCommandId; // There are new commands if lastCommandId != RS_JointsCommandId //Variables used only by order = 0 control: var float angle; // the desired spining angle. used for order=0 control. var int startAng; // the start angle. used for compare spined angle. }; var array JointsControl; struct pvector { var float X; var float Y; var float Z; }; //======================= // Networking RobotState //======================= // // Replication variables used to update Robot State on clients var KRBVec RS_ChassisPosition; var Quat RS_ChassisQuaternion; var KRBVec RS_ChassisLinVel; var KRBVec RS_ChassisAngVel; // dynamic array canot be replicated. So we must use static array here. // Here, to make the client and server have the same state, we directly // replicate the RigidBodyState. In the KCar class, it replicates the // RigidBodyState related to the chassis. I don't know why they use relative // state. I had tried to use relative state. But it involves vector and // quaternion calculation. We need to calculate the relative pos and relative // quat. For relative pos, it's just subtract part's (wheel's) pos from chassis // pos. For relative quat, we need to use the third axis, that's // Joints[i].KPriAxis1 Cross Joints[i].KSecAxis1), to calculate the relative // quat. However, I cannot figure out the correct calculating method for general // case, such as connect the y axis of the part to the x axis of the chassis // through a joint. ANYWAY, the simplest, most stable and straightforward method // is replicating all the (absolute) RigidBodyState. If the server is correct, // then the client should also be correct. The only weakness of this method is we // need to replicate more data. var pvector RS_PartsPos[16]; var Quat RS_PartsQuat[16]; var vector RS_PartsLinVel[16]; var vector RS_PartsAngVel[16]; var float RS_JointsSteer[16]; var byte RS_JointsOrder[16]; var float RS_JointsValue[16]; var byte RS_JointsCommandId[16]; var byte RS_UpdateId; // -- End Replication variables var byte CacheUpdateId; // New RB params were loaded from replication and we must notify // Karma to update RB state on client side var bool bNewRobotState; //only used on server in ProcessCarInput() var bool bNewCommand; var bool bNeedUpdate; var bool bReady; var float NextNetUpdateTime; // Next time we should force an update of vehicles state. var float MaxNetUpdateInterval; // Parts contructed the robot var array Parts; var array Parents; var array Joints; // KCarWheelJoint setting for steering (see KCarWheelJoint). Duplicated here for handiness. var float SteerPropGap; var float SteerTorque; var float SteerSpeed; // KCarWheelSuspension setting var float SuspStiffness; var float SuspDamping; var float SuspHighLimit; var float SuspLowLimit; var float SuspRef; // The Max torque for all the joints var config float MaxTorque; // KDHinge Joint settings var config float HingePropGap; // KCarWheelJoint defalut working torque var config float MotorTorque; var config float MotorSpeed; var float uuMotorSpeed; // KTire settings. var float TireRollFriction; var float TireLateralFriction; var float TireRollSlip; var float TireLateralSlip; var float TireMinSlip; var float TireSlipRate; var float TireSoftness; var float TireAdhesion; var float TireRestitution; // Robot parameters var config float Payload; var config float Weight; var KRigidBodyState ChassisState; var config float ChassisMass; var config InterpCurve TorqueCurve; // Engine RPM in, Torque out. var float HitSoundThreshold; // Flip var config float FlipTorque; var config float FlipTime; var float FlipTimeLeft; //=============================== // Items mounted on the robot //=============================== // Item mount structure struct sItem { var class ItemClass; var name Parent; var string ItemName; var vector Position; var vector Direction; var rotator uuDirection; }; // Sensors var config array Sensors; var config float msgTimer; // Timer used for sending out sensor data var array SensorList; var array ProcessedSensors; // Effecters var config array Effecters; var array EffecterList; // Battery var config int batteryLife; var int startTime; var int myLife; // Headlight var config sItem HeadLight; var USARHeadlight myHeadLight; var bool bHeadlightOn; var byte HeadlightItensity; // Camera var config array Cameras; var array CamList; var RobotCamera myCamera; var int CameraZoom; var float PanSpeed, TiltSpeed; //========================= // Others //========================= // Variables used for programming var config bool bDebug; var int CurrentPart; var config bool bDisplayTeamBeacon; var float lastTime; var vector lastLocation; var bool bRobotBuilt; var config string ConverterClass; var USARConverter converter; var config bool bMountByUU; //var KSimParams oldKSP, newKSP; replication { // We replicate the robot state. reliable if(Role == ROLE_Authority) RS_ChassisPosition, RS_ChassisQuaternion, RS_ChassisLinVel, RS_ChassisAngVel, RS_PartsPos, RS_PartsQuat, RS_PartsLinVel, RS_PartsAngVel, RS_JointsSteer, RS_JointsOrder, RS_JointsValue, RS_JointsCommandId, RS_UpdateId; reliable if(Role == ROLE_Authority) FlipTimeLeft, CameraZoom, bHeadlightOn, bReady; } simulated event PreBeginPlay() { local class cClass; Super.PreBeginPlay(); bNoTeamBeacon=!bDisplayTeamBeacon; cClass = class(DynamicLoadObject(ConverterClass, class'Class')); converter = new cClass; ConvertParam(converter); if (MotorTorque>MaxTorque) MotorTorque = MaxTorque; /* //Adjust Karma params KGetSimParams(oldKSP); newKSP = oldKSP; newKSP.GammaPerSec = 15; newKSP.PenetrationScale = 5; newKSP.MaxTimestep = 0.02; KSetSimParams(newKSP); */ } simulated function ConvertParam(USARConverter converter) { local int i; if (converter==None) { uuMotorSpeed = MotorSpeed; } else { uuMotorSpeed = converter.SpinSpeedToUU(MotorSpeed); } if (!bMountByUU && converter!=None) { for (i=0;i>"); log("Receive<<"@RS_ChassisPosition.X@RS_ChassisPosition.Y@RS_ChassisPosition.Z); log(" "@RS_ChassisQuaternion.X@RS_ChassisQuaternion.Y@RS_ChassisQuaternion.Z); log(" "@RS_ChassisLinVel.X@RS_ChassisLinVel.Y@RS_ChassisLinVel.Z); log(" "@RS_ChassisAngVel.X@RS_ChassisAngVel.Y@RS_ChassisAngVel.Z@">>"); */ // Don't do anything if vehicle isn't started up. if(!bRobotBuilt) { for (i=0; i 1 || VSize(oldLinVel - chassisLinVel) > 1 || bNewCommand || Level.TimeSeconds > NextNetUpdateTime ) { NextNetUpdateTime = Level.TimeSeconds + MaxNetUpdateInterval; } else { return; //NextNetUpdateTime = Level.TimeSeconds + MaxNetUpdateInterval; } RS_ChassisPosition = RBState.Position; RS_ChassisQuaternion = RBState.Quaternion; RS_ChassisLinVel = RBState.LinVel; RS_ChassisAngVel = RBState.AngVel; // Get each part's state. for (i=0;i>"); log("Pack<<"@i@"S:"@JointsControl[i].steer@JointsControl[i].order@JointsControl[i].value); log(" D:"@RS_JointsSteer[i]@RS_JointsOrder[i]@RS_JointsValue[i]@">>"); } } // This flag lets the client know this data is new. RS_UpdateId += 1; } function RobotCamera GetCamera(String name) { local int i; for (i=0;i"); GetAxes(Parent.Rotation,RotX,RotY,RotZ); //Spawn Part offset = JointParts[CurrentPart].ParentPos - JointParts[CurrentPart].SelfPos; Parts[CurrentPart] = spawn(JointParts[CurrentPart].PartClass, Parent,, Parent.Location + offset.X*RotX + offset.Y*RotY + offset.Z*RotZ,Parent.Rotation); Parts[CurrentPart].SetDrawScale3D(JointParts[CurrentPart].DrawScale3D); //Spawn Joint (any KConstraint class) Joints[CurrentPart] = spawn(JointParts[CurrentPart].JointClass,Parent); //Set primary constraint params Joints[CurrentPart].KConstraintActor1 = Parent; Joints[CurrentPart].KPos1 = JointParts[CurrentPart].ParentPos/50; Joints[CurrentPart].KPriAxis1 = JointParts[CurrentPart].ParentAxis; if (VSize(JointParts[CurrentPart].ParentAxis2)>0) Joints[CurrentPart].KSecAxis1 = JointParts[CurrentPart].ParentAxis2; //Set secondary constraint params Joints[CurrentPart].KConstraintActor2 = Parts[CurrentPart]; Joints[CurrentPart].KPos2 = JointParts[CurrentPart].SelfPos/50; Joints[CurrentPart].KPriAxis2 = JointParts[CurrentPart].SelfAxis; if (VSize(JointParts[CurrentPart].SelfAxis2)>0) Joints[CurrentPart].KSecAxis2 = JointParts[CurrentPart].SelfAxis2; Joints[CurrentPart].SetPhysics(PHYS_Karma); if (ClassIsChildOf(JointParts[CurrentPart].PartClass,class'KTire') && Joints[CurrentPart].IsA('KCarWheelJoint')) { (KTire(Parts[CurrentPart])).WheelJoint = KCarWheelJoint(Joints[CurrentPart]); (KTire(Parts[CurrentPart])).WheelJoint.KUpdateConstraintParams(); } else if (ClassIsChildOf(JointParts[CurrentPart].PartClass,class'USARBot.KDPart')) (KDPart(Parts[CurrentPart])).setJoint(Joints[CurrentPart]); if(Role != ROLE_Authority) KarmaParams(Parts[CurrentPart].KParams).bDestroyOnSimError = False; //Generate mission package. The parts are stored in the mounting order. //Since parts are always mounted from chassis to the terminal, the parts //in the MisPackage should in the root-->terminal order. if (JointParts[CurrentPart].PackageName!='' && JointParts[CurrentPart].PackageType!='') { for(i=0;i=Packages.length) { mPkg = newMisPackage(JointParts[CurrentPart].PackageType,JointParts[CurrentPart].PackageName); mPkg.PartsName.Insert(0,1); mPkg.PartsName[0] = JointParts[CurrentPart].PartName; mPkg.PartsId.Insert(0,1); mPkg.PartsId[0] = CurrentPart; Packages.Insert(Packages.length,1); Packages[Packages.length-1]=mPkg; } } } if (bDebug) { DumpPackages(); DumpJoints(); } // Initially make sure parameters are sync'ed with Karma KVehicleUpdateParams(); // For KImpact event KSetImpactThreshold(HitSoundThreshold); // If this is not 'authority' version - don't destroy it if there is a problem. // The network should sort things out. if(Role != ROLE_Authority) KarmaParams(KParams).bDestroyOnSimError = False; // init the array size JointsControl.length = JointParts.length; ///////////////////////////////// // Mount Items ///////////////////////////////// // Mount headlight if (HeadLight.ItemName!="") { Parent = FindPart(HeadLight.Parent); if (Parent!=None) { GetAxes(Parent.Rotation,RotX,RotY,RotZ); myHeadLight = USARHeadlight(spawn(HeadLight.ItemClass, Parent,, Parent.Location + HeadLight.Position.X * RotX + HeadLight.Position.Y * RotY + HeadLight.Position.Z * RotZ, )); myHeadlight.SetBase(Parent); myHeadlight.SetRelativeRotation(HeadLight.uuDirection); } } // Mount cameras for (i=0;i0) { myCamera = CamList[0]; CameraZoom = CamList[0].CameraFov; } // Mount sensors for (i=0;i> Rotation; worldUp = vect(0, 0, 1) >> Rotation; worldRight = vect(0, 1, 0) >> Rotation; torqueAxis = Normal(worldUp Cross vect(0, 0, 1)); // Torque scaled by how far over we are. // This will be between 0 and PI - so convert to between 0 and 1. torqueScale = Acos(worldUp Dot vect(0, 0, 1))/3.1416; Torque = FlipTorque * torqueScale * torqueAxis; } function StartFlip(Pawn Pusher) { //local vector toPusher, worldUp; // if we are already flipping the car - dont do it again! if(FlipTimeLeft > 0) return; FlipTimeLeft = FlipTime; // Start the flip on the server USARRemoteBot(Controller).Flip = false; } //given a name and return the correspond jointpart's id function int FindJointPartId(string jname) { local int i; for (i=0;i FindChildren(int idx) { local array res; local int i; local name myName,pName; //invalid idx is treated as the robot platform (hard mount). if (idx<0 || idx>=JointParts.length) myName='None'; //iterate JointParts to find all the children myName = JointParts[idx].PartName; for (i=0;i=JointParts.length) { log("Invaild JointPart index in function rLocJointParent!"); return vect(0,0,0); } //find the parent's orientation parent = FindPart(JointParts[idx].Parent); if (parent==None) { log("Can't find the parent in function rLocJointParent!"); return vect(0,0,0); } if (parent.Rotation==rot(0,0,0)) { forward = vect(1,0,0); right = vect(0,1,0); upward = vect(0,0,1); } else GetAxes(parent.Rotation,forward,right,upward); //project to the parent's coordinate dif = Joints[idx].Location - parent.Location; res.X = dif Dot forward; res.Y = dif Dot right; res.Z = dif Dot upward; return res; } // The relative orientation of the joint (mount) respect to the parent part // Ref: http://people.csail.mit.edu/bkph/articles/Kinematics_Vicarm_WP_69.pdf function rotator rRotJointParent(int idx) { local rotator res; local vector pForward, pRight, pUpward; local vector jForward, jRight, jUpward; local Actor parent, joint; local float m00,m01,m02,m10,m11,m12,m20,m21,m22; //check idx if (idx<0 || idx>=JointParts.length) { log("Invaild JointPart index in function rLocJointParent!"); return rot(0,0,0); } //find the parent's orientation parent = FindPart(JointParts[idx].Parent); if (parent==None) { log("Can't find the parent in function rLocJointParent!"); return rot(0,0,0); } if (parent.Rotation==rot(0,0,0)) { pForward = vect(1,0,0); pRight = vect(0,1,0); pUpward = vect(0,0,1); } else GetAxes(parent.Rotation,pForward,pRight,pUpward); //find the joint's orientation joint = Joints[idx]; if (joint.Rotation==rot(0,0,0)) { jForward = vect(1,0,0); jRight = vect(0,1,0); jUpward = vect(0,0,1); } else GetAxes(joint.Rotation,jForward,jRight,jUpward); //calculate the rotation matrix m00 = jForward Dot pForward; m10 = jForward Dot pRight; m20 = jForward Dot pUpward; m01 = jRight Dot pForward; m11 = jRight Dot pRight; m21 = jRight Dot pUpward; m02 = jUpward Dot pForward; m12 = jUpward Dot pRight; m22 = jUpward Dot pUpward; //calculate the pitch, yaw and roll angles in UU which indicate we getting //part coordinate by rotating joint coordinate roll->pitch->yaw. res.Pitch = Atan(-m20,Sqrt((m00*m00+m10*m10+m21*m21+m22*m22)/2))*10430.3783505; if (Abs(res.Pitch-16384)<10) { // Can't uniquely determine yaw and roll. Here we set roll=0. res.Roll = 0; res.Yaw = -Atan(m01-m20,m11+m02)*10430.3783505; } else if (Abs(res.Pitch+16384)<10) { // Can't uniquely determine yaw and roll. Here we set roll=0. res.Roll = 0; res.Yaw = Atan(-m01-m20,m11-m02)*10430.3783505; } else { res.Yaw = Atan(m10,m00)*10430.3783505; res.Roll = Atan(m21,m22)*10430.3783505; } res.Yaw=-res.Yaw; return res; } // The relative location of the part respect to the joint (mount) function vector rLocPartJoint(int idx) { local vector res, forward, right, upward, dif; local Actor joint; //check idx if (idx<0 || idx>=JointParts.length) { log("Invaild JointPart index in function rLocJointParent!"); return vect(0,0,0); } //find the joint's orientation joint = Joints[idx]; if (joint.Rotation==rot(0,0,0)) { forward = vect(1,0,0); right = vect(0,1,0); upward = vect(0,0,1); } else GetAxes(joint.Rotation,forward,right,upward); //project to the joint's coordinate dif = Parts[idx].Location - joint.Location; res.X = dif Dot forward; res.Y = dif Dot right; res.Z = dif Dot upward; return res; } // The relative orientation of the part respect to the joint (mount) function rotator rRotPartJoint(int idx) { local rotator res; local vector pForward, pRight, pUpward; local vector jForward, jRight, jUpward; local Actor part, joint; local float m00,m01,m02,m10,m11,m12,m20,m21,m22; //check idx if (idx<0 || idx>=JointParts.length) { log("Invaild JointPart index in function rLocJointParent!"); return rot(0,0,0); } //find the part's orientation part = Parts[idx]; if (part.Rotation==rot(0,0,0)) { pForward = vect(1,0,0); pRight = vect(0,1,0); pUpward = vect(0,0,1); } else GetAxes(part.Rotation,pForward,pRight,pUpward); //find the joint's orientation which should be parent's orientation joint = Parents[idx]; if (joint==None || joint.Rotation==rot(0,0,0)) { jForward = vect(1,0,0); jRight = vect(0,1,0); jUpward = vect(0,0,1); } else GetAxes(joint.Rotation,jForward,jRight,jUpward); //calculate the rotation matrix m00 = jForward Dot pForward; m10 = jForward Dot pRight; m20 = jForward Dot pUpward; m01 = jRight Dot pForward; m11 = jRight Dot pRight; m21 = jRight Dot pUpward; m02 = jUpward Dot pForward; m12 = jUpward Dot pRight; m22 = jUpward Dot pUpward; //calculate the pitch, yaw and roll angles in UU which indicate we getting //part coordinate by rotating joint coordinate roll->pitch->yaw. res.Pitch = Atan(-m20,Sqrt((m00*m00+m10*m10+m21*m21+m22*m22)/2))*10430.3783505; if (Abs(res.Pitch-16384)<10) { // Can't uniquely determine yaw and roll. Here we set roll=0. res.Roll = 0; res.Yaw = -Atan(m01-m20,m11+m02)*10430.3783505; } else if (Abs(res.Pitch+16384)<10) { // Can't uniquely determine yaw and roll. Here we set roll=0. res.Roll = 0; res.Yaw = Atan(-m01-m20,m11-m02)*10430.3783505; } else { res.Yaw = Atan(m10,m00)*10430.3783505; res.Roll = Atan(m21,m22)*10430.3783505; } /* Debug:: log(JointParts[idx].PartName@pForward@pRight@pUpward@jForward@jRight@jUpward); log(m00@m01@m02); log(m10@m11@m12); log(m20@m21@m22); log(res); */ res.Yaw=-res.Yaw; return res; } simulated function int getJointAngle(KCarWheelJoint WheelJ) { local Quat curQ, relQ; local Vector axis11, axis12, axis21, axis22, newAxis11; local float difCos, difSign; local int curAng; curQ = WheelJ.KConstraintActor1.KGetRBQuaternion(); axis11 = QuatRotateVector(curQ,WheelJ.KPriAxis1); axis12 = QuatRotateVector(curQ,WheelJ.KSecAxis1); curQ = WheelJ.KConstraintActor2.KGetRBQuaternion(); axis21 = QuatRotateVector(curQ,WheelJ.KPriAxis2); axis22 = QuatRotateVector(curQ,WheelJ.KSecAxis2); relQ = QuatFindBetween(axis12,axis22); newAxis11 = QuatRotateVector(relQ,axis11); difCos = newAxis11 Dot axis21; if (difCos>1.0) difCos = 1.0; if (difCos<-1.0) difCos = -1.0; difSign = (newAxis11 Cross axis21) Dot axis22; if (difSign<0) difSign=-1.0; else difSign=1.0; curAng = difSign * ACos(difCos)*32768/PI; return curAng; } function ProcessCarInput() { local int i; local int JIdx; local string type, name, outstring, tmpstring; local MisPackage mPkg; bNewCommand = false; // Set sensor/Effecters/cameras JIdx=-1; type = USARRemoteBot(Controller).SetType; name = USARRemoteBot(Controller).SetName; if (type!="" && Caps(type)!="JOINT") { outstring = "RES {Time "$Level.TimeSeconds$"} {Type "$type$"} {Name "$USARRemoteBot(Controller).SetName$"}"; for (i=0;i=0) { mPkg = Packages[i]; //The default MISPKG actions. They can be overrode by your robot class. if (mPkg.Type=='PanTilt') { // Tilt if (mPkg.PartsId.length>0) { JIdx = mPkg.PartsId[mPkg.PartsId.length-1]; JointsControl[JIdx].state = 1; // new command JointsControl[JIdx].steer = 0; JointsControl[JIdx].order = USARRemoteBot(Controller).MPOrder; JointsControl[JIdx].value = -USARRemoteBot(Controller).MPRotation.Pitch; if (JointsControl[JIdx].order==2 && JointsControl[JIdx].value<-MaxTorque) JointsControl[JIdx].value = -MaxTorque; } // Pan if (mPkg.PartsId.length>1) { JIdx = mPkg.PartsId[mPkg.PartsId.length-2]; JointsControl[JIdx].state = 1; // new command JointsControl[JIdx].steer = 0; JointsControl[JIdx].order = USARRemoteBot(Controller).MPOrder; JointsControl[JIdx].value = USARRemoteBot(Controller).MPRotation.Yaw; if (JointsControl[JIdx].order==2 && JointsControl[JIdx].value>MaxTorque) JointsControl[JIdx].value = MaxTorque; } bNewCommand = True; } else if (mPkg.Type=='Flipper') { for (i=0; i=0) { JointsControl[JIdx].state = 1; // new command JointsControl[JIdx].steer = USARRemoteBot(Controller).JSteer[i]; JointsControl[JIdx].order = USARRemoteBot(Controller).JOrder[i]; JointsControl[JIdx].value = USARRemoteBot(Controller).JValue[i]; if (JointsControl[JIdx].order==2 && JointsControl[JIdx].value>MaxTorque) JointsControl[JIdx].value = MaxTorque; } if (bDebug) log("Input <<"@USARRemoteBot(Controller).JointControlIdx @USARRemoteBot(Controller).JName[i] @USARRemoteBot(Controller).JSteer[i] @USARRemoteBot(Controller).JOrder[i] @USARRemoteBot(Controller).JValue[i] @JIdx@">>"); } if (Caps(USARRemoteBot(Controller).SetType)=="JOINT") { JIdx = FindJointPartId(USARRemoteBot(Controller).SetName); if (JIdx>=0) { JointsControl[JIdx].state = 1; if (USARRemoteBot(Controller).Opcode=="0" || caps(USARRemoteBot(Controller).Opcode)=="ANGLE") JointsControl[JIdx].order = 0; else if (USARRemoteBot(Controller).Opcode=="1" || caps(USARRemoteBot(Controller).Opcode)=="VELOCITY") JointsControl[JIdx].order = 1; else if (USARRemoteBot(Controller).Opcode=="2" || caps(USARRemoteBot(Controller).Opcode)=="TORQUE") JointsControl[JIdx].order = 2; i = InStr(USARRemoteBot(Controller).Params,","); if( i == -1 ) { JointsControl[JIdx].steer = 0; if (JointsControl[JIdx].order<2) JointsControl[JIdx].value = converter.AngleToUU(float(USARRemoteBot(Controller).Params)); else JointsControl[JIdx].value = float(USARRemoteBot(Controller).Params); } else { JointsControl[JIdx].steer = converter.AngleToUU(float(mid(USARRemoteBot(Controller).Params,i+1))); if (JointsControl[JIdx].order<2) JointsControl[JIdx].value = converter.AngleToUU(float(left(USARRemoteBot(Controller).Params,i))); else JointsControl[JIdx].value = float(left(USARRemoteBot(Controller).Params,i)); } if (JointsControl[JIdx].order==2 && JointsControl[JIdx].value>MaxTorque) JointsControl[JIdx].value = MaxTorque; } } } function ResetCarInput() { USARRemoteBot(Controller).SetType=""; USARRemoteBot(Controller).GeoType=""; USARRemoteBot(Controller).ConfType=""; USARRemoteBot(Controller).MPName=""; USARRemoteBot(Controller).JointControlIdx=0; } simulated event SetInitialState() { Super.SetInitialState(); Enable('Tick'); } simulated function Tick(float Delta) { local int i; local float spinAng, difAng, slowAng; local KCarWheelJoint WheelJ; local KDHinge HingeJ; Super.Tick(Delta); if( FlipTimeLeft > 0 ) KWake(); // If the server, process input and pack updated car info into struct. if(Role == ROLE_Authority) { ProcessCarInput(); ResetCarInput(); PackState(); } // Battery: If battery low then set torque to 0 (this will brake every joint, see later...) if (myLife>=batteryLife) { myLife=batteryLife; for (i=0;i>"@i@JointsControl[i].state@JointsControl[i].order@JointsControl[i].value@JointsControl[i].steer); //log(" "@WheelJ.KMotorTorque@WheelJ.KMaxSpeed@WheelJ.KBraking); // Drive /////////// // Brake if (JointsControl[i].order==3) { WheelJ.KBraking = JointsControl[i].value; WheelJ.KMotorTorque = 0.0; } // Torque else if (JointsControl[i].order==2) { WheelJ.KMotorTorque = JointsControl[i].value; WheelJ.KMaxSpeed = 1310700; if (JointsControl[i].value!=0) WheelJ.KBraking = 0.0; else WheelJ.KBraking = JointParts[i].BrakeTorque + 0.5; } // Speed else if (JointsControl[i].order==1) { WheelJ.KMaxSpeed = JointsControl[i].value; if (JointsControl[i].value!=0) { WheelJ.KBraking = 0.0; WheelJ.KMotorTorque = MotorTorque; } else { WheelJ.KBraking = JointParts[i].BrakeTorque + 0.5; WheelJ.KMotorTorque = 0.0; } } // Angle else if (JointsControl[i].order==0 && JointsControl[i].value!=0.0) { spinAng = getJointAngle(WheelJ); slowAng = Delta*uuMotorSpeed*1.5; if (JointsControl[i].state == 1) { JointsControl[i].startAng = spinAng; JointsControl[i].angle = 0.0; difAng = 0.0; WheelJ.KBraking = 0.0; WheelJ.KMotorTorque = MotorTorque; if (JointsControl[i].value>0) { if (JointsControl[i].value<=slowAng) WheelJ.KMaxSpeed = 500; else WheelJ.KMaxSpeed = uuMotorSpeed; } else { if (JointsControl[i].value>=-slowAng) WheelJ.KMaxSpeed = -500; else WheelJ.KMaxSpeed = -uuMotorSpeed; } JointsControl[i].state = 254; // -2 } else { difAng = spinAng - JointsControl[i].startAng; if (difAng>32768) difAng -= 65535; else if (difAng<-32768) difAng += 65535; JointsControl[i].angle += difAng; JointsControl[i].startAng = spinAng; if (JointsControl[i].value>0 && JointsControl[i].angle>=JointsControl[i].value-slowAng) if ((JointsControl[i].value-JointsControl[i].angle)<3000*Delta) WheelJ.KMaxSpeed = 500; else WheelJ.KMaxSpeed = 1500; if (JointsControl[i].value<0 && JointsControl[i].angle<=JointsControl[i].value+slowAng) if ((JointsControl[i].value-JointsControl[i].angle)>-3000*Delta) WheelJ.KMaxSpeed = -500; else WheelJ.KMaxSpeed = -1500; if ( (JointsControl[i].value>0 && JointsControl[i].angle>=JointsControl[i].value) || (JointsControl[i].value<0 && JointsControl[i].angle<=JointsControl[i].value) ) { WheelJ.KMotorTorque = 0.0; WheelJ.KBraking = 1.0; WheelJ.KMaxSpeed = 0.0; JointsControl[i].value = 0.0; JointsControl[i].state = 0; } } //log("<<"@i@JointsControl[i].state@JointsControl[i].order@JointsControl[i].value); //log(" "@KCarWheelJoint(Joints[i]).KMotorTorque@KCarWheelJoint(Joints[i]).KMaxSpeed@KCarWheelJoint(Joints[i]).KBraking); //log("Order_0"@spinAng@JointsControl[i].startAng@"<-->"@difAng@JointsControl[i].angle@JointsControl[i].value@JointsControl[i].state@Parts[i].Rotation); if (bDebug) log("Order_0"@i@spinAng@JointsControl[i].startAng@"<-->"@difAng@JointsControl[i].angle@JointsControl[i].value@JointsControl[i].state); } // Steer if (JointsControl[i].steer!=65535) WheelJ.KSteerAngle = JointsControl[i].steer; if (JointsControl[i].order>0) JointsControl[i].state = 0; WheelJ.KUpdateConstraintParams(); if (bDebug) log("Tick <<"@i@WheelJ.KSteerAngle@WheelJ.KMotorTorque@WheelJ.KMaxSpeed@WheelJ.KBraking@">>"); } // End KCarWheelJoint else if(Joints[i].IsA('KDHinge')) { HingeJ = KDHinge(Joints[i]); switch(JointsControl[i].order) { case 0: // Drive: ANGLE HingeJ.KHingeType = HT_Controlled; HingeJ.KMaxTorque = MotorTorque; HingeJ.KDesiredAngVel = uuMotorSpeed; HingeJ.KDesiredAngle = HingeJ.KCurrentAngle - JointsControl[i].value; //relative angle HingeJ.Update(); break; case 1: // Drive: ANGLE SPEED HingeJ.KHingeType = HT_Motor; HingeJ.KMaxTorque = MotorTorque; HingeJ.KDesiredAngVel = -JointsControl[i].value; HingeJ.Update(); break; case 2: // Drive: TORQUE HingeJ.KHingeType = HT_Motor; HingeJ.KMaxTorque = -JointsControl[i].value; if(JointsControl[i].value > 0) HingeJ.KDesiredAngVel = 327680; //5 turns/sec else HingeJ.KDesiredAngVel = -327680; //5 turns/sec HingeJ.Update(); break; } JointsControl[i].state = 0; } // End KDHinge } // other control commands from GameBot if (Role == ROLE_Authority) { bHeadlightOn=USARRemoteBot(Controller).Light; if (USARRemoteBot(Controller).Flip) StartFlip(None); if (USARRemoteBot(Controller).myCameraZoom>=0&&myCamera!=NONE) { CameraZoom = USARRemoteBot(Controller).myCameraZoom; if (CameraZoom==0) CameraZoom = myCamera.degCameraDefFov; // reset else if (CameraZoom<=myCamera.degCameraMinFov) CameraZoom = myCamera.degCameraMinFov; // low bound else if (CameraZoom>myCamera.degCameraMaxFov) CameraZoom = myCamera.degCameraMaxFov; // upper bound myCamera.setFov(CameraZoom); CamList[0].setFov(CameraZoom); USARRemoteBot(Controller).myCameraZoom = -1; } } // Projecting effect if(Level.NetMode != NM_DedicatedServer && myHeadlight!=None) { myHeadlight.DetachProjector(); if(bHeadlightOn) myHeadlight.AttachProjector(); } // Flipping if(FlipTimeLeft > 0) { FlipTimeLeft -= Delta; FlipTimeLeft = FMax(FlipTimeLeft, 0.0); // Make sure it doesn't go negative } return; } function timer() { local string outstring; local int i; local vector loc,vel; local float time; time = Level.TimeSeconds; loc = Location; vel = (loc-lastLocation)/(time-lastTime); outstring = "STA {Time "$time$"}"$ " {Location "$Converter.Str_LengthVectorFromUU(loc)$"}"$ " {Orientation "$Converter.Str_RotatorFromUU(Rotation)$"}"$ " {Velocity "$Converter.Str_VelocityVectorFromUU(vel)$"}"$ //" {CameraFov "$Converter.Str_AngleFromDeg(CameraZoom)$"}"$ " {LightToggle "$bHeadlightOn$"}"$ " {LightIntensity "$HeadlightItensity$"}"$ " {Battery "$(batteryLife-myLife)$"}"; USARRemoteBot(Controller).myConnection.SendLine(outstring); //log(time@Rotation@loc@vel); outstring = ""; for (i=0;i' ^][W 6w6X *a6P ' ' 6W ^6W ]6W [' *6p&a6o'&'& 6w9?,2& 6lK6q9?%& 6q&*& 6X 9?,2& 6j6r9?%& 6r&o$ a6P  &a/!g.*.&.*'a6P  .*D& 9:9:$.*-(6Q!6R!%:706a6Q#6r6R\76Y@6Y\&\6Y6t@6-\&\6-9=:G7j[6R6Q@6Yj%&%6Yj6t@6-j%&%6-j9=@7&7&j -Z\DS99:9:$.-(775{6SW'O6oW5w'*' ^][Y.%a6r W' ' 66EW^66EW]66EW[Ya*'Y6UW%77'O6o7vr'*' ^][. a6r 7' ' 66E7^66E7]66E7[L:6S7'6E76U76o7<7%%b%l% 76'O6o6r'* ' ^][:.a6r 6' ' 66E6^66E6]66E6[:L:6S6'6E66U66o6b $%w 7B'O6oBa r'*m ' ^][b.Za6r B' ' 66EB^66EB]66EB[bL:6SB'6EB6UB6oB' ?a['_9Dqt GI!Q\ZxQ%uQ7&稨9SQName9W6tQPart9VQ*Joint9VQ&Q GJ!b[[)6rib6ai]i Gi@k[A?A.I7AF@AFI&IAFA-DIAF[I GU //============================================================================= // Piper spawner location. //============================================================================= class KNActorFactory extends Actor placeable; var(Factory) int Count; var(Factory) vector Range; var(Factory) class KNActorClass; function PostNetBeginPlay() { local int i; local vector v; local rotator r; local KNActor myActor; for (i=0;i&xU .H%uH7U FkrHU FAU FH&uH  G@// Network KActor that works on server and client // // Simplified form NetKActor http://mods.beyondunreal.com/mod.php?id=200. All credits go // to the GoodKarma group. -- Jijun Wang class KNActor extends KActor placeable; var KRigidBodyState KState, KRepState; var bool bReceiveStateNew; var byte StateCount, LastStateCount; replication { reliable if(Role == ROLE_Authority) KRepState, StateCount; } // This even is for updating the state (position, velocity etc.) of the tire's karma // body when we get new information from the network. simulated event bool KUpdateState(out KRigidBodyState newState) { if(Level.NetMode == NM_DedicatedServer || StateCount == LastStateCount) return false; newState = KrepState; LastStateCount = StateCount; return true; } function Tick(float Delta) { Super.Tick(Delta); if (Level.NetMode == NM_DedicatedServer) PackState(); } // Pack current state to be sent to the client. // Should only get called on the server. function PackState() { local bool bChanged; if(!KIsAwake()) return; KGetRigidBodyState(KState); bChanged = bChanged || VSize(KRBVecToVector(KState.Position) - KRBVecToVector(KRepState.Position)) > 1.0; bChanged = bChanged || VSize(KRBVecToVector(KState.LinVel) - KRBVecToVector(KRepState.LinVel)) > 0.2; bChanged = bChanged || VSize(KRBVecToVector(KState.AngVel) - KRBVecToVector(KRepState.AngVel)) > 0.2; if(bChanged) { KRepState = KState; StateCount++; } return; } simulated event Bump(Actor Other) { if(!KIsAwake()) KWake() ; } simulated event FellOutOfWorld(eKillZType KillType) { bTearOff = true ; SetPhysics(PHYS_None) ; bHidden = true ; } O~class KDTrack extends KTire config(USARBot) abstract; var float Radius; var class AuxTireClass; var vector ATPos; var float ATRadius; var KTire AuxTire; var class TrackTireClass; var array TTires; var float TTRadius; var config int MaxTTiresNum; var int TTiresNum; // KCarWheelJoint settings var float SuspHighLimit; var float SuspLowLimit; var float SuspStiffness; var float SuspDamping; var float lastKMotorTorque; var float lastKMaxSpeed; var float lastKBraking; var float ATRatio; var float TTRatio; struct pvector { var float X; var float Y; var float Z; }; var pvector RS_TiresPos[17]; //var Quat RS_TiresQuat[17]; var vector RS_TiresLinVel[17]; //var vector RS_TiresAngVel[17]; var byte RS_UpdateId; var byte last_RS_UpdateId; var float NextNetUpdateTime; var float MaxNetUpdateInterval; replication { reliable if(Level.NetMode == NM_DedicatedServer) RS_TiresPos, /*RS_TiresQuat,*/ RS_TiresLinVel, /*RS_TiresAngVel,*/ RS_UpdateId; } simulated function vector toVector(pVector pv) { local vector vec; vec.X = pv.X; vec.Y = pv.Y; vec.Z = pv.Z; return vec; } simulated function pVector toPVector(vector vec) { local pVector pv; pv.X = vec.X; pv.Y = vec.Y; pv.Z = vec.Z; return pv; } simulated function PostNetBeginPlay() { local int i; local float len, sinValue, cosValue; local vector pos, step; Super.PostNetBeginPlay(); if (MaxTTiresNum>16) MaxTTiresNum=16; AuxTire = spawn(AuxTireClass,Owner,,Location+ATPos); AuxTire.WheelJoint = spawn(class'KCarWheelJoint',Owner); //Set primary constraint params AuxTire.WheelJoint.KConstraintActor1 = Owner; AuxTire.WheelJoint.KPos1 = (Location-Owner.Location+ATPos)/50; AuxTire.WheelJoint.KPriAxis1 = vect(0,0,1); AuxTire.WheelJoint.KSecAxis1 = vect(0,1,0); //Set secondary constraint params AuxTire.WheelJoint.KConstraintActor2 = AuxTire; AuxTire.WheelJoint.KPos2 = vect(0,0,0); AuxTire.WheelJoint.KPriAxis2 = vect(0,0,1); AuxTire.WheelJoint.KSecAxis2 = vect(0,1,0); AuxTire.WheelJoint.KSuspHighLimit = SuspHighLimit; AuxTire.WheelJoint.KSuspLowLimit = SuspLowLimit; AuxTire.WheelJoint.KSuspStiffness = SuspStiffness; AuxTire.WheelJoint.KSuspDamping = SuspDamping; AuxTire.WheelJoint.SetPhysics(PHYS_Karma); len = Sqrt(ATPos.X*ATPos.X-(Radius-ATRadius)*(Radius-ATRadius)); TTiresNum = Min(MaxTTiresNum,2*Ceil(len/TTRadius/2)); if (ATPos.X<0) len = -len; sinValue = (Radius-ATRadius)/len; cosValue = ATPos.X/len; pos.X = (Radius-TTRadius)*sinValue; pos.Z = (Radius-TTRadius)*cosValue; step.X = (2*len/TTiresNum)*cosValue; step.Z = -(2*len/TTiresNum)*sinValue; for (i=0;i 1) || Level.TimeSeconds > NextNetUpdateTime) NextNetUpdateTime = Level.TimeSeconds + MaxNetUpdateInterval; else return; RS_TiresPos[0] = toPVector(KRBVecToVector(RBState.Position)); //RS_TiresQuat[0] = RBState.Quaternion; RS_TiresLinVel[0] = KRBVecToVector(RBState.LinVel); //RS_TiresAngVel[0] = KRBVecToVector(RBState.AngVel); for (i=0;i G khQz-6c ,r * r* 6A6|6A6M6A6~6A6l Y6|o6~p6l h6M#?K6M#?6A6|6A6M6A6~6A6l   46dM6d[6d%6h cY6Md6 4cm \ m#?_ K%6f hM \ _ 6 4M mN cYkopN k%6e K6 4k -'46dM6d[6d&6h cY6Md64cm\ m#?_ K&6f hM \ _ 64M mN cYkopN k&6e K64k-'6_d6`-}-6z-p-6v-6c(-f' G K!@ZF\@%@7c p9S@Type9W6r@Name9W6a@PartsH%H76Y@c ppc 9WH6Y@/9RH6-@Hpc @ GV!C|{]LC%CC79z9W6aCCCC G\_ ?\_ .]7_ P@_ P]&]_ P GJ// Dynamic Part class KDPart extends KActor abstract; // This should be an abstract and all of the parts of the robot should extend // this class and define they own properties like StaticMesh, DrawScale3d, ... // This is filled in by VehicleStateReceived in KRobot. var KRigidBodyState ReceiveState; var bool bReceiveStateNew; // The type of the part, eg. ARM, LEG, Pan-Tilt etc. var name Type; var KConstraint KJoint; var config float Weight; simulated function setJoint(KConstraint kc) { KJoint = kc; } // This even is for updating the state (position, velocity etc.) of the tire's karma // body when we get new information from the network. simulated event bool KUpdateState(out KRigidBodyState newState) { if(!bReceiveStateNew) return false; newState = ReceiveState; bReceiveStateNew = false; return true; } CX!a >xa .C%uC7a PkrCa PAa PC&uC  GPclass KDHinge extends KHinge; var KRigidBodyState ReceiveState; var bool bReceiveStateNew; //Call this if you modify Hinge type or some of its params simulated function Update() { KUpdateConstraintParams(); KConstraintActor2.KWake(); } simulated event bool KUpdateState(out KRigidBodyState newState) { if(!bReceiveStateNew) return false; newState = ReceiveState; bReceiveStateNew = false; return true; } }class KDCarWheelJoint extends KCarWheelJoint; var KRigidBodyState ReceiveState; var bool bReceiveStateNew; simulated event bool KUpdateState(out KRigidBodyState newState) { if(!bReceiveStateNew) return false; newState = ReceiveState; bReceiveStateNew = false; return true; } [!/*? G^!<0> G a!pp]!]u@b!&waiclass Item extends Actor config(USARBot) abstract; var string ItemName; var string ItemType; var name ItemMount; var USARConverter converter; var vector myPosition; var rotator myDirection; var KVehicle Platform; var config float Weight; function SetName(String iName) { ItemName = iName; } function string Set(String opcode, String args) { return "Failed"; } simulated function Init(String SName, Actor parent, vector position, rotator direction, KVehicle veh, name mount) { Platform = veh; if (mount=='None') ItemMount = 'HARD'; else ItemMount = mount; ItemName = SName; SetBase(parent); SetRelativeRotation(direction); myPosition = position; myDirection = direction; if (Platform.IsA('KRobot')) converter = KRobot(Platform).Converter; else if (Platform.IsA('USARCar')) converter = USARCar(Platform).Converter; else if (Platform.IsA('USARBc')) converter = USARBc(Platform).Converter; else converter = None; ConvertParam(converter); } simulated function ConvertParam(USARConverter converter) { } function bool isType(String type) { return (Caps(ItemType)==Caps(type)); } function bool isName(String name) { return (Caps(ItemName)==Caps(name)); } \!// This class is basically the same as the USARSim RangeSensor class // For the moment only the Range and output curve parameters are changed // author: Erik Winter // created: 2005-02-24 Created the class from the USARSim RangeSensor class // // modified: 2005-03-07 Made the IR look straight through transparent materials // 2005-03-15 If the IR hits a transparent material it now sends out a new trace from the HitLocation recursively // until it hits a non-transparent material or reaches MaxRange // // Todo: // - Apply the fact that the IR can see through, and though miss glass walls // * halfly done, if it hits a transparent material it returns maxRange. On these maps it should be an okay simplification, Fully Done class IRSensor extends RangeSensor config (USARBot); function float GetRange() { local vector HitLocation,HitNormal, locTmp; local float range; local material mtrl; range=0; locTmp=Location; while(rangeMaxRange) range=MaxRange; if (range0) range=InterpCurveEval(OutputCurve, range); range += RandRange(-Noise,Noise)*range; if (range>MaxRange) range=MaxRange; if (range1* G b_Dbz% z7*z&a/!gt.z&t--6nztetitjt6Nz0-6mzto:totHCtBtntqtktlt'z&a/!ua./z&aCajata$a'z*a/!r_.z*_{_F_H_M_S_V_X_Y_Zz K G g!o!@W jX9?% ba#Ta#?\a#?^T#?GT#?I@rիTG^ G Ng V 8)g 7Ng 9D9?g 9?7Ng N GB5class IRScanner extends IRSensor config (USARBot); var config float ScanInterval; var config float Resolution; var config float ScanFov; var config bool bYaw; var config bool bPitch; var int uuResolution, uuScanFov; var string rangeData; var float time; var USARRemoteBot rBot; simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); rangeData=""; if (ScanInterval>=0.1) SetTimer(ScanInterval,true); } function ConvertParam(USARConverter converter) { super.ConvertParam(converter); if (converter!=None) { uuResolution = converter.AngleToUU(Resolution); uuScanFov = converter.AngleToUU(ScanFov); } else { uuResolution = Resolution; uuScanFov = ScanFov; } } function timer() { local int i; local float range; local rotator turn; time = Level.TimeSeconds; rangeData=""; for (i=uuScanFov/2;i>-uuScanFov/2;i-=uuResolution) { if (bYaw) turn.Yaw = i; if (bPitch) turn.Pitch = i; curRot = rTurn(Rotation,turn); range = GetRange(); if (rangeData == "") rangeData = converter.FloatString(range); else rangeData = rangeData$","$converter.FloatString(range); //log("i="$i@"rot="$rot@"Rotation="$Rotation@"range="$range); } } function rotator rTurn(rotator rHeading,rotator rTurnAngle) { // Generate a turn in object coordinates // this should handle any gymbal lock issues local vector vForward,vRight,vUpward; local vector vForward2,vRight2,vUpward2; local rotator T; local vector V; GetAxes(rHeading,vForward,vRight,vUpward); // rotate in plane that contains vForward&vRight T.Yaw=rTurnAngle.Yaw; V=vector(T); vForward2=V.X*vForward + V.Y*vRight; vRight2=V.X*vRight - V.Y*vForward; vUpward2=vUpward; // rotate in plane that contains vForward&vUpward T.Yaw=rTurnAngle.Pitch; V=vector(T); vForward=V.X*vForward2 + V.Y*vUpward2; vRight=vRight2; vUpward=V.X*vUpward2 - V.Y*vForward2; // rotate in plane that contains vUpward&vRight T.Yaw=rTurnAngle.Roll; V=vector(T); vForward2=vForward; vRight2=V.X*vRight + V.Y*vUpward; vUpward2=V.X*vUpward - V.Y*vRight; T=OrthoRotation(vForward2,vRight2,vUpward2); return(T); } function string Set(String opcode, String args) { if (Caps(opcode)=="SCAN") { timer(); return "OK"; } return "Failed"; } function String GetHead() { local string outstring; if (bWithTimeStamp) outstring="SEN {Time "$time$"} {Type "$ItemType$"}"; else outstring="SEN {Type "$ItemType$"}"; return outstring; } function String GetData() { local string outstring; if (rangeData == "") return ""; outstring = "{Name "$ItemName$"} " //$"{Time "$time$"} " //$"{Location "$Location$"} " //$"{Rotation "$(base.Rotation + myDirection)$"} " $"{Resolution "$converter.FloatString(Resolution)$"} " $"{FOV "$converter.FloatString(ScanFov)$"} " $"{Range "$rangeData$"}"; rangeData = ""; return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{Resolution "$converter.FloatString(Resolution)$"} {Fov "$converter.FloatString(ScanFov)$"}"; outstring = outstring@"{Paning "$bYaw$"} {Tilting "$bPitch$"}"; return outstring; } i!m!r.c &c 7Nc %c N Gl!wsAw\E Grh!r!PlMl3X9?% XU.-n( Gn!~a$w%w7N[9?{9?wN%N{9D9?wN%N9?H9?w&N&NH9D9?w&N&Nw,{%[9?~9?{A%N@!H%Z9?r9?{A&N@ Gp!gUxTmLn%Cn79z9W6tngnn Gq j!`w t!mwsq F=rrrr3}rrrr`$VI@L$ARZ= AY"$#$"$zD#$zD(] IRScanner\'class IRCamera extends IRSensor config (USARBot); var config int Fov; var config int HorResolution; var config int VerResolution; var config int RowsAtTime; var int uuFov, uuHorResolution, uuVerResolution; var string rangeData[240]; //max width = 240 var USARRemoteBot rBot; var int rowCount; //counter used to send each time a different row var bool bScan; simulated function PostNetBeginPlay() { local int i; Super.PostNetBeginPlay(); rowCount=0; for (i=0; i<240; i++) rangeData[i]=""; if (VerResolution>240) VerResolution = 240; } function ConvertParam(USARConverter converter) { if (converter!=None) { uuFov = converter.AngleToUU(Fov); uuHorResolution = converter.AngleToUU(HorResolution); uuVerResolution = converter.AngleToUU(VerResolution); } else { uuFov = Fov; uuHorResolution = HorResolution; uuVerResolution = VerResolution; } } function string Set(String opcode, String args) { if(Caps(opcode)=="SCAN") { bScan = true; return "OK"; } return "Failed"; } function String GetData() { local string outstring; local int i, j; local int range; if (!bScan) return ""; outstring = "{Name "$ItemName$"} {Time "$Level.TimeSeconds$"} "; curRot = base.Rotation + myDirection; for (i=0; i= uuFov/uuVerResolution) { rowCount = 0; if (rBot == None) rBot = USARRemoteBot(Platform.Controller); rBot.IRCameraScan = false; //reset command } } bScan = false; return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{Fov "$converter.FloatString(Fov)$"}"; outstring = outstring@"{HorResolution "$converter.FloatString(HorResolution)$"} {VerResolution "$converter.FloatString(VerResolution)$"}"; return outstring; } nq!^h%U^9D9?r%N[9?A[9D9?r&NZ9?\ Gs!@ Bn(@ %@ 7z!z6t@ l%l7G 6alG !G !l@  G z@m7m&7m&mllEm Gm@B"w!zf+y<<>> Gq u!vy{!/5?q F=rrr3}ʁ)rr>̪rrrf"L$@K$ #=FRZ= AY"$#$"$@#$@(] IRCamera  $? 52.5|! 0.019047619047}! 57.2957795131~! 0.01745329252! 10430.3783505@" 0.000095873799P class INUSensor extends sensor config (USARBot); //The class implements an Inertial Navigation Unit - it returns Roll, Pitch and Yaw //with a bounded error superimposed on it var USARRemoteBot rBot; var config float ScanInterval; var string compassData; var Rotator iniRot; simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); compassData=""; if (ScanInterval>0.0) SetTimer(ScanInterval,true); } function Init(String SName, Actor parent, vector position, rotator direction, KVehicle platform, name mount) { Super.Init(SName, parent, position, direction, platform, mount); iniRot = base.Rotation; } function timer() { local rotator dif; compassData = ""; // log(base.Rotation); dif = base.Rotation - iniRot; dif.yaw += converter.AngleToUU(2*pi); dif.yaw = dif.yaw % converter.AngleToUU(2*pi); if(dif.yaw > converter.AngleToUU(pi)) { dif.yaw -= converter.AngleToUU(2*pi); } dif.roll += RandRange(-Noise, Noise) * dif.roll; dif.pitch += RandRange(-Noise, Noise) * dif.pitch; dif.yaw += RandRange(-Noise, Noise) * dif.yaw; if (converter!=None) { compassData="{Orientation "$converter.Str_AngleFromUU(dif.roll) $","$converter.Str_AngleFromUU(dif.pitch) $","$converter.Str_AngleFromUU(dif.yaw)$"}"; } else compassData="{Orientation "$dif.roll$","$dif.pitch$","$dif.yaw$"}"; } function string Set(String opcode, String args) { if(Caps(opcode)=="RESET") { iniRot = base.Rotation; compassData="{Orientation 0,0,0}"; return "OK"; } return "Failed"; } function String GetData() { local string outstring; if (ScanInterval==0.0) timer(); if (compassData == "") return ""; outstring = "{Name "$ItemName$"} "$compassData; compassData = ""; return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{ScanInterval "$ScanInterval$"}"; return outstring; } C"~{ D"Veʁ)ʁ)rrrrrrrʁ)v$?A$ #<(]INU $L>2$={ class HumanMotionSensor extends Sensor config (USARBot); var config float MaxRange; var config float FOV; var float MaxSpeed; var float uuMaxRange; var float uuMaxSpeed; function ConvertParam(USARConverter converter) { if (converter!=None) { uuMaxRange = converter.LengthToUU(MaxRange); uuMaxSpeed = converter.SpeedToUU(MaxSpeed); } else { uuMaxRange = MaxRange; uuMaxSpeed = MaxSpeed; } } function String GetData() { local string Outstring; local vector SegLoc,SegVel,HitLocation,HitNormal; local float CosAngle,Distance,Speed,Prob; local array Victims; local int i,j; local actor a; Outstring=""; Victims = USARDeathMatch(Level.Game).Victims; for (i=0;iuuMaxRange) continue; // not in FOV CosAngle = ((SegLoc - Location) dot vector(Rotation)) / Distance; // VSize(vector(Rotation))=1; if (CosAngleuuMaxSpeed) Speed=uuMaxSpeed; Prob=(1.0-Distance/uuMaxRange)*(Speed/uuMaxSpeed)*CosAngle; Outstring="{Prob "$converter.FloatString(Prob)$"}"; break; } if (Speed>0) break; } if (Outstring!="") Outstring = super.GetData()@OutString; return Outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{MaxRange "$converter.FloatString(MaxRange)$"} {Fov "$converter.FloatString(FOV)$"}"; return outstring; } {@o E"f| I"Terr3}>BEPEPrrrL$@@~$ ?\$?RZ= AY"$#$"$zD#$zD(] HumanMotionmclass ExpPath extends Object config(ExpPath); var config array path; var int next; var int offX; var int offY; var float scaleX; var float scaleY; function int getValue(int i) { if (i>path.length) i=i%path.length; return path[i]; } function int nextValue() { next+=1; if (next>=path.length) next=0; return path[next]; } function setOffset(int x0, int y0) { offX=x0; offY=y0; } function setScale(int w, int h) { local int i,mx,my; for (i=0;i0) scaleX=w/((mx+offX-path[0])*2.0); if (my>0) scaleY=h/((mx+offX-path[1])*2.0); } function nextPoint(out int X, out int Y) { X=(nextValue()-path[0])*scaleX+offX; Y=(nextValue()-path[1])*scaleY+offY; } function dump() { local int i; log("<<>>"); } E=class EncoderSensor extends sensor config (USAR); /** This class simulates the encoder sensor. The added config params are: Resolution: The resoulution of the encoder defined in UU. The returned value is: Tick: The data range is (-65535/uuResolution)~(65535/uuResolution). Positive value means clockwise direction. It's the controller's resposible to count how many circles the part has rotated. */ var USARRemoteBot rBot; var config float Resolution; var int uuResolution; var string tickData; var int myTick; var vector axis1,axis2; var int lastAng, curAng; var int lastBaseAng, curBaseAng; var float totalAng, myAng, baseAng; var Actor parBase; function Init(String SName, Actor parent, vector position, rotator direction, KVehicle platform, name mount) { Super.Init(SName, parent, position, direction, platform, mount); axis1 = vector(direction); // the turning axis axis2 = vector(direction+rot(16384,0,0)); if (parent.Owner!=None) parBase = parent.Owner; else if (parent.Base!=None) parBase = parent.Base; else parBase = None; } function ConvertParam(USARConverter converter) { if (converter!=None) uuResolution = converter.AngleToUU(Resolution); else uuResolution = Resolution; } function int getTick() { local vector newAxis1,newAxis2,lastAxis; local Quat relQ, curQ; local float difAng,difCos,difSign; // my angle curQ = base.KGetRBQuaternion(); newAxis1 = QuatRotateVector(curQ,axis1); newAxis2 = QuatRotateVector(curQ,axis2); relQ = QuatFindBetween(newAxis1,axis1); lastAxis = QuatRotateVector(relQ,newAxis2); difCos = lastAxis Dot axis2; difCos = int((difCos*10000+5))/10000.0; if (difCos>1.0) difCos = 1.0; if (difCos<-1.0) difCos = -1.0; difSign = (lastAxis Cross axis2) Dot axis1; if (difSign<0) difSign=-1.0; else difSign=1.0; curAng = difSign * ACos(difCos)*32768/PI; difAng = curAng - lastAng; lastAng = curAng; if (difAng>=32768) difAng = difAng - 65535; else if (difAng<-32768) difAng = difAng + 65535; myAng += difAng; // base's angle if (parBase!=None) { curQ = parBase.KGetRBQuaternion(); newAxis1 = QuatRotateVector(curQ,axis1); newAxis2 = QuatRotateVector(curQ,axis2); relQ = QuatFindBetween(newAxis1,axis1); lastAxis = QuatRotateVector(relQ,newAxis2); difCos = lastAxis Dot axis2; difCos = int((difCos*10000+5))/10000.0; if (difCos>1.0) difCos = 1.0; if (difCos<-1.0) difCos = -1.0; difSign = (lastAxis Cross axis2) Dot axis1; if (difSign<0) difSign=-1.0; else difSign=1.0; curBaseAng = difSign * ACos(difCos)*32768/PI; difAng = curBaseAng - lastBaseAng; lastBaseAng = curBaseAng; if (difAng>=32768) difAng = difAng - 65535; else if (difAng<-32768) difAng = difAng + 65535; baseAng += difAng; } totalAng = normalAngle(myAng - baseAng); if (totalAng!=(myAng - baseAng)) { myAng = normalAngle(myAng); baseAng = normalAngle(baseAng); } //log(ItemName@"dif:"$myAng@baseAng@totalAng@base.Rotation@base.Owner.Rotation); totalAng += RandRange(-Noise, Noise)*totalAng; myTick = int(normalAngle(totalAng)/uuResolution); return myTick; } function float normalAngle(float ang) { if (ang>65536) ang-=65536; if (ang<-65536) ang+=65536; return ang; } function string Set(String opcode, String args) { if(Caps(opcode)=="RESET") { myAng = 0; baseAng = 0; totalAng = 0; myTick = 0; return "OK"; } return "Failed"; } function String GetData() { local string outstring; outstring = "{Name "$ItemName$" Tick "$getTick()$"}"; return outstring; } function String GetConfData() { local string outstring; outstring = Super.GetConfData(); outstring = outstring@"{Resolution "$converter.FloatString(Resolution)$"}"; return outstring; } x!I WpcI %I 7Invaild JointPart index in function rLocJointParent!#kO6aI rk*Can't find the parent in function rLocJointParent!#*k "n#?m#?k#?Ik nmkO I & k 6K O n6K O m6K O kK  GK @L"R VucR %R 7Invaild JointPart index in function rLocJointParent!"[ O6aR r[ *Can't find the parent in function rLocJointParent!"*[  "h#?g#?f#?I[  hgfhR &h "e#?a#?`#?h ea`] eh` egc efgah^agd aff`hY`ge `f6@9Dc ] ] ` ` d d e e 9?,"F/9?6@@9?, 6@%6@9Dgc ^f"F9?6@@9?, 6@%6@9Dgc ^f"F6@9D` ] "F6@9Dd e "F6@6@@ G@AD^+ 0A-E0w*b .#.". "-E'.-d^.#9?_."9?=^9?1D.#_9?1D."D^6 &$6&$6&^-$'D^L_6 ,$6,$6,_-$'L_w*6. % 6. 9:.&Q6. V6. M-WQ6. V6. MQ6 6b66. V6. 6 6b6QQQQQQQQVVVV2VVMMVVV%9:.&6 ,$6,.6,9?V9:6,&Q9?VQRYQ%9:.&6 ,$6,.6,9?Q~9:6,&S9?QSR-$' G@wTz;T[ G bAh s+ ^A!.-x .-ds.#9? r."9? s9?1D.#r9?1D."Xh s6 &$6&$6&r6 ,$6,$6,r-$'h sf r6 %$6%$6%s6 ,$6,$6,s-$'f r6,6&h 6,h $tIP6%6,f 6,[f $tI G@O"g K|gcg %g 7Invaild JointPart index in function rLocJointParent!#n g &n  "Y#?X#?V#?n  YXVm g * n  6i m Y6i m X6i m Vi  Gi A]"k +A.-x{.-dk .#9?j ."9?k 9?1D.#j 9?1D."pk 6 &$6&$6&k -$']tj 6 %$6%$6%j -$'p6&t6% G@W"p Jcp %p 7Invaild JointPart index in function rLocJointParent!"Op *O "[#?Z#?X#?O [ZXz p Girz *z  "W#?U#?S#?z  WUS{ W[~ WZA WXNU[LUZB UXMS[@SZC SX6~9DA { { ~ ~ B B C C 9?,"F9?6~@9?, 6~%6~9DNA LM"F?9?6~@9?, 6~%6~9DNA LM"F6~9D~ { "F6~9DB C "F6~6~~ G~bpfX '-g 77,bf f`fGf,Hf,fFa%%GH%% % %lfJaG%GH&& & &lfNa%HGH,, , ,lfRaGHGH,, , ,lbf G@`tQGv qty G AEN+ 6~A-h0w*H .#.". "-h'.-x.-dN.#9?O."9?TN9?1D.#O9?1D."EN6 ,$6,$6,N6 ,$6,$6,N-$'NFO6 ,$6,$6,O6 ,$6,$6,O-$'6,6,E6,E$tI6,6,F6,F$tI{w*6. % 6. q9:.&G6. E6. 7-uG6. E6. 7G6 6H66. E6. 6 6H6qGGGGGGGGEEEEEE77EEE%9:.&6 ,$6,.6,9?E9:6,&Q9?EQRCG%9:.&6 , $6, .6, 9?Gh9:6, &S9?GsSR-$' GH@o class Effecter extends Item abstract; function String GetConfHead() { local string outstring; outstring="CONF {Type "$ItemType$"}"; return outstring; } function String GetConfData() { return "{Name "$ItemName$"}"; } function string GetGeoHead() { local string outstring; outstring="GEO {Type "$ItemType$"}"; return outstring; } function string GetGeoData() { local string outstring; if (converter==None) outstring="{Name "$ItemName$" Location "$(Location-Base.Location)$" Orientation "$(Rotation-Base.Rotation)$" Mount "$ItemMount$"}"; else outstring="{Name "$ItemName$" Location "$(converter.Str_LengthVectorFromUU(Location-Base.Location)) $" Orientation "$(converter.Str_RotatorFromUU(Rotation-Base.Rotation)) $" Mount "$ItemMount$"}"; return outstring; } Ei"H./EHc-D(,.J%:5oS,S,9:6S&6S-D'SA,-Dblocking...6N%6N&S,,S,6 S$6S$6SS G["{_[|{J|{ C|{ |{r |{ j |{ KCj ] KJ@] r @?@?*@@J] r j ^J9?%JiJ?Y9DJ@9?I@Y G@%class CameraTilt extends KDPart; |Al"T+Cm A-gL  .#.". "-g'.-x.-dT.#9? N~."9? NIT9?1D.#~9?1D."g T6 ,$6,$6,T6 ,$6,$6,T-$'Ch ~6 ,$6,$6,~6 ,$6,$6,~-$'x6,6,g 6,g $tI6,6,h 6,h $tIjT9?T~6N%C?6N&C?6F,6F,E6F,E6F,T9?6N%6N&6F,6F,6F,6F,Ow*6. % 6. 9:.&B6. 6. V-pB6. 6. VB6 6L 66. 6. 6 6L 6BBBBBBBB;VV%9:.&6 , $6, .6, 9?9:6, &Q9?QRbB%9:.&6 , $6, .6, 9?B9:6, &S9?BSR-$'O9?6 6L 6, 9?*6, 6 , $., &., &?., &`I-@(j .J%:5oO,O,9:6O&6O-@'Oj -@blocking...6N%6N&O,j O,6 O$6O$6OO  G@dm"]N2ML,-m 9:9:$ -S(]e-S(-m (' G g yc{69:9:$K %*#?{%*#?s &*#?K s  #<v v K s 9?,~{v K y#?~n yQ9:9:$e36en y6en -m ' G@g"B@o".6 L $class CameraPan extends KDPart; Ev"y.9Ey Gdx"@N,L,-Y 9:9:$ -S(@e-S(-Y (' G Y Zc69:9:$M %*#?]%*#?^ &*#?M ^  #<a a M ^ 9?,_]a M Z#?_Z ZQ9:9:$e36eZ y6eZ -Y ' GA`d!q.j.p.q.H.j$ Gy"emu!. G Ex6Ah f Of th qxppppppppppppppppppppSTA {Time 9Uh } {Location 1 yf } {Orientation 1 n} {Velocity 1 ZO} {LightToggle 9T-m} {LightIntensity 9Re} {Battery 9S] P}. $xxB%@B7669:Bb %B:-f xaB:JxB:&6{x."$B:YxBxqh tf B%B76Bb $B] Gr"D@~"x16 |"_afYKr%r76zr:J_gzKKr:&KKr:&rb $rK GK@AD }+. AS  A{.HQ |.HQ %P Q 6rP !Lo 6. Y n 6. Y V o o n n W @S S 2V W Z ?V W 9?I@=Z GY n o Y Y 9?I@Z 9?,9?@|9:%6-P 6 |$6F|6|$6|.|&Y |9:&6-P 6 |$6F|6|$6|.|&Z -$'Invalid Package Name.HC-Cw*G  .#.". "-C'~.-x.-d}.#9?."9? }9?1D.#9?1D."D }6 &$6&$6&}6 ,$6,$6,}-$'E 6 %$6%$6%6 ,$6,$6,-$'46,6&D 6,?D $tIs6%6,E 6,~E $tI+ w*6. % 6. !9:.&O6. R6. m-jO6. R6. O6 6G 66. R6. 6 6G 6!OO<<OOZOOuuOORRRRRRRRUR%9:.&6 ,$6,.6,9?Rz9:6,&Q9?RQRO%9:.&6 ,$6,.6,9?O 9:6,&S9?O# SR-$' G%class CameraBase extends KDPart; G B Ay U+dA-{|  .#.". "-{'b.-x.-dU.#9?XR."9?XIU9?1D.#R9?1D."z R6 %$6%$6%R6 ,$6,$6,R6 ,$6,$6,R-$'y U6 &$6&$6&U6 ,$6,$6,U6 ,$6,$6,U-$'6,6&6,6,y 6,y $tIW6%6,6%6,z 6,bz $tIw*6. % 6. -|Z6. ^6. qZ6 6| 66. ^6. 6 6| 6ZZZZZZZZ^^88^^V^^qq^^^%9:.&6 ,$6,.6,9?^9:6,&Q9?^QzD}Z%9:.&6 ,$6,.6,9?Z9:6,&S9?ZSzD-$' GD#H@J#-6  $`?| ER#Z.lGmEZ9:9:$,* ow 6o[w L> p#?{w p9?H@l {9?@{9?@{9?{9?{9?| Tl {9?, 9:| ,l {.,&{j9:| ,| $ GAK y+ 3kA-AB  .#.". "-A'.-x.-dy.#9?x."9?Iy9?1D.#x9?1D."K y6 &$6&$6&y6 ,$6,$6,y-$'=J x6 %$6%$6%x6 ,$6,$6,x-$'q6,6&K 6,|K $tI6%6,J 6,J $tIhw*6. % 6. ^9:.&A6. C6. $-tA6. C6. $A6 6B 66. C6. 6 6B 6^AAyyAAAAAACCCC CC$$CCC%9:.&6 ,$6,.6,9?C9:6,&Q9?CQR0A%9:.&6 ,$6,.6,9?AU9:6,&S9?A`SR-$' GC #class BcTire extends USARTire; n Az{ +A-Ni  .#.". "-N'.-x.-d{ .#9?8 z ."9?8 I{ 9?1D.#z 9?1D."z{ 6 &$6&$6&{ -$'Iz 6 %$6%$6%z -$'z6&I6%w*&6. % 6. 9:.&D6. T6. d-jD6. T6. dD6 6i 66. T6. 6 6i 6DDDDDDDDTT++TTITTddTTT%9:.&6 ,$6,.6,9?T9:6,&Q9?TQRpD%9:.&6 ,$6,.6,9?D9:6,&S9?DSR-$' GD (class BcSmallTire extends USARTire; i Ae\+ 2A-Un  .#.". "-U'\.#9?]."9?|e\6 &$6&$6&\6 ,$6,$6,\6 ,$6,$6,\-$'e\4`]6 %$6%$6%]6 ,$6,$6,]6 ,$6,$6,]-$'`]w*_6. % 6. 9:.&S6. P6. #-GS6. P6. S6 6n 66. P6. 6 6n 6SSSSSS++SSIPPddPPPPPP P%9:.&6 ,$6,.6,9?P09:6,&Q9?P;QRS%9:.&6 ,$6,.6,9?S9:6,&S9?SSR-$' GE bZ#NX~ 9D9?N@e a_  N`NNEa%%~ N e  bNIa~ %~ N e  bbN G%class AtrvTire extends USARTire; Dua )ADa 3wa *_ a Iu>_ u GH Z AS p+ 1vA-Y0w*V  .#.". "-Y'.-x.-dp.#9?q."9?Tp9?1D.#q9?1D."S p6 &$6&$6&p6 ,$6,$6,p-$'HT q6 %$6%$6%q6 ,$6,$6,q-$'|6,6&S 6,S $tI6%6,T 6,T $tIsw*6. % 6. i9:.&~6. N6. /-b~6. N6. /~6 6V 66. N6. 6 6V 6i~~~~~~~~NNNNNN//NNN%9:.&6 ,$6,.6,9?N9:6,&Q9?NQR;~%9:.&6 ,$6,.6,9?~`9:6,&S9?~kSR-$' GV I C=class ATRVJr extends KRobot config(USARBot); var float cachedLeftValue,cachedRightValue; var rotator cachedCameraRot,initCameraRot; var bool bGetInitCameraRot; var config bool bAbsoluteCamera; function ProcessCarInput() { local float LeftValue,RightValue; local int CameraPan,CameraTilt; Super.ProcessCarInput(); if (!bGetInitCameraRot) { initCameraRot = myCamera.Rotation; USARRemoteBot(Controller).LeftThrottle = 0.0; USARRemoteBot(Controller).RightThrottle = 0.0; USARRemoteBot(Controller).myCameraRotation = rot(0,0,0); bGetInitCameraRot = true; } if (USARRemoteBot(Controller).bNewThrottle) { if (USARRemoteBot(Controller).Normalized) { LeftValue = USARRemoteBot(Controller).LeftThrottle*650; RightValue = USARRemoteBot(Controller).RightThrottle*650; } else { LeftValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).LeftThrottle); RightValue = Converter.SpinSpeedToUU(USARRemoteBot(Controller).RightThrottle); } if (cachedLeftValue!=LeftValue) { JointsControl[1].state = 1; // new command JointsControl[1].order = 1; JointsControl[1].value = LeftValue; JointsControl[3].state = 1; // new command JointsControl[3].order = 1; JointsControl[3].value = LeftValue; bNewCommand = true; } if (cachedRightValue!=RightValue) { JointsControl[0].state = 1; // new command JointsControl[0].order = 1; JointsControl[0].value = RightValue; JointsControl[2].state = 1; // new command JointsControl[2].order = 1; JointsControl[2].value = RightValue; bNewCommand = true; } if (JointsControl[3].value==JointsControl[1].value) cachedLeftValue=JointsControl[3].value; else cachedLeftValue=1000000; // a big value to force updating if (JointsControl[0].value==JointsControl[2].value) cachedRightValue=JointsControl[2].value; else cachedRightValue=1000000; // a big value to force updating } if (myCamera!=None) { if (USARRemoteBot(Controller).myCameraRotation.roll!=0) return; USARRemoteBot(Controller).myCameraRotation.roll = -1; if (USARRemoteBot(Controller).myCameraRotationOrder==1) { CameraTilt = USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else if (!bAbsoluteCamera) { CameraTilt = -USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw; } else { CameraTilt = myCamera.Rotation.Pitch - initCameraRot.Pitch -Rotation.Pitch - USARRemoteBot(Controller).myCameraRotation.Pitch; CameraPan = USARRemoteBot(Controller).myCameraRotation.Yaw - myCamera.Rotation.Yaw + initCameraRot.Yaw + Rotation.Yaw; if (CameraTilt>65535) CameraTilt-=65535; else if (CameraTilt<-65535) CameraTilt+=65535; if (CameraTilt>32768) CameraTilt-=65535; else if (CameraTilt<-32768) CameraTilt+=65535; if (CameraPan>65535) CameraPan-=65535; else if (CameraPan<-65535) CameraPan+=65535; if (CameraPan>32768) CameraPan-=65535; else if (CameraPan<-32768) CameraPan+=65535; } if (CameraPan!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[5].state = 1; //JointsControl[5].steer = 65535; JointsControl[5].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[5].value = CameraPan; } if (JointsControl[5].order==1) PanSpeed = CameraPan; else PanSpeed = MotorSpeed; if (CameraTilt!=0 || USARRemoteBot(Controller).myCameraRotationOrder==1) { JointsControl[6].state = 1; //JointsControl[6].steer = 65535; JointsControl[6].order = USARRemoteBot(Controller).myCameraRotationOrder; JointsControl[6].value = CameraTilt; } if (JointsControl[6].order==1) TiltSpeed = CameraTilt; else TiltSpeed = MotorSpeed; bNewCommand = true; } //bReady = true; } aO f#_6N 6O RB6N 6O RB6N 6O RBN  G bryX ''-j 77,by y`yM y,yOa%%M y%% % %lySaM %M y&& & &lby GN Ab#h+!9RA-VZ  .#.". "-V'.-dh.#9?i."9?2h9?1D.#i9?1D."rh6 &$6&$6&h6 ,$6,$6,h6 ,$6,$6,h-$'rh\i6 %$6%$6%i6 ,$6,$6,i6 ,$6,$6,i-$'\iOw*6. % 6. E9:.&J6. I6.  -hJ6. I6.  J6 6Z 66. I6. 6 6Z 6EJJ``JJ~JJJJIIIIII  IIyI%9:.&6 ,$6,.6,9?I9:6,&Q9?IQRJ%9:.&6 ,$6,.6,9?J<9:6,&S9?JGSR-$' G$AA@B4:$$-SS!$?$AA@B$$-A$HBSS!$?$=L>4:$?$B-SS!$?$AA@B4:$$-SS!$?$AA@B4:$$-SS!$?$ #< ף<<4:$?$HB-SS!$?$Q8>u>>4:$?$B-SS!$?$BB4:$$-SS!$?$ #< ף<<4:$?$HB-SS!$?$AA@B$$ A-SS!$?y$L?$ #< ף<<4:$?$HB-SS!$?$ #< ף<<$?$HB-SS!$?$ #< ף<<4:$?$HB-SS!$?$ #< ף<<4:$?$HB-SS!$?$ #< ף<<4:$?$HB-SS!$?$AA@B4:$$-SS$ff?ff?ff?$$SS$ff?ff?ff?$$SS$ff?ff?ff?$$A$ ASS$ff?ff?ff?$$SS$ff?ff?ff?$$SS$ff?ff?ff?$$SS$ff?ff?ff?$$SS$ffAffAffAP$@$B$BSS$L?L?L?$$A$HBSSy$?$333?$SS!$?$333?$SS!$?$333?$SS!$?P$ #<$333?$SS!$?P$ #<$333?$SS!$?$333?$SS!$?$333?$SS!$?$333?$SS!$?$333?$SS!$?$333?$SS!$HB$333?$SS!$?$333?$SS!$HB$333?$SS!$?P$?A$ASS!$?y$L>v$PG$=$>-SSv$?!$>y$L>v$PGqqoAofor{ogoNoc{_oIMCovoMo`oHM] q*o oMIk`joo`lNHNAopNEotIjoO{g o[qMNE `kMYo|anoboE vaoJ{wMU ocN{ MT v[ {zND Il oFoaoVoH N{o] MY IR oLMv IQq~ododIlv/M} qj {xNAIL oCv\ v^ {yIQ v} N[M\NX oKMS `N MJ vZ NU MQ vsvN `M N[a| {f IS o{NK MoIOi orvvaWOa qsIcIiHh IhMI N\IgNJ oLNTvI v<a]v6qPNc ouNb veI\ Nd ahMJ NA I[ N aWvK I] vpI^ Ne v}vF vN{=vLIG Ni vt Nl NzIH ok aRMcqgoqqgtqYq}NF v.OK NB ocz qdZNHaC qwvSvXoZe oF NA vSv/vDvoOV v<v.NvX aNqSMJ O\ vAvqqvn JrAZAr q=p ol MfI,Uqs qEm q~Od NT ok NY NLNcNY NZ vz q*cMIN@aUow{Evb qboOvO Nf N_ N` qtq}NENAv@NHv_ vJ o`vp O] FvMOL  ;Av< `  Iw UGI b] oGt |Ge IGk Vx cGl tv Av RbW _PlGV z`  GGW SFV `FW nFX  |S I2V2dGX rT GCL"L [t1i `  Z&n fH t@]@g]=p ley=s IE VA c=T pc}S MW Z=V g7`  s9`  'F Ka W` dT q'| ~'{ KZX,q f'z t]Ao  Oa \aJi%.#sx  V=e  b}  o=g |[ I=| V=O ca p[ }N1J[ { e H [ U#U  ba nA {a HGX TA a2oAQ}2 K2 Y2 f2s2BAZP,^E ua Abx  N^NZ]uhG ][ jEwL#%iFOoJ }M #&~Jn H}  UJ bAf oj  {{ H| Ux bN oU  {fHsV[ d#6GqVU  xR DU| Rea  _eHleu |Go K#v XDpnezq  SV`x o[ |Y2IwE {~q  GETwA bZR of}Gm KGe XR  eZ[ rX GN Lsk  Y~fW vV Cl Pk ]Cje CN  Px  ]t jqB wN Dm Pa ]IvjM  `|qmU  {pq  G[ TGaGJyqT Cc.PE~N  La YV fM  tnO A\ Mx ZI gV tn Bd.OW }H Kq  X{f el  rg0bL oU }a JEWC e/L rB @O  MF ZEghmu^ C>p Qn ^Vk^  yhlFX Tj/aEPe ^^ kW yX Gx  UGubN  zEGM  Up bU  ol0{h\ kx yx  FN  RM  _nN la ywx Fnf S__x  mnaynZGnQUqb cn on }Wg  JA Wl  cz pz }zQKq  Yzefm tDp Ad| N1/[n JeW8.f| TG ae nd {j  HH  UV^ aVa oU  }E Jv VKd  dCcqP TeaRdpKc  TuH  auP mt zIdGFGkH  yV omFx  sOy@ux  PP ]I_jOSICEWbke0F P x ]K jr wKQDKZRs`Kf ou{|Ex UFx bFd ot|uE LM XG e8| rF x  LuG YuM f;x  sG  L YQgZuaCf QE]Jdl d PZ  ]E iutuJBE{G7Q`B ns{IAJr K$EXHTfG.XzG+kR0f } i_I bx  h 0at 2l  B GP7O 6mF 6lT 4x  b 6\ o 4a } 0V I jW X  o 0Q| 0 J G:bW 8~y sj  G k  T ~ a {n U)I| m E Ll R 8m ~ m K Pm X m d m q m ~ @m K E %PX ]h q]w Fm T Bm a v3bm v3wO Ed F Em S l&N_ Im m z :Sz P%YM Lm f <Ns Pm A E %ON Sm ] Sd j v3mw U)ad nE l&ES Vm X Ym e ZHTr [m F ZIAS m T ^m ` ZJAm m n m z dmF c T R  b ppo }S_ P%pr fm b m o {{ PT I S W d e /@r G:Fr x x )ME y(R n z /m F <Us 6kH {* s v3h@ Xi h wd Q wm ^ l&ej {m O ` \ P%Tj ~m ~ c K q5Y 6B[#N [  i T1v @Gg .Bn m p N[| m W K  d Dyq m j N>v Mm t D*A n k m w 6GJD D5ZN m h n u bbB 6M>d m b /N>n /\0l m \ m i bN>u /!s G4BT U  V cBmc .JP G4|7Z CBV CzX G4-R m  {/]L Ddi y{)}M G4^J v{3Gh @~o d m m z Q{&}F m C ErP DjB G42l <w^ L{%hU m } FeJ I]o }G45L m A /ZN Cjh mR G40a IHZQ pKk t{ v t/@C yt)jC vG4]m t6GJ mQ SK_ m j tssw +Cj F m mz G45H Je} G42b KeT G44y Lem G45R MeG vt3Dl ^lp d \ m i ^ tYyu m n m { Qt&fG m m v/6z Lt%ip m Y G4\f n B NbN G4a%p [  Q J#^ cuA ZOFv G4[@| Hp W #{ G #/3T PFG G4OM T]\ G4IJy  M,B@ n#sszn m.t-zmnG4D|G4X@SfXG4ue~cG4SsG4FG4jEW{ov#3Dj6z nd hm u^ #YyAm za|Gm C>m PSP]whm;m U G4HbYcj%G4JMG4UWG4[Vlr GG4WT7G45k A>` uf^L)^D CbL6`e6G4_pENhdA=LBI~&LKm WMKd{%`o m OgQ \pVm|kCyr)PnMV~Dr5BT'm V+G4Kc;nu_x|Ym  t-n  @o Ms [2U  iuG4yuV{."nG40PU  @<G4vL%n BM r&[N7m i6wvLr%Xm:m EbTRzIf?G4,ock[G49FG:QXVPD]  f.Us<0HMtxE  l^ Y1yHm jv wZIiFKm oO[  |N1HIv>QNm OG49\xRU*HgXG48uQ8}m.ajUm KIfZXl&srYm e\G49rIgZk`G41E]Hjv^m `hklbG4d=Wi\{UJkWcm BmpOP%Gfm FiG4^SbMeqkG4LVpobpG4NQE  _Dk<%~nwcrG4T:ZJoIn{wUG4?E/ODG4CSzm VG4Fc{G4hiw4Q%slEG4_wq~m Ph+]F  HtZU>wo&G  f/@sU)=s?_pyN O G4s]P  PC]uf`G4sFvXyG4JRQA>[uwhYuSrAuism \ua|iu6z e^u.t-_M  S6] `w{}G4ZPx_u+CRn UeuPFbtH hxlpG4g\m CuCjPv3~zn xd Em Rl&U^m sm @P%EMm RG4L>_zhkuDjSG4E }Ca BU)]Nm khUxubbMm oZ{L|KLHG4nTm B l&tN m B G4[+O c|nj SuDsX uXH K zS #G4f5b FH H!Y V![u<KU!m`!G41n!}g_!G40F!~gv!G41]!@gN!G4.u!6~c!Adq!G4/U!BdD!G4,h!DeT!P%Py!m I!G4/V!EeE!G4.j!FeX!hG4+}!bu/~ h!:j  f!u>ws!bk  j!G4Zw!U)gQ!cJ{x!KLs!bG44!m s!l&l !m k!G4C@x!L[{"gG4/V"u?_E"G44d"%H X"Y f"BP e"ms"bQ A"G4KCO"Tj Z"G4/D"u)Ms"bG4^=@"u}S^#7T q#G4bb#Xga$G4UH$]q]$G4TN$P%Db%m f%^Gs%mEz%G40%m o%i  |%>k  I%}cV%zj  y%G46F%G40|%;~l%G42z%U )Gl%?_s%l &&R% m x%v 3]D%>wa%u]X% m g%G43t% e*g%SKQ% l'\%m C%P %eO%m t%dgA%lp&rh%m Z%ur g%G42t%egf%mM% G43[%ggN%#G47u%c l%ikz%Pp%/e%$m T%pKa%<| l%<} v%<~A%&mI%4G4VCX%QF n&$m t&U<)}@&2m }&<iRJ&0m \&Gji&%n S&lS`&6gs&G@}A&@c ~&^Ya&;G4S8z&8mM'm[['GG4Gv'l<&O}*=m L*G@[ Y*P<%Wt*@m K*Cm X*GNMd*G4@q*Omq0O/@^0Em^0G4-l0/jY0\|C1[;1Kmz1?MI1OG4` V1pKv1>wA1G4Kx1G4Z~C1/)]2<)F2GQ o2ZLn2|Xz2?_R2G4Uq2Wm F2>wS2/G4[J2bG4He2/)m2<)V2kf2kM M2u^Z2NR x2G4tD2G4g!x2<p_3DJ O3@}Y3VJV3tG4M5`3im m3rBy3lm {3s1G3hgx3PEF3aDK3pn O3UX\3q wrt3{G4g'f3sm M4haZ4Bu{4xmp4f{4q yaz4S [4Te4Uz4VN4Wb4Xv4ym K4G4[ W4{Zr4G4F!L4m R4g  _4GP  k4|{x4G4xs4G4P=k5WK{5mF5m T5Vl `5mL5A+[Z5m u5z1A5Ur5A+d@5m d5Kwp5mg5A+Vu5m K5Jd W5m{5bXgI5 m p6Q1|6Ab+qm6bU^6m l6ZG4z x6E.{r6_Im6m v6G4/B6m q6A+S~6m Q6m ]6dN^i6cJG6Zm Q6Ba]6U~6m L6G4.X6E.*F6pm p6m |6dN^H6m f6cJr6`h|6m d6e+p66J[6m e6Daq6aXR6>m j6m v6A+IC6m L7G4/X7UG7m U7Ua7A+Wo7m F7HgR7Uy7Dm G7E.~S7A+aQ7mr7G4-@7;Um7A+e{7m`7G42n7U`7A;+Fn7mt7biXTB7G4/V7Di)OE7mT74Ub7Ab+ip7bUY7!mg7G4N=u7f_C8b4Xkb8mM8A4+L[8xBg8x:i8x;c8;xB^84xB`8bxBb8xBd8xBf8xBh8x:j8xBd8bx3f8xBY8xB[8xB]8ux<_8x*[8x*E8x1o8x*`8vx*J8}x*t8x*^8x1H8l8y8#lq8lM8hli8l#E8l#h8lK8`lg8?lC8l_8l{8lW8ls8lO8m,k8m4W8