Skip to content

Commit

Permalink
Fixed #13 by changing to NavigationToolbar2Tk.
Browse files Browse the repository at this point in the history
Updated copyright year.
Made robot attributes (type, etc) class attributes.
  • Loading branch information
aarant committed Feb 8, 2019
1 parent 3038860 commit 53ff58f
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 38 deletions.
Binary file added dist/Soar-1.5.2.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ def __getattr__(cls, name):

# General information about the project.
project = 'Soar'
copyright = '2017, Andrew Antonitis'
copyright = '2019, Andrew Antonitis'
author = 'Andrew Antonitis'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.5.1'
version = '1.5.2'
# The full version, including alpha/beta/rc tags.
release = '1.5.1'
release = '1.5.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
packages=['soar', 'soar.brains', 'soar.gui', 'soar.robot', 'soar.sim', 'soar.worlds'],
package_data={'': ['*.gif']},
entry_points={'console_scripts': ['soar = soar.__main__:main',]},
install_requires=['pyserial>=3.0', 'matplotlib>=2.0'],
install_requires=['pyserial>=3.0,<4.0', 'matplotlib>=3.0,<4.0'],
python_requires='>=3.3',
license='LGPLv3',
classifiers=['License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
Expand Down
10 changes: 5 additions & 5 deletions soar/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -15,16 +15,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# soar/__init__.py
""" Soar (Snakes on a Robot) v1.5.1
""" Soar (Snakes on a Robot) v1.5.2
An extensible Python framework for both simulating and interacting with robots.
Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
"""


__version__ = '1.5.1'
__version__ = '1.5.2'
blerb = 'Soar (Snakes on a Robot) v' + __version__ + ': A Python robotics framework.\n' \
'https://github.com/arantonitis/soar\n\n' \
'Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.'
'Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.'

2 changes: 1 addition & 1 deletion soar/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/__main__.py
""" Allows use of Soar from the command line by passing arguments to :func:`soar.client.main`
Expand Down
2 changes: 1 addition & 1 deletion soar/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/client.py
""" Soar client entrypoint.
Expand Down
2 changes: 1 addition & 1 deletion soar/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/common.py
# TODO: Move these into __init__?
Expand Down
2 changes: 1 addition & 1 deletion soar/controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/controller.py
""" Controller classes and functions for controlling robots, simulated or real. """
Expand Down
2 changes: 1 addition & 1 deletion soar/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/errors.py
""" Soar error classes. """
Expand Down
2 changes: 1 addition & 1 deletion soar/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/gui/__init__.py
""" Soar GUI Modules.
Expand Down
2 changes: 1 addition & 1 deletion soar/gui/canvas.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/gui/canvas.py
""" Soar canvas classes and methods.
Expand Down
2 changes: 1 addition & 1 deletion soar/gui/output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/gui/output.py
""" Soar output classes.
Expand Down
4 changes: 2 additions & 2 deletions soar/gui/plot_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if platform.system() == 'Darwin': # Fix for Soar crashing on macOS
matplotlib.use('TkAgg')
# Tk backends, used for plotting in various modes (GUI or headless)
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, FigureCanvasAgg, NavigationToolbar2TkAgg
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, FigureCanvasAgg, NavigationToolbar2Tk
import matplotlib.pyplot as plt
from tkinter import Tk, Toplevel, TOP, BOTH

Expand Down Expand Up @@ -63,7 +63,7 @@ def make_window(self):
This method is called during initialization and it is unlikely you will need to call it elsewhere.
"""
self.canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
self.toolbar = NavigationToolbar2TkAgg(self.canvas, self.canvas._master)
self.toolbar = NavigationToolbar2Tk(self.canvas, self.canvas._master)
self.toolbar.update()
self.canvas._tkcanvas.pack(side=TOP, fill=BOTH, expand=1)

Expand Down
2 changes: 1 addition & 1 deletion soar/gui/soar_ui.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/gui/soar_ui.py
""" Soar Main GUI classes.
Expand Down
2 changes: 1 addition & 1 deletion soar/hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/hooks.py
""" Functions for brains to hook into various elements of Soar.
Expand Down
2 changes: 1 addition & 1 deletion soar/robot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/robot/__init__.py
""" Soar robot modules, containing the BaseRobot class, example robot subclasses, and bundled implementations like
Expand Down
2 changes: 1 addition & 1 deletion soar/robot/arcos.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/robot/arcos.py
""" ARCOS (Advanced Robot Control and Operations Software) Client.
Expand Down
4 changes: 2 additions & 2 deletions soar/robot/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/robot/base.py
""" Soar BaseRobot class, intended as a parent class for nontrivial/useful robots.
Expand All @@ -14,6 +14,7 @@


class BaseRobot(WorldObject):
type = 'BaseRobot'
""" A base robot class, intended to be subclassed and overridden.
Any robot usable in SoaR should supplement or re-implement this class' methods with the desired behavior.
Expand All @@ -40,7 +41,6 @@ class BaseRobot(WorldObject):

def __init__(self, polygon, **options):
WorldObject.__init__(self, do_draw=True, do_step=True, **options) # Robots are always drawn and stepped
self.type = 'BaseRobot'
self.simulated = True
self.world = None
self.pose = Pose(0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion soar/robot/names.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/robot/names.py
""" Generate a neutral name from an arbitrary serial number string. """
Expand Down
15 changes: 7 additions & 8 deletions soar/robot/pioneer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/robot/pioneer.py
""" A PioneerRobot class, for representing a real or simulated Pioneer 3 robot.
Expand Down Expand Up @@ -55,6 +55,12 @@ def gen_tone_pairs(note_string, bpm=120):


class PioneerRobot(BaseRobot):
type = 'Pioneer3'
# Sonar poses relative to the robot's center
sonar_poses = [Pose(0.08, 0.134, pi/2), Pose(0.122, 0.118, 5*pi/18), Pose(0.156, 0.077, pi/6),
Pose(0.174, 0.0266, pi/18), Pose(0.174, -0.0266, -pi/18), Pose(0.156, -0.077, -pi/6),
Pose(0.122, -0.118, -5*pi/18), Pose(0.08, -0.134, -pi/2)]
SONAR_MAX = 1.5 # meters
""" An abstract, universal Pioneer 3 robot. Instances of this class can be fully simulated, or used to communicate
with an actual Pioneer3 robot over a serial port.
Expand Down Expand Up @@ -83,13 +89,6 @@ def __init__(self, **options):
(-0.034, 0.190), (-0.051, 0.190), (-0.051, 0.150), (-0.153, 0.150),
(-0.223, 0.074), (-0.223, -0.103), (-0.153, -0.179), (-0.051, -0.179),
(-0.051, -0.219)], None, fill='black', dummy=True))
self.type = 'Pioneer3'
# Sonar poses relative to the robot's center
self.sonar_poses = [Pose(0.08, 0.134, pi/2), Pose(0.122, 0.118, 5*pi/18),
Pose(0.156, 0.077, pi/6), Pose(0.174, 0.0266, pi/18),
Pose(0.174, -0.0266, -pi/18), Pose(0.156, -0.077, -pi/6),
Pose(0.122, -0.118, -5*pi/18), Pose(0.08, -0.134, -pi/2)]
self.SONAR_MAX = 1.5 # meters
self.arcos = None # The ARCOS client, if connected
self.serial_device = None # The serial device, if connected
self._fv = 0.0 # Internal forward velocity storage
Expand Down
2 changes: 1 addition & 1 deletion soar/sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/sim/__init__.py
""" Simulation modules, containing general 2D geometry methods, graphical world objects with collision detection, etc.
Expand Down
2 changes: 1 addition & 1 deletion soar/sim/geometry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/sim/geometry.py
""" Geometry classes, for manipulating points, collections of points, lines, and normalizing angles. """
Expand Down
2 changes: 1 addition & 1 deletion soar/sim/world.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/sim/world.py
""" Soar World and WorldObject classes/subclasses, for simulating and drawing worlds. """
Expand Down
2 changes: 1 addition & 1 deletion soar/update.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Soar (Snakes on a Robot): A Python robotics framework.
# Copyright (C) 2017 Andrew Antonitis. Licensed under the LGPLv3.
# Copyright (C) 2019 Andrew Antonitis. Licensed under the LGPLv3.
#
# soar/update.py
""" Function to check for updates on PyPI, and return a message for the user. """
Expand Down

0 comments on commit 53ff58f

Please sign in to comment.