Sensor
Last updated
Last updated
Sensors are detecting . The sensor can use BoxColliders or Raycasts for collision detection. A behavior component (e.g. Sensor_Standard) must be added to the Sensor for a connection to a PLC’s Input and Outputs.
This tutorial explains first steps with Sensors:
This picture shows a configured Sensor using Colliders in the demo model:
Because collisions are used to detect the Sensor status you need to take care that the sensor game object is on the appropriate collision layer which should be normally g4aSensor.
The Sensor can change the color by changing the material of the sensor. For this, you need to select Display Status.
Another way for implementing Sensors is to use Raycasts. The advantage of a Raycasts is, that you don’t need to define colliders and you are totally free which Layers you would like to check with the Raycast.
Because there is no sensor geometry connected to a Raycast Sensor you need to define the Raycast Direction from the pivot point of the Gameobject and the Raycast length, as usual in mmm in realvirtual.io. In the game view the Raycast is shown as a Line Renderer which is automatically created on simulation start.
The current sensor status can be inspected under the section Sensor IO’s.
You can subscribe to the Unity Events on the Sensor.
Event MU Sensor is called on every MU detected by the Sensor.
Event Non MU Gameobjet Sensor is called for all colliders without an MU script that are colliding with the Sensor.
Besides the color of the sensor you can check the state of the sensor in the section Sensor Status in the Inspector of the Sensor.
The Sensor_Standard component provides the standard Sensor behavior and connectivity to the PLC inputs and outputs. With the property NormallyClosed=true it can be selected, as the sensor is true and the sensor is not occupied.
It is possible to limit the sensor function to a certain Tag of the . You must enter the Tag in the property Limit Sensor To Tag.
Please check the for more information about the properties and methods of this component.
© 2022 in2Sight GmbH - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.