heuristicus / spot_ros

ROS driver for controlling Boston Dynamics' Spot robot
https://heuristicus.github.io/spot_ros/
Other
273 stars 141 forks source link

Fix spam from pointcloud task when there is no EAP #109

Closed heuristicus closed 1 year ago

heuristicus commented 1 year ago

PR #64 included a pointcloud task to get clouds from the EAP, but if the EAP doesn't exist then this would cause some spam like

Update tasks failed with error: 'NoneType' object has no attribute 'get_point_cloud_async'
Update tasks failed with error: 'NoneType' object has no attribute 'get_point_cloud_async'
Update tasks failed with error: 'NoneType' object has no attribute 'get_point_cloud_async'
Update tasks failed with error: 'NoneType' object has no attribute 'get_point_cloud_async'
Update tasks failed with error: 'NoneType' object has no attribute 'get_point_cloud_async'

on every task update. This PR fixes that by checking if the point cloud client isn't none, and only creating the task and adding it to the list if it exists.

Also makes the warning on adding an image task more obvious about what task already existed in the list.

jeremysee2 commented 1 year ago

That looks good to me, I saw that logging too when my EAP was turned off.