笔者的场景是
嵌入式板和主机通信一开始正常,几秒后异常退出,程序中断
经过日志排查
[0m[ INFO] [1648798793.101583194]: Loading nodelet /camera/driver of type astra_camera/AstraDriverNodelet to manager camera_nodelet_manager with the following remappings:[0m [0m[ INFO] [1648798793.105607216]: /camera/depth -> /camera/depth[0m [0m[ INFO] [1648798793.105671488]: /camera/depth/image -> /camera/depth_registered/image_raw[0m [0m[ INFO] [1648798793.105706124]: /camera/depth_registered -> /camera/depth_registered[0m [0m[ INFO] [1648798793.105734979]: /camera/ir -> /camera/ir[0m [0m[ INFO] [1648798793.105775292]: /camera/rgb -> /camera/rgb[0m [0m[ INFO] [1648798793.105812167]: /camera/rgb/image -> /camera/rgb/image_raw[0m [0m[ INFO] [1648798793.112451231]: waitForService: Service [/camera/camera_nodelet_manager/load_nodelet] has not been advertised, waiting...[0m [0m[ INFO] [1648798793.181086281]: waitForService: Service [/camera/camera_nodelet_manager/load_nodelet] is now available.[0m [0m[ INFO] [1648798807.262441338]: Bond broken, exiting[0m
看到可能是话题服务接收不到导致,发布话题的节点一直不能获取。
但是在笔者的笔记本电脑上通信正常,而笔记本电脑与板子中有ROS_MASTER_URI和ROS_HOSTNAME在bash文件中有设置,且在/etc/hosts中有IP与主机名的映射。尝试仅仅设置ROS_MASTER_URI和ROS_HOSTNAME后仍未解决问题,然后在板子和主机两边的/etc/hosts进行映射后解决。
一直稳定,未异常退出
至于具体原因笔者也不明,但既然与笔记本通信无异常,并且日志中是服务获取不到,那只能首先考虑IP了。