Katana.h
Go to the documentation of this file.
1 /*
2  * UOS-ROS packages - Robot Operating System code by the University of Osnabrück
3  * Copyright (C) 2010 University of Osnabrück
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * Katana.h
20  *
21  * Created on: 06.12.2010
22  * Author: Martin Günther <mguenthe@uos.de>
23  */
24 
25 #ifndef KATANA_H_
26 #define KATANA_H_
27 
28 #include <ros/ros.h>
29 #include <std_srvs/Empty.h>
30 #include <boost/thread/recursive_mutex.hpp>
31 #include <boost/thread.hpp>
32 
33 #include <kniBase.h>
34 
36 #include <katana/AbstractKatana.h>
37 #include <katana/KNIConverter.h>
38 
39 namespace katana
40 {
41 
48 class Katana : public AbstractKatana
49 {
50 public:
51  Katana();
52  virtual ~Katana();
53 
54  void refreshEncoders();
55 
57  boost::function<bool()> isPreemptRequested);
58 
59  virtual void freezeRobot();
60  virtual bool moveJoint(int jointIndex, double turningAngle);
61 
62  virtual void refreshMotorStatus();
63  virtual bool someMotorCrashed();
64  virtual bool allJointsReady();
65  virtual bool allMotorsReady();
66 
67  virtual void setLimits(void);
68  virtual void testSpeed();
69 
70 protected:
72  boost::recursive_mutex kni_mutex;
73  std::vector<TMotStsFlg> motor_status_;
74 
76 
77  short round(const double x);
78 
79 private:
83 
86 
88 
89  void calibrate();
90 
91  bool switchMotorsOff(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response);
92  bool switchMotorsOn(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response);
93  bool testSpeedSrv(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response);
94 };
95 
96 }
97 
98 #endif /* KATANA_H_ */
virtual bool executeTrajectory(boost::shared_ptr< SpecifiedTrajectory > traj, boost::function< bool()> isPreemptRequested)
Definition: Katana.cpp:286
ros::ServiceServer switch_motors_off_srv_
Definition: Katana.h:80
KNIConverter * converter
Definition: Katana.h:75
virtual void freezeRobot()
Definition: Katana.cpp:454
boost::recursive_mutex kni_mutex
Definition: Katana.h:72
virtual void refreshMotorStatus()
Definition: Katana.cpp:228
virtual ~Katana()
Definition: Katana.cpp:133
ros::ServiceServer switch_motors_on_srv_
Definition: Katana.h:81
CCdlBase * device
Definition: Katana.h:85
virtual void setLimits(void)
Definition: Katana.cpp:145
CCplSerialCRC * protocol
Definition: Katana.h:84
ros::Time last_encoder_update_
Definition: Katana.h:87
void refreshEncoders()
Definition: Katana.cpp:155
std::vector< TMotStsFlg > motor_status_
Definition: Katana.h:73
bool switchMotorsOn(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response)
Definition: Katana.cpp:592
virtual void testSpeed()
Definition: Katana.cpp:606
ros::ServiceServer test_speed_srv_
Definition: Katana.h:82
bool switchMotorsOff(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response)
Definition: Katana.cpp:584
boost::shared_ptr< CLMBase > kni
Definition: Katana.h:71
virtual bool moveJoint(int jointIndex, double turningAngle)
Definition: Katana.cpp:461
Wrapper class around the KNI (Katana Native Library).
Definition: Katana.h:48
virtual bool allMotorsReady()
Definition: Katana.cpp:516
virtual bool allJointsReady()
Definition: Katana.cpp:505
virtual bool someMotorCrashed()
Definition: Katana.cpp:494
bool testSpeedSrv(std_srvs::Empty::Request &request, std_srvs::Empty::Response &response)
Definition: Katana.cpp:600
short round(const double x)
Definition: Katana.cpp:532
void calibrate()
Definition: Katana.cpp:540


katana
Author(s): Martin Günther
autogenerated on Fri Jun 7 2019 22:06:58