当前位置:网站首页>Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
Rviz仿真时遇到机器人瞬间回到世界坐标原点的问题及可能原因
2022-07-06 08:22:00 【Will_Ye】
1. Problem
仿真过程中,原本正常控制机器人移动,但是突然机器人瞬间回到世界坐标的原点,突破所有限制。
这时应该是算法中某些变量算得了nan
,然后计算速度的方程用到了这个带nan
的数值,也得到nan
的值,通过/cmd_vel
这个topic发给机器人端,导致机器人瞬间就回到原点
2. Solution
这时只能在代码中反向排查了,从cmd_vel
的数据一步步往上排查,设个判断nan
的语句,慢慢检查一下是哪一个变量出问题了,如下:
if(isnan(inter_the[2]))
cout <<"nan appear!"<<endl;
造成这些变量变成nan
的原因太多了,很多都是基本计算逻辑问题,只要定位出来就好办了,有时比如给函数input的变量有个0,而这个0用作分母,这就出问题了。
这里只是对Rviz做仿真时出现的一种异常现象的一种可能分析,我遇到这种问题几次,都是由于nan作为速度发出去导致的,所以只要找到算出nan的地方就能快速fix这个bug。
边栏推荐
- Golang DNS 随便写写
- Easy to use tcp-udp_ Debug tool download and use
- On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced
- String to leading 0
- CAD ARX 获取当前的视口设置
- Leetcode question brushing (5.28) hash table
- Online yaml to CSV tool
- 2022.02.13 - 238. Maximum number of "balloons"
- 使用 BR 恢复 S3 兼容存储上的备份数据
- IP lab, the first weekly recheck
猜你喜欢
2022.02.13 - NC003. Design LRU cache structure
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
3. File operation 3-with
From monomer structure to microservice architecture, introduction to microservices
将 NFT 设置为 ENS 个人资料头像的分步指南
Pyqt5 development tips - obtain Manhattan distance between coordinates
Make learning pointer easier (3)
Configuring OSPF load sharing for Huawei devices
让学指针变得更简单(三)
Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation
随机推荐
logback1.3. X configuration details and Practice
3. File operation 3-with
CAD ARX 获取当前的视口设置
Synchronized solves problems caused by sharing
LDAP应用篇(4)Jenkins接入
指针进阶---指针数组,数组指针
Learn Arduino with examples
Leetcode question brushing (5.28) hash table
[MySQL] database stored procedure and storage function clearance tutorial (full version)
Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
2022.02.13 - NC001. Reverse linked list
synchronized 解决共享带来的问题
Introduction to number theory (greatest common divisor, prime sieve, inverse element)
wincc7.5下载安装教程(Win10系统)
图像融合--挑战、机遇与对策
[MySQL] lock
Easy to use tcp-udp_ Debug tool download and use
String to leading 0
从 SQL 文件迁移数据到 TiDB