/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE HIL_CONTROLS PACKING
package com.MAVLink.common;
import com.MAVLink.MAVLinkPacket;
import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.Messages.MAVLinkPayload;
/**
* Sent from autopilot to simulation. Hardware in the loop control outputs
*/
public class msg_hil_controls extends MAVLinkMessage{
public static final int MAVLINK_MSG_ID_HIL_CONTROLS = 91;
public static final int MAVLINK_MSG_LENGTH = 42;
private static final long serialVersionUID = MAVLINK_MSG_ID_HIL_CONTROLS;
/**
* Timestamp (microseconds since UNIX epoch or microseconds since system boot)
*/
public long time_usec;
/**
* Control output -1 .. 1
*/
public float roll_ailerons;
/**
* Control output -1 .. 1
*/
public float pitch_elevator;
/**
* Control output -1 .. 1
*/
public float yaw_rudder;
/**
* Throttle 0 .. 1
*/
public float throttle;
/**
* Aux 1, -1 .. 1
*/
public float aux1;
/**
* Aux 2, -1 .. 1
*/
public float aux2;
/**
* Aux 3, -1 .. 1
*/
public float aux3;
/**
* Aux 4, -1 .. 1
*/
public float aux4;
/**
* System mode (MAV_MODE)
*/
public short mode;
/**
* Navigation mode (MAV_NAV_MODE)
*/
public short nav_mode;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
public MAVLinkPacket pack(){
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH);
packet.sysid = 255;
packet.compid = 190;
packet.msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putFloat(roll_ailerons);
packet.payload.putFloat(pitch_elevator);
packet.payload.putFloat(yaw_rudder);
packet.payload.putFloat(throttle);
packet.payload.putFloat(aux1);
packet.payload.putFloat(aux2);
packet.payload.putFloat(aux3);
packet.payload.putFloat(aux4);
packet.payload.putUnsignedByte(mode);
packet.payload.putUnsignedByte(nav_mode);
return packet;
}
/**
* Decode a hil_controls message into this class fields
*
* @param payload The message to decode
*/
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.roll_ailerons = payload.getFloat();
this.pitch_elevator = payload.getFloat();
this.yaw_rudder = payload.getFloat();
this.throttle = payload.getFloat();
this.aux1 = payload.getFloat();
this.aux2 = payload.getFloat();
this.aux3 = payload.getFloat();
this.aux4 = payload.getFloat();
this.mode = payload.getUnsignedByte();
this.nav_mode = payload.getUnsignedByte();
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_hil_controls(){
msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_hil_controls(MAVLinkPacket mavLinkPacket){
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
public String toString(){
return "MAVLINK_MSG_ID_HIL_CONTROLS -"+" time_usec:"+time_usec+" roll_ailerons:"+roll_ailerons+" pitch_elevator:"+pitch_elevator+" yaw_rudder:"+yaw_rudder+" throttle:"+throttle+" aux1:"+aux1+" aux2:"+aux2+" aux3:"+aux3+" aux4:"+aux4+" mode:"+mode+" nav_mode:"+nav_mode+"";
}
}