I too have seen that we have not setup the obstacle detection to be good values so far. I have only done a little in this area so I will explain some pieces and you can perhaps try to set things for better detection.
I will assume that of course you have enabled the sonars in the /etc/ubiquity/robot.yaml file (I see we don’t explain this in our sonar setup page at bottom of https://learn.ubiquityrobotics.com/camera_sensors and will add this to doc improvement list that I continually work on over time.
You can see details on sonar option here: https://learn.ubiquityrobotics.com/sensors
It is best to setup RViz for sonar detection debug but if you cannot then be aware of the sonar ROS topics and monitor them to verify that the forward sonars are ‘seeing’ objects.
If you have current move_basic.cpp, which recently was updated, go into move_basic.cpp near line 700 to find this line:
double forwardObstacleThreshold = 1.5; // if distance < velocity times this we stop
What I found is it did not look far enough out so by the time the robot came upon an object that was very close and perhaps outside of the cone of detection for the forward sonar it was too late. Works for BIG objects but small ones had grief.
Next I will say that I am not convinced the two sonars that look 45 deg to right and left are considered for detection in current move_basic code well enough or perhaps at all so this must be investigated on our side. That means a single forward facing ‘cone of detection’ must see the object or we will not detect it.
Also very important for detection evaluation is to setup RViz so you can see the sonar’s as they detect things and do some static tests by placing objects in front and verify you are happy that the sonars are working.
Do you run Rviz on a laptop setup for ROS yet?