2

move_base中的recursive_mutex

 1 year ago
source link: https://charon-cheung.github.io/2023/05/29/%E8%B7%AF%E5%BE%84%E8%A7%84%E5%88%92/move_base%20%E5%88%86%E6%9E%90/move_base%E4%B8%AD%E7%9A%84%E5%BE%AA%E7%8E%AF%E9%94%81/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

move_base中的recursive_mutex | 沉默杀手

move_base中的recursive_mutex
2023-05-29|路径规划move_base分析|
Word count: 165|Reading time: 1 min

经过我大量修改,move_base在有导航任务时,如果ctrl+C退出,终端必定会出现下面的错误,虽然毫无影响,但是毕竟不优雅

move_base 退出时报错死锁

这个错误是在有锁的情况下,仍然加锁。 也就是多调用了lock()函数。

搜索move_base,发现只有7个lock()。逐个查看,由于是退出时的报错,所以不可能是makePlan的那个,很容易发现是planThread函数最后的那个。加上判断即可解决

if( !lock.owns_lock() )
lock.lock();

过了一段时间,发现偶尔还是会出现这个错误,但是概率很小, 难以复现,暂时搁置了

©2018 - 2023 By Charon Cheung
Driven - Hexo|Theme - Melody

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK