Ejemplo n.º 1
0
    def static_build_gps_raw_info_message():
        message_header = ROSLinkBridgeGapter.static_build_roslink_header_message(
            MESSAGE_TYPE.ROSLINK_MESSAGE_GPS_RAW_INFO)

        s = ROSLinkBridgeGapter.SRTLines[ROSLinkBridgeGapter.SRTLines_counter]
        s = s.split("(")
        gps = s[1].split(",")
        # print(s)
        ROSLinkBridgeGapter.SRTLines_counter += 6
        if ROSLinkBridgeGapter.SRTLines_counter > 500:
            ROSLinkBridgeGapter.SRTLines_counter = 3
        ROSLinkStateVariables.lat = gps[0]
        ROSLinkStateVariables.lon = gps[1]

        alt = s[1].split(":")[1][0:4]
        ROSLinkStateVariables.alt = alt
        print(ROSLinkStateVariables.alt)
        global_motion_message = GPSRawInfo(
            message_header, ROSLinkStateVariables.time_boot_ms,
            ROSLinkStateVariables.fix_type, ROSLinkStateVariables.lat,
            ROSLinkStateVariables.lon, ROSLinkStateVariables.altitude,
            ROSLinkStateVariables.eph, ROSLinkStateVariables.epv,
            ROSLinkStateVariables.vel, ROSLinkStateVariables.cog,
            ROSLinkStateVariables.satellites_visible)
        return global_motion_message.__dict__
 def static_build_gps_raw_info_message():
     message_header = ROSLinkBridgeTurtlebot.static_build_roslink_header_message(
         MESSAGE_TYPE.ROSLINK_MESSAGE_GPS_RAW_INFO)
     global_motion_message = GPSRawInfo(
         message_header, ROSLinkStateVariables.time_boot_ms,
         ROSLinkStateVariables.fix_type, ROSLinkStateVariables.lat,
         ROSLinkStateVariables.lon, ROSLinkStateVariables.alt,
         ROSLinkStateVariables.eph, ROSLinkStateVariables.epv,
         ROSLinkStateVariables.vel, ROSLinkStateVariables.cog,
         ROSLinkStateVariables.satellites_visible)
     return global_motion_message.__dict__