当前位置:网站首页>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。
边栏推荐
- Résumé des diagrammes de description des broches de la série ESP
- Modify the video name from the name mapping relationship in the table
- VMware 虚拟化集群
- C language custom type: struct
- Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform
- 【刷题】牛客网面试必刷TOP101
- 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
- Upgrade tidb operator
- Synchronized solves problems caused by sharing
- Step by step guide to setting NFT as an ens profile Avatar
猜你喜欢

【MySQL】锁

C语言自定义类型:结构体

Hcip day 16
![[brush questions] top101 must be brushed in the interview of niuke.com](/img/55/5ca957e65d48e19dbac8043e89e7d9.png)
[brush questions] top101 must be brushed in the interview of niuke.com

2022.02.13 - NC002. sort

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

Understanding of law of large numbers and central limit theorem

On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced

Synchronized solves problems caused by sharing

"Designer universe" APEC design +: the list of winners of the Paris Design Award in France was recently announced. The winners of "Changsha world center Damei mansion" were awarded by the national eco
随机推荐
Migrate data from SQL files to tidb
Analysis of Top1 accuracy and top5 accuracy examples
JVM performance tuning and practical basic theory - Part 1
[MySQL] database stored procedure and storage function clearance tutorial (full version)
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
Online yaml to CSV tool
Day29-t77 & t1726-2022-02-13-don't answer by yourself
Char to leading 0
Upgrade tidb with tiup
Use dumping to back up tidb cluster data to S3 compatible storage
vulnhub hackme: 1
Wincc7.5 download and installation tutorial (win10 system)
ESP系列引脚說明圖匯總
synchronized 解决共享带来的问题
Online yaml to CSV tool
CAD ARX gets the current viewport settings
LDAP application (4) Jenkins access
On the day of resignation, jd.com deleted the database and ran away, and the programmer was sentenced
2022.02.13 - NC003. Design LRU cache structure
All the ArrayList knowledge you want to know is here