当前位置:网站首页>ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
2022-06-24 19:51:00 【biter0088】
报错:
error: invalid initialization of reference of type ‘const boost::shared_ptr<const
sensor_driver_msgs::GpswithHeading_<std::allocator<void> > >&’ from expression of type
‘const boost::shared_ptr<const sensor_msgs::NavSatFix_<std::allocator<void> > >’

报错原因:
使用const sensor_msgs::NavSatFix类型来初始化sensor_driver_msgs::GpswithHeading类型数据,这是改代码时马虎造成的。
教训:
(1)有些看起来像c++、python等语言语法报错的,可能只是自己代码写/改错了,不要急着去找语法错误,先硬着头皮看报错
(2)在ros中使用message_filters进行多个话题同步时,需要注意以下三个位置数据类型一致(这次报错就是下面图片中第四行的数据类型没有改为新的)


边栏推荐
- Ten commandments of self-learning in machine learning
- Im instant messaging development application keeping alive process anti kill
- C# Winform 最大化遮挡任务栏和全屏显示问题
- I suddenly find that the request dependent package in NPM has been discarded. What should I do?
- How can I persuade leaders to use DDD to construct the liver project?
- Ott marketing is booming. How should businesses invest?
- 【排行榜】Carla leaderboard 排行榜 运行与参与手把手教学
- MySQL log management
- Scrollview height cannot fill full screen
- Report on operation pattern and future prospect of global and Chinese propyl isovalerate industry from 2022 to 2028
猜你喜欢

Canvas spiral style animation JS special effect

技术分享| WVP+ZLMediaKit实现摄像头GB28181推流播放

Registration method of native method in JNI

微搭低代码中实现增删改查

On the difficulty of developing large im instant messaging system

Opengauss kernel: simple query execution

2019 summary and 2020 outlook

The third generation of power electronics semiconductors: SiC MOSFET learning notes (V) research on driving power supply

A small program written this week

Do280openshift access control -- encryption and configmap
随机推荐
Meta&伯克利基于池化自注意力机制提出通用多尺度视觉Transformer,在ImageNet分类准确率达88.8%!开源...
C# Winform 最大化遮挡任务栏和全屏显示问题
The drawableleft of the custom textview in kotlin is displayed in the center together with the text
Paint rounded rectangle
iNFTnews | 国内NFT发展仅限于数字藏品吗?
Meta & Berkeley proposed a universal multi-scale visual transformer based on pooled self attention mechanism. The classification accuracy in Imagenet reached 88.8%! Open source
How to use promise Race() and promise any() ?
Do280openshift access control -- encryption and configmap
Hibernate learning 2 - lazy loading (delayed loading), dynamic SQL parameters, caching
Wx applet jump page
Simple collation of Web cache
Encryption and encoding resolution
Related operations of ansible and Playbook
Zed acquisition
Microsoft won the title of "leader" in the magic quadrant of Gartner industrial Internet of things platform again!
OTT营销之风正盛,商家到底该怎么投?
Analysis report on operation pattern and supply and demand situation of global and Chinese cyano ketoprofen industry from 2022 to 2028
What is test development? Can you find a job at this stage?
More pictures | explain the Nacos parameters in detail!
D does not require opapply() as a domain