Đang chuẩn bị liên kết để tải về tài liệu:
Hacking Roomba - Tod E.Kurt Part 5

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Tham khảo tài liệu 'hacking roomba - tod e.kurt part 5', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 102 Part I Interfacing Listing 5-3 Continued pause int pausetime 1000 stop public void spinLeft int angle if angle 0 return float pausetime Math.abs millimetersPerDegree angle speed spinLeftAt Math.abs speed pause int pausetime 1000 stop Pivoting around a particular angle looks like this roombacomm.spinLeft 90 turn anti-clockwise 90 degrees roombacomm.spinRight 360 spin totally around Moving in Curves The straight motion and pivot turns are sufficient to move around but arc turns are more efficient when dealing with obstacles. Watch the Roomba while it operates and you ll notice it performs three basic types of non-pivot turns see Figure 5-7 Small circle The Roomba moves in a circle with a radius a little bigger than itself. This is performed when the Roomba bumps against something usually a table leg and tries to drive around it. Waggle The Roomba moves forward by moving in alternating arcs with radii larger than the Roomba. This is performed when the Roomba is searching for something dirt home base and so on . Expanding spiral The Roomba moves in a circle that gets bigger and bigger accomplished by gradually increasing the radius over time. This is performed when the Roomba thinks it is in a large open area of floor. The small circle is pretty evident now. You can implement it in RoombaComm with something like roombacomm.drive 200 300 250 mm s turn left on 300 mm radius You can test that out with the roombacomm.Drive program. The waggle is just the same but with a larger radius approximately 600 and it switches every quarter second or so. To emulate it you could do something in a loop for however long you want like Listing 5-4. Chapter 5 Driving Roomba 103 Small circle Waggle Expanding spiral Figure 5-7 Common preprogrammed Roomba moves Listing 5-4 The Main Loop of Waggle.java while done roombacomm.drive 200 600 roombacomm.pause 250 roombacomm.drive 200 -600 roombacomm.pause 250 104 Part I Interfacing You can test this out with the roombacomm.Waggle test program.

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.