post
poster: Xorm
description: Housebot_002_defines
language: plain text
[download]
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

// DRIVE SYSTEM #defines
#define PORT_MOTOR 3 // port (left) motor port
#define STBD_MOTOR 1 //  starboard (right) motor port
// yarr, nautical terms be for the win.
#define MF 65  // the tracking adjustment speed (turning)
#define FF 90 // the forwardstracking speed

// CAMERA stuff
#define CAM_CENTER 170
#define TRACK_ADJUST_AMT 0.15
#define FWD_AMT 0.15
#define CHANNEL 0
#define INDEX 0
#define CH 0
#define I 0
#define TRACK_THRESH 60
#define DZ 35

// HOUSE COLLECTION/PROCESSING
#define HOUSE_CLAW_SERVO 0 // servo number of the claw that picks 
// up the houses.
#define HOUSE_RETRACT_SERVO 1  // servo # of servo that moves the
// house claw back and forth to the chamber
#define UMBRELLA_MOTOR 2   // house shield dispenser motor

// WATER COLLECTION/DISPENSION
#define CLAW_SERVO 0 // servo that moves the claw up and down/
#define CLAW_MOTOR 0 // motor that actually actuates the claw.
#define CLAW_SLEEP 0.5 // sets the distance traveled by claw in
// single action. 0.5 seems to work fine.
#define CLAW_POS_DOWN 120 // servo position for lowest position
// for the claw servo.
#define CLAW_POS_UP 200  // highest position w/o hitting the USB cable
 // when plugged in for interaction
#define CLAW_ACT_SLEEP 0.5 // amount of sleep given to complete actions
// on the claw.


#define BLUE_BALL_DIST_TO_DROP_CLAW 140


// ANALOG SENSORS This includes ports 0-6.
#define IR_SENS 5 // ET sensor for ranging. Presumably we'll
// be using this to range the blue balls
// and the bins. IR_SENS [port no]
#define DIST_TO_OBJECT_FROM_ET 100

// DIGITAL SENSORS (switches and stuff) Ports 8-14
#define CLAW_TOUCH_SENS 10 //port number for the touch sensor
//attached to the claw to sense when
// a ball has been picked up.

// GLOBAL VARS

int cur_blob_pos = 0;  // current blob X position as seen by
// the XBCCam. Updated constantly by
// update_camdata()

int track_d = 0;