当前位置:网站首页>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。
边栏推荐
- 【MySQL】数据库的存储过程与存储函数通关教程(完整版)
- Colorlog结合logging打印有颜色的日志
- 2. File operation - write
- Restore backup data on S3 compatible storage with tidb lightning
- C language custom type: struct
- Summary of MySQL index failure scenarios
- IOT -- interpreting the four tier architecture of the Internet of things
- 【MySQL】鎖
- Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
- 使用 BR 恢复 S3 兼容存储上的备份数据
猜你喜欢
The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
Wincc7.5 download and installation tutorial (win10 system)
C语言自定义类型:结构体
[MySQL] log
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached
2022.02.13 - 238. Maximum number of "balloons"
Leetcode question brushing (5.28) hash table
Beijing invitation media
你想知道的ArrayList知识都在这
指针进阶---指针数组,数组指针
随机推荐
【MySQL】鎖
Nacos Development Manual
指针进阶---指针数组,数组指针
Résumé des diagrammes de description des broches de la série ESP
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
指针和数组笔试题解析
CISP-PTE实操练习讲解
Wincc7.5 download and installation tutorial (win10 system)
【云原生】手把手教你搭建ferry开源工单系统
Make learning pointer easier (3)
Ruffian Heng embedded bimonthly, issue 49
Asia Pacific Financial Media | art cube of "designer universe": Guangzhou community designers achieve "great improvement" in urban quality | observation of stable strategy industry fund
Yyds dry goods inventory three JS source code interpretation eventdispatcher
Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform
leetcode刷题 (5.28) 哈希表
Migrate data from CSV files to tidb
ESP系列引脚说明图汇总
wincc7.5下载安装教程(Win10系统)
MFC sends left click, double click, and right click messages to list controls
Golang DNS write casually