def __init__ (self): sp.Module.__init__ (self) self.blinkingTimer = sp.Timer () self.blinkingLight = sp.Marker () self.pulse = sp.Oneshot () self.counter = sp.Register () self.run = sp.Runner ()
def __init__(self): sp.Module.__init__(self) self.page('rocket control') self.group('gimbal angle controls blue/yellow', True) self.toYellow = sp.Marker() self.toBlue = sp.Marker() self.group('gimbal angle state blue/yellow') self.blueYellowDelta = sp.Register() self.blueYellowAngle = sp.Register() self.group('thruster angle controls green/red', True) self.toRed = sp.Marker() self.toGreen = sp.Marker() self.group('thruster angle state green/red') self.greenRedDelta = sp.Register() self.greenRedAngle = sp.Register() self.group('fuel throttle controls', True) self.throttleOpen = sp.Marker() self.throttleClose = sp.Marker() self.group('fuel throttle state') self.throttleDelta = sp.Register() self.throttlePercent = sp.Register()
def __init__(self): sp.Module.__init__(self) self.page('lidar control') self.group('inputs', True) self.driveEnabled = sp.Marker() self.nearestObstacleDistance = sp.Register(sp.finity) self.nearestObstacleAngle = sp.Register(0) self.nextObstacleDistance = sp.Register(sp.finity) self.nextObstacleAngle = sp.Register(0) self.targetObstacleDistance = sp.Register(sp.finity) self.targetObstacleAngle = sp.Register(0) self.velocity = sp.Register(0) self.group('outputs') self.targetVelocity = sp.Register() self.steeringAngle = sp.Register(30)
def __init__(self): sp.Module.__init__(self) self.page('motion control') self.group('driver input', True) self.targetVelocityStep = sp.Register(0) self.steeringAngleStep = sp.Register(2) self.group('control output') self.targetVelocity = sp.Register() self.steeringAngle = sp.Register() self.group('sweep time measurement', True) self.sweepMin = sp.Register(1000) self.sweepMax = sp.Register() self.sweepWatch = sp.Timer() self.run = sp.Runner()
def __init__(self): simpylc.Module.__init__(self) self.page('BassieStove!') # ############# Constants ############# self.group('Page constants', True) self.PAGE_LOCK = simpylc.Register() self.PAGE_ALARM = simpylc.Register() self.PAGE_MAIN = simpylc.Register() self.PAGE_SELECT_STOVE = simpylc.Register() self.PAGE_CHANGE_STOVE = simpylc.Register() self.PAGE_VIEW_TIMER = simpylc.Register() self.PAGE_CHANGE_TIMER = simpylc.Register() self.group('Lock constants') self.LOCK_COUNT = simpylc.Register() self.group('Stove constants') self.STOVE_COUNT = simpylc.Register() self.STOVE_TEMP_MAX = simpylc.Register() self.STOVE_TEMP_INC = simpylc.Register() self.group('Timer constants') self.TIMER_MAX = simpylc.Register() self.TIMER_INC = simpylc.Register() # ############# State ############# self.group('Global state', True) self.randSeed = simpylc.Register() self.cycleCounter = simpylc.Register() self.group('Beeper state') self.beeperEnabled = simpylc.Marker() self.beeperFrequency = simpylc.Register() self.group('Page state') self.page = simpylc.Register() self.lockCounter = simpylc.Register() self.selectedLock = simpylc.Register() self.selectedStove = simpylc.Register(1) self.updateScreen = simpylc.Marker() self.updateScreenTimer = simpylc.Timer() self.group('Timer state') self.timerTime = simpylc.Register() self.timerTimer = simpylc.Timer() self.timerStarted = simpylc.Marker() self.timerFinished = simpylc.Marker() # ############# Locals ############# self.group('Lock page locals', True) self.lock1ButtonTrigger = simpylc.Marker() self.lock2ButtonTrigger = simpylc.Marker() self.lock3ButtonTrigger = simpylc.Marker() self.group('Alarm page locals') self.alarmTimer = simpylc.Timer() self.newBeeperFrequency = simpylc.Register() self.group('Main page locals') self.changeButtonTrigger = simpylc.Marker() self.timerButtonTrigger = simpylc.Marker() self.lockButtonTrigger = simpylc.Marker() self.group('Select stove page locals') self.selectButtonTrigger = simpylc.Marker() self.newSelectedStove = simpylc.Register() self.leftButtonTrigger = simpylc.Marker() self.rightButtonTrigger = simpylc.Marker() self.group('Change stove page locals', True) self.backButtonTrigger = simpylc.Marker() self.newStove1Temperature = simpylc.Register() self.newStove2Temperature = simpylc.Register() self.newStove3Temperature = simpylc.Register() self.newStove4Temperature = simpylc.Register() self.downButtonTrigger = simpylc.Marker() self.upButtonTrigger = simpylc.Marker() self.group('View timer page locals') self.back2ButtonTrigger = simpylc.Marker() self.createStopButtonTrigger = simpylc.Marker() self.group('Change timer page locals') self.startButtonTrigger = simpylc.Marker() self.newTimerTime = simpylc.Register() self.down2ButtonTrigger = simpylc.Marker() self.up2ButtonTrigger = simpylc.Marker() # ############# Stoves ############# self.group('Stoves', True) # Stove 1 self.stove1Value = simpylc.Register() self.stove1Target = simpylc.Register() # Stove 2 self.stove2Value = simpylc.Register() self.stove2Target = simpylc.Register() # Stove 3 self.stove3Value = simpylc.Register() self.stove3Target = simpylc.Register() # Stove 4 self.stove4Value = simpylc.Register() self.stove4Target = simpylc.Register() # ############# Buttons ############# self.group('Buttons') # Left button self.leftButton = simpylc.Marker() self.leftButtonOneshot = simpylc.Oneshot() self.leftButtonHandled = simpylc.Marker() # Middle button self.middleButton = simpylc.Marker() self.middleButtonOneshot = simpylc.Oneshot() self.middleButtonHandled = simpylc.Marker() # Right button self.rightButton = simpylc.Marker() self.rightButtonOneshot = simpylc.Oneshot() self.rightButtonHandled = simpylc.Marker()
def __init__(self): sp.Module.__init__(self) self.page('sailboat') self.group('transform', True) self.position_x = sp.Register() self.position_y = sp.Register() self.position_z = sp.Register() self.sailboat_rotation = sp.Register() self.group('body') self.mass = sp.Register(20) self.group('velocity') self.drag = sp.Register() self.drag_deacceleration = sp.Register() self.acceleration = sp.Register() self.forward_velocity = sp.Register() self.horizontal_velocity = sp.Register() self.vertical_velocity = sp.Register() self.head_wind_force = sp.Register() self.group('sail') self.target_sail_angle = sp.Register() self.local_sail_angle = sp.Register() self.global_sail_angle = sp.Register() self.sail_alpha = sp.Register() self.perpendicular_sail_force = sp.Register() self.forward_sail_force = sp.Register() self.apparent_wind = sp.Register() self.apparent_wind_angle = sp.Register() self.boot_wind = sp.Register() self.alfa = sp.Register() self.boot_direction = sp.Register() self.head_wind_direction = sp.Register() self.true_apparent_wind = sp.Register() self.group('rudder') self.target_gimbal_rudder_angle = sp.Register(0) self.gimbal_rudder_angle = sp.Register(0) self.rotation_speed = sp.Register() self.group('pause') self.pause = sp.Marker()
def __init__ (self): sp.Module.__init__ (self) self.page ('car physics') self.group ('wheels', True) self.acceleration = sp.Register (2) self.targetVelocity= sp.Register () self.velocity = sp.Register () self.midWheelAngularVelocity = sp.Register () self.midWheelAngle = sp.Register (30) self.steeringAngle = sp.Register () self.midSteeringAngle = sp.Register () self.inverseMidCurveRadius = sp.Register (20) self.midAngularVelocity = sp.Register () self.attitudeAngle = sp.Register (50) self.courseAngle = sp.Register () self.tangentialVelocity = sp.Register () self.velocityX = sp.Register () self.velocityY = sp.Register () self.positionX = sp.Register () self.positionY = sp.Register () self.radialAcceleration = sp.Register () self.slipping = sp.Marker () self.radialVelocity = sp.Register ()
def __init__(self): sp.Module.__init__(self) self.page('rocket physics') self.group('gimbal angle blue/yellow', True) self.blueYellowDelta = sp.Register() self.blueYellowRoughAngle = sp.Register() self.blueYellowAngle = sp.Register() self.group('thruster angle green/red') self.greenRedDelta = sp.Register() self.greenRedRoughAngle = sp.Register() self.greenRedAngle = sp.Register() self.group('fuel throttle') self.throttleDelta = sp.Register() self.throttlePercent = sp.Register() self.thrust = sp.Register() self.group('ship') self.shipMass = sp.Register(5000) self.effectiveRadius = sp.Register(0.15) self.effectiveHeight = sp.Register(1.5) self.thrusterTiltSpeed = sp.Register(30) self.thrusterMaxAngle = sp.Register(90) self.throttleSpeed = sp.Register(20) self.thrusterMaxForce = sp.Register(100000) self.group('sweep time measurement') self.sweepMin = sp.Register(1000) self.sweepMax = sp.Register() self.sweepWatch = sp.Timer() self.run = sp.Runner() self.group('linear accelleration', True) self.linAccelX = sp.Register() self.linAccelY = sp.Register() self.linAccelZ = sp.Register() self.group('linear velocity') self.linVelocX = sp.Register() self.linVelocY = sp.Register() self.linVelocZ = sp.Register() self.group('position') self.positionX = sp.Register() self.positionY = sp.Register() self.positionZ = sp.Register(cm.earthDiam / 2) self.group('thrust in ship frame') self.forwardThrust = sp.Register() self.blueYellowThrust = sp.Register() self.greenRedThrust = sp.Register() self.group('thrust in world frame') self.thrustX = sp.Register() self.thrustY = sp.Register() self.thrustZ = sp.Register() self.group('angular acceleration', True) self.angAccelX = sp.Register() self.angAccelY = sp.Register() self.angAccelZ = sp.Register() self.group('angular velocity') self.angVelocX = sp.Register() self.angVelocY = sp.Register() self.angVelocZ = sp.Register() self.group('torques in ship frame') self.blueYellowTorque = sp.Register() self.greenRedTorque = sp.Register() self.group('torques in world frame') self.torqueX = sp.Register() self.torqueY = sp.Register() self.torqueZ = sp.Register() if cm.useQuaternions: self._shipRotQuat = sp.quatFromAxAng(np.array((1, 0, 0)), 0) self.group('ship rotation quaternion') self.shipRotQuat0 = sp.Register() self.shipRotQuat1 = sp.Register() self.shipRotQuat2 = sp.Register() self.shipRotQuat3 = sp.Register() self._shipRotMat = sp.rotMatFromQuat(self._shipRotQuat) else: self._shipRotMat = np.array( [ # Columns are tangent (front), normal (up) and binormal (starboard) of ship [1, 0, 0], [0, 1, 0], [0, 0, 1] ]) self.group('attitude') self.attitudeX = sp.Register() self.attitudeY = sp.Register() self.attitudeZ = sp.Register() self.group('earth gravity', True) self.distEarthSurf = sp.Register() self.earthGravX = sp.Register() self.earthGravY = sp.Register() self.earthGravZ = sp.Register() self.group('moon gravity') self.distMoonSurf = sp.Register() self.moonGravX = sp.Register() self.moonGravY = sp.Register() self.moonGravZ = sp.Register() self.group('total force') self.totalForceX = sp.Register() self.totalForceY = sp.Register() self.totalForceZ = sp.Register()
def __init__ (self): sp.Module.__init__ (self) self.page ('Trafic lights') self.group ('Timers', True) self.regularPhaseTimer = sp.Timer () self.cyclePhaseTimer = sp.Timer () self.tBlink = sp.Register (0.3) self.blinkTimer = sp.Timer () self.blinkPulse = sp.Oneshot () self.blink = sp.Marker () self.group ('Mode switching') self.modeButton = sp.Marker () self.modePulse = sp.Oneshot () self.modeStep = sp.Register () self.regularMode = sp.Marker (True) self.cycleMode = sp.Marker () self.nightMode = sp.Marker () self.offMode = sp.Marker () self.group ('Regular mode phases', True) self.northSouthGreen = sp.Marker (True) self.northSouthBlink = sp.Marker () self.eastWestGreen = sp.Marker () self.eastWestBlink = sp.Marker () self.group ('Cycle mode phases') self.northGreen = sp.Marker () self.northBlink = sp.Marker () self.eastGreen = sp.Marker () self.eastBlink = sp.Marker () self.southGreen = sp.Marker () self.southBlink = sp.Marker () self.westGreen = sp.Marker () self.westBlink = sp.Marker () self.group ('Lamps') self.northGreenLamp = sp.Marker () self.northYellowLamp = sp.Marker () self.northRedLamp = sp.Marker () self.eastGreenLamp = sp.Marker () self.eastYellowLamp = sp.Marker () self.eastRedLamp = sp.Marker () self.southGreenLamp = sp.Marker () self.southYellowLamp = sp.Marker () self.southRedLamp = sp.Marker () self.westGreenLamp = sp.Marker () self.westYellowLamp = sp.Marker () self.westRedLamp = sp.Marker () self.group ('Regular phase end times', True) self.tNorthSouthGreen = sp.Register (5) self.tNorthSouthBlink = sp.Register (7) self.tEastWestGreen = sp.Register (12) self.tEastWestBlink = sp.Register (14) self.group ('Cycle phase end times') self.tNorthGreen = sp.Register (5) self.tNorthBlink = sp.Register (7) self.tEastGreen = sp.Register (12) self.tEastBlink = sp.Register (14) self.tSouthGreen = sp.Register (19) self.tSouthBlink = sp.Register (21) self.tWestGreen = sp.Register (26) self.tWestBlink = sp.Register (28) self.group ('Street illumination') self.brightButton = sp.Marker () self.brightPulse = sp.Oneshot () self.brightDirection = sp.Marker (True) self.brightMin = sp.Register (2047) self.brightMax = sp.Register (4095) self.brightFluxus = sp.Register (200) self.brightDelta = sp.Register () self.streetLamp = sp.Register (2047) self.group ('System') self.runner = sp.Runner ()
def __init__(self): sp.Module.__init__(self) self.page('robot physics') self.group('torso electronics', True) self.torVolt = sp.Register() self.torEnab = sp.Marker() self.torGain = sp.Register(2) self.torMax = sp.Register(20) self.group('torso mechanics') self.torInert = sp.Register(8) self.torTorq = sp.Register() self.torBrake = sp.Marker() self.torAccel = sp.Register() self.torSpeed = sp.Register() self.torAng = sp.Register() self.group('upper arm electronics', True) self.uppVolt = sp.Register() self.uppEnab = sp.Marker() self.uppGain = sp.Register(2) self.uppMax = sp.Register(20) self.group('upper arm mechanics') self.uppInert = sp.Register(4) self.uppTorq = sp.Register() self.uppBrake = sp.Marker() self.uppAccel = sp.Register() self.uppSpeed = sp.Register() self.uppAng = sp.Register() self.group('fore arm electronics', True) self.forVolt = sp.Register() self.forEnab = sp.Marker() self.forGain = sp.Register(2) self.forMax = sp.Register(20) self.group('fore arm mechanics') self.forInert = sp.Register(2) self.forTorq = sp.Register() self.forBrake = sp.Marker() self.forAccel = sp.Register() self.forSpeed = sp.Register() self.forAng = sp.Register() self.forShift = sp.Register() self.group('wrist electronics', True) self.wriVolt = sp.Register() self.wriEnab = sp.Marker() self.wriGain = sp.Register(2) self.wriMax = sp.Register(20) self.group('wrist mechanics') self.wriInert = sp.Register(1) self.wriTorq = sp.Register() self.wriBrake = sp.Marker() self.wriAccel = sp.Register() self.wriSpeed = sp.Register() self.wriAng = sp.Register() self.group('hand and finger servos', True) self.hanAngSet = sp.Register() self.hanAng = sp.Register() self.hanEnab = sp.Marker() self.finAngSet = sp.Register() self.finAng = sp.Register() self.finEnab = sp.Marker()
def __init__(self): sp.Module.__init__(self) self.page('movement control') self.group('torso drive control', True) self.torVoltFac = sp.Register(0.8) self.torVoltMax = sp.Register(10) self.torVolt = sp.Register() self.torEnab = sp.Marker() self.group('torso angle') self.torAngSet = sp.Register() self.torAng = sp.Register() self.torAngOld = sp.Register() self.torAngDif = sp.Register() self.torMarg = sp.Register(15) self.torRound = sp.Marker() self.torSpeedFac = sp.Register(0.5) self.torSpeedMax = sp.Register(20) self.torSpeedSet = sp.Register() self.torSpeed = sp.Register() self.torSpeedDif = sp.Register() self.group('general') self.go = sp.Marker() self.group('upper arm drive control', True) self.uppVoltFac = sp.Register(0.25) self.uppVoltMax = sp.Register(10) self.uppVolt = sp.Register() self.uppEnab = sp.Marker() self.group('upper arm angle') self.uppAngSet = sp.Register() self.uppAng = sp.Register() self.uppAngOld = sp.Register() self.uppAngDif = sp.Register() self.uppMarg = sp.Register(15) self.uppRound = sp.Marker() self.uppSpeedFac = sp.Register(0.5) self.uppSpeedMax = sp.Register(20) self.uppSpeedSet = sp.Register() self.uppSpeed = sp.Register() self.uppSpeedDif = sp.Register() self.group('fore arm drive control', True) self.forVoltFac = sp.Register(0.25) self.forVoltMax = sp.Register(10) self.forVolt = sp.Register() self.forEnab = sp.Marker() self.group('fore arm angle') self.forAngSet = sp.Register() self.forAng = sp.Register() self.forAngOld = sp.Register() self.forAngDif = sp.Register() self.forMarg = sp.Register(15) self.forRound = sp.Marker() self.forSpeedFac = sp.Register(0.5) self.forSpeedMax = sp.Register(20) self.forSpeedSet = sp.Register() self.forSpeed = sp.Register() self.forSpeedDif = sp.Register() self.group('wrist drive control', True) self.wriVoltFac = sp.Register(0.25) self.wriVoltMax = sp.Register(10) self.wriVolt = sp.Register() self.wriEnab = sp.Marker() self.group('wrist angle') self.wriAngSet = sp.Register() self.wriAng = sp.Register() self.wriAngOld = sp.Register() self.wriAngDif = sp.Register() self.wriMarg = sp.Register(3) self.wriRound = sp.Marker() self.wriSpeedFac = sp.Register(0.5) self.wriSpeedMax = sp.Register(20) self.wriSpeedSet = sp.Register() self.wriSpeed = sp.Register() self.wriSpeedDif = sp.Register() self.group('hand and fingers setpoints', True) self.hanAngSet = sp.Register() self.hanEnab = sp.Marker() self.finAngSet = sp.Register() self.finEnab = sp.Marker() self.finDelay = sp.Register(1) self.finTimer = sp.Timer() self.finLatch = sp.Latch() self.group('sweep time measurement') self.sweepMin = sp.Register(1000) self.sweepMax = sp.Register() self.sweepWatch = sp.Timer() self.run = sp.Runner()
def __init__(self): sp.Module.__init__(self) self.page('Four plate stove control with cooking alarm') self.group('General buttons', True) self.powerButton = sp.Marker() self.powerEdge = sp.Oneshot() self.power = sp.Marker() self.group() self.childLockButton = sp.Marker() self.childLockChangeTimer = sp.Timer() self.childLockEdge = sp.Oneshot() self.childLock = sp.Marker() self.unlocked = sp.Marker() self.group('Plate selection') self.plateSelectButton = sp.Marker() self.plateSelectEdge = sp.Oneshot() self.plateSelectDelta = sp.Register() self.plateSelectNr = sp.Register() self.tempDelta = sp.Register() self.tempChange = sp.Marker() self.group('Up/down buttons') self.upButton = sp.Marker() self.upEdge = sp.Oneshot() self.group() self.downButton = sp.Marker() self.downEdge = sp.Oneshot() self.group('Cooking plates', True) self.plate0Temp = sp.Register() self.plate0Selected = sp.Marker() self.group() self.plate1Temp = sp.Register() self.plate1Selected = sp.Marker() self.group() self.plate2Temp = sp.Register() self.plate2Selected = sp.Marker() self.group() self.plate3Temp = sp.Register() self.plate3Selected = sp.Marker() self.group('Alarm selection button') self.alarmSelectButton = sp.Marker() self.alarmSelectEdge = sp.Oneshot() self.alarmSelected = sp.Marker() self.alarmTime = sp.Register() self.alarmTimer = sp.Timer() self.alarmOn = sp.Latch() self.alarmEdge = sp.Oneshot() self.alarmTimeLeft = sp.Register() self.alarmChangeTimer = sp.Timer() self.alarmChangeStep = sp.Register() self.alarmDelta = sp.Register() self.group('Numerical displays', True) self.digitIndex = sp.Register() self.plateDigitValue = sp.Register() self.alarmDigitValue = sp.Register() self.digitValue = sp.Register() self.digitDot = sp.Marker() self.group('Buzzer') self.buzzerOnTime = sp.Register(6) self.buzzerOnTimer = sp.Timer() self.buzzerOn = sp.Latch() self.buzzerBaseFreq = sp.Register(300.) self.buzzerPitchTimer = sp.Timer() self.buzzerFreq = sp.Register() self.buzzerWaveTimer = sp.Timer() self.buzzerEdge = sp.Oneshot() self.buzzer = sp.Marker() self.group('System') self.sweepMin = sp.Register(1000) self.sweepMax = sp.Register() self.sweepWatch = sp.Timer() self.run = sp.Runner()