Lesson 1: What is a Bumper Sensor?
In this Lesson, you will learn what a sensor is and why you would use sensors with a VR Robot. The first sensor that you will learn about is the Bumper Sensor. You will learn how the Bumper Sensor works and how to use the VR Robot Bumper Sensors in a VEXcode VR project.
Learning Outcomes
- Identify that the Bumper Sensor is a type of switch.
- Identify that the Bumper Sensor reports a value of either FALSE (released) or TRUE (pressed).
- Identify that the Bumper Sensor can be used to cause a VR Robot action when pressed or released.
- Identify that the <Pressing bumper> block is a Boolean that reports if the Bumper Sensor is pressed.
- Describe why the Bumper Sensor would be used in a VEXcode VR project.
Bumper Sensor
The VR Robot has two Bumper Sensors located on the front.
A Bumper Sensor is a switch that reports if it is pressed or released.
- The Bumper Sensor will report a sensor value of TRUE when the Bumper Sensor is pressed.
- The Bumper Sensor will report a sensor value of FALSE when the Bumper Sensor is released.
The Bumper Sensor is pressed by walls in the Wall Maze Playground, or by the outer walls surrounding other Playgrounds.
The Bumper Sensor is used to determine if the VR Robot is touching an object or wall. Use the <Pressing bumper> block in a VEXcode VR project to check the condition of the Bumper Sensor.
Read the Bumper Sensor - Robot Features - VEX VR article for detailed information on how the Bumper Sensor works.
<Pressing bumper> Block
<Pressing bumper> is a Boolean reporter block. It reports TRUE if the Bumper is pressed, and FALSE if it is not pressed.
Using Switch Blocks
This is the Switch <Bumper pressed> block.
The <Pressing bumper> block is used with blocks from the Control category that accepts hexagonal Boolean blocks.
In the following example, the VR Robot will drive forward until the Left Bumper is pressed. Once the Left Bumper is pressed, the VR Robot will stop driving.
Apply
Sensors are essential to robotics. For a VR Robot to truly be considered a robot, it must be able to sense and interact with its environment. This is commonly referred to as the Sense → Think → Act decision loop.
A VR Robot uses sensors to collect data from its surroundings (Sense), make decisions based on this information (Think) and turn that information into instructions for behaviors (Act).
Sensors enable a VR Robot to interact with its environment, and allow the user to create more dynamic projects. These dynamic projects require a VR Robot to interact and respond to changing environments.
In this Unit, you are introduced to the Bumper Sensor, a sensor that can detect physical contact. The Bumper Sensor is used to inform a VR Robot when it has made contact with an object or wall. A VR Robot can then use the reported information from the Left Bumper Sensor to make decisions. In the example below, the VR Robot will drive forward, then make a 90 degree right turn after the Left Bumper Sensor is pressed, detecting contact with an object or wall.