This actuator reads the values of linear and angular speed and applies them to the robot as speeds for the wheels. It only works with robots of the type WheeledRobot, such as the Segway RMP 400 and the Pioneer 3-DX. The movement of the robot is more realistic, but also depends on more factors, such as the friction between the wheels and the surface.
The speeds for the left and right wheels are calculated as:
left_speed = (v - e w) / R right_speed = (v + e w) / R
- v is the linear velocity given as parameter
- w is the angular velocity given as parameter
- e is half of the distance between the left and
right wheels - R is the radius of the wheels
No configurable parameter.
This actuator reads these datafields at each simulation step:
linear velocity in x direction (forward movement) (m/s)
angular velocity (rad/s)
Returns the properties of a component.
a dictionary of the current component’s properties
Modifies v and w according to the parameters
Modify one property on a component
Stop the robot
Internally, it sets (v, w) to (0.0, 0.0)
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 actuator motionvwdiff = MotionVWDiff() # place your component at the correct location motionvwdiff.translate(<x>, <y>, <z>) motionvwdiff.rotate(<rx>, <ry>, <rz>) robot.append(motionvwdiff) # define one or several communication interface, like 'socket' motionvwdiff.add_interface(<interface>) env = Environment('empty')