Skip to content

Commit 375198f

Browse files
committed
wip: new dribble holding check
1 parent e9261df commit 375198f

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func HandleRequest(conn net.Conn) {
131131
"ERROR": %t,
132132
"ERRORCODE": %d,
133133
"ERRORMESSAGE": "%s"
134-
}`, float32(recvdata.Volt)/10.0, recvdata.IsHoldBall, isRobotError, RobotErrorCode, RobotErrorMessage)
134+
}`, float32(recvdata.Volt)/10.0, recvdata.IsDetectPhotosensor, isRobotError, RobotErrorCode, RobotErrorMessage)
135135

136136
fmt.Fprint(conn, response)
137137

send_to_ai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func RunServer(chserver chan bool, MyID uint32) {
2929
defer conn.Close()
3030

3131
for {
32-
pe := createStatus(uint32(MyID), recvdata.IsHoldBall, uint32(recvdata.Volt), uint32(recvdata.CapPower))
32+
pe := createStatus(uint32(MyID), recvdata.IsDetectPhotosensor, uint32(recvdata.Volt), uint32(recvdata.CapPower))
3333
Data, _ := proto.Marshal(pe)
3434

3535
conn.Write([]byte(Data))

serial.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ func RunSerial(chclient chan bool, MyID uint32) {
166166
// time.Sleep(16 * time.Millisecond) //少し待つ
167167
//log.Printf("Sent %v bytes\n", n) //何バイト送信した?
168168
if kicker_enable || sendbytes[8] != 0 {
169-
log.Printf("Kickerval: %3d | sendbytes[8]: %3d | ball_detect: %t\n", kicker_val, sendbytes[8], recvdata.IsHoldBall)
169+
log.Printf("Kickerval: %3d | sendbytes[8]: %3d | ball_detect: %t\n", kicker_val, sendbytes[8], recvdata.IsDetectPhotosensor)
170170
}
171171
if chip_enable || sendbytes[9] != 0 {
172-
log.Printf("Chipval: %3d | sendbytes[9]: %3d | ball_detect: %t\n", chip_val, sendbytes[9], recvdata.IsHoldBall)
172+
log.Printf("Chipval: %3d | sendbytes[9]: %3d | ball_detect: %t\n", chip_val, sendbytes[9], recvdata.IsDetectPhotosensor)
173173
}
174174
// log.Println(sendbytes) //送信済みのバイトを表示
175175

variables.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ var sendarray bytes.Buffer //送信用バッファ
1919

2020
// 受信時の構造体
2121
type RecvStruct struct {
22-
Volt uint8
23-
IsHoldBall bool
24-
CapPower uint8
22+
Volt uint8
23+
IsDetectPhotosensor bool
24+
IsTouchingDribbler bool
25+
CapPower uint8
2526
}
2627

2728
type SendStruct struct {

0 commit comments

Comments
 (0)