open_manipulator_p_teleop_joystick.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2019 ROBOTIS CO., LTD.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
17 /* Authors: Darby Lim, Hye-Jong KIM, Ryan Shim, Yong-Ho Na */
18 
19 #ifndef OPEN_MANIPULATOR_P_TELEOP_JOYSTICK_H_
20 #define OPEN_MANIPULATOR_P_TELEOP_JOYSTICK_H_
21 
22 #include <termios.h>
23 
24 #include <ros/ros.h>
25 #include <sensor_msgs/JointState.h>
26 #include <sensor_msgs/Joy.h>
27 
28 #include "open_manipulator_msgs/SetJointPosition.h"
29 #include "open_manipulator_msgs/SetKinematicsPose.h"
30 
31 #define PI 3.141592
32 #define NUM_OF_JOINT 6
33 #define DELTA 0.01
34 #define JOINT_DELTA 0.05
35 #define PATH_TIME 0.5
36 
38 {
39  public:
42 
43  private:
44  /*****************************************************************************
45  ** ROS NodeHandle
46  *****************************************************************************/
49 
50  /*****************************************************************************
51  ** ROS Parameters
52  *****************************************************************************/
54 
55  /*****************************************************************************
56  ** Variables
57  *****************************************************************************/
58  std::vector<double> present_joint_angle_;
59  std::vector<double> present_kinematic_position_;
60 
61  /*****************************************************************************
62  ** Init Functions
63  *****************************************************************************/
64  void initClient();
65  void initSubscriber();
66 
67  /*****************************************************************************
68  ** ROS Subscribers, Callback Functions and Relevant Functions
69  *****************************************************************************/
73 
74  void jointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg);
75  void kinematicsPoseCallback(const open_manipulator_msgs::KinematicsPose::ConstPtr &msg);
76  void joyCallback(const sensor_msgs::Joy::ConstPtr &msg);
77 
78  /*****************************************************************************
79  ** ROS Clients and Callback Functions
80  *****************************************************************************/
84 
85  bool setJointSpacePath(std::vector<std::string> joint_name, std::vector<double> joint_angle, double path_time);
86  bool setTaskSpacePathFromPresentPositionOnly(std::vector<double> kinematics_pose, double path_time);
87  bool setToolControl(std::vector<double> joint_angle);
88  void setGoal(const char *str);
89 };
90 
91 #endif // OPEN_MANIPULATOR_P_TELEOP_JOYSTICK_H_
void jointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg)
bool setTaskSpacePathFromPresentPositionOnly(std::vector< double > kinematics_pose, double path_time)
void kinematicsPoseCallback(const open_manipulator_msgs::KinematicsPose::ConstPtr &msg)
bool setJointSpacePath(std::vector< std::string > joint_name, std::vector< double > joint_angle, double path_time)
std::vector< double > present_kinematic_position_
ros::ServiceClient goal_task_space_path_from_present_position_only_client_
void joyCallback(const sensor_msgs::Joy::ConstPtr &msg)
bool setToolControl(std::vector< double > joint_angle)


open_manipulator_p_teleop
Author(s): Ryan Shim , Yong-Ho Na , Hye-Jong KIM
autogenerated on Thu Oct 22 2020 03:16:41