当前位置:网站首页>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。
边栏推荐
- 2022.02.13 - NC001. Reverse linked list
- [research materials] 2021 China online high growth white paper - Download attached
- vulnhub hackme: 1
- 1204 character deletion operation (2)
- 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
- 使用 BR 备份 TiDB 集群数据到兼容 S3 的存储
- 指针和数组笔试题解析
- Asia Pacific Financial Media | art cube of "designer universe": Guangzhou community designers achieve "great improvement" in urban quality | observation of stable strategy industry fund
- TiDB备份与恢复简介
- 2. File operation - write
猜你喜欢
What is the use of entering the critical point? How to realize STM32 single chip microcomputer?
Hcip day 16
C language custom type: struct
IoT -- 解读物联网四层架构
Easy to use tcp-udp_ Debug tool download and use
2022.02.13 - NC002. sort
2022.02.13 - 238. Maximum number of "balloons"
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached
Deep learning: derivation of shallow neural networks and deep neural networks
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
随机推荐
使用 Dumpling 备份 TiDB 集群数据到兼容 S3 的存储
2022.02.13 - NC002. sort
String to leading 0
tree树的精准查询
Permutation and combination function
MFC sends left click, double click, and right click messages to list controls
What is the use of entering the critical point? How to realize STM32 single chip microcomputer?
华为云OBS文件上传下载工具类
[MySQL] lock
使用 BR 备份 TiDB 集群数据到兼容 S3 的存储
Upgrade tidb with tiup
2022.02.13 - NC003. Design LRU cache structure
Yyds dry goods inventory three JS source code interpretation eventdispatcher
Circular reference of ES6 module
2. File operation - write
wincc7.5下载安装教程(Win10系统)
Leetcode question brushing (5.28) hash table
1. Color inversion, logarithmic transformation, gamma transformation source code - miniopencv from zero
Analysis of Top1 accuracy and top5 accuracy examples
Remote storage access authorization