A generic actuator to control pan-tilt supports
This actuator reads the rotation values for pan and tilt, and applies them to the pan-tilt unit that must be set as children of this actuator. Angles are expected in radians.
Unlike most other actuators, the Pan-Tilt unit is composed not only of an Empty object, but it also includes two meshes. These are the PanBase and the TiltBase that must also be imported when using this actuator. These meshes will rotate to produce the effect of a real Pan-Tilt unit.
When mounting a camera or stereo unit on top of the Pan-Tilt unit, make sure to parent the camera to the PTU object.
This component can be configured to be operated manually as well as through data from a middleware. When using manual mode, the pan and tilt segments can be rotated using the following keys:
You can set these properties in your scripts with <component>.properties(<property1>=..., <property2>=...).
Rotation speed, in rad/s
(no documentation available yet)
If true, the PTU can only move via the keyboard.
This actuator reads these datafields at each simulation step:
Pan value, in radians
Tilt value, in radians
Returns the properties of a component.
a dictionary of the current component’s properties
Move the platine to look in the direction of the given object.
Move the platine to a given target position, represented by an angle couple.
Move the platine to look towards a given point. The point is expected to be given in the world reference
Returns the current angles for the pan and tilt segments.
a couple of float, representing respectively the pan and the tilt of the platine, in radian.
Returns the configurations of a component (parsed from the properties).
a dictionary of the current component’s configurations
Modify one property on a component
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 actuator ptu = PTU() # place your component at the correct location ptu.translate(<x>, <y>, <z>) ptu.rotate(<rx>, <ry>, <rz>) robot.append(ptu) # define one or several communication interface, like 'socket' ptu.add_interface(<interface>) env = Environment('empty')