Project

General

Profile

Statistics
| Revision:

root / trunk / docs / libdragonfly / group__move.html @ 241

History | View | Annotate | Download (11.4 KB)

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
<title>libdragonfly: Movement</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
<link href="tabs.css" rel="stylesheet" type="text/css">
6
</head><body>
7
<!-- Generated by Doxygen 1.5.3 -->
8
<div class="tabs">
9
  <ul>
10
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11
    <li><a href="modules.html"><span>Modules</span></a></li>
12
    <li><a href="files.html"><span>Files</span></a></li>
13
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
14
  </ul>
15
</div>
16
<h1>Movement</h1>Functions fo controlling robot motion Higher level functions to control the movement of robots.  
17
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
18
<tr><td></td></tr>
19
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
20
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga02f16883c5ce325e2dbb8c3835aa9a1"></a><!-- doxytag: member="move::FWD" ref="ga02f16883c5ce325e2dbb8c3835aa9a1" args="" -->
21
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#ga02f16883c5ce325e2dbb8c3835aa9a1">FWD</a>&nbsp;&nbsp;&nbsp;0</td></tr>
22

    
23
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move forwards. <br></td></tr>
24
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb8d9d2e1ff6a03ce3b45a32e0002a405"></a><!-- doxytag: member="move::BCK" ref="gb8d9d2e1ff6a03ce3b45a32e0002a405" args="" -->
25
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#gb8d9d2e1ff6a03ce3b45a32e0002a405">BCK</a>&nbsp;&nbsp;&nbsp;1</td></tr>
26

    
27
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move backwards. <br></td></tr>
28
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gff79b776dbd665d08a0cfcb4c2931c98"></a><!-- doxytag: member="move::SLOW_SPD" ref="gff79b776dbd665d08a0cfcb4c2931c98" args="" -->
29
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#gff79b776dbd665d08a0cfcb4c2931c98">SLOW_SPD</a>&nbsp;&nbsp;&nbsp;96</td></tr>
30

    
31
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A slow speed. <br></td></tr>
32
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0dd7c6a61a43fb8a3698988c414a9bf"></a><!-- doxytag: member="move::HALF_SPD" ref="ga0dd7c6a61a43fb8a3698988c414a9bf" args="" -->
33
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#ga0dd7c6a61a43fb8a3698988c414a9bf">HALF_SPD</a>&nbsp;&nbsp;&nbsp;128</td></tr>
34

    
35
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Half of the full speed. <br></td></tr>
36
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gab20a9de15efe0d1b5599a3dd2ae9fea"></a><!-- doxytag: member="move::NRML_SPD" ref="gab20a9de15efe0d1b5599a3dd2ae9fea" args="" -->
37
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#gab20a9de15efe0d1b5599a3dd2ae9fea">NRML_SPD</a>&nbsp;&nbsp;&nbsp;160</td></tr>
38

    
39
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A normal speed. <br></td></tr>
40
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga1f2e117ff854d46ca84f16a1eb8419a"></a><!-- doxytag: member="move::FAST_SPD" ref="ga1f2e117ff854d46ca84f16a1eb8419a" args="" -->
41
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#ga1f2e117ff854d46ca84f16a1eb8419a">FAST_SPD</a>&nbsp;&nbsp;&nbsp;192</td></tr>
42

    
43
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A fast speed. <br></td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g35819c1d24f97763dab51cd367514443"></a><!-- doxytag: member="move::FULL_SPD" ref="g35819c1d24f97763dab51cd367514443" args="" -->
45
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#g35819c1d24f97763dab51cd367514443">FULL_SPD</a>&nbsp;&nbsp;&nbsp;255</td></tr>
46

    
47
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The maximum speed. <br></td></tr>
48
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g4e9e38cfcdb9bfd0f80c69a574301731"></a><!-- doxytag: member="move::SLOW_TURN" ref="g4e9e38cfcdb9bfd0f80c69a574301731" args="" -->
49
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#g4e9e38cfcdb9bfd0f80c69a574301731">SLOW_TURN</a>&nbsp;&nbsp;&nbsp;64</td></tr>
50

    
51
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A slow turning speed. <br></td></tr>
52
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gdfc67eeed7b52f97b8483af04e27a9ce"></a><!-- doxytag: member="move::NRML_TURN" ref="gdfc67eeed7b52f97b8483af04e27a9ce" args="" -->
53
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#gdfc67eeed7b52f97b8483af04e27a9ce">NRML_TURN</a>&nbsp;&nbsp;&nbsp;96</td></tr>
54

    
55
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A medium turning speed. <br></td></tr>
56
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb900792066abf52697bd19cc5240ae24"></a><!-- doxytag: member="move::FAST_TURN" ref="gb900792066abf52697bd19cc5240ae24" args="" -->
57
#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#gb900792066abf52697bd19cc5240ae24">FAST_TURN</a>&nbsp;&nbsp;&nbsp;128</td></tr>
58

    
59
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A high turning speed. <br></td></tr>
60
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
61
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#g4e27eab618b1d874ff25fd2b2a65493b">move</a> (int velocity, int omega)</td></tr>
62

    
63
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move the robot at the specified velocity.  <a href="#g4e27eab618b1d874ff25fd2b2a65493b"></a><br></td></tr>
64
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__move.html#g8e79749d6af4a0aa12aceee41ad62ebd">move_avoid</a> (int velocity, int omega, int strength)</td></tr>
65

    
66
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move the robot while avoiding obstacles.  <a href="#g8e79749d6af4a0aa12aceee41ad62ebd"></a><br></td></tr>
67
</table>
68
<hr><a name="_details"></a><h2>Detailed Description</h2>
69
Functions fo controlling robot motion Higher level functions to control the movement of robots. 
70
<p>
71
<hr><h2>Function Documentation</h2>
72
<a class="anchor" name="g4e27eab618b1d874ff25fd2b2a65493b"></a><!-- doxytag: member="move.c::move" ref="g4e27eab618b1d874ff25fd2b2a65493b" args="(int velocity, int omega)" -->
73
<div class="memitem">
74
<div class="memproto">
75
      <table class="memname">
