Rotorcraft attitude motion controller¶
Motion controller using force and torque to achieve desired attitude.
This actuator reads roll,pitch, yaw rate (or yaw, depending the control mode) 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. In YawRateControl, the yaw-rate input is integrated to yield an absolute yaw setpoint for the controller, otherwise yaw is considered directly as the order. Thrust is directly applied as force in z-direction of the robot.
Note
Angle are given in aerospace North East Down convention (NED)
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
LinearThrust
(bool, default:True
)- If set to true, the force thrust is linear w.r.t. the collective thrust input (Force = ThrustFactor*thrust). If set to false, the force thrust is quadratic w.r.t. the collective thrust input (Force = ThrustFactor*thrust^2)
YawRateControl
(bool, default:True
)- If set to true, the robot is controlled in YawRate, otherwise yaw is considered directly as the order
UseAngleAgainstNorth
(bool, default:False
)- If set to true, return the absolute yaw against North. The whole geodetic coordinates (longitude, latitude, altitude, angle_against_north) must be configured. Otherwise, return the yaw against the Blender coordinates
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
)- If YawRateControl yaw rate in radians/sec, otherwise yaw angle in radian
thrust
(float, initial value:0.0
)- collective thrust: 0 .. 1 (= 0 .. 100%)
Interface support:
ros
as std_msgs/Float32MultiArray (morse.middleware.ros.rotorcraft_attitude.RotorcraftAttitudeReader
)socket
as straight JSON deserialization (morse.middleware.socket_datastream.SocketReader
)yarp
as YarpReader (morse.middleware.yarp_datastream.YarpReader
)mavlink
as AttitudeTarget (morse.middleware.mavlink.read_attitude_target.AttitudeTarget
)
Services for Rotorcraft attitude motion controller¶
get_configurations()
(blocking)Returns the configurations of a component (parsed from the properties).
Return value
a dictionary of the current component’s configurations
get_properties()
(blocking)Returns the properties of a component.
Return value
a dictionary of the current component’s properties
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
Examples¶
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
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')
Other sources of examples¶
(This page has been auto-generated from MORSE module morse.actuators.rotorcraft_attitude.)