Differential Driver Actuator: Linear and angular speed (V, W) actuator ================================================================================== 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 :doc:`Segway RMP 400 <../robots/segwayrmp400>` and the :doc:`Pioneer 3-DX <../robots/pioneer3dx>`. 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 where: - **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 .. cssclass:: properties morse-section Configuration parameters for Differential Driver Actuator: Linear and angular speed (V, W) actuator --------------------------------------------------------------------------------------------------------------- *No configurable parameter.* .. cssclass:: fields morse-section Data fields ----------- This actuator reads these datafields at each simulation step: - ``v`` (float, initial value: ``0.0``) linear velocity in x direction (forward movement) (m/s) - ``w`` (float, initial value: ``0.0``) angular velocity (rad/s) *Interface support:* - :tag:`pocolibs` as `GENPOS_CART_SPEED `_ (:py:mod:`morse.middleware.pocolibs.actuators.genpos.GenPosPoster`) - :tag:`ros` as `geometry_msgs/Twist `_ (:py:mod:`morse.middleware.ros.motion_vw.TwistReader`) - :tag:`socket` as straight JSON deserialization (:py:mod:`morse.middleware.socket_datastream.SocketReader`) - :tag:`yarp` as yarp::Bottle (:py:mod:`morse.middleware.yarp_datastream.YarpReader`) - :tag:`moos` as MotionReader (:py:mod:`morse.middleware.moos.motion.MotionReader`) .. cssclass:: services morse-section Services for Differential Driver Actuator: Linear and angular speed (V, W) actuator ----------------------------------------------------------------------------------------------- - ``get_properties()`` (blocking) Returns the properties of a component. - Return value a dictionary of the current component's properties - ``set_speed(v, w)`` (blocking) Modifies v and w according to the parameters - Parameters - ``v``: desired linear velocity (meter by second) - ``w``: desired angular velocity (radian by second) - ``set_property(prop_name, prop_val)`` (blocking) Modify one property on a component - Parameters - ``prop_name``: the name of the property to modify (as shown the documentation) - ``prop_val``: the new value of the property. Note that there is no checking about the type of the value so be careful - Return value nothing - ``stop()`` (blocking) Stop the robot Internally, it sets (v, w) to (0.0, 0.0) - ``get_configurations()`` (blocking) Returns the configurations of a component (parsed from the properties). - Return value a dictionary of the current component's configurations .. cssclass:: examples morse-section Examples -------- The following examples show how to use this component in a *Builder* script: .. code-block:: python 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(, , ) motionvwdiff.rotate(, , ) robot.append(motionvwdiff) # define one or several communication interface, like 'socket' motionvwdiff.add_interface() env = Environment('empty') .. cssclass:: files morse-section Other sources of examples +++++++++++++++++++++++++ - `Source code <../../_modules/morse/actuators/v_omega_diff_drive.html>`_ - `Unit-test <../../_modules/base/v_omega_diff_drive_testing.html>`_ *(This page has been auto-generated from MORSE module morse.actuators.v_omega_diff_drive.)*