76
        <tr>
77
          <td class="memname">void move           </td>
78
          <td>(</td>
79
          <td class="paramtype">int&nbsp;</td>
80
          <td class="paramname"> <em>velocity</em>, </td>
81
        </tr>
82
        <tr>
83
          <td class="paramkey"></td>
84
          <td></td>
85
          <td class="paramtype">int&nbsp;</td>
86
          <td class="paramname"> <em>omega</em></td><td>&nbsp;</td>
87
        </tr>
88
        <tr>
89
          <td></td>
90
          <td>)</td>
91
          <td></td><td></td><td width="100%"></td>
92
        </tr>
93
      </table>
94
</div>
95
<div class="memdoc">
96

    
97
<p>
98
Move the robot at the specified velocity. 
99
<p>
100
Causes the robot to move with the given translation and rotational velocities. motors_init must be called before this function can be used.<p>
101
<dl compact><dt><b>Parameters:</b></dt><dd>
102
  <table border="0" cellspacing="2" cellpadding="0">
103
    <tr><td valign="top"></td><td valign="top"><em>velocity</em>&nbsp;</td><td>the translational velocity of the robot, in the range -255 to 255. A positive value indicates forward motion, while a negative value indicates backwards motion.</td></tr>
104
    <tr><td valign="top"></td><td valign="top"><em>omega</em>&nbsp;</td><td>the rotational velocity of the robot, in the range -255 to 255. A positive value indicates a counterclockwise velocity, while a negative value indicates a clockwise velocity.</td></tr>
105
  </table>
106
</dl>
107
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#gbad32bfc46c9f31ba81955775611bd21" title="Initialize the motors.">motors_init</a>, <a class="el" href="group__motors.html#g751a431c19cdb52bbbc8127455bd41ee" title="Set speed and direction of motor1.">motor1_set</a>, <a class="el" href="group__motors.html#g23940fd8408c23fcf312b1d5937f0ab0" title="Set speed and direction of motor2.">motor2_set</a> </dd></dl>
108

    
109
</div>
110
</div><p>
111
<a class="anchor" name="g8e79749d6af4a0aa12aceee41ad62ebd"></a><!-- doxytag: member="move.c::move_avoid" ref="g8e79749d6af4a0aa12aceee41ad62ebd" args="(int velocity, int omega, int strength)" -->
112
<div class="memitem">
113
<div class="memproto">
114
      <table class="memname">
115
        <tr>
116
          <td class="memname">void move_avoid           </td>
117
          <td>(</td>
118
          <td class="paramtype">int&nbsp;</td>
119
          <td class="paramname"> <em>velocity</em>, </td>
120
        </tr>
121
        <tr>
122
          <td class="paramkey"></td>
123
          <td></td>
124
          <td class="paramtype">int&nbsp;</td>
125
          <td class="paramname"> <em>omega</em>, </td>
126
        </tr>
127
        <tr>
128
          <td class="paramkey"></td>
129
          <td></td>
130
          <td class="paramtype">int&nbsp;</td>
131
          <td class="paramname"> <em>strength</em></td><td>&nbsp;</td>
132
        </tr>
133
        <tr>
134
          <td></td>
135
          <td>)</td>
136
          <td></td><td></td><td width="100%"></td>
137
        </tr>
138
      </table>
139
</div>
140
<div class="memdoc">
141

    
142
<p>
143
Move the robot while avoiding obstacles. 
144
<p>
145
Moves the robot with the given translational and angular velocities while avoiding obstacles. To be effective, this function must be called repeatedly throughout the motion. It relies on the IR rangefinders to detect obstacles. Before calling this function, motors_init and range_init must be called.<p>
146
<dl compact><dt><b>Parameters:</b></dt><dd>
147
  <table border="0" cellspacing="2" cellpadding="0">
148
    <tr><td valign="top"></td><td valign="top"><em>velocity</em>&nbsp;</td><td>the translational velocity of the robot, in the range -255 to 255. A positive value indicates forward motion.</td></tr>
149
    <tr><td valign="top"></td><td valign="top"><em>omega</em>&nbsp;</td><td>the rotational velocity of the robot, in the range -255 to 255. A positive value indicates a counterclockwise velocity.</td></tr>
150
    <tr><td valign="top"></td><td valign="top"><em>strength</em>&nbsp;</td><td>the strength of the avoid behavior, in the range 0 to 100.</td></tr>
151
  </table>
152
</dl>
153
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#gbad32bfc46c9f31ba81955775611bd21" title="Initialize the motors.">motors_init</a>, <a class="el" href="group__rangefinder.html#g52d0666b725e6d3a14b5bddc28190e59" title="Initialize the rangefinders.">range_init</a>, <a class="el" href="group__move.html#g4e27eab618b1d874ff25fd2b2a65493b" title="Move the robot at the specified velocity.">move</a> </dd></dl>
154

    
155
</div>
156
</div><p>
157
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Nov 8 23:15:40 2007 for libdragonfly by&nbsp;
158
<a href="http://www.doxygen.org/index.html">
159
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
160
</body>
161
</html>