dynamixel_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_DYNAMIXEL_CONTROLLER_H
20 #define OPEN_MANIPULATOR_DYNAMIXEL_CONTROLLER_H
21 
22 #include <ros/ros.h>
23 
24 #include <vector>
25 #include <string>
26 
28 #include <sensor_msgs/JointState.h>
29 
30 namespace dynamixel
31 {
32 #define ITERATION_FREQUENCY (25)
33 #define JOINT_NUM 4
34 #define GRIPPER_NUM 1
35 #define DXL_NUM 5
36 #define PALM_NUM 2
37 
39 {
40  private:
41  // ROS NodeHandle
44 
45  // ROS Parameters
46 
47  // ROS Topic Publisher
49 
50  // ROS Topic Subscriber
53 
54  // ROS Service Server
55 
56  // ROS Service Client
57 
58  // Dynamixel Workbench Parameters
59  std::string robot_name_;
61 
64 
65  std::vector<uint8_t> joint_id_;
66  std::vector<uint8_t> gripper_id_;
67 
68  std::string joint_mode_;
69  std::string gripper_mode_;
70 
71  public:
74  bool control_loop();
75 
76  private:
77  void initMsg();
78 
79  void initPublisher();
80  void initSubscriber();
81  void getDynamixelInst();
82  void setOperatingMode();
83  void setSyncFunction();
84  void readPosition(double *value);
85  void readVelocity(double *value);
86  void updateJointStates();
87 
88  void goalJointPositionCallback(const sensor_msgs::JointState::ConstPtr &msg);
89  void goalGripperPositionCallback(const sensor_msgs::JointState::ConstPtr &msg);
90 };
91 }
92 
93 #endif //OPEN_MANIPULATOR_DYNAMIXEL_CONTROLLER_H
std::vector< uint8_t > joint_id_
void goalGripperPositionCallback(const sensor_msgs::JointState::ConstPtr &msg)
DynamixelWorkbench * joint_controller_
std::vector< uint8_t > gripper_id_
DynamixelWorkbench * gripper_controller_
void goalJointPositionCallback(const sensor_msgs::JointState::ConstPtr &msg)


open_manipulator_dynamixel_ctrl
Author(s): Darby Lim
autogenerated on Sat Jun 2 2018 02:43:30