Note: This tutorial assumes that you have completed the previous tutorials: diagnostics/Tutorials/Configuring Diagnostic Aggregators.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Modifying the Diagnostic Analyzers on a PR2

Description: This tutorial shows you how to modify the diagnostic analyzers on a PR2. This is useful for modified robots.

Tutorial Level:

Overview

The diagnostics system on the PR2 monitors the status and health of all PR2 components. The system verifies that all components are functioning normally, and alerts users to problems.

The PR2 diagnostics system uses a diagnostic_aggregator to collect and analyze the diagnostic data. The aggregated output is sent to the pr2_dashboard for viewing and analysis. The aggregator_node uses Analyzers to collect and processes the data. Modifying these analyzers allows the diagnostic_aggregator to process data from new sensors, or ignore missing components.

Default PR2 Configuration

When the PR2 is launched, the diagnostic analyzers are loaded from parameters in the diag_agg namespace. The default parameters are loaded in the file /etc/ros/robot.launch:

   1 <launch>
   2     <!-- Robot Description --> 
   3     <param name="robot_description" 
   4            textfile="/etc/ros/urdf/robot.xml" />
   5 
   6     <!-- Robot Analyzer --> 
   7     <rosparam command="load" 
   8               file="$(find pr2_bringup)/config/pr2_analyzers.yaml" 
   9               ns="diag_agg" />
  10 
  11     <!-- Robot bringup --> 
  12     <include file="$(find pr2_bringup)/pr2.launch" />
  13 
  14     <!-- Web ui --> 
  15     <include file="$(find webui)/webui.launch" />
  16 </launch> 

The file pr2_bringup/config/pr2_analyzers.yaml contains the parameters for the diagnostic analyzers.

Removing the Arms of a PR2

If you had a no-armed PR2, you can easily modify the parameters for the analyzers.

   1 <launch>
   2   <include file="$(find pr2_bringup)/config/pr2_analyzers.launch" />
   3 
   4   <!-- Uncomment the following line if the robot has no arms -->
   5   <include file="$(find pr2_bringup)/config/no_arms/pr2_analyzers_no_arms_diff.launch" />
   6 
   7 </launch>

Subtracting the Prosilica Camera

Now we'll assume our robot is missing the Prosilica camera. We want to remove it from the launch file so that it doesn't distract users from real problems.

Add this to the /etc/ros/robot.launch file:

<param name="diag_agg/analyzers/cameras/analyzers/prosilica/num_items" value="0" />

This tells the analyzer for the Prosilica driver to expect zero items, and ignore all input.

Adding an Extra Hokuyo

When adding an extra Hokuyo laser scanner to the PR2, we want it to show up in the diagnostics. Edit the /etc/ros/robot.launch file and add:

   1     <!-- Add Side Hokuyo -->
   2     <rosparam command="load" file="/etc/ros/diagnostics/side_hokuyo.yaml" ns="diag_agg" />

In the YAML file:

analyzers:
  lasers:
    analyzers:
      side_hk:
        type: GenericAnalyzer
        path: Side Hokuyo
        find_and_remove_prefix: side_hokuyo_node
        num_items: 2

These parameters will be inserted into the diag_agg/analyzers/... namespace, and add an extra analyzer for the Hokuyo scanner.

Wiki: pr2_robot/Tutorials/Modifying the Diagnostic Analyzers on a PR2 (last edited 2010-05-04 03:17:22 by KevinWatts)