当前位置:网站首页>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。
边栏推荐
- 使用 TiUP 升级 TiDB
- NFT smart contract release, blind box, public offering technology practice -- contract
- Hungry for 4 years + Ali for 2 years: some conclusions and Thoughts on the road of research and development
- ESP系列引脚說明圖匯總
- Understanding of law of large numbers and central limit theorem
- Mobile Test Engineer occupation yyds dry goods inventory
- 指针和数组笔试题解析
- Hcip day 16
- 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
- Summary of MySQL index failure scenarios
猜你喜欢

The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?

leetcode刷题 (5.28) 哈希表

What is the use of entering the critical point? How to realize STM32 single chip microcomputer?

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

2022.02.13 - 238. Maximum number of "balloons"

指针和数组笔试题解析

Analysis of pointer and array written test questions

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

Zhong Xuegao, who cannot be melted, cannot escape the life cycle of online celebrity products
随机推荐
matplotlib. Widgets are easy to use
【MySQL】锁
Chinese Remainder Theorem (Sun Tzu theorem) principle and template code
1202 character lookup
远程存储访问授权
Huawei cloud OBS file upload and download tool class
[research materials] 2022 enterprise wechat Ecosystem Research Report - Download attached
Sort according to a number in a string in a column of CSV file
Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform
From monomer structure to microservice architecture, introduction to microservices
Step by step guide to setting NFT as an ens profile Avatar
leetcode刷题 (5.28) 哈希表
2022.02.13 - 238. Maximum number of "balloons"
2022.02.13 - NC004. Print number of loops
Easy to use tcp-udp_ Debug tool download and use
The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
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 backup and recovery introduction
Golang DNS 随便写写
PLT in Matplotlib tight_ layout()