~vibhavp/ubuntu/saucy/urg/merge-from-debian

« back to all changes in this revision

Viewing changes to samples/cpp/parameterLines.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Albert Huang
  • Date: 2011-05-20 11:33:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520113303-u8niofzwzcea0osk
Tags: 0.8.12-1
* New upstream release (closes: #624987)
* Add debian/watch file
* Bump standards-version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \example parameterLines.cpp
 
3
 
 
4
  \brief Displays PP data
 
5
 
 
6
  \author Satofumi KAMIMURA
 
7
 
 
8
  $Id: parameterLines.cpp 1737 2010-03-06 07:15:19Z satofumi $
 
9
*/
 
10
 
 
11
#include "UrgDevice.h"
 
12
#include "RangeSensorParameter.h"
 
13
#include <cstdlib>
 
14
#include <cstdio>
 
15
 
 
16
using namespace qrk;
 
17
 
 
18
 
 
19
//! main
 
20
int main(int argc, char *argv[])
 
21
{
 
22
  // Change the port name appropriately
 
23
#ifdef WINDOWS_OS
 
24
  const char device[] = "COM3";
 
25
#else
 
26
  const char device[] = "/dev/ttyACM0";
 
27
#endif
 
28
 
 
29
  UrgDevice urg;
 
30
  if (! urg.connect(device)) {
 
31
    printf("UrgDevice::connect: %s\n", urg.what());
 
32
    exit(1);
 
33
  }
 
34
 
 
35
  // Display parameter information
 
36
  RangeSensorParameter parameters = urg.parameter();
 
37
  printf("model: %s\n", parameters.model.c_str());
 
38
  printf("distance_min: %ld\n", parameters.distance_min);
 
39
  printf("distance_max: %ld\n", parameters.distance_max);
 
40
  printf("area_total: %d\n", parameters.area_total);
 
41
  printf("area_min: %d\n", parameters.area_min);
 
42
  printf("area_max: %d\n", parameters.area_max);
 
43
  printf("area_front: %d\n", parameters.area_front);
 
44
  printf("scan_rpm: %d\n", parameters.scan_rpm);
 
45
 
 
46
#ifdef MSC
 
47
  getchar();
 
48
#endif
 
49
 
 
50
  return 0;
 
51
}