arm_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_ARM_CONTROLLER_H
20 #define OPEN_MANIPULATOR_ARM_CONTROLLER_H
21 
22 #include <ros/ros.h>
23 
27 
31 
32 #include <moveit_msgs/DisplayTrajectory.h>
33 
34 #include <vector>
35 
36 #include <std_msgs/Float64.h>
37 #include <std_msgs/String.h>
38 
39 #include <sensor_msgs/JointState.h>
40 #include <geometry_msgs/PoseStamped.h>
41 
42 #include "open_manipulator_msgs/State.h"
43 
44 #include "open_manipulator_msgs/GetJointPosition.h"
45 #include "open_manipulator_msgs/GetKinematicsPose.h"
46 
47 #include "open_manipulator_msgs/SetJointPosition.h"
48 #include "open_manipulator_msgs/SetKinematicsPose.h"
49 
50 #include <eigen3/Eigen/Eigen>
51 
53 {
54 #define ITERATION_FREQUENCY 25 //Hz
55 #define JOINT_NUM 4
56 
57 typedef struct
58 {
59  uint8_t group;
60  uint16_t waypoints; // planned number of via-points
61  Eigen::MatrixXd planned_path_positions; // planned position trajectory
63 
65 {
66  private:
67  // ROS NodeHandle
70 
71  // ROS Parameters
73  std::string robot_name_;
76 
77  // ROS Publisher
81 
82  // ROS Subscribers
84 
85  // ROS Service Server
90 
91  // ROS Service Client
92 
93  // MoveIt! interface
96 
97  // Process state variables
98  bool is_moving_;
99  uint16_t all_time_steps_;
100 
101  public:
102  ArmController();
103  virtual ~ArmController();
104 
105  void process(void);
106 
107  private:
108  void initPublisher(bool using_gazebo);
109  void initSubscriber(bool using_gazebo);
110 
111  void initServer();
112 
113  void initJointPosition();
114 
115  bool calcPlannedPath(open_manipulator_msgs::JointPosition msg);
116  bool calcPlannedPath(open_manipulator_msgs::KinematicsPose msg);
117 
118  void displayPlannedPathMsgCallback(const moveit_msgs::DisplayTrajectory::ConstPtr &msg);
119 
120  bool setJointPositionMsgCallback(open_manipulator_msgs::SetJointPosition::Request &req,
121  open_manipulator_msgs::SetJointPosition::Response &res);
122 
123  bool setKinematicsPoseMsgCallback(open_manipulator_msgs::SetKinematicsPose::Request &req,
124  open_manipulator_msgs::SetKinematicsPose::Response &res);
125 
126  bool getJointPositionMsgCallback(open_manipulator_msgs::GetJointPosition::Request &req,
127  open_manipulator_msgs::GetJointPosition::Response &res);
128 
129  bool getKinematicsPoseMsgCallback(open_manipulator_msgs::GetKinematicsPose::Request &req,
130  open_manipulator_msgs::GetKinematicsPose::Response &res);
131 };
132 }
133 
134 #endif /*OPEN_MANIPULATOR_ARM_CONTROLLER_H*/
bool getJointPositionMsgCallback(open_manipulator_msgs::GetJointPosition::Request &req, open_manipulator_msgs::GetJointPosition::Response &res)
bool setKinematicsPoseMsgCallback(open_manipulator_msgs::SetKinematicsPose::Request &req, open_manipulator_msgs::SetKinematicsPose::Response &res)
ros::ServiceServer get_joint_position_server_
ros::Subscriber display_planned_path_sub_
void displayPlannedPathMsgCallback(const moveit_msgs::DisplayTrajectory::ConstPtr &msg)
void initPublisher(bool using_gazebo)
ros::Publisher gazebo_goal_joint_position_pub_[10]
ros::ServiceServer set_kinematics_pose_server_
ros::Publisher goal_joint_position_pub_
bool getKinematicsPoseMsgCallback(open_manipulator_msgs::GetKinematicsPose::Request &req, open_manipulator_msgs::GetKinematicsPose::Response &res)
ros::ServiceServer set_joint_position_server_
void initSubscriber(bool using_gazebo)
moveit::planning_interface::MoveGroupInterface * move_group
bool calcPlannedPath(open_manipulator_msgs::JointPosition msg)
bool setJointPositionMsgCallback(open_manipulator_msgs::SetJointPosition::Request &req, open_manipulator_msgs::SetJointPosition::Response &res)
ros::ServiceServer get_kinematics_pose_server_


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