コード例 #1
0
class LEDColour(object):
    off = robot.rgb(False, False, False)
    red = robot.rgb(True, False, False)
    green = robot.rgb(False, True, False)
    blue = robot.rgb(False, False, True)
    yellow = robot.rgb(True, True, False)
    cyan = robot.rgb(False, True, True)
    magenta = robot.rgb(True, False, True)
    white = robot.rgb(True, True, True)
コード例 #2
0
import math
import Log
import robot

blankRGB = robot.rgb()

def amIFallen(blackboard):
   myPlayerNumber = blackboard.gameController.player_number
   return blackboard.receiver.incapacitated[myPlayerNumber - 1]

def head(yaw=0, pitch=0, isYawRelative=False, yawSpeed=1.0, pitchSpeed=1.0):
   return robot.HeadCommand(yaw, pitch, isYawRelative, yawSpeed, pitchSpeed)

def stand(power=0.1):
   return walk(0, 0, 0, power, bend=0)

def crouch(power=0.4):
   return walk(0, 0, 0, power, bend=1)

robotName = ""
try:
   # Quick hack to access the robot's hostname, so we can make exception cases for helo.
   hostname_file = open("/etc/hostname")
   robotName = hostname_file.read()
   robotName = robotName.lstrip(" ").rstrip(" ").replace("\n", "").lower()
   hostname_file.close()
except:
   robotName = "secretAgent"

Log.info("robotName is:\n%s", robotName)
コード例 #3
0
import math

import robot

blankRGB = robot.rgb()


def head(yaw=0, pitch=0, isYawRelative=False, yawSpeed=1.0, pitchSpeed=1.0):
    return robot.HeadCommand(yaw, pitch, isYawRelative, yawSpeed, pitchSpeed)


def stand(power=0.1):
    return walk(0, 0, 0, power, bend=0)


def crouch(power=0.4):
    return walk(0, 0, 0, power, bend=1)


# deprecated not supported
def jabKick(forward=1, left=0, turn=0, power=0.5, foot=robot.Foot.LEFT):
    return walk(forward, left, turn, power, 0, 0, foot,
                True)  # speed=0 and isFast=True signals jabKick to Walk2014


# deprecated not supported
def walkKick(forward=1, left=0, turn=0, power=0.5, foot=robot.Foot.LEFT):
    return walk(forward, left, turn, power, 0, 1, foot,
                True)  # speed=1 and isFast=True signals walkKick to Walk2014