Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
Plot.arrow bug fix
Add more data to Robot.state
  • Loading branch information
D. MacCarthy committed Feb 15, 2017
1 parent 1511b90 commit 3c2fc04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sc8pr/plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015-2016 D.G. MacCarthy <http://dmaccarthy.github.io>
# Copyright 2015-2017 D.G. MacCarthy <http://dmaccarthy.github.io>
#
# This file is part of "sc8pr".
#
Expand Down Expand Up @@ -147,7 +147,7 @@ def grid(self, delta=(1,1), axisStyle=(BLACK,3), gridStyle=(GREY,1), zero=(True,

def arrow(self, tail, tip, tailWidth=None, headLength=None, flatness=1, fill=None, stroke=None, strokeWeight=1):
"Plot an arrow"
pts = arrow(self.coords(tail), self.coords(tip), tailWidth, headLength, flatness)
pts = arrow(self.coords(tail), self.coords(tip), tailWidth, headLength, flatness).points
Image.polygon(pts, True, fill, stroke, strokeWeight, self.size).blitTo(self)

def blit(self, img, posn, anchor=NW):
Expand Down
4 changes: 2 additions & 2 deletions sc8pr/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def gyroCompass(self):
@property
def state(self):
"Return the state of the robot as a dictionary"
return dict(environ=self.environ, motors=self.motors, stall=self.stall, proximity=self.proximity,
downColor=self.downColor, frontColor=self.frontColor, uptime=self.uptime, gyro=self.gyro)
return dict(environ=self.environ, motors=self.motors, stall=self.stall, stallTime=self.stallTime, proximity=self.proximity,
downColor=self.downColor, frontColor=self.frontColor, uptime=self.uptime, gyro=self.gyro, penColor=self.penColor)

@classmethod
def _makeCostumes(cls, colors=None):
Expand Down

0 comments on commit 3c2fc04

Please sign in to comment.