Transmit Copy and Collect

From FIRE Wiki
Jump to: navigation, search

Project Description

This multi-robot project demonstrates communication and coordination between 2 NXT robots to accomplish a task. Two NXT robots are initially placed at the same starting point. The leader robot has a light sensor and the follower robot has only a gripper (no sensors). The leader robot will drive up to the line then transmit this distance to the follower robot. The follower robot will then drive up and collect the ball. This multi-robot project demonstrates how one robot can share sensor data with another robot with specialized capabilities.


Topics covered in this project:

  • Use of light 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

User Notes

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.

  • This lab can be performed with any 2 robots. It is not required to use a ball gripper robot. However, you need to modify the code for Robot B that operates the gripper mechanism.
  • 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



  • The leader NXT robot (Robot A) should be equipped with a single, downward-facing light sensor which has been calibrated to sense the presence of a black line (black tape) on a white background.
  • The follower NXT robot (Robot B) does not possess any sensors, but has a mechanical gripper connected to a Lego motor.
  • 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 gripper mechanism (or equivalent) should be constructed for the follower robot. The motor for the gripper is plugged into motor port A.
  • A plastic ball should be mounted on a short platform and positioned so that when the follower robot moves to the line it will be able to grasp the ball with the gripper mechanism.


  • The goal of the leader robot is to first move forward until it senses the black line. Then the leader robot stops, creates a string message based on the encoder counts (proportional to distance moved), and then sends this string message to the follower robot using the NXTBee.
  • The goal of the follower robot is to wait to receive a string message from the leader robot using the NXTBee, convert the string into an integer, and then move forward based on the encoder count received. When the follower robot reaches the goal, it stops forward motion. It then closes the gripper to grasp the ball, and then the robot moves in reverse for a short distance.
  • InitRS485(); function must be called at the start of every program to initialize the NXTBee radios.


Robot A (Leader) Source Code

Robot B (Follower) Source Code

Download - Gripper Robot B

Follow-up Projects and Discussion Questions

  1. Replace light sensor on the leader robot with other sensor such as touch sensor or sonar sensor. Modify lab so that leader uses this sensor to determine distance.
  2. Use a follower robot with a function or capability besides a ball gripper.
  3. Have the follower robot transmit a signal to the leader robot when the follower robot has successfully completed the task.
  4. Try this lab with multiple follower robots. There will be one leader robot, but each follower robot can perform a different function.
  5. 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?
  6. Create, test, demonstrate and share your own challenge or application based on this technology.
  7. What are some real-world applications of this technology?