Rotorcraft attitude motion controller
=====================================


**Motion controller using force and torque to achieve desired attitude.**


This actuator reads roll,pitch, yaw rate and thrust commands as e.g.
used to manually control a quadrotor via RC or by higher level
control loops. This controller is meant to be used by quadrotors and
similar flying robots with Rigid Body physics in blender. It is a
simple PD-controller which applies torques to the robot to change
and control the attitude. The yaw-rate input is integrated to yield
an absolute yaw setpoint for the controller. Thrust is directly
applied as force in z-direction of the robot.

.. note:: Angle are given in aerospace North East Down convention (NED)


.. cssclass:: properties morse-section

Configuration parameters for rotorcraft attitude motion controller
------------------------------------------------------------------


You can set these properties in your scripts with ``<component>.properties(<property1>=..., <property2>=...)``.

- ``RollPitchPgain`` (float, default: ``100.0``)
	proportional gain for roll/pitch control
- ``RollPitchDgain`` (float, default: ``20.0``)
	derivative gain for roll/pitch control
- ``YawPgain`` (floatproportional gain for yaw control, default: ``16.0``)
	(no documentation available yet)
- ``YawDgain`` (float, default: ``4.0``)
	derivative gain for yaw control
- ``ThrustFactor`` (float, default: ``40.0``)
	multiplication factor for applied thrust force in N


.. cssclass:: fields morse-section

Data fields
-----------


This actuator reads these datafields at each simulation step:

- ``roll`` (float, initial value: ``0.0``)
	roll angle in radians
- ``pitch`` (float, initial value: ``0.0``)
	pitch angle in radians
- ``yaw`` (float, initial value: ``0.0``)
	yaw angle in radians
- ``thrust`` (float, initial value: ``0.0``)
	collective thrust: 0 .. 1 (= 0 .. 100%)

*Interface support:*

- :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`)


.. cssclass:: services morse-section

Services for Rotorcraft attitude motion controller
--------------------------------------------------

- ``get_properties()`` (blocking)
    Returns the properties of a component.
    
    
  - Return value

    a dictionary of the current component's properties  

- ``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 *
    
    robot = ATRV()
    
    # creates a new instance of the actuator
    rotorcraftattitude = RotorcraftAttitude()

    # place your component at the correct location
    rotorcraftattitude.translate(<x>, <y>, <z>)
    rotorcraftattitude.rotate(<rx>, <ry>, <rz>)
    
    robot.append(rotorcraftattitude)
    
    # define one or several communication interface, like 'socket'
    rotorcraftattitude.add_interface(<interface>)

    env = Environment('empty')
    

.. cssclass:: files morse-section

Other sources of examples
+++++++++++++++++++++++++

- `Source code <../../_modules/morse/actuators/rotorcraft_attitude.html>`_
- `Unit-test <../../_modules/base/rotorcraft_attitude_testing.html>`_




*(This page has been auto-generated from MORSE module morse.actuators.rotorcraft_attitude.)*
