当前位置:网站首页>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。
边栏推荐
- Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
- Asia Pacific Financial Media | "APEC industry +" Western Silicon Valley invests 2trillion yuan in Chengdu Chongqing economic circle to catch up with Shanghai | stable strategy industry fund observatio
- 化不掉的钟薛高,逃不出网红产品的生命周期
- Modify the video name from the name mapping relationship in the table
- CISP-PTE实操练习讲解
- Use br to back up tidb cluster data to S3 compatible storage
- 根据csv文件某一列字符串中某个数字排序
- 1. Color inversion, logarithmic transformation, gamma transformation source code - miniopencv from zero
- 使用 Dumpling 备份 TiDB 集群数据到兼容 S3 的存储
- Use dumping to back up tidb cluster data to S3 compatible storage
猜你喜欢

Online yaml to CSV tool

hcip--mpls

Synchronized solves problems caused by sharing

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

Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center

Sort according to a number in a string in a column of CSV file

IP lab, the first weekly recheck

Hungry for 4 years + Ali for 2 years: some conclusions and Thoughts on the road of research and development

ESP系列引脚说明图汇总

Online yaml to CSV tool
随机推荐
2. File operation - write
Leetcode question brushing (5.31) string
Deep learning: derivation of shallow neural networks and deep neural networks
ESP系列引脚说明图汇总
ESP系列引脚說明圖匯總
VMware 虚拟化集群
Remote storage access authorization
根据csv文件某一列字符串中某个数字排序
Online yaml to CSV tool
Migrate data from CSV files to tidb
JS select all and tab bar switching, simple comments
从 CSV 文件迁移数据到 TiDB
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
LDAP Application Section (4) Jenkins Access
Upgrade tidb operator
Restore backup data on S3 compatible storage with tidb lightning
vulnhub hackme: 1
指针和数组笔试题解析
logback1.3. X configuration details and Practice
Day29-t77 & t1726-2022-02-13-don't answer by yourself