当前位置:网站首页>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。
边栏推荐
- Easy to use tcp-udp_ Debug tool download and use
- ESP系列引脚說明圖匯總
- 使用 Dumpling 备份 TiDB 集群数据到兼容 S3 的存储
- 2022.02.13 - NC003. Design LRU cache structure
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- IP lab, the first weekly recheck
- 2022.02.13 - 238. Maximum number of "balloons"
- [brush questions] top101 must be brushed in the interview of niuke.com
- CAD ARX 获取当前的视口设置
- [secretly kill little partner pytorch20 days -day01- example of structured data modeling process]
猜你喜欢

Leetcode question brushing record | 203_ Remove linked list elements

Pyqt5 development tips - obtain Manhattan distance between coordinates

根据csv文件某一列字符串中某个数字排序

Résumé des diagrammes de description des broches de la série ESP

C language custom type: struct

2022.02.13 - NC001. Reverse linked list

Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers

【刷题】牛客网面试必刷TOP101

Online yaml to CSV tool

NFT smart contract release, blind box, public offering technology practice -- contract
随机推荐
[secretly kill little partner pytorch20 days -day01- example of structured data modeling process]
C language - bit segment
【MySQL】日志
Convolution, pooling, activation function, initialization, normalization, regularization, learning rate - Summary of deep learning foundation
String to leading 0
The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
Cisp-pte practice explanation
Configuring OSPF load sharing for Huawei devices
LDAP應用篇(4)Jenkins接入
leetcode刷题 (5.29) 哈希表
Hcip day 16
华为云OBS文件上传下载工具类
Online yaml to CSV tool
C language custom type: struct
Analysis of pointer and array written test questions
1. Color inversion, logarithmic transformation, gamma transformation source code - miniopencv from zero
PLT in Matplotlib tight_ layout()
ESP系列引脚說明圖匯總
Tidb backup and recovery introduction
2022.02.13 - NC001. Reverse linked list