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.

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