-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnarration.rtf
40 lines (39 loc) · 3.24 KB
/
narration.rtf
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
{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
\f0\fs24 \cf0 controller node:\
\
subscribes to objectPose from camera node\
can request the angle turned since last ask from drive node\
sends \'91drive distance\'92, \'91drive speed\'92, turn distance service requests to drive node\
contains high-level logic:\
find the goal, then the ball\
use trig to figure out which direction to go in and how far so that it\'92s behind the ball\
approach the ball, and center it again, strike the ball\
\
\
the controller node contains the high-level logic and decision-making for the robot\
\
in order to play soccer, the robot first locates the goal. Because the distance calculated by the camera node is averaged over several frames, the robot must keep the goal in view for several seconds in order to ensure accurate measurements.\
\
The robot then finds the ball, and again waits for accurate measurements. It then uses the distances and bearings of the ball and goal to calculate the direction and distance it needs to drive in order to put itself behind the ball relative to the goal, and drive to those coordinates. \
\
The robot them begins the process of hitting the ball into the goal. It first finds the ball and calculates how far it needs to drive to put itself within striking distance (one foot). After approaching the ball, it then centers the ball in the camera one final time before striking the ball into the goal.\
\
You have probably noticed that our robot only turns to the right.. The reason for this is a bug in the robot\'92s firmware which causes all distances reported to be incorrect. In order to obtain information such as how far the robot had turned or driven in a given period of time, we were required to write our own routines to obtain this information based on the number of wheel encoder ticks and the physical dimensions of the robot. Due to time constraints and the way in which the robot reports encoder tick counts, it made more sense for us to simply assume the robot would always turn in one direction.\
\
The drive node handles the interface between our software and the iRobot Create. By using the pyserial library and several custom service definitions, it provides several different services which other nodes, such as the controller node, can call to get information from or operate the robot. \
\
In particular, it provides four main services: Drive Distance, Drive Speed, Turn Angle, and Request Angle.\
\
Drive Speed allows a node to specify a linear velocity and rotational velocity, which the robot will then attempt to move at until told to do something else. \
\
Drive Distance and Drive Angle provide a way for a node to request the robot drive a set number of inches, or turn a set number of degrees, and then stop.\
\
Request Angle allows a node to query the number of degrees the robot has turned since Request Angle was last called. \
\
These four services provide the interface for any other node to move the robot through its full range of motion, without having to worry about the actual hardware or serial commands.\
\
}