Compute the distance to the ground
Sensor to compute the distance to the ground
To work properly, the ground and relevant obstacles must be marked as Actor.
You can set these properties in your scripts with <component>.properties(<property1>=..., <property2>=...).
Maximum distance to which ground is detected.If nothing is detected, return +infinity
This sensor exports these datafields at each simulation step:
number of seconds in simulated time
Distance to “ground”
Returns the properties of a component.
a dictionary of the current component’s properties
Returns the current data stored in the sensor.
a dictionary of the current sensor’s data
Modify one property on a component
Returns the configurations of a component (parsed from the properties).
a dictionary of the current component’s configurations
The following examples show how to use this component in a Builder script:
from morse.builder import * # adds a default robot (the MORSE mascott!) robot = Morsy() # creates a new instance of the sensor radaraltimeter = RadarAltimeter() # place your component at the correct location radaraltimeter.translate(<x>, <y>, <z>) radaraltimeter.rotate(<rx>, <ry>, <rz>) robot.append(radaraltimeter) # define one or several communication interface, like 'socket' radaraltimeter.add_interface(<interface>) env = Environment('empty')