Skip to content

Touch Sensor

Cort edited this page Dec 20, 2020 · 1 revision

This simulates a touch sensor. Unlike those found on a Lego EV3 robot, you cannot add components to the button, but you may configure its width and depth.

Working Principles (Simulator)

This works by detecting physics collision with the red button at the bottom of the sensor. Unlike ray casting method used by the Ultrasonic and Laser sensors, the physics collision method can detect collision with any points in the sensor area, with no risk of the obstacles falling between rays.

Differences from a real sensor

  • You cannot add components to the button.

  • A real sensor is spring loaded, and requires the button to be sufficiently depressed to detect a press. The simulated sensor will detect a touch on even the slightest touch, and it exerts no spring pressure on the obstacle.

Configurations

Default values are shown below.

"type": "TouchSensor",
"options": {
  "width": 2,
  "depth": 2
}

width: Width of the sensor body. Note that the detection area is 2mm shorter than the sensor body.

depth: Depth of the sensor body. Note that the detection area is 2mm shorter than the sensor body.