美文网首页
[项目笔记1]-novatel driver记录

[项目笔记1]-novatel driver记录

作者: scott_yu779 | 来源:发表于2018-01-10 14:01 被阅读0次

    1、过程记录

    sensor_msgs::NavSatStatus::STATUS_FIX
    sensor_msgs::NavSatStatus::STATUS_GBAS_FIX;

    sensor_msgs的doc
    wjwwood的github

    调试记录

    1 segment fault调试记录

    Version:0.9 StartHTML:0000000332 EndHTML:0000011185 StartFragment:0000000368 EndFragment:0000011149 SourceURL:https://landray.dingtalkapps.com/alid/app/reportpc/createreport.html?reportid=161bdab5ca387f7d1f380914eb29b0e0&templateid=15f0a2cd99cf637412bc7de4e1faa036&corpid=ding5feebb43dd76297235c2f4657eb6378f&comeFromInside=1

    1、调试novatel驱动程序报segmentfualt错误,已经找到问题并解决,

    过程记录:
    a、cmake工程 增加gdb调试信息

    SET(CMAKE_BUILD_TYPE "Debug") 
    SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
    SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
    

    然后重新编译
    b、catkin_make -DCMAKE_BUILD_TYPE=Debug
    c、然后gdb调试,找到SIGSEGV的错误调用堆栈信息
    gdb ./novatel_read_from_file core.xxxx
    set args 2018.1.15-1.GPS
    run
    直到segment fault出现,
    使用bt命令就可以看到调用堆栈信息


    gdb捕捉的调用堆栈信息,序号越大,表示越早进入函数

    d、确定调用栈后,发现时协议版本有更改,修复后
    以下部分为出问题的代码的片段
    修复前的代码

    case PSRDOPB_LOG_TYPE:
                Dop psr_dop;
                header_length = (uint16_t) *(message+3);
                payload_length = (((uint16_t) *(message+9)) << 8) +
                                 ((uint16_t) *(message+8));
    
                // Copy header and unrepeated fields
                memcpy(&psr_dop, message, header_length+24);
                //Copy repeated fields
                memcpy(&psr_dop.prn, message+header_length+28, (4*psr_dop.number_of_prns));
                //Copy CRC
                memcpy(&psr_dop.crc, message+header_length+payload_length, 4);
    
                if (pseudorange_dop_callback_)
                    pseudorange_dop_callback_(psr_dop, read_timestamp_);
                break;
    

    修复后的代码如下,只有一个地方发生了变化
    memcpy(&psr_dop, message, header_length+24);中的24变为了28

    case PSRDOPB_LOG_TYPE:
            Dop psr_dop;
            //cout << "header_length:" << header_length << endl;//header_length=28
            header_length = (uint16_t) * (message + 3);
            //cout << "payload_length:" << payload_length << endl;//payload_length=2856
            payload_length = (((uint16_t) * (message + 9)) << 8) +
                             ((uint16_t) * (message + 8));
    
            //Copy header and unrepeated fields
            memcpy(&psr_dop, message, header_length + 28);
    
            //cout << "psr_dop.number_of_prns:" << psr_dop.number_of_prns << endl;//psr_dop.number_of_prns=2856
    
            //Copy repeated fields
            memcpy(&psr_dop.prn, message + header_length + 28, (4 * psr_dop.number_of_prns));
            //Copy CRC
            memcpy(&psr_dop.crc, message + header_length + payload_length, 4);
    
            if (pseudorange_dop_callback_)
                pseudorange_dop_callback_(psr_dop, read_timestamp_);
            break;
    
    [yuhs@yuhs novatel]$./novatel_read_from_file 2018.1.15-1.GPS 
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110165000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7971
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110166000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7933
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110167000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7869
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110168000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7905
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110169000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7808
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110170000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7824
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110171000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.788
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110172000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7816
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110173000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7817
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110174000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7818
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110175000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7873
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110176000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7927
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110177000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7878
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    BESTPOS: 
    GPS Week: 1984  GPS milliseconds: 110178000
      Latitude: 34.3999
      Longitude: 117.471
      Height: 49.7842
    
      Solution status: 0
      position type: 50
      number of svs tracked: 19
      number of svs used: 16
    payload_length:2856
    
    mssage[0]is:aa
    mssage[1]is:44
    mssage[2]is:12
    mssage[3]is:1c
    mssage[4]is:ae
    mssage[5]is:0
    mssage[6]is:0
    mssage[7]is:3e
    mssage[8]is:5c
    mssage[9]is:0
    mssage[10]is:0
    mssage[11]is:0
    mssage[12]is:7b
    mssage[13]is:b4
    mssage[14]is:c0
    mssage[15]is:7
    mssage[16]is:80
    mssage[17]is:e8
    mssage[18]is:90
    mssage[19]is:6
    mssage[20]is:0
    mssage[21]is:0
    mssage[22]is:0
    mssage[23]is:0
    mssage[24]is:79
    mssage[25]is:17
    mssage[26]is:16
    mssage[27]is:37
    
    mssage[28]is:cf
    mssage[29]is:f7
    mssage[30]is:b3
    mssage[31]is:3f
    
    mssage[32]is:5a
    mssage[33]is:64
    mssage[34]is:8b
    mssage[35]is:3f
    
    mssage[36]is:a0
    mssage[37]is:1a
    mssage[38]is:2f
    mssage[39]is:3f
    
    mssage[40]is:4a
    mssage[41]is:c
    mssage[42]is:62
    mssage[43]is:3f
    
    mssage[44]is:17
    mssage[45]is:d9
    mssage[46]is:e
    mssage[47]is:3f
    
    mssage[48]is:0
    mssage[49]is:0
    mssage[50]is:a0
    mssage[51]is:40
    
    mssage[52]is:10
    mssage[53]is:0
    mssage[54]is:0
    mssage[55]is:0
    
    mssage[56]is:e
    mssage[57]is:0
    mssage[58]is:0
    mssage[59]is:0
    mssage[60]is:12
    mssage[61]is:0
    mssage[62]is:0
    mssage[63]is:0
    mssage[64]is:1a
    mssage[65]is:0
    mssage[66]is:0
    mssage[67]is:0
    mssage[68]is:16
    mssage[69]is:0
    mssage[70]is:0
    mssage[71]is:0
    mssage[72]is:18
    mssage[73]is:0
    mssage[74]is:0
    mssage[75]is:0
    mssage[76]is:19
    mssage[77]is:0
    mssage[78]is:0
    mssage[79]is:0
    mssage[80]is:a
    mssage[81]is:0
    mssage[82]is:0
    mssage[83]is:0
    mssage[84]is:20
    mssage[85]is:0
    mssage[86]is:0
    mssage[87]is:0
    mssage[88]is:c
    mssage[89]is:0
    mssage[90]is:0
    mssage[91]is:0
    mssage[92]is:1f
    mssage[93]is:0
    mssage[94]is:0
    mssage[95]is:0
    mssage[96]is:2f
    mssage[97]is:0
    mssage[98]is:0
    mssage[99]is:0
    mssage[100]is:2b
    mssage[101]is:0
    mssage[102]is:0
    mssage[103]is:0
    mssage[104]is:2e
    mssage[105]is:0
    mssage[106]is:0
    mssage[107]is:0
    mssage[108]is:35
    mssage[109]is:0
    mssage[110]is:0
    mssage[111]is:0
    mssage[112]is:2a
    mssage[113]is:0
    mssage[114]is:0
    mssage[115]is:0
    mssage[116]is:2c
    mssage[117]is:0
    mssage[118]is:0
    mssage[119]is:0
    mssage[120]is:f4
    mssage[121]is:47
    mssage[122]is:7b
    mssage[123]is:86
    
    psr_dop.number_of_prns:135306244
    Segmentation fault (core dumped)
    

    相关文章

      网友评论

          本文标题:[项目笔记1]-novatel driver记录

          本文链接:https://www.haomeiwen.com/subject/dnronxtx.html