Chapter 7. Creating a New Hardware Interface

Until now, this book has focused on robotics hardware supported by Microsoft Robotics Studio (MSRS). This means that the MSRS installation contains the onboard interface and service files necessary to interface with and operate a particular robot. But what if you want to work with your own custom-built robot or a robot kit not already supported by MSRS?

To operate an unsupported robot, you need to create an onboard interface that executes directly on the robotics hardware. You also must create services that not only communicate with the onboard interface but are also used to perform specific functions such as subscribe to a robot’s contact sensors or send commands to drive the robot. In this chapter, we will review the steps needed to operate an unsupported robot named ARobot. Even if you decide not to purchase and assemble the ARobot, the sections in this chapter provide a good understanding of the steps necessary to build your own hardware interface with MSRS.

Working with the ARobot

ARobot is a three-wheeled robot kit (see Figure 7-1) made by a small robotics company in Texas named Arrick Robotics. ARobot was designed and built by the company’s owner, Roger Arrick (see the sidebar titled Profile: Roger Arrick). The ARobot, pronounced "a robot," was created for robot hobbyists, and, like the BoeBot, it uses a Basic Stamp 2 (BS2) controller chip to provide the brains for the robot.

The ARobot by Arrick Robotics is an expandable, three-wheeled robot designed for robotics hobbyists.

Figure 7-1. The ARobot by Arrick Robotics is an expandable, three-wheeled robot designed for robotics hobbyists.

You can purchase a complete ARobot kit from the Arrick Robotics Web site (/www.robotics.com/arobot) for $284. The ARobot will take you around three hours to assemble with basic hand tools. After you assemble it, the robot can be programmed using BASIC Stamp software provided by a company named Parallax (www.parallax.com). You can download a free version of the BASIC Stamp software from the following URL: www.parallax.com/html_pages/downloads/software/software_basic_stamp.asp. You need this to build the onboard remote communications interface for the ARobot. We will cover building this interface in the next section, Build an Onboard Interface.

Unlike the robots covered in previous chapters, the ARobot does not have a two-wheel differential drive system. Instead, it uses a remote control servo motor to steer and a bidirectional, front-drive gear motor to move the robot. Because of this, we will not use the generic drive service included with MSRS when controlling the ARobot’s ability to move. The steps for building the drive service will be covered in the section titled Build a Drive Service.

The ARobot includes two front whisker sensors that can be used as bumpers for the robot. When triggered, they will indicate that an object collision is about to happen. In this case, we will be able to use the generic contact sensors service to implement a bumper service for the ARobot. This will be covered in the section titled Build a Bumper Service.

To communicate with the ARobot using MSRS, we will need to build several layers or services that serve as an abstraction for the actual robot (see Figure 7-2). The first layer that is needed is the onboard interface, which consists of a BASIC program that executes on the ARobot’s BS2 controller. This program will communicate directly with the ARobot’s control service.

Diagram of the multilayered services used to communicate with the ARobot.

Figure 7-2. Diagram of the multilayered services used to communicate with the ARobot.

The core service is responsible for accepting operation requests from the ARobot services and mapping them to the appropriate commands that execute on the ARobot. For example, to make the robot move, you need to execute commands on the ARobot that operate the steering and drive motors. Operation requests are sent from the ARobot’s drive service to the core service. These operations are then mapped to the appropriate commands and sent to the ARobot via a wired or wireless serial data connection. The result is movement by the robot.

Each sensor or actuator is represented through an individual service. Multiple high-level services are used to represent the interface that outside services use to communicate with the ARobot. If you were to add an additional component to the ARobot, such as an ultrasonic sensor, then an additional service representing this sensor would also need to be added. Only the high-level services should communicate directly with the core service. Services used to control the ARobot should access these services and not the core service.

Tip

Tip

After assembling your ARobot, do not be surprised when you power it up and find that it does nothing. The BS2 comes to you empty. To get the robot to do anything, you will have to download a BASIC program to the coprocessor using the BASIC Stamp Editor. You can download the ARobot User Guide for detailed instructions on how to assemble and operate the ARobot through the following URL: www.robotics.com/arobot/guide.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.155.70