当前位置:网站首页>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。
边栏推荐
- Yyds dry goods inventory three JS source code interpretation eventdispatcher
- LDAP應用篇(4)Jenkins接入
- The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
- Leetcode question brushing (5.31) string
- Use Alibaba icon in uniapp
- Résumé des diagrammes de description des broches de la série ESP
- vulnhub hackme: 1
- sys. argv
- "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
- From monomer structure to microservice architecture, introduction to microservices
猜你喜欢
Learn Arduino with examples
hcip--mpls
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
[research materials] 2021 Research Report on China's smart medical industry - Download attached
2. File operation - write
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
matplotlib. Widgets are easy to use
Understanding of law of large numbers and central limit theorem
What is the use of entering the critical point? How to realize STM32 single chip microcomputer?
Nft智能合约发行,盲盒,公开发售技术实战--拼图篇
随机推荐
Golang DNS write casually
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
【云原生】手把手教你搭建ferry开源工单系统
Nacos Development Manual
Image fusion -- challenges, opportunities and Countermeasures
2022.02.13 - 238. Maximum number of "balloons"
【MySQL】日志
Analysis of Top1 accuracy and top5 accuracy examples
LDAP Application Section (4) Jenkins Access
How to use information mechanism to realize process mutual exclusion, process synchronization and precursor relationship
tree树的精准查询
Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform
ESP系列引脚說明圖匯總
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
From monomer structure to microservice architecture, introduction to microservices
Ruffian Heng embedded bimonthly, issue 49
面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
TiDB备份与恢复简介
Migrate data from SQL files to tidb