Seeing Eye Robot
This multi-robot project demonstrates communication and coordination between 2 NXT robots to accomplish a task. The NXT leader robot with a sonar sensor navigates an obstacle course, and then the leader transmits a sequence of movement commands to a second NXT follower robot with no sensors. The follower robot then successfully navigates the obstacle course. This multi-robot project demonstrates how one robot can share sensor data with another robot to accomplish navigation.
Topics covered in this project:
- Use of sonar sensor interfacing and calibration.
- Use of motor encoders and understanding mathematical and mechanical relationship between encoder counts and robot motion.
- Construction and building techniques (ball gripper).
- Transmitting and Receiving Data from an RS-485 Device (NXTBee)
- Using External Libraries
- Formatting strings and converting strings to integers
Note: The concepts outlined in this lesson are geared towards an intermediate user of ROBOTC and C Programming languages. Students should be comfortable with all material covered in the Teaching ROBOTC for MINDSTORMS curriculum before jumping into any Multi-Robot communication lessons.
- Remember when using Multi-Robot communications to always start the robot that is the receiver first. Otherwise, the receiving robot will not be listening when the sending robot broadcasts it's message.
Hardware and Software Required
- Sonar sensor assembly for one NXT robot B Building Instructions (PDF)
- The leader NXT robot (Robot A) should be equipped with a single, front-facing sonar sensor.
- The follower NXT robot (Robot B) does not possess any sensors.
- Both robots should have the same drive system and wheels.
- An NXTBee radio should be connected to sensor port 4 of each robot. The radios on each robot should be paired so that there is communication.
- A simple obstacle course should be setup which requires forward motion, and 90 degree right turn and left turns. In this lab, a single corner piece was setup (see figures.) The follow-up challenges require more advanced obstacles courses.
- The leader robot should be positioned 1 foot in front of the follower robot.
- The forward distances to the walls of the obstacle course are unknown and must be determined by the leader robot using the sonar sensor.
- The goal of the leader robot is to navigate through the 1-corner obstacle course (maze). The required motion consists of a forward path determined by sonar, then a 90 degree right turn, then forward. During the navigation, the leader robot is creating and storing navigation commands, in the form of string messages, which will be sent to the follower robot. When the leader robot completes the navigation of the obstacle course (maze), the leader robot stops, and then transmits a sequence of motion command strings to the follower robot. After each command is transmitted to the follower, the leader waits for a reply from the follower that the motion was completed before transmitting the next command.
- The leader robot code must take into account the fact that the follower robot was initially positioned 1 foot behind the leader robot. Also, the follower robot should end up approximately 1 foot behind the leader robot at the end of the task.
- The goal of the follower robot is to establish a loop to receive a sequence of string messages from the leader robot using the NXTBee. Each string command will be parsed and numerical data will be converted into an integer. The possible motions include move forward (based on the encoder count received) or turn right or left. After each command is executed, the follower robot will send a message to the leader that the command has been successfully executed. Based on these received commands, the follower robot will navigate through the obstacle course (maze).
Robot A (Leader) Source Code
- Download - Maze Robot A
Robot B (Follower) Source Code
- Download - Maze Robot B
Follow-up Project: 2-corner Challenge
Goal: Expand the results of the 1-corner challenge to a 2-corner obstacle course (see pictures and video below.) Robot A (leader) should move forward (an unknown distance) to a wall of the first corner, turn right, move forward (an unknown distance) to wall of second corner, then turn left, then move forward to exit the obstacle course. Motion commands should then be sent from Robot A to Robot B so that Robot B can successfully navigate through the obstacles without using any sensors. Robot B should start approximately 1 foot behind Robot A at the start, and Robot B should stop approximately 1 foot behind Robot A after exiting obstacle course. (See video below.)
More Follow-up Projects and Discussion Questions
- Modify and expand the obstacle course (maze). For example, add additional turns and complexity.
- Add functionality to the follower robot such as carrying payload, etc.
- Add functionality to the leader robot software so that if the follower robot fails at some point to execute one the commands, the leader robot will display an error message and the name of the command that failed (Hint: use timer).
- Replace wheels/tires with wheels of a different diameter on the leader or follower robot. How does this impact the encoder readings? How would the code need to change?
- In this example, the turns were fixed at 90 degrees. Modify this example so that different turning angles can be used.
- Modify the leader robot to use another sensor instead of the sonar sensor to determine distances.
- Add additional follower robots that will move successfully through the maze based on commands from the leader.
- Modify the algorithm so that the follower robot begins to execute commands and moves to follow Robot A before Robot A exits the obstacle course. Be careful of collisions. What are the advantages and disadvantages of this approach?
- Create, test, demonstrate and share your own challenge or application based on this technology.
- What are some real-world applications of this technology?