peripherals  1.4.2
RoadNarrows Robotics Hardware Peripherals Package
MotDummy.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: RoadNarrows Robotics Peripherals
4 //
5 // Library: libmot
6 //
7 // File: MotDummy.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2013-02-13 16:41:34 -0700 (Wed, 13 Feb 2013) $
12  * $Rev: 2683 $
13  *
14  * \brief Dummy Motor Controller Interface.
15  *
16  * \author: Robin Knight (robin.knight@roadnarrows.com)
17  * \author: Daniel Packard (daniel@roadnarrows.com)
18  * \author: Jessica Trujillo (jessica@roadnarrows.com)
19  * \author: Maurice Woods III (maurice@roadnarrows.com)
20  *
21  * \copyright
22  * \h_copy 2012-2017. RoadNarrows LLC.\n
23  * http://www.roadnarrows.com\n
24  * All Rights Reserved
25  */
26 // Permission is hereby granted, without written agreement and without
27 // license or royalty fees, to use, copy, modify, and distribute this
28 // software and its documentation for any purpose, provided that
29 // (1) The above copyright notice and the following two paragraphs
30 // appear in all copies of the source code and (2) redistributions
31 // including binaries reproduces these notices in the supporting
32 // documentation. Substantial modifications to this software may be
33 // copyrighted by their authors and need not follow the licensing terms
34 // described here, provided that the new terms are clearly indicated in
35 // all files where they apply.
36 //
37 // IN NO EVENT SHALL THE AUTHOR, ROADNARROWS LLC, OR ANY MEMBERS/EMPLOYEES
38 // OF ROADNARROW LLC OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
39 // PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
40 // DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
41 // EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
42 // THE POSSIBILITY OF SUCH DAMAGE.
43 //
44 // THE AUTHOR AND ROADNARROWS LLC SPECIFICALLY DISCLAIM ANY WARRANTIES,
45 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
46 // FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
47 // "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
48 // PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
49 //
50 ////////////////////////////////////////////////////////////////////////////////
51 
52 
53 
54 #ifndef _MOTDUMMY_H
55 #define _MOTDUMMY_H
56 #include "rnr/mot/Mot.h"
57 #define MOTDUMMY_NUM_OUTPUTS 2
58 namespace rnr
59 {
60  class MotDummy : Mot
61  {
62  public:
63  MotDummy()
64  {
65  m_nMinSpeed = -255;
66  m_nMaxSpeed = 255;
67  m_nSpeedStepSize = 1;
68  m_nMinBrake = 0;
69  m_nMaxBrake = 31;
70  m_nBrakeStepSize = 1;
71  }
72 
73  int setSpeed( int id, int speed);
74  int getAttrSpeed(int *minSpeed , int *maxSpeed,int *stepSize);
75  int setBrake(int id, int brake);
76  int getAttrBrake(int *minBrake, int *maxBrake, int *stepSizeBrake);
77  private:
78  int m_speed[MOTDUMMY_NUM_OUTPUTS];
79  int m_brake[MOTDUMMY_NUM_OUTPUTS];
80 
81  };
82 }
83 
84 #endif
85 
Definition: Mot.h:63
RoadNarrows Robotics standard namespace.
Definition: HID.h:65
Common Motor Controller Interface.