Page 111 - Designing Autonomous Mobile Robots : Inside the Mindo f an Intellegent Machine
P. 111

Chapter 6

            To allow computer operating systems to be compatible with a wide range of peripher-
            als, the burden was eventually placed on the hardware vendor to provide the
            interface. If the interface is at the hardware level (such as driving a printer through a
            serial port), the interface program is usually called a driver. Everyone who has ever
            installed a modem on their home PC has run into the process of loading the proper
            driver.
            When the interface is at the software level, it is usually in the form of a DLL
            (dynamically linked library) or an OCX (active-X control object). A DLL is a library
            containing definitions and procedures that can be called from your application. You
            need to understand what each procedure does and in what sequence, and with what
            data they must be called. This process is usually straightforward, but exacting.
            When an interface is provided as an OCX, it is in the form of a drop-in object that
            contains a completely encapsulated interface to the system. A good OCX will make
                                 6
            you look like a genius .  The software programmer manipulates the OCX by setting
            its properties or calling its methods, and the OCX generates the application protocol
            messages to cause the desired result. All of the communications details are hidden
                                 7
            from the programmer . In many cases, the OCX will provide its own forms for the
            control of parameters, or the display of video, and so forth.

            Porting your application protocol over the Ethernet is equally simple. In Visual
            Basic, you only need to drop a TCP host object into your project, and to tell it the
            address of the robot. If your link is to break out on the robot to a serial (RS-232)
            connection, this can be done with a small box called a port server. The port server
            IP address is entered into the host along with a port number. The port number
            usually defines the way the serial data will be handled. Port 6001 is typically used for
            straight-through connections.

            Programming the transmission and reception of data with these “drop-in” hosts and
            clients is done very much as it is with serial communications. On the transmitting
            end, the data is simply loaded into the transmit buffer. On the receiving end, data
            arriving will generate events. These events are exactly like serial communications
            interrupt handlers, and if the status properties are okay, the data can be sent to your
            application protocol decoder.


            6  We used a digital video system from Indigo which had an excellent OCX.
            7  The proper solution to standardizing interfaces for the security robots mentioned earlier would
              have been to require each robot vendor to supply an OCX with certain properties and procedures,
              and not try to standardize the application layer protocol.



                                                    94
   106   107   108   109   110   111   112   113   114   115   116