<<Prev 1 2 3 4 5 6 7 8 9 10 Next>>
Talking to the NXT
To communicate with the NXT brick we use the RoboRealm Lego NXT module under the control category.
This module provides us a way to use variable values to control or read aspects of the Lego NXT.
The module uses serial communication over bluetooth to communicate with the Lego NXT. See
the documentation for more information about the setup.
We will only be using the motor commands to steer the Lego NXT robot to its destination. While all
the other sensors can be used this tutorial only focuses on the motors of the robot.
From the interface image you can see that we have 3 variables that are required in order to
move the robot. Depending on the values of LEFT_MOTOR and RIGHT_MOTOR the appropriate commands
will be sent over bluetooth to the NXT in direct mode to command the left and right motor to move.
Be sure that your left and right motors are plugged in the right way round otherwise your robot will
move left when it should have moved right!
Note that the gripper on the Tribot is also a motor. BUT you don't want to leave that motor on for
long otherwise you will stress the structure and potentially pop the grippers AND camera off from
the robot (this was done numerous times while developing this tutorial). The gripper motor should
only be activated for a short period of time to open the gripper but once the ball has been
grabbed you will need to leave the motors on to ensure the ball stays in place.
The last part that we need for this project to work is to connect what the vision system produces
with these motor commands. For that we need a bit of programming code ...
<<Prev 1 2 3 4 5 6 7 8 9 10 Next>>
|