Amigobot Landmark Recognition Software



The assembly implementation of sonar based landmark recognition and navigation software allows an AmigoBot controlled by a 16bit simple computer implemented on an Altera FLEX controller to position itself within a known landmark consisting of three equally spaced buckets. Obstacle avoidance, and landmark recognition will be implemented using the robot’s eight sonar units, each capable of resolving distance to the centimeter reliably within a two meter range. Robot navigation software consists of partitioned sets of subroutines, callable to perform basic repeatable operations.




This robot was programmed as part of a final project in ECE2031 (Digital Design Lab). This semesters task was landmark recognition. A landmark composed of three five gallon buckets centered at the vertices of an equilateral triangle with edge length of 4 feet is located at a random position in the main hallway of the ECE building. An Amigobot must be programmed to locate the landmark and drive from it's random starting point in the mail hallway to the landmarks center. While locating the landmark it must not collide with the walls and should not drive down the side hallways. A soft collision with the walls will subtract 5 points from the final score and a hard collision will disqualify the robot. While no penalty will be assessed for driving down the side hallway, the robot would probably not complete the task in the requires 5 minutes if it traverses a side hallway. The robot must stop and display FF on its LED display before the 5 minute time limit ends. The final score is determined by the final distance from the center of the landmark.

Teams of 4 worked to program a given robot. The code and diagrams presented here are my part of the project, Landmark recognition and traversal. Code and methods for obstacle avoidance, hallway traversal and initial orientation were implemented by other team members and are not presented here.



The amigobot has 8 sonar sensors for navigation and landmark recognition, 4 on the front, 2 on the sides and 2 on the back. The amigobot is controlled by an Altera Flex CPLD, on which a simple computer is implemented in VHDL.

The navigation software for the amigobot is programmed in assembly, which is then compiled and loaded onto the Altera Flex controller as a memory initialization file.


Simple Computer Instruction Set Architecture:

The Table presented on the right contains all the assembly instructions implemented on the SCOMP.



Mathematical functions and subroutines implemented in assembly:

  • Operand system: Memory registers created for input to functions (OperandA, OperandB) and to retrieve results from functions (Result1, Result2)
  • Multiply: Multiplies OperandA and OperandB by iterative addition. Result1 = OperandA*OperandB = OperandA added to 0 OperandB times.
  • Divide: Divide operates by iterative subtraction. Result1 = OperandA/OperandB, Result2 = OperandA%OperandB
  • Power: Iteratively calls multiply. Result1 = OperandA^OperandB
  • Cos: Approximates cosine by taylor expansion (-90deg<=OperandA>=90deg). Result1 = cos(OperandA) = 100 - (OperandA^2)/81
  • SonarFD: First difference filter for edge detection. ;AC = 0 if invalid, positive if edge, negative if not. Result1 = current distance in cm, 0 if invalid
  • Sonarshift: Converts sonar reading to cm and checks for errors.
  • Orbit: Orbits bucket at given radius and velocity.
  • Radialshift: Computes wheel velocities for orbit.

The code is fairly well commented, and explanations are given for most functions in the code.



Landmark Recognition:

The robots primary objective is to recognize a landmark composed of three identical 12-15” diameter buckets centered at the vertices of an equilateral triangle with edge length of 4 feet. After the robot identifies one or more of the vertices, it must navigate to the center of the bucket arrangement. Buckets will be distinguished from other objects by edge detection. A radial scan of the sonar will be initiated, and past distance readings will be recorded. When a sudden decrease in distance occurs that exceeds a preset threshold stored in memory, the robot will identify this as a bucket at one of the vertices of the landmark.

To position itself in the center of the landmark the robot will travel in a circular path, at a radius of half the spacing between the buckets, around the vertex of the triangle until its heading is normal to an edge. At this point the sonar will be detecting the opposing vertex and the center of the landmark will be located directly between the robot and opposing bucket. The robot will proceed in a straight line for a preset distance until it reaches the center of the landmark, display FF and end program execution.


Amigobot Navigation:


Amigobot Navigation:


Useful links:




By attempting to reproduce any experiments or devices listed on this domain in part or in whole, you agree to hold me harmless against any lawsuit or liability.

Copyright © 1998 - 2005 by Andrew Seltzman. All rights reserved.

Contact me at: