Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laelaps_stop.py File Reference

Package: RoadNarrows Robotics Laelaps Robotic Mobile Platform Package. More...

Go to the source code of this file.

Classes

class  laelaps_stop.usage
 Unit test command-line exception class. More...
 

Functions

def laelaps_stop.printTry ()
 Print 'try' message'.
 
def laelaps_stop.printUsageErr (emsg)
 Print usage error. More...
 
def laelaps_stop.printUsage ()
 Print Command-Line Usage Message. More...
 
def laelaps_stop.getOptions (kwargs)
 Get command-line options. More...
 

Variables

 laelaps_stop.Argv0 = os.path.basename(__file__)
 
dictionary laelaps_stop.CliArgs = {}
 
bool laelaps_stop.DoStop = True
 
 laelaps_stop.wd = WatchDog.WatchDog()
 
 laelaps_stop.ret = wd.cmdReadEnables()
 
 laelaps_stop.motorctlr = RoboClaw.RoboClaw()
 

Detailed Description

Package: RoadNarrows Robotics Laelaps Robotic Mobile Platform Package.

File: laelaps_stop

LastChangedDate
2015-09-25 18:32:17 -0600 (Fri, 25 Sep 2015)
Rev
4109

Stop the Laelaps.

Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Copyright
© 2015-2017. RoadNarrows LLC.
http://www.roadnarrows.com
All Rights Reserved
EULA@

Unless otherwise stated explicitly, all materials contained are copyrighted and may not be used without RoadNarrows LLC's written consent, except as provided in these terms and conditions or in the copyright notice (documents and software) or other proprietary notice provided with the relevant materials.

IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY MEMBERS/EMPLOYEES/CONTRACTORS OF ROADNARROWS OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE AUTHORS AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

—@

Definition in file laelaps_stop.py.

Function Documentation

def laelaps_stop.getOptions (   kwargs)

Get command-line options.

Parameters
[in,out]kwargsCommand-line keyword dictionary.
Returns
Parsed keyword arguments.

Definition at line 118 of file laelaps_stop.py.

118 def getOptions(kwargs):
119  argv = sys.argv
120 
121  # defaults
122  kwargs['debug'] = False
123 
124  # parse command-line options
125  try:
126  opts, args = getopt.getopt(argv[1:], "?h", ['help', ''])
127  except getopt.error, msg:
128  raise usage(msg)
129  for opt, optarg in opts:
130  if opt in ('-h', '--help', '-?'):
131  printUsage()
132  sys.exit(0)
133 
134  return kwargs
135 
136 #
137 # Parse command-line options and arguments
138 #
139 try:
140  CliArgs = getOptions(CliArgs)
def laelaps_stop.printUsage ( )

Print Command-Line Usage Message.

Definition at line 95 of file laelaps_stop.py.

95 def printUsage():
96  print \
97 """
98 usage: %s [OPTIONS]
99  %s --help
100 
101 Stop all Laelaps motors.
102 
103 Options and arguments:
104 -h, --help : Display this help and exit.
105 
106 Exit Status:
107  Returns exits status of 0 on success. An exit status of 128 indicates usage
108  error.
109 """ % (Argv0, Argv0)
110 
111 #
def laelaps_stop.printUsageErr (   emsg)

Print usage error.

Parameters
emsgError message string.

Definition at line 87 of file laelaps_stop.py.

87 def printUsageErr(emsg):
88  if emsg:
89  print "%s: Error: %s" % (Argv0, emsg)
90  else:
91  print "%s: Error" % (Argv0)
92  printTry()
93