kuka_hardware_interface.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2014 Norwegian University of Science and Technology
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the Norwegian University of Science and
18  * Technology, nor the names of its contributors may be used to
19  * endorse or promote products derived from this software without
20  * specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 
36 /*
37  * Author: Lars Tingelstad
38  */
39 
40 #ifndef KUKA_RSI_HARDWARE_INTERFACE_KUKA_HARDWARE_INTERFACE_
41 #define KUKA_RSI_HARDWARE_INTERFACE_KUKA_HARDWARE_INTERFACE_
42 
43 // STL
44 #include <vector>
45 #include <string>
46 
47 // ROS
48 #include <ros/ros.h>
49 #include <std_msgs/String.h>
50 
51 
52 // ros_control
58 
59 // Timers
60 #include <chrono>
61 
62 // UDP server
64 
65 // RSI
68 
70 {
71 
72 static const double RAD2DEG = 57.295779513082323;
73 static const double DEG2RAD = 0.017453292519943295;
74 
76 {
77 
78 private:
79 
80  // ROS node handle
82 
83  unsigned int n_dof_;
84 
85  std::vector<std::string> joint_names_;
86 
87  std::vector<double> joint_position_;
88  std::vector<double> joint_velocity_;
89  std::vector<double> joint_effort_;
90  std::vector<double> joint_position_command_;
91  std::vector<double> joint_velocity_command_;
92  std::vector<double> joint_effort_command_;
93 
94  // RSI
97  std::vector<double> rsi_initial_joint_positions_;
98  std::vector<double> rsi_joint_position_corrections_;
99  unsigned long long ipoc_;
100 
101  std::unique_ptr<realtime_tools::RealtimePublisher<std_msgs::String> > rt_rsi_pub_;
102 
103  std::unique_ptr<UDPServer> server_;
104  std::string local_host_;
106  std::string remote_host_;
107  std::string remote_port_;
108  std::string in_buffer_;
109  std::string out_buffer_;
110 
111  // Timing
114  double loop_hz_;
115 
116  // Interfaces
119 
120 public:
121 
124 
125  void start();
126  void configure();
127  bool read(const ros::Time time, const ros::Duration period);
128  bool write(const ros::Time time, const ros::Duration period);
129 
130 };
131 
132 } // namespace kuka_rsi_hw_interface
133 
134 #endif
static const double DEG2RAD
static const double RAD2DEG
hardware_interface::PositionJointInterface position_joint_interface_
std::unique_ptr< realtime_tools::RealtimePublisher< std_msgs::String > > rt_rsi_pub_
hardware_interface::JointStateInterface joint_state_interface_
bool read(const ros::Time time, const ros::Duration period)
bool write(const ros::Time time, const ros::Duration period)


kuka_rsi_hw_interface
Author(s): Lars Tingelstad
autogenerated on Tue Oct 15 2019 03:33:54