mapping.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 # -*- coding: utf-8 -*-
00003 #     _____
00004 #    /  _  \
00005 #   / _/ \  \
00006 #  / / \_/   \
00007 # /  \_/  _   \  ___  _    ___   ___   ____   ____   ___   _____  _   _
00008 # \  / \_/ \  / /  _\| |  | __| / _ \ | ┌┐ \ | ┌┐ \ / _ \ |_   _|| | | |
00009 #  \ \_/ \_/ /  | |  | |  | └─┐| |_| || └┘ / | └┘_/| |_| |  | |  | └─┘ |
00010 #   \  \_/  /   | |_ | |_ | ┌─┘|  _  || |\ \ | |   |  _  |  | |  | ┌─┐ |
00011 #    \_____/    \___/|___||___||_| |_||_| \_\|_|   |_| |_|  |_|  |_| |_|
00012 #            ROBOTICS™
00013 #
00014 #
00015 #  Copyright © 2012 Clearpath Robotics, Inc. 
00016 #  All Rights Reserved
00017 #  
00018 # Redistribution and use in source and binary forms, with or without
00019 # modification, are permitted provided that the following conditions are met:
00020 #     * Redistributions of source code must retain the above copyright
00021 #       notice, this list of conditions and the following disclaimer.
00022 #     * Redistributions in binary form must reproduce the above copyright
00023 #       notice, this list of conditions and the following disclaimer in the
00024 #       documentation and/or other materials provided with the distribution.
00025 #     * Neither the name of Clearpath Robotics, Inc. nor the
00026 #       names of its contributors may be used to endorse or promote products
00027 #       derived from this software without specific prior written permission.
00028 # 
00029 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00030 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00031 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00032 # DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY
00033 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00034 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00035 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00036 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00038 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039 #
00040 # Please send comments, questions, or patches to skynet@clearpathrobotics.com
00041 #
00042 
00043 # applanix group number : ( topic name, ROS message class, [opts] )
00044 groups = {
00045       1: ("nav", "NavigationSolution"),
00046       2: ("status/perf", "NavigationPerformance"),
00047       3: ("status/gnss/primary", "GNSSStatus"),
00048       4: ("imu", "IMUData"),
00049       5: ("events/1", "Event"),
00050       6: ("events/2", "Event"),
00051       7: ("status/pps", "PPSStatus"),
00052       8: ("status/logging", "LoggingStatus"),
00053       9: ("gams", "GAMS"),
00054       10: ("status/general", "GeneralStatus"),
00055       11: ("status/gnss/secondary", "GNSSStatus"),
00056       12: ("status/gnss/aux_1", "GNSSAuxStatus"),
00057       13: ("status/gnss/aux_2", "GNSSAuxStatus"),
00058       14: ("status/installation", "CalibratedInstallationParameters"),
00059       15: ("dmi", "DMIData"),
00060       17: ("status/user_time", "UserTimeStatus"),
00061       20: ("status/iin", "IINSolutionStatus"),
00062       21: ("status/base_gnss/1/modem", "BaseGNSSModemStatus"),
00063       22: ("status/base_gnss/2/modem", "BaseGNSSModemStatus"),
00064       23: ("raw/gnss/aux_1_display", "RawData"),
00065       24: ("raw/gnss/aux_2_display", "RawData"),
00066       25: ("status/dgps", "GNSSDGPSStatus"),
00067       26: ("status/dgps_stations", "GNSSDGPSStationDatabase"),
00068       30: ("events/3", "Event"),
00069       31: ("events/4", "Event"),
00070       32: ("events/5", "Event"),
00071       33: ("events/6", "Event"),
00072       99: ("status/version", "Version"),
00073       10001: ("raw/gnss/primary", "RawData"),
00074       10002: ("raw/imu", "RawData"),
00075       10003: ("raw/pps", "RawPPS"),
00076       10004: ("events/1", "Event"),
00077       10005: ("events/2", "Event"),
00078       10006: ("raw/dmi", "RawDMI"),
00079       10007: ("raw/gnss/aux_1", "RawData"),
00080       10008: ("raw/gnss/aux_2", "RawData"),
00081       10009: ("raw/gnss/secondary", "RawData"),
00082       10011: ("raw/base_gnss/1", "RawData"),
00083       10012: ("raw/base_gnss/2", "RawData"),
00084       }
00085 
00086 msgs = {
00087       0: ("ack", "Ack", False),
00088       20: ("general", "GeneralParams", True),
00089       21: ("gams", "GAMSParams", True),
00090       22: ("aiding_sensors", "AidingSensorParams", True),
00091       24: ("user_accuracy", "UserAccuracySpecs", True),
00092       30: ("primary_gnss_setup", "GNSSSetup", True),
00093       31: ("secondary_gnss_setup", "GNSSSetup", True),
00094       32: ("ip_address", "IPAddress", True),
00095       33: ("event_setup", "EventSetup", True),
00096       34: ("com_port_setup", "COMPortSetup", True),
00097       35: ("nmea_message_select", "NMEAMessageSelect", True),
00098       36: ("binary_message_select", "BinaryMessageSelect", True),
00099       37: ("base_gnss_1_setup", "BaseGNSSSetup", True),
00100       38: ("base_gnss_2_setup", "BaseGNSSSetup", True),
00101       40: ("precise_gravity", "PreciseGravitySpecs", True),
00102       41: ("primary_dgps_source", "DGPSSourceControl", True),
00103       50: ("nav_mode", "NavModeControl", True),
00104       51: ("display_port", "PortControl", True),
00105       52: ("primary_data_port", "PortControl", True),
00106       53: ("logging_port", "LoggingControl", True),
00107       54: ("save_restore", "SaveRestoreControl", False),
00108       55: ("time_sync", "TimeSyncControl", True),
00109       57: ("installation_calibration", "InstallationCalibrationControl", False),
00110       58: ("gams_calibration", "GAMSCalibrationControl", False),
00111       61: ("secondary_data_port", "PortControl", True),
00112       90: ("program", "ProgramControl", False),
00113       91: ("gnss", "GNSSControl", False),
00114       92: ("integration_diagnostics", "IntegrationDiagnosticsControl", True),
00115       93: ("aiding_sensor_integration", "AidingSensorIntegrationControl", True),
00116     }
00117 
00118 if __name__ == '__main__':
00119   import sys
00120   # by default, print out all of the messages that correspond to services
00121   if len(sys.argv) <= 1 or sys.argv[1] == "-s":
00122     srvs = []
00123     for name, msg, in_all_msgs in msgs.values():
00124       if name != "ack" and msg not in srvs:
00125         srvs += [msg]
00126 
00127     print ";".join(srvs)
00128 
00129   elif sys.argv[1] == "-a":
00130     print "time last_changed"
00131     print "time last_sent"
00132     for name, msg, in_all_msgs in msgs.values():
00133       if in_all_msgs:
00134         print "applanix_msgs/%s %s" % (msg, name)
00135 
00136   elif sys.argv[1] == "-g":
00137     msg_name = sys.argv[2]
00138     print "applanix_msgs/" + msg_name + " request"
00139     print "---"
00140     print "applanix_msgs/Ack ack"
00141 
00142   else:
00143     print "Usage: mapping.py [-s|-a|-g <msg name>]"
00144     print "If no arguments or -s given, list services to generate"
00145     print "  -a generate AllMsgs message definition"
00146     print "  -g <msg_name> Generate service for message type given"
00147     sys.exit(1)
00148 
00149 
00150 else:
00151   # magic to replace class names with actual class instances
00152   import applanix_msgs.msg
00153   for k in groups.keys():
00154     name, msg_name = groups[k]
00155     groups[k] = (name, applanix_msgs.msg.__dict__[msg_name])
00156 
00157   for k in msgs.keys():
00158     name, msg_name, in_all_msgs = msgs[k]
00159     msgs[k] = (name, applanix_msgs.msg.__dict__[msg_name])
00160     msgs[k][1].in_all_msgs = in_all_msgs
00161     


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Aug 27 2015 12:15:50