NXT or EV3 gyro sensor
LEGO doesn't make a gyro sensor for NXT, but Hitechnic sells a gyro third party product and Mindsensors has a combo gyro/accelerometer/compass (IMU). Both can be used with EV3, and LEGO also has a gyro sensor, included in the Education kit