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

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

Go to the source code of this file.

Classes

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

Functions

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

Variables

 laelaps_imu.Argv0 = os.path.basename(__file__)
 
dictionary laelaps_imu.CliArgs = {}
 
 laelaps_imu.imu = Imu.Imu()
 
 laelaps_imu.ImuSymName
 
 laelaps_imu.baudrate
 
 laelaps_imu.ident = imu.readIdent()
 
 laelaps_imu.meas = imu.readRawImu('si', 'si')
 
 laelaps_imu.rpy = imu.readAttitude('si')
 

Detailed Description

Package: RoadNarrows Robotics Laelaps Robotic Mobile Platform Package.

File: laelaps_imu.py

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

Read and prints basic IMU data.

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_imu.py.

Function Documentation

def laelaps_imu.getOptions (   kwargs)

Get command-line options.

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

Definition at line 119 of file laelaps_imu.py.

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

Print Command-Line Usage Message.

Definition at line 96 of file laelaps_imu.py.

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

Print usage error.

Parameters
emsgError message string.

Definition at line 88 of file laelaps_imu.py.

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