Revision 715
tweaked smart_run_around for recharging...from now on, it will be known as smart_walk/crawl_around. slowing everything down seems to make recharging much more stable. maybe demo-ready.
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/recharge_i2c.c | ||
---|---|---|
63 | 63 |
**/ |
64 | 64 |
void recharge_i2c_receive(char i2c_byte) |
65 | 65 |
{ |
66 |
//usb_putc(i2c_byte);
|
|
66 |
//usb_putc(i2c_byte);
|
|
67 | 67 |
if(recharge_i2c_prev_byte == I2C_MSG_HOMING_DATA) |
68 | 68 |
{ |
69 | 69 |
recharge_i2c_homing_sensor_data = i2c_byte; |
70 | 70 |
recharge_i2c_prev_byte = i2c_byte; |
71 |
//usb_puti(i2c_byte); |
|
71 | 72 |
return; |
72 | 73 |
} |
73 | 74 |
|
... | ... | |
88 | 89 |
default: |
89 | 90 |
break; |
90 | 91 |
} |
92 |
recharge_i2c_homing_sensor_data = 0; |
|
91 | 93 |
recharge_i2c_prev_byte = i2c_byte; |
92 | 94 |
} |
93 | 95 |
|
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/seeking.c | ||
---|---|---|
35 | 35 |
int seek_station_with_bom(int station) |
36 | 36 |
{ |
37 | 37 |
int charging_loc = wl_token_get_my_sensor_reading(station); |
38 |
/*usb_puts("\n\rBOM reading: "); |
|
39 |
usb_puti(charging_loc); |
|
40 |
usb_puts("\n\r");*/ |
|
38 | 41 |
if (charging_loc != old_reading) |
39 | 42 |
{ |
40 | 43 |
RECHARGE_DEBUG_PRINT("BOM reading: "); |
... | ... | |
71 | 74 |
{ |
72 | 75 |
int widthcount = recharge_i2c_get_homing_reading(); |
73 | 76 |
int direction = homing_direction(widthcount); |
77 |
/*usb_puts("\n\rHoming Direction: "); |
|
78 |
usb_puti(direction); |
|
79 |
usb_puts("\n\r");*/ |
|
74 | 80 |
|
75 | 81 |
switch(direction) |
76 | 82 |
{ |
branches/autonomous_recharging/code/projects/autonomous_recharging/dragonfly/smart_run_around_fsm.h | ||
---|---|---|
15 | 15 |
|
16 | 16 |
#define BACKUP_MAX 60 |
17 | 17 |
#define CRAZY_MAX 200 //The number of counts between "crazy moments" |
18 |
#define STRAIT_SPEED 185 //The speed when going strait or backing up.
|
|
19 |
#define TURN_CONSTANT 2
|
|
18 |
#define STRAIT_SPEED 155 //The speed when going strait or backing up.
|
|
19 |
#define TURN_CONSTANT 5
|
|
20 | 20 |
#define PCONTROL_CRAZY_LIMIT 80 |
21 | 21 |
|
22 | 22 |
int avoid_state; |
Also available in: Unified diff