![nxt program alpha rex nxt program alpha rex](https://cdn-o.fishpond.com/0024/353/940/213209960/original.jpeg)
The first column provides a numerical identifier that the software can use to identify each possible state. The following table lists these cases, or states. Tilting the Alpha Rex side to side may be broken down into nine separate cases defining the C motor action necessary to implement a basic movement. The rotation sensors built into the NXT motors allow them to work very nicely as servo motors. In the case of the Alpha Rex the components are the robot's two legs, which have two degrees of freedom in the way they can move: shifting the weight of the robot from one leg to the other, and moving one leg forward at the same time moving the other leg backward. Moving a limited distance means that the motor does not rotate an unlimited amount, rather the motor rotates only that amount necessary to move the lever, or connected mechanical component the required amount. Using a motor as a servo means that the primary function of the motor is to move, or actuate a lever arm over a limited distance (or travel). Unlike the RoboCenter example, the following subroutine uses the C motor as a servo (as opposed to a simple motor). The C motor (plugged into port C) moves the robot from side to side. I highly recommend reading the above pages before continuing with the rest of this discussion. The reader is pointed to the above reference for a detailed understanding of toddler movements, and since the Alpha Rex is a toddler type robot these considerations apply. The composite movement routines, described below, make use of two basic building blocks: a routine for tilting the robot side to side, and a routine to move the robot's feet back and forth.įor a complete discussion on how these two movements can be combined into composite movements see pages 33-37, 56-57, and 65-66 of the Parallax manualĪdvanced Robotics with the Toddler, by Bill Wong and Ken Gracey. Seamless movement means that a composite movement, such as tilting left and moving the right foot forward, may be combined together without the programmer needing to concern themselves with the details of servo position, direction of rotation, and amount of rotation. Seamless movement, from a programming perspective, requires that movements do not depend on other movements. Efficiency and economy in programming dictates that these basic movements link together seamlessly to provide more complex movements, such as walking forward, or turning right. The other servo moves the feet backward and forward. One servo shifts the robot's weight from one foot to the other foot. Generally speaking a toddler robot uses only two servos for movement, like the Alpha Rex. The Alpha Rex mechanical design falls into a category referred to by robotics hobbyists as a toddler biped. The final section, following the description of these techniques, presents the development of a complete program for avoiding obstacles. The following sections describe these techniques in much more detail. Furthermore, including such functionality as having the Alpha Rex walk around avoiding obstacles behooves the application of more advanced programming techniques. However the examples are rather inadequate when it comes to combining basic movements into more complex movements, such as having your Alpha Rex move in a figure eight pattern. The RoboCenter examples perform basic movements such as walking forward and turning. The inspiration for this program comes mainly from sources other than the Mindstorms RoboCenter software examples for the Alpha Rex. Abstraction handles combining the basic movements into more complex movements, such as walking forward and turning right and left. A state machine design handles basic movements such as tilting side to side and striding the robot's feet forward and backward. The program described below illustrates two advanced programming techniques: state machines and abstraction. The following discussion will concentrate on software programming of the Alpha Rex.
#Nxt program alpha rex series
The Alpha Rex comprises probably the most complex of the RoboCenter series of robots, both from the mechanical design perspective and the software programming perspective.