当前位置:网站首页>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进行多个话题同步时,需要注意以下三个位置数据类型一致(这次报错就是下面图片中第四行的数据类型没有改为新的)


边栏推荐
- Fast pace? high pressure? VR panoramic Inn brings you a comfortable life
- Use coordinatorlayout+appbarlayout+collapsingtoolbarlayout to create a collapsed status bar
- Eye gaze estimation using webcam
- Usage of ViewModel and livedata in jetpack
- The third generation of power electronics semiconductors: SiC MOSFET learning notes (V) research on driving power supply
- Go crawler framework -colly actual combat (III) -- panoramic cartoon picture capture and download
- Design scheme of authority management of fusion model
- 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
- 软件测试与游戏测试文章合集录
- VNC viewer remote connection raspberry pie without display
猜你喜欢

JPA learning 1 - overview, JPA, JPA core annotations, JPA core objects

Use of JMeter easynmon
[distributed system design profile (2)] kV raft

Go crawler framework -colly actual combat (II) -- Douban top250 crawling

Dynamic effect of canvas lines

Unimportant tokens can be stopped in advance! NVIDIA proposes an efficient visual transformer network a-vit with adaptive token to improve the throughput of the model

How to delete the entire row with duplicate items in a column of WPS table

Go crawler framework -colly actual combat (4) -- Zhihu answer crawl (2) -- visual word cloud
![[leaderboard] Carla leaderboard leaderboard leaderboard operation and participation in hands-on teaching](/img/bd/b176e93ee6fa2125f021bcad3025c2.png)
[leaderboard] Carla leaderboard leaderboard leaderboard operation and participation in hands-on teaching

Canvas spiral style animation JS special effect
随机推荐
软件测试与游戏测试文章合集录
D does not require opapply() as a domain
What are the advantages of VR panoramic production? Why is it favored?
Color gradient gradient color collection
Registration method of native method in JNI
Wx applet jump page
Alternative to log4j
The new employee of the Department after 00 is really a champion. He has worked for less than two years. The starting salary of 18K is close to me when he changes to our company
[Solved] Public key for mysql-community-xxx. rpm is not installed
im即时通讯开发应用保活之进程防杀
Requests Library
Microsoft won the title of "leader" in the magic quadrant of Gartner industrial Internet of things platform again!
Human body transformation vs digital Avatar
Meta&伯克利基于池化自注意力机制提出通用多尺度视觉Transformer,在ImageNet分类准确率达88.8%!开源...
December 6, 2019 what happens after the browser enters a URL
【面试题】instancof和getClass()的区别
Outer screen and widescreen wasted? Harmonyos folding screen design specification teaches you to use it
[proteus simulation] example of using timer 0 as a 16 bit counter
[figure database performance and scenario test sharp tool ldbc SNB] series I: introduction to data generator & Application to ges service
Paper review: U2 net, u-net composed of u-net