SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CHapticsBase.hpp
1 /* This file is part of scl, a control and simulation library
2  for robots and biomechanical models.
3 
4  scl is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 3 of the License, or (at your option) any later version.
8 
9  Alternatively, you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of
12  the License, or (at your option) any later version.
13 
14  scl is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License and a copy of the GNU General Public License along with
21  scl. If not, see <http://www.gnu.org/licenses/>.
22  */
23 /* \file CHapticsBase.hpp
24  *
25  * Created on: Oct 23, 2012
26  *
27  * Copyright (C) 2012
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CHAPTICSBASE_HPP_
33 #define CHAPTICSBASE_HPP_
34 
35 //For interfacing with chai
36 #include <scl/data_structs/SObject.hpp>
37 #include <scl/DataTypes.hpp>
38 #include <Eigen/Core>
39 
40 #include <vector>
41 #include <string>
42 
43 namespace scl
44 {
51  class CHapticsBase : public SObject
52  {
53  public:
55  CHapticsBase() : SObject("CHapticsBase") {}
56 
58  virtual ~CHapticsBase(){}
59 
60  /* ********************************************************
61  * HAPTIC FUNCTIONS
62  * ******************************************************** */
68  virtual scl::sInt connectToDevices()=0;
69 
73  virtual scl::sBool getHapticDevicePosition(const sUInt arg_id, Eigen::VectorXd& ret_pos_vec) const =0;
74 
78  virtual scl::sBool getAllHapticDevicePositions(std::vector<Eigen::VectorXd>& ret_pos_vec) const =0;
79 
81  virtual scl::sBool setHapticDeviceActuator(const sUInt arg_id, const Eigen::VectorXd& arg_cmd_vec)=0;
82 
84  virtual scl::sBool setAllHapticDeviceActuators(const std::vector<Eigen::VectorXd>& arg_cmd_vec)=0;
85 
86  /* Close the connections to the haptic devices */
87  virtual scl::sBool closeConnectionToDevices()=0;
88 
90  virtual scl::sUInt getNumDevicesConnected()=0;
91  };
92 }
93 
94 #endif /* CHAPTICSBASE_HPP_ */
95 
Definition: CHapticsBase.hpp:51
virtual scl::sBool getHapticDevicePosition(const sUInt arg_id, Eigen::VectorXd &ret_pos_vec) const =0
virtual scl::sBool setHapticDeviceActuator(const sUInt arg_id, const Eigen::VectorXd &arg_cmd_vec)=0
virtual scl::sUInt getNumDevicesConnected()=0
CHapticsBase()
Definition: CHapticsBase.hpp:55
virtual ~CHapticsBase()
Definition: CHapticsBase.hpp:58
virtual scl::sBool getAllHapticDevicePositions(std::vector< Eigen::VectorXd > &ret_pos_vec) const =0
bool sBool
Definition: DataTypes.hpp:54
virtual scl::sInt connectToDevices()=0
int sInt
Definition: DataTypes.hpp:64
virtual scl::sBool setAllHapticDeviceActuators(const std::vector< Eigen::VectorXd > &arg_cmd_vec)=0
Definition: SObject.hpp:43