gripper_controller.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2016 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: Taehun Lim (Darby) */
18 
19 #ifndef OPEN_MANIPULATOR_GRIPPER_CONTROLLER_H
20 #define OPEN_MANIPULATOR_GRIPPER_CONTROLLER_H
21 
22 #include <ros/ros.h>
23 
27 
28 #include <moveit_msgs/DisplayTrajectory.h>
29 
30 #include <vector>
31 
32 #include <std_msgs/Float64.h>
33 #include <std_msgs/String.h>
34 
35 #include <sensor_msgs/JointState.h>
36 
37 #include "open_manipulator_msgs/SetJointPosition.h"
38 #include "open_manipulator_msgs/State.h"
39 
40 #include <eigen3/Eigen/Eigen>
41 
42 namespace open_manipulator
43 {
44 #define LEFT_PALM 0
45 #define RIGHT_PALM 1
46 
47 #define ITERATION_FREQUENCY 25 //Hz
48 
49 #define GRIP_ON 0.01 // mm
50 #define GRIP_OFF -0.01
51 #define NEUTRAL 0.0
52 
53 typedef struct
54 {
55  uint16_t waypoints; // planned number of via-points
56  Eigen::MatrixXd planned_path_positions; // planned position trajectory
57 } PlannedPathInfo;
58 
60 {
61  private:
62  // ROS NodeHandle
65 
66  // ROS Parameters
68  std::string robot_name_;
69  int palm_num_;
71 
72  // ROS Publisher
76 
77  // ROS Subscribers
80 
81  // ROS Service Server
83 
84  // ROS Service Client
85 
86  // MoveIt! interface
89 
90  // Process state variables
91  bool is_moving_;
92  uint16_t all_time_steps_;
93 
94  public:
96  virtual ~GripperController();
97 
98  void process(void);
99 
100  private:
101  void initPublisher(bool using_gazebo);
102  void initSubscriber(bool using_gazebo);
103 
104  void initServer();
105 
106  bool calcPlannedPath(open_manipulator_msgs::JointPosition msg);
107 
108  void displayPlannedPathMsgCallback(const moveit_msgs::DisplayTrajectory::ConstPtr &msg);
109 
110  bool setGripperPositionMsgCallback(open_manipulator_msgs::SetJointPosition::Request &req,
111  open_manipulator_msgs::SetJointPosition::Response &res);
112 
113  void gripperOnOffMsgCallback(const std_msgs::String::ConstPtr &msg);
114 };
115 }
116 
117 #endif /*OPEN_MANIPULATOR_GRIPPER_CONTROLLER_H*/
bool calcPlannedPath(open_manipulator_msgs::JointPosition msg)
moveit::planning_interface::MoveGroupInterface * move_group
bool setGripperPositionMsgCallback(open_manipulator_msgs::SetJointPosition::Request &req, open_manipulator_msgs::SetJointPosition::Response &res)
void gripperOnOffMsgCallback(const std_msgs::String::ConstPtr &msg)
ros::ServiceServer set_gripper_position_server_
void displayPlannedPathMsgCallback(const moveit_msgs::DisplayTrajectory::ConstPtr &msg)


open_manipulator_position_ctrl
Author(s): Darby Lim
autogenerated on Sat Jun 2 2018 02:43:38