1. A method implemented by a processor, the method comprising: receiving, at the processor, information of an image of a surgical tool that was captured by an image capture device, wherein the surgical tool has a first marker that includes a first identification feature which includes a first plurality of dots, the first plurality of dots arranged in a first pattern of dots which indicates values of first data bits and a value or values of at least one first error checking bit, wherein a value of a corresponding one of the first data bits and the at least one first error checking bit is determined by a presence or absence of a dot in each location of a predefined pattern of possible dot locations, wherein the values of the first data bits indicate an identity of the first marker, and wherein the value or values of the at least one first error checking bit indicates one of an informational redundancy and a correctness of the first data bits; determining, by using the processor, a position and orientation for the first marker by processing the received image; determining, by using the processor, the identity of the first marker by comparing the first pattern of dots against a plurality of patterns of dots, wherein each of the plurality of patterns of dots identifies a unique marker by depicting a different combination of the presence and absence of dots in the predefined pattern of possible dot locations than all others of the plurality of patterns of dots; validating, by using the processor, the determined identity of the first marker by using the value or values of the at least one first error checking bit; determining, by using the processor, a tool state for the surgical tool by using the determined position and orientation for the first marker and the determined identity of the first marker after being validated; and commanding, by using the processor, a robotic mechanism to move the surgical tool in response to input from a control device by using the determined tool state for the surgical tool.