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

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)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,324评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,303评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,192评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,555评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,569评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,566评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,927评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,583评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,827评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,590评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,669评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,365评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,941评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,928评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,159评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,880评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,399评论 2 342