00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
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
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
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