Revision 1580
Tried to use bom_get_vector instead of bom_get_max.
It works for the master (still need works), not for the slave (still need to figure out why)
trunk/code/behaviors/formation_control/circle_spacing/circle_spacing.c | ||
---|---|---|
6 | 6 |
int master = 0; |
7 | 7 |
int sending = 0; |
8 | 8 |
int stop = 0; |
9 |
struct vector slave_position; |
|
9 | 10 |
|
10 |
|
|
11 | 11 |
void switch_sending () |
12 | 12 |
{ |
13 | 13 |
if(sending) |
... | ... | |
78 | 78 |
|
79 | 79 |
else // recieving |
80 | 80 |
{ |
81 |
if(bom_get_max()+1==5) |
|
82 |
{ |
|
81 |
|
|
82 |
bom_get_vector(&slave_position, NULL); |
|
83 |
if(slave_position.y/slave_position.x > 10){ |
|
84 |
|
|
85 |
//if(bom_get_max()+1==5){ |
|
86 |
|
|
83 | 87 |
send_buffer[0] = 's'; |
84 | 88 |
wl_basic_send_global_packet(42, send_buffer, 2); |
85 | 89 |
} |
... | ... | |
113 | 117 |
|
114 | 118 |
else |
115 | 119 |
{ |
116 |
|
|
120 |
|
|
117 | 121 |
|
122 |
|
|
123 |
|
|
124 |
//bom_get_vector(&slave_position, NULL); |
|
125 |
//if(abs(slave_position.x)>2 && (double)slave_position.y/(double)slave_position.x < 0.1){ |
|
126 |
|
|
118 | 127 |
if(bom_get_max()+1==8){ |
119 | 128 |
orb2_set_color(BLUE); |
120 | 129 |
motor_r_set(FORWARD,180); |
trunk/code/behaviors/formation_control/circle_spacing/Makefile | ||
---|---|---|
11 | 11 |
USE_WIRELESS = 1 |
12 | 12 |
|
13 | 13 |
# com1 = serial port. Use lpt1 to connect to parallel port. |
14 |
AVRDUDE_PORT = $(shell if uname -s |grep -i w32 >/dev/null; then echo 'COM4:'; else echo '/dev/ttyUSB0'; fi)
|
|
14 |
AVRDUDE_PORT = $(shell if uname -s |grep -i w32 >/dev/null; then echo 'COM7:'; else echo '/dev/ttyUSB0'; fi)
|
|
15 | 15 |
|
16 | 16 |
else |
17 | 17 |
COLONYROOT := ../$(COLONYROOT) |
Also available in: Unified diff