virtual_shadowhand_library.cpp
Go to the documentation of this file.
1 
28 #include <ros/ros.h>
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 namespace shadowrobot
34 {
35 
38  {
39  joints_map_mutex.lock();
40 
41  JointData tmpData;
42  JointData tmpDataZero;
43  JointControllerData tmpController;
44  tmpDataZero.isJointZero = 1;
45  tmpDataZero.max = 180.0;
46 
47  joints_map["FFJ0"] = tmpDataZero;
48  joints_map["FFJ1"] = tmpData;
49  joints_map["FFJ2"] = tmpData;
50  joints_map["FFJ3"] = tmpData;
51  tmpData.min = -20.0;
52  tmpData.max = 20.0;
53  joints_map["FFJ4"] = tmpData;
54 
55  joints_map["MFJ0"] = tmpDataZero;
56  tmpData.min = 0.0;
57  tmpData.max = 90.0;
58  joints_map["MFJ1"] = tmpData;
59  joints_map["MFJ2"] = tmpData;
60  joints_map["MFJ3"] = tmpData;
61  tmpData.min = -20.0;
62  tmpData.max = 20.0;
63  joints_map["MFJ4"] = tmpData;
64 
65  joints_map["RFJ0"] = tmpDataZero;
66  tmpData.min = 0.0;
67  tmpData.max = 90.0;
68  joints_map["RFJ1"] = tmpData;
69  joints_map["RFJ2"] = tmpData;
70  joints_map["RFJ3"] = tmpData;
71  tmpData.min = -20.0;
72  tmpData.max = 20.0;
73  joints_map["RFJ4"] = tmpData;
74 
75  joints_map["LFJ0"] = tmpDataZero;
76  tmpData.min = 0.0;
77  tmpData.max = 90.0;
78  joints_map["LFJ1"] = tmpData;
79  joints_map["LFJ2"] = tmpData;
80  joints_map["LFJ3"] = tmpData;
81  tmpData.min = -20.0;
82  tmpData.max = 20.0;
83  joints_map["LFJ4"] = tmpData;
84  tmpData.min = 0.0;
85  tmpData.max = 45.0;
86  joints_map["LFJ5"] = tmpData;
87 
88  tmpData.min = 0.0;
89  tmpData.max = 90.0;
90  joints_map["THJ1"] = tmpData;
91  tmpData.min = -40.0;
92  tmpData.max = 40.0;
93  joints_map["THJ2"] = tmpData;
94  tmpData.min = -15.0;
95  tmpData.max = 15.0;
96  joints_map["THJ3"] = tmpData;
97  tmpData.min = 0.0;
98  tmpData.max = 75.0;
99  joints_map["THJ4"] = tmpData;
100  tmpData.min = -60.0;
101  tmpData.max = 60.0;
102  joints_map["THJ5"] = tmpData;
103 
104  tmpData.min = -30.0;
105  tmpData.max = 45.0;
106  joints_map["WRJ1"] = tmpData;
107  tmpData.min = -30.0;
108  tmpData.max = 10.0;
109  joints_map["WRJ2"] = tmpData;
110 
111  joints_map_mutex.unlock();
112  }
113 
114  int16_t VirtualShadowhandLibrary::sendupdate(std::string joint_name, double target)
115  {
116  return (int16_t) 0;
117  }
118 
120  {
121  JointData tmp;
122  return tmp;
123  }
124 
125  std::map<std::string, JointData> VirtualShadowhandLibrary::getAllJointsData()
126  {
127  joints_map_mutex.lock();
128  JointsMap tmp_map = JointsMap(joints_map);
129  joints_map_mutex.unlock();
130  return tmp_map;
131  }
132 
133  int16_t VirtualShadowhandLibrary::setContrl(std::string contrlr_name, JointControllerData ctrlr_data)
134  {
135  return (int16_t) 0;
136  }
137 
139  {
141  return tmp;
142  }
143 
144  int16_t VirtualShadowhandLibrary::setConfig(std::vector<std::string> myConfig)
145  {
146  return (int16_t) 0;
147  }
148 
149  void VirtualShadowhandLibrary::getConfig(std::string joint_name)
150  {
151  }
152 
153  std::vector<DiagnosticData> VirtualShadowhandLibrary::getDiagnostics()
154  {
155  std::vector<DiagnosticData> tmp;
156  return tmp;
157  }
158 } // namespace shadowrobot
virtual JointData getJointData(std::string joint_name)
virtual void getConfig(std::string joint_name)
virtual int16_t setContrl(std::string contrlr_name, JointControllerData ctrlr_data)
std::map< std::string, JointData > JointsMap
virtual int16_t sendupdate(std::string joint_name, double target)
JointsMap joints_map
A mapping between the joint names and the information regarding those joints.
virtual JointControllerData getContrl(std::string ctrlr_name)
This is a parent class for the different types of Shadowhand we can have. It makes it possible to swa...
virtual int16_t setConfig(std::vector< std::string > myConfig)
virtual std::vector< DiagnosticData > getDiagnostics()


sr_hand
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:53