当前位置:网站首页>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。
边栏推荐
- Image fusion -- challenges, opportunities and Countermeasures
- Verrouillage [MySQL]
- Migrate data from a tidb cluster to another tidb cluster
- PLT in Matplotlib tight_ layout()
- Yyds dry goods inventory three JS source code interpretation eventdispatcher
- 1202 character lookup
- 使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
- [cloud native topic -45]:kubesphere cloud Governance - Introduction and overall architecture of enterprise container platform based on kubernetes
- [2022 广东省赛M] 拉格朗日插值 (多元函数极值 分治NTT)
- Summary of MySQL index failure scenarios
猜你喜欢

Cisp-pte practice explanation

tree树的精准查询

你想知道的ArrayList知识都在这

2022.02.13 - 238. Maximum number of "balloons"

Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform

Chinese Remainder Theorem (Sun Tzu theorem) principle and template code

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

Beijing invitation media

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
![[MySQL] log](/img/e9/1617122888c096cf6aba2bdb88f0ef.png)
[MySQL] log
随机推荐
从 CSV 文件迁移数据到 TiDB
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
根据csv文件某一列字符串中某个数字排序
The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
C language custom type: struct
Verrouillage [MySQL]
ESP系列引脚说明图汇总
MFC sends left click, double click, and right click messages to list controls
Make learning pointer easier (3)
logback1.3. X configuration details and Practice
[2022 Guangdong saim] Lagrange interpolation (multivariate function extreme value divide and conquer NTT)
Tidb backup and recovery introduction
你想知道的ArrayList知识都在这
[research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached
使用 TiUP 升级 TiDB
ESP series pin description diagram summary
Analysis of pointer and array written test questions
使用 TiDB Lightning 恢复 S3 兼容存储上的备份数据
sys.argv
从 SQL 文件迁移数据到 TiDB