katana_teleop_key.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) 2011 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_teleop_key.h
20  *
21  * Created on: 13.04.2011
22  * Author: Henning Deeken <hdeeken@uos.de>
23  */
24 #ifndef KATANA_TELEOP_KEY_H__
25 #define KATANA_TELEOP_KEY_H__
26 
27 
28 #include <termios.h>
29 #include <signal.h>
30 #include <math.h>
31 #include <stdio.h>
32 #include <stdlib.h>
33 
34 #include <ros/ros.h>
35 #include <sensor_msgs/JointState.h>
36 #include <katana_msgs/JointMovementAction.h>
37 #include <control_msgs/GripperCommandAction.h>
38 
41 
43 typedef control_msgs::GripperCommandGoal GCG;
44 
45 #define KEYCODE_A 0x61
46 #define KEYCODE_D 0x64
47 #define KEYCODE_S 0x73
48 #define KEYCODE_W 0x77
49 
50 #define KEYCODE_R 0x72
51 #define KEYCODE_Q 0x71
52 #define KEYCODE_I 0x69
53 
54 #define KEYCODE_O 0x6F
55 #define KEYCODE_C 0x63
56 
57 #define KEYCODE_PLUS 0x2B
58 #define KEYCODE_NUMBER 0x23
59 #define KEYCODE_POINT 0x2E
60 #define KEYCODE_COMMA 0x2C
61 
62 #define KEYCODE_0 0x30
63 #define KEYCODE_1 0x31
64 #define KEYCODE_2 0x32
65 #define KEYCODE_3 0x33
66 #define KEYCODE_4 0x34
67 #define KEYCODE_5 0x35
68 #define KEYCODE_6 0x36
69 #define KEYCODE_7 0x37
70 #define KEYCODE_8 0x38
71 #define KEYCODE_9 0x39
72 
73 #define GRASP 1
74 #define RELEASE 2
75 
76 struct termios cooked, raw;
77 int kfd = 0;
79 
80 
81 namespace katana{
82 
84 {
85 
86  public:
88 
89  void jointStateCallback(const sensor_msgs::JointState::ConstPtr& js);
90  void keyboardLoop();
91 
93 
94  private:
95  bool matchJointGoalRequest(double increment);
96  void giveInfo();
97  bool send_gripper_action(int32_t goal_type);
98 
99  size_t jointIndex;
100  double increment;
103 
104  std::vector<std::string> joint_names_;
105  std::vector<std::string> gripper_joint_names_;
106  std::vector<std::string> combined_joints_;
107 
108  sensor_msgs::JointState movement_goal_;
109  sensor_msgs::JointState current_pose_;
110  sensor_msgs::JointState initial_pose_;
111 
115 };
116 }
117 
118 #endif /* KATANA_TELEOP_KEY_H__ */
bool send_gripper_action(int32_t goal_type)
std::vector< std::string > gripper_joint_names_
void jointStateCallback(const sensor_msgs::JointState::ConstPtr &js)
sensor_msgs::JointState current_pose_
control_msgs::GripperCommandGoal GCG
sensor_msgs::JointState initial_pose_
std::vector< std::string > combined_joints_
sensor_msgs::JointState movement_goal_
actionlib::SimpleActionClient< katana_msgs::JointMovementAction > JMAC
std::vector< std::string > joint_names_
actionlib::SimpleActionClient< control_msgs::GripperCommandAction > gripper_
struct termios cooked raw
bool matchJointGoalRequest(double increment)
int kfd
bool got_joint_states_


katana_teleop
Author(s): Henning Deeken
autogenerated on Fri Jan 3 2020 04:01:13