STM32和ROS串口通信常见问题汇总答疑
大家好,我是白茶清欢,最近看了博客文章《stm32和ros的串口通信》有很多问题的评论,这里汇总回复一下。
问题1:运行时报错如下:
rosrun topic_example publish_node
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): open: No such file or directory
已放弃 (核心已转储)
或者下面这个:
Error: system:5
请检查您的串口/dev/ttyUSB0,是否已经准备好:
1.读写权限是否打开(默认不打开)
2.串口名称是否正确
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): write: Bad file descriptor
已放弃 (核心已转储)
回答:
该问题大概有三种可能的原因:
**原因一:**串口连接所使用的的线材质量过差,甚至没有数据线。
主要现象:识别不到端口
ls -l