From sdk-wiki
Jump to: navigation, search

Head Sonar Control

Around the head is a ring of 12 sonar sensors for detecting movements within Baxter's proximity. Next to each sonar sensor are yellow LEDs, which by default indicate when the corresponding sensors detect an object within a certain threshold. You can control the sonar sensors and lights to override the default behavior and either disable or enable each of the 12 channels.

Basic Usage

To Turn Off the sonar sensors:

    $ rostopic pub /robot/sonar/head_sonar/set_sonars_enabled std_msgs/UInt16 0

Sonar Behaviors

The sonars and the sonar lights display a few different behaviors.

  • During Boot-up Behvaior: The yellow lights will 'spin' in a ring around the head.
  • Default Run Behavior: The lights near each sensor will respond to objects detected by the sensor.
  • Disabled Sonars Behavior: The lights will not respond to motion, and will remain off.


# Check state of enable flags, listen to confirm annoying clicking sound
$ rostopic echo -n1 /robot/sonar/head_sonar/sonars_enabled 
data: 4095

# Turn off enable flags for all sonar channels
$ rostopic pub /robot/sonar/head_sonar/set_sonars_enabled std_msgs/UInt16 0
# Listen for peaceful silence; confirm enable flags state is 0
$ rostopic echo -n1 /robot/sonar/head_sonar/sonars_enabled 
data: 0

# Turn back on enable flags for all sonar channels
$ rostopic pub /robot/sonar/head_sonar/set_sonars_enabled std_msgs/UInt16 4095
# Listen, wave hand to activate sonar, confirm enable state
$ rostopic echo -n1 /robot/sonar/head_sonar/sonars_enabled 
data: 4095


Nothing happens when you publish to disable the sonars.

Make sure your ROS_IP or ROS_HOSTNAME is exported and resolvable to the robot.

Make sure that your network connection is configured allowing you to make commands to the robot: Connecting and Testing the Development Workstation

In particular that your ROS_HOSTNAME is resolvable to the robot, or alternatively setting your ROS_IP to your current ip address (make sure that your ROS_HOSTNAME is not set when using this approach):