peripherals  1.4.2
RoadNarrows Robotics Hardware Peripherals Package
MotRoboteq.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: RoadNarrows Robotics Peripherals
4 //
5 // Library: libmot
6 //
7 // File: roboteq.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2013-09-24 09:34:42 -0600 (Tue, 24 Sep 2013) $
12  * $Rev: 3323 $
13  *
14  * \brief Common Roboteq 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 #ifndef _MOT_ROBOTEQ_H
54 #define _MOT_ROBOTEQ_H
55 
56 #include <vector>
57 #include "rnr/rnrconfig.h"
58 #include "rnr/units.h"
59 #include "rnr/mot/Mot.h"
60 
61 namespace rnr
62 {
63  class MotRoboteq : public Mot
64  {
65  public:
66  MotRoboteq() : Mot()
67  {
68  m_fd=0;
69  m_ntimeout = 100000;
70  m_baudRate = 115200;
71  }
72 
73  MotRoboteq() : Mot()
74  {
75  }
76 
77 
78  virtual ~MotRoboteq()
79  {
80  close();
81  }
82 
83  int open(const std::string &devName, int baudRate);
84  int close();
85  int sendCommand(int fd, byte_t *buf, int nBytes, int timeout);
86  int recvResponse(int fd, byte_t *buf, int timeout);
87 
88  protected:
89  int m_fd;
90  int m_ntimeout;
91  int m_nbaudRate;
92  }
93 }
94 
95 
96 
97 #endif // _MOT_ROBOTEQ_H
int close()
Function closes serial communication with motor controller device.
Definition: Mot.h:63
int open(const std::string &devName, int baudRate)
Function opens serial communication with motor controller device.
RoadNarrows Robotics standard namespace.
Definition: HID.h:65
Common Motor Controller Interface.