To install sonars,

sudo apt update
sudo apt upgrade
sudo apt install ros-kinetic-pi-sonar`

Then, to enable the sensors, edit the file /etc/ubiquity/robot.yaml so that

sonars: 'pi_sonar_v1' is uncommented and sonars: None is commented.

Like so:

# Robot Configuration
#sonars: None
sonars: 'pi_sonar_v1'


The sonar node publishes a sensor_msgs/Range message for each sonar reading. Rviz can visualize these messages as cones. There are launch files to do this in: (the source package, not the binary packages)

The move_basic node uses these messages to determine proximity to obstacles. publishes a 2D visualization of the sonar.

Topic Direction
/pi_sonar/sonar_0 Far right
/pi_sonar/sonar_1 45 degrees to the left
/pi_sonar/sonar_2 45 degrees to the right
/pi_sonar/sonar_3 Front
/pi_sonar/sonar_4 Far left

back- - - - - - - - - - up