/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : lcSubscriber.cc                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include <stdio.h>
#include "LayeredControlIF.h"


int main(int argc, char **argv)
{
  LayeredControlIF *layeredControl = 
    new LayeredControlIF("layeredControl");

  // Subscribe to OutputGenerated events
  layeredControl->subscribe(LayeredControlIF::OutputGenerated);

  while (True) {

    // Wait for event
    printf("Wait for event:\n");
    layeredControl->waitForEvent();

    LayeredControlIF::OutputCommand command;

    layeredControl->getCommand(&command);

    printf("Depth mode: %d\n", command.depthMode);
    printf("Depth: %.3f\n", command.depth);
    printf("Heading mode: %d\n", command.headingMode);
    printf("Heading: %.3f\n", command.heading);
    printf("Speed mode: %d\n", command.speedMode);
    printf("Speed: %.3f\n", command.speed);
  }

  return 0;
}


