-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactuators_8h_source.html
122 lines (122 loc) · 17 KB
/
actuators_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>naowalkoptimiser: /Users/jason/Code/naowalkoptimiser/src/Locomotion/Walk/actuators.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<h1>/Users/jason/Code/naowalkoptimiser/src/Locomotion/Walk/actuators.h</h1><a href="actuators_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef ACTUATORS_H</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define ACTUATORS_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="jwalkincludes_8h.html">jwalkincludes.h</a>"</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="sensors_8h.html">sensors.h</a>"</span>
<a name="l00012"></a>00012
<a name="l00013"></a><a class="code" href="actuators_8h.html#a8dd5c68117785c9ab1acf02de50c6e77">00013</a> <span class="preprocessor">#define ACTUATORS_CLEARAFTER 0 // use this to switch between the aldcm's ClearAfter and ClearAll modes</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a>00015 <span class="comment">// These offsets only work for 'not head' data, add 2 to work with 'all' data</span>
<a name="l00016"></a><a class="code" href="actuators_8h.html#aa18703395ea05618ea1aaffd6139da13">00016</a> <span class="preprocessor">#define JOINT_OFFSET_LARM 0</span>
<a name="l00017"></a><a class="code" href="actuators_8h.html#aedd1bb9ab7e19d37f620f6ed1646efbc">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define JOINT_OFFSET_RARM 4 // so that jointPositions[JOINT_OFFSET_RARM] is the first joint in the arm</span>
<a name="l00018"></a><a class="code" href="actuators_8h.html#affbeacd38c0561c6cf4761be999e3485">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define JOINT_OFFSET_LLEG 8</span>
<a name="l00019"></a><a class="code" href="actuators_8h.html#a0bcacf71c2e17a0b7be8616ba11bff27">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define JOINT_OFFSET_RLEG 14</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="actuators_8h.html#a43ff6f58c2e5ecaadc0bde77ccefac78">00021</a> <span class="preprocessor">#define ALIAS_HARDNESS_ALL string("Actuators/Hardness/All")</span>
<a name="l00022"></a><a class="code" href="actuators_8h.html#a629463229d42fb278324372963b14e04">00022</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_HARDNESS_ALL_LENGTH J_NUM_JOINTS</span>
<a name="l00023"></a><a class="code" href="actuators_8h.html#aed5883edb29be3fba980a5b95a1dd0a0">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_HARDNESS_NOT_HEAD string("Actuators/Hardness/NotHead")</span>
<a name="l00024"></a><a class="code" href="actuators_8h.html#a68646df963f2fc5181fab03ba43ad171">00024</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_HARDNESS_NOT_HEAD_LENGTH J_NUM_JOINTS - 2</span>
<a name="l00025"></a><a class="code" href="actuators_8h.html#ab7fad0ced13f804aacba8d20ac79f4b2">00025</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_HARDNESS_HEAD string("Actuators/Hardness/Head")</span>
<a name="l00026"></a><a class="code" href="actuators_8h.html#a6326299df2105357a7c2c27c1c30127d">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_HARDNESS_HEAD_LENGTH 2</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a><a class="code" href="actuators_8h.html#a884d547cbaf18cd0482f65a6f6242390">00028</a> <span class="preprocessor">#define ALIAS_TARGETS_ALL string("Actuators/Targets/All")</span>
<a name="l00029"></a><a class="code" href="actuators_8h.html#a05167fbc765568d551174a31c1d83632">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_TARGETS_ALL_LENGTH J_NUM_JOINTS</span>
<a name="l00030"></a><a class="code" href="actuators_8h.html#a06da028f0a6ec61ef14c0b75c34d6620">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_TARGETS_NOT_HEAD string("Actuators/Targets/NotHead")</span>
<a name="l00031"></a><a class="code" href="actuators_8h.html#a00b8c605bea3098c6c9e20e726546488">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_TARGETS_NOT_HEAD_LENGTH J_NUM_JOINTS - 2</span>
<a name="l00032"></a><a class="code" href="actuators_8h.html#af4ad8d47370050ba8e2e2e0fe80c538a">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_TARGETS_HEAD string("Actuators/Targets/Head")</span>
<a name="l00033"></a><a class="code" href="actuators_8h.html#a2203ff2bc61f3b3e4f8cd4fc2b03b077">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define ALIAS_TARGETS_HEAD_LENGTH 2</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="comment">// Convert the index defined in sensors.h to the position actuator name ie J_L_ANKLE_PITCH => "LAnklePitch/Position/Actuator/Value"</span>
<a name="l00036"></a>00036 <span class="keyword">extern</span> <span class="keywordtype">string</span> <a class="code" href="actuators_8cpp.html#a8db8f36e3917fc7e4406cc04d41b0c68">indexToPositionActuator</a>[];
<a name="l00037"></a>00037 <span class="keyword">extern</span> <span class="keywordtype">string</span> <a class="code" href="actuators_8cpp.html#af16ebe6a7786b1b37fb68a19a73db472">indexToHardnessActuator</a>[];
<a name="l00038"></a>00038 <span class="keyword">extern</span> <span class="keywordtype">float</span> <a class="code" href="actuators_8cpp.html#ac6ebabd2fbc89c3765e0b93d4faeaae5">jointLimits</a>[][2];
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">extern</span> <span class="keywordtype">float</span> <a class="code" href="actuators_8cpp.html#adc91e1f088b052fc32f82984d500436f">actuatorHardnesses</a>[];
<a name="l00041"></a>00041 <span class="keyword">extern</span> <span class="keywordtype">float</span> <a class="code" href="actuators_8cpp.html#a7abd97891cc8f39c731d2ea8cd0777db">actuatorPositions</a>[];
<a name="l00042"></a>00042
<a name="l00043"></a><a class="code" href="class_actuators.html">00043</a> <span class="keyword">class </span><a class="code" href="class_actuators.html">Actuators</a>
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 <span class="keyword">public</span>:
<a name="l00046"></a>00046 <a class="code" href="class_actuators.html#afce1366940f322ce59e39edbc900897c">Actuators</a>();
<a name="l00047"></a>00047 <a class="code" href="class_actuators.html#a57a346be610b5d04444e380c0323719c">~Actuators</a>();
<a name="l00048"></a>00048
<a name="l00049"></a>00049 <span class="comment">// Voltage stabilised hardness</span>
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#a5725da03d6fefb1569e7e55c73d36cb5">setStiffness</a>(<span class="keywordtype">int</span> jointindex, <span class="keywordtype">float</span> value);
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#a0e1248e749cadc72a93e87375bc1c5a5">setStiffnessHead</a>(<span class="keywordtype">float</span> value[]);
<a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#a33192655a2d74c71fd70ca3ab6a89bfa">setStiffnessAll</a>(<span class="keywordtype">float</span> values[]);
<a name="l00053"></a>00053 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#a33192655a2d74c71fd70ca3ab6a89bfa">setStiffnessAll</a>(<span class="keywordtype">float</span> values[], <span class="keywordtype">int</span> time);
<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#a1c6ec8c1d5e314929948210d8315525f">setStiffnessNotHead</a>(<span class="keywordtype">float</span> values[]);
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">// Whole body position and hardness values for the next dcm cycle</span>
<a name="l00057"></a>00057 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#acd94883db2df1b03facd91e3f22a1106">clearDCM</a>();
<a name="l00058"></a>00058 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#ac48c4ba222fe762dadde8d521ce797bd">resetMotorBoards</a>();
<a name="l00059"></a>00059 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#acca343db13f7f4695068017ed5d58b2d">resetChestBoard</a>();
<a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#ae3ed8e5faa08cdb7108c85a52dbb8a67">sendFrameToBody</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">float</span> hardnesses[]);
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="class_actuators.html#a5b5cf33d67ffb76470d60ab35dd242ec">sendFrameToNotHead</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">float</span> hardnesses[]);
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="comment">// Whole body positions with time</span>
<a name="l00064"></a>00064 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#ae86b63a6778e2f6408c2b08c50018758">goToAngle</a>(<span class="keywordtype">int</span> jointindex, <span class="keywordtype">float</span> position, <span class="keywordtype">int</span> time);
<a name="l00065"></a>00065 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#a9a946ff5bb9bdd06177dcd055989ab1f">goToAnglesAll</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">int</span> time);
<a name="l00066"></a>00066 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#af7d299d1bf345f4257e9775aca6a2380">goToAnglesWithVelocityAll</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">float</span> velocity);
<a name="l00067"></a>00067 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#a79e7b86887eb744112df9118cc59974c">goToAnglesNotHead</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">int</span> time);
<a name="l00068"></a>00068 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#a2692b6c1e33492cff040b7d3a5cad505">goToAnglesWithVelocityNotHead</a>(<span class="keywordtype">float</span> positions[], <span class="keywordtype">float</span> velocity);
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">// Head positions</span>
<a name="l00071"></a>00071 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#a6e794832ca4d520bc2c7b49115bcd32a">goToAngleHeadYaw</a>(<span class="keywordtype">float</span> position, <span class="keywordtype">int</span> time);
<a name="l00072"></a>00072 <span class="keywordtype">int</span> <a class="code" href="class_actuators.html#ac96ba4e55f547a0125b549373f368295">goToAngleHeadPitch</a>(<span class="keywordtype">float</span> position, <span class="keywordtype">int</span> time);
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="keyword">public</span>:
<a name="l00075"></a><a class="code" href="class_actuators.html#ad10596c2c22feb32e6668bda80e0378a">00075</a> <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="class_actuators.html#ad10596c2c22feb32e6668bda80e0378a">MaxBatteryVoltage</a>;
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="keyword">private</span>:
<a name="l00078"></a>00078 <span class="comment">// Initialisation functions</span>
<a name="l00079"></a>00079 <span class="keywordtype">void</span> createHardnessAliases();
<a name="l00080"></a>00080 <span class="keywordtype">void</span> createTargetAliases();
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="comment">// Stiffness adjustments</span>
<a name="l00083"></a>00083 <span class="keywordtype">void</span> adjustHardness(<span class="keywordtype">float</span> hardness, <span class="keywordtype">float</span>* adjustedhardness);
<a name="l00084"></a>00084 <span class="keywordtype">void</span> adjustHardnesses(<span class="keywordtype">float</span> hardnesses[], <span class="keywordtype">float</span> adjustedhardnesses[], <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> numactuators);
<a name="l00085"></a>00085
<a name="l00086"></a>00086 <span class="comment">// Communication with the alDcm</span>
<a name="l00087"></a>00087 <span class="keywordtype">void</span> sendToActuator(<span class="keywordtype">string</span> actuatorname, <span class="keywordtype">int</span> time, <span class="keywordtype">float</span> value); <span class="comment">// single actuator, time and target</span>
<a name="l00088"></a>00088 <span class="keywordtype">void</span> sendToAliasActuator(<span class="keywordtype">string</span> aliasname, <span class="keywordtype">int</span> time, <span class="keywordtype">float</span> values[], <span class="keywordtype">int</span> numactuators); <span class="comment">// many actuators, single time, a target for each actuator</span>
<a name="l00089"></a>00089 <span class="keywordtype">void</span> sendToAliasActuator(<span class="keywordtype">string</span> aliasname, <span class="keywordtype">int</span> times[], <span class="keywordtype">float</span> values[], <span class="keywordtype">int</span> numactuators); <span class="comment">// many actuators, single different time for each target</span>
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="keywordtype">void</span> sendCurveToActuator(<span class="keywordtype">string</span> actuatorname, <span class="keywordtype">int</span> starttime, <span class="keywordtype">float</span> value[], <span class="keywordtype">int</span> numvalues); <span class="comment">// single actuator, numvalues target, a start time</span>
<a name="l00092"></a>00092 <span class="keywordtype">void</span> sendCurveToAliasActuator(<span class="keywordtype">string</span> aliasname, <span class="keywordtype">int</span> starttime, <span class="keywordtype">float</span> values[<span class="comment">/*numvalues*/</span>][<a class="code" href="actuators_8h.html#a05167fbc765568d551174a31c1d83632">ALIAS_TARGETS_ALL_LENGTH</a>], <span class="keywordtype">int</span> numvalues); <span class="comment">// many actuators, many targets</span>
<a name="l00093"></a>00093 <span class="keywordtype">void</span> sendCurveToAliasActuator(<span class="keywordtype">string</span> aliasname, <span class="keywordtype">int</span> starttime, <span class="keywordtype">float</span> values[<span class="comment">/*numvalues*/</span>][<a class="code" href="actuators_8h.html#a00b8c605bea3098c6c9e20e726546488">ALIAS_TARGETS_NOT_HEAD_LENGTH</a>], <span class="keywordtype">int</span> numvalues); <span class="comment">// many actuators, many targets</span>
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Fri Oct 9 13:42:11 2009 for naowalkoptimiser by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>