-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalwalk_8h_source.html
More file actions
139 lines (139 loc) · 19.2 KB
/
alwalk_8h_source.html
File metadata and controls
139 lines (139 loc) · 19.2 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!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/alwalk.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/alwalk.h</h1><a href="alwalk_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * alwalk.h</span>
<a name="l00003"></a>00003 <span class="comment"> * jwalk</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created by jason on 6/04/09.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2009 UoN. All rights reserved.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> */</span>
<a name="l00009"></a>00009
<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="actuators_8h.html">actuators.h</a>"</span>
<a name="l00012"></a>00012
<a name="l00013"></a><a class="code" href="alwalk_8h.html#a280079bdd38478e1d21489fe32c97672">00013</a> <span class="preprocessor">#define ALWALK_VERBOSITY 3</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a><a class="code" href="alwalk_8h.html#a751e75a0fc7de88baa2754ec9ee8fea3">00015</a> <span class="preprocessor">#define CONFIG_LOCATION string("/home/root/jasondata/alwalkconfig/")</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663f">00017</a> <span class="keyword">enum</span> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663f">ALWalkPrimitiveEnum</a>
<a name="l00018"></a>00018 {
<a name="l00019"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa4f5e30ed90175cbfb7792a40aa255410">00019</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa4f5e30ed90175cbfb7792a40aa255410">ALWALK_PRIMITIVE_FORWARD</a>,
<a name="l00020"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa9fe15c641fdd36578fb385fe7db048ed">00020</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa9fe15c641fdd36578fb385fe7db048ed">ALWALK_PRIMITIVE_BACKWARD</a>,
<a name="l00021"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa693860bf55ca674f6b19c7cee30f6fa5">00021</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa693860bf55ca674f6b19c7cee30f6fa5">ALWALK_PRIMITIVE_ARC</a>,
<a name="l00022"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663facf72d8c6a16c5eb42b92479b6c7ffaba">00022</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663facf72d8c6a16c5eb42b92479b6c7ffaba">ALWALK_PRIMITIVE_SIDEWAYS</a>,
<a name="l00023"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa07fff2895f5c7670abb0e5eef3cb0c5e">00023</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa07fff2895f5c7670abb0e5eef3cb0c5e">ALWALK_PRIMITIVE_TURN</a>,
<a name="l00024"></a><a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa9b2602a61f56a51345753479257b39ad">00024</a> <a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa9b2602a61f56a51345753479257b39ad">ALWALK_NUM_PRIMITIVES</a>
<a name="l00025"></a>00025 };
<a name="l00026"></a>00026
<a name="l00027"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744f">00027</a> <span class="keyword">enum</span> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744f">ALWalkDirectionEnum</a>
<a name="l00028"></a>00028 {
<a name="l00029"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faef718765032a242c6428641a2019d80d">00029</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faef718765032a242c6428641a2019d80d">ALWALK_DIRECTION_UNDEFINED</a>,
<a name="l00030"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fadd189f9b6059a3a121c6e4e49c11ddb1">00030</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fadd189f9b6059a3a121c6e4e49c11ddb1">ALWALK_DIRECTION_FORWARD</a>,
<a name="l00031"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744facf3487b3a61e5b5eb5ab6c9152c8ea74">00031</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744facf3487b3a61e5b5eb5ab6c9152c8ea74">ALWALK_DIRECTION_BACKWARD</a>,
<a name="l00032"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faad30e55a7b4408c24e60e65a331b803f">00032</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faad30e55a7b4408c24e60e65a331b803f">ALWALK_DIRECTION_ARC</a>, <span class="comment">// this is a tricky because it is the only on with a continuous input</span>
<a name="l00033"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faa6ab27115bb84134ad1f1fddf530a57f">00033</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744faa6ab27115bb84134ad1f1fddf530a57f">ALWALK_DIRECTION_LEFT</a>,
<a name="l00034"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fad48a3d717ebff520f1889c92fd65f471">00034</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fad48a3d717ebff520f1889c92fd65f471">ALWALK_DIRECTION_RIGHT</a>,
<a name="l00035"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa52bf94254f754942aab5f18494dbf55a">00035</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa52bf94254f754942aab5f18494dbf55a">ALWALK_DIRECTION_TURN_LEFT</a>,
<a name="l00036"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa04c7f64435a2aab1a3062836653561cb">00036</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa04c7f64435a2aab1a3062836653561cb">ALWALK_DIRECTION_TURN_RIGHT</a>,
<a name="l00037"></a><a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa5785c4d211c5a4114e6960bdb542632f">00037</a> <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744fa5785c4d211c5a4114e6960bdb542632f">ALWALK_NUM_DIRECTIONS</a>
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="structalwalkconfig__t.html">00040</a> <span class="keyword">struct </span><a class="code" href="structalwalkconfig__t.html">alwalkconfig_t</a>
<a name="l00041"></a>00041 {
<a name="l00042"></a><a class="code" href="structalwalkconfig__t.html#a0a8b440ad47b7d156ca50b8952f84e1a">00042</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a0a8b440ad47b7d156ca50b8952f84e1a">Hardnesses</a>[<a class="code" href="actuators_8h.html#a00b8c605bea3098c6c9e20e726546488">ALIAS_TARGETS_NOT_HEAD_LENGTH</a>];
<a name="l00043"></a><a class="code" href="structalwalkconfig__t.html#aac088714520a1b85d2a8bef93d387247">00043</a> <span class="keywordtype">int</span> <a class="code" href="structalwalkconfig__t.html#aac088714520a1b85d2a8bef93d387247">CyclesPerStep</a>;
<a name="l00044"></a><a class="code" href="structalwalkconfig__t.html#a5b9cc61f5a097b30badac0b3a27804b0">00044</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a5b9cc61f5a097b30badac0b3a27804b0">StepLength</a>; <span class="comment">// the step length</span>
<a name="l00045"></a><a class="code" href="structalwalkconfig__t.html#a0068b30a003c438af0ab39eece516731">00045</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a0068b30a003c438af0ab39eece516731">StepHeight</a>; <span class="comment">// the step height</span>
<a name="l00046"></a><a class="code" href="structalwalkconfig__t.html#a1dccf44738ec94c320c349200673a402">00046</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a1dccf44738ec94c320c349200673a402">StepSide</a>; <span class="comment">// the size of sideways step</span>
<a name="l00047"></a><a class="code" href="structalwalkconfig__t.html#a52063b0824d904e7af1e2d682f216992">00047</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a52063b0824d904e7af1e2d682f216992">StepTurn</a>; <span class="comment">// the angle of a turn step</span>
<a name="l00048"></a><a class="code" href="structalwalkconfig__t.html#a7964bdf82f99d0319d6fb35c3d5ebab1">00048</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a7964bdf82f99d0319d6fb35c3d5ebab1">ZMPX</a>; <span class="comment">// ZMP in the forwards direction</span>
<a name="l00049"></a><a class="code" href="structalwalkconfig__t.html#aa4149645c811ecd34ce5c58ea8293af5">00049</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#aa4149645c811ecd34ce5c58ea8293af5">ZMPY</a>; <span class="comment">// ZMP in the backwards direction</span>
<a name="l00050"></a><a class="code" href="structalwalkconfig__t.html#a03bc6cea0cc70da55710f33f59224bdc">00050</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a03bc6cea0cc70da55710f33f59224bdc">LHipBacklash</a>;
<a name="l00051"></a><a class="code" href="structalwalkconfig__t.html#a5086434b2aa85653499c303984ffe723">00051</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a5086434b2aa85653499c303984ffe723">RHipBacklash</a>;
<a name="l00052"></a><a class="code" href="structalwalkconfig__t.html#ab03615a3b9652244203165bdd9a9dfde">00052</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#ab03615a3b9652244203165bdd9a9dfde">HipHeight</a>;
<a name="l00053"></a><a class="code" href="structalwalkconfig__t.html#a05b06cf2f70a1ffcf0513663b33884c3">00053</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a05b06cf2f70a1ffcf0513663b33884c3">TorsoOrientation</a>; <span class="comment">// Torso orientation; positive is forwards</span>
<a name="l00054"></a><a class="code" href="structalwalkconfig__t.html#a98df0e283e5f34d912f0bc963da4aea4">00054</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a98df0e283e5f34d912f0bc963da4aea4">DistanceCommandFactor</a>; <span class="comment">// such that alMotion((desired distance) * DistanceCommandFactor)</span>
<a name="l00055"></a><a class="code" href="structalwalkconfig__t.html#a481911860ade25762edbb7fc6c305596">00055</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a481911860ade25762edbb7fc6c305596">AngleCommandFactor</a>; <span class="comment">// such that alMotion((desired angle) * AngleCommandFactor)</span>
<a name="l00056"></a><a class="code" href="structalwalkconfig__t.html#a729d8f4ef1eacab73cbee8a44d0be2bc">00056</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a729d8f4ef1eacab73cbee8a44d0be2bc">DistanceOdometryFactor</a>; <span class="comment">// such that actual distance = DistanceOdometryFactor * alMotionOdometry()</span>
<a name="l00057"></a><a class="code" href="structalwalkconfig__t.html#a4df48cdb0184edd07d6d42963901ae65">00057</a> <span class="keywordtype">float</span> <a class="code" href="structalwalkconfig__t.html#a4df48cdb0184edd07d6d42963901ae65">AngleOdometryFactor</a>; <span class="comment">// such that actual angle = AngleOdometryFactor * alMotionOdometry()</span>
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059
<a name="l00060"></a><a class="code" href="class_a_l_walk.html">00060</a> <span class="keyword">class </span><a class="code" href="class_a_l_walk.html">ALWalk</a>
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062 <span class="keyword">public</span>:
<a name="l00063"></a>00063 <a class="code" href="class_a_l_walk.html#a4218b92ca0ff620ac90fe2ea15fa8f72">ALWalk</a>();
<a name="l00064"></a>00064 <a class="code" href="class_a_l_walk.html#a0bf9a7380fdc7a5eda2eb26daff40883">~ALWalk</a>();
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a8d3308dbfbeaba2bf21d9a61c25a3b50">setStiffnessNotHead</a>(<span class="keywordtype">float</span> values[]);
<a name="l00067"></a>00067 <span class="keywordtype">int</span> <a class="code" href="class_a_l_walk.html#a8f066de3e1caf9037bee094723c9ec51">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_a_l_walk.html#ab913d40ca8d2ff39e7775be646c0eebc">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="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a09f9defc83d3047b05f996e346724c15">walkStraight</a>(<span class="keywordtype">float</span> distance);
<a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a3499f7d000a4fe8d0ade307c5e8fd6f3">walkArc</a>(<span class="keywordtype">float</span> angle, <span class="keywordtype">float</span> radius);
<a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a108c73a835df95df9fbf1a45fbddfa74">walkSideways</a>(<span class="keywordtype">float</span> distance);
<a name="l00073"></a>00073 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#acf8e90372b745d0c8e17ad99b7a02755">turn</a>(<span class="keywordtype">float</span> angle);
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a82552bad3ca3ec13cfcf732a00882e97">goForward</a>();
<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a693a62d64381894b8992664040eeb458">goBackward</a>();
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a9dea335750020f5ef3d9d9af9ec0a795">goArc</a>(<span class="keywordtype">float</span> angle);
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#afbbc6eb280b88593843ed26186f327b5">goLeft</a>();
<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#ab9a13798c7a91cea813ef449ed5249b0">goRight</a>();
<a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a9c82282d3e412267ee43840acb8d1249">goTurnLeft</a>();
<a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#af57dfcc348e1fae88106cd6898292519">goTurnRight</a>();
<a name="l00082"></a>00082 <span class="keywordtype">bool</span> <a class="code" href="class_a_l_walk.html#a26522b0f9b9c7efde3ffa461f7541af7">gIsActive</a>();
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="keywordtype">bool</span> <a class="code" href="class_a_l_walk.html#a56e4e5d4a85ccedf80280b80ff244ed8">walkIsActive</a>();
<a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a9e6a9c69d94ca02ea11ce243edf6bb4f">waitUntilFinished</a>();
<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a1680b5341483cd513a4fa8df743160b0">stop</a>();
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="class_a_l_walk.html#a5877697934ba1302b52628899d785d67">innerTest</a>();
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="keyword">private</span>:
<a name="l00091"></a>00091 <span class="comment">// Initialisation</span>
<a name="l00092"></a>00092 <span class="keywordtype">void</span> initSelf();
<a name="l00093"></a>00093 <span class="keywordtype">void</span> readConfigs();
<a name="l00094"></a>00094 <span class="keywordtype">void</span> readConfig(<span class="keywordtype">string</span> name, <a class="code" href="structalwalkconfig__t.html">alwalkconfig_t</a>* config);
<a name="l00095"></a>00095 <span class="keywordtype">int</span> lineToFloats(<span class="keywordtype">string</span> line, <span class="keywordtype">float</span> values[]);
<a name="l00096"></a>00096
<a name="l00097"></a>00097 <span class="keywordtype">void</span> configALMotion(<a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663f">ALWalkPrimitiveEnum</a> primitive);
<a name="l00098"></a>00098 <span class="keyword">public</span>:
<a name="l00099"></a><a class="code" href="class_a_l_walk.html#a5758c195f905b56b3aa963abd8adcffc">00099</a> <span class="keywordtype">float</span> *<a class="code" href="class_a_l_walk.html#a5758c195f905b56b3aa963abd8adcffc">alWalkHardnesses</a>;
<a name="l00100"></a>00100 <span class="keyword">private</span>:
<a name="l00101"></a>00101 <a class="code" href="structalwalkconfig__t.html">alwalkconfig_t</a> alWalkConfigs[<a class="code" href="alwalk_8h.html#ad80c2c3fa2a48dbae5a634d9e136663fa9b2602a61f56a51345753479257b39ad">ALWALK_NUM_PRIMITIVES</a>];
<a name="l00102"></a>00102 <a class="code" href="alwalk_8h.html#ad29d19c10365d263da29c2afe8df744f">ALWalkDirectionEnum</a> alWalkGoDirection;
<a name="l00103"></a>00103
<a name="l00104"></a>00104
<a name="l00105"></a>00105 };
<a name="l00106"></a>00106
<a name="l00107"></a>00107
<a name="l00108"></a>00108
</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>