Android Open Source - 3DR-Services-Library Mission Item Message






From Project

Back to project page 3DR-Services-Library.

License

The source code is released under:

Apache License

If you think the Android project 3DR-Services-Library listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ox3dr.services.android.lib.drone.property;
// ww  w .j a  v a 2 s .c  o m
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Message encoding a mission item. This message is emitted to announce
 * the presence of a mission item and to set a mission item on the system.
 */
public class MissionItemMessage implements Parcelable {

    private static final int MAVLINK_MSG_ID_MISSION_ITEM = 39;

    private int sysId;
    private int compId;

    /**
     * PARAM1, see MAV_CMD enum
     */
    private float param1;
    /**
     * PARAM2, see MAV_CMD enum
     */
    private float param2;
    /**
     * PARAM3, see MAV_CMD enum
     */
    private float param3;
    /**
     * PARAM4, see MAV_CMD enum
     */
    private float param4;
    /**
     * PARAM5 / local: x position, global: latitude
     */
    private float x;
    /**
     * PARAM6 / y position: global: longitude
     */
    private float y;
    /**
     * PARAM7 / z position: global: altitude (relative or absolute, depending on frame.
     */
    private float z;
    /**
     * Sequence
     */
    private int seq;
    /**
     * The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs
     */
    private int command;
    /**
     * System ID
     */
    private byte target_system;
    /**
     * Component ID
     */
    private byte target_component;
    /**
     * The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h
     */
    private byte frame;
    /**
     * false:0, true:1
     */
    private byte current;
    /**
     * autocontinue to next wp
     */
    private byte autocontinue;


    public int getMessageId(){
        return MAVLINK_MSG_ID_MISSION_ITEM;
    }

    public int getSysId() {
        return sysId;
    }

    public void setSysId(int sysId) {
        this.sysId = sysId;
    }

    public int getCompId() {
        return compId;
    }

    public void setCompId(int compId) {
        this.compId = compId;
    }

    public float getParam1() {
        return param1;
    }

    public void setParam1(float param1) {
        this.param1 = param1;
    }

    public float getParam2() {
        return param2;
    }

    public void setParam2(float param2) {
        this.param2 = param2;
    }

    public float getParam3() {
        return param3;
    }

    public void setParam3(float param3) {
        this.param3 = param3;
    }

    public float getParam4() {
        return param4;
    }

    public void setParam4(float param4) {
        this.param4 = param4;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getZ() {
        return z;
    }

    public void setZ(float z) {
        this.z = z;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public int getCommand() {
        return command;
    }

    public void setCommand(int command) {
        this.command = command;
    }

    public byte getTarget_system() {
        return target_system;
    }

    public void setTarget_system(byte target_system) {
        this.target_system = target_system;
    }

    public byte getTarget_component() {
        return target_component;
    }

    public void setTarget_component(byte target_component) {
        this.target_component = target_component;
    }

    public byte getFrame() {
        return frame;
    }

    public void setFrame(byte frame) {
        this.frame = frame;
    }

    public byte getCurrent() {
        return current;
    }

    public void setCurrent(byte current) {
        this.current = current;
    }

    public byte getAutocontinue() {
        return autocontinue;
    }

    public void setAutocontinue(byte autocontinue) {
        this.autocontinue = autocontinue;
    }

    @Override
    public String toString() {
        return "MissionItemMessage{" +
                "sysId=" + sysId +
                ", compId=" + compId +
                ", param1=" + param1 +
                ", param2=" + param2 +
                ", param3=" + param3 +
                ", param4=" + param4 +
                ", x=" + x +
                ", y=" + y +
                ", z=" + z +
                ", seq=" + seq +
                ", command=" + command +
                ", target_system=" + target_system +
                ", target_component=" + target_component +
                ", frame=" + frame +
                ", current=" + current +
                ", autocontinue=" + autocontinue +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.sysId);
        dest.writeInt(this.compId);
        dest.writeFloat(this.param1);
        dest.writeFloat(this.param2);
        dest.writeFloat(this.param3);
        dest.writeFloat(this.param4);
        dest.writeFloat(this.x);
        dest.writeFloat(this.y);
        dest.writeFloat(this.z);
        dest.writeInt(this.seq);
        dest.writeInt(this.command);
        dest.writeByte(this.target_system);
        dest.writeByte(this.target_component);
        dest.writeByte(this.frame);
        dest.writeByte(this.current);
        dest.writeByte(this.autocontinue);
    }

    public MissionItemMessage() { }

    private MissionItemMessage(Parcel in) {
        this.sysId = in.readInt();
        this.compId = in.readInt();
        this.param1 = in.readFloat();
        this.param2 = in.readFloat();
        this.param3 = in.readFloat();
        this.param4 = in.readFloat();
        this.x = in.readFloat();
        this.y = in.readFloat();
        this.z = in.readFloat();
        this.seq = in.readInt();
        this.command = in.readInt();
        this.target_system = in.readByte();
        this.target_component = in.readByte();
        this.frame = in.readByte();
        this.current = in.readByte();
        this.autocontinue = in.readByte();
    }

    public static final Parcelable.Creator<MissionItemMessage> CREATOR = new Parcelable.Creator<MissionItemMessage>() {
        public MissionItemMessage createFromParcel(Parcel source) {
            return new MissionItemMessage(source);
        }

        public MissionItemMessage[] newArray(int size) {
            return new MissionItemMessage[size];
        }
    };
}




Java Source Code List

com.ox3dr.services.android.lib.ApplicationTest.java
com.ox3dr.services.android.lib.coordinate.LatLngAlt.java
com.ox3dr.services.android.lib.coordinate.LatLng.java
com.ox3dr.services.android.lib.drone.connection.ConnectionParameter.java
com.ox3dr.services.android.lib.drone.connection.ConnectionResult.java
com.ox3dr.services.android.lib.drone.connection.ConnectionType.java
com.ox3dr.services.android.lib.drone.event.Event.java
com.ox3dr.services.android.lib.drone.event.Extra.java
com.ox3dr.services.android.lib.drone.property.Altitude.java
com.ox3dr.services.android.lib.drone.property.Attitude.java
com.ox3dr.services.android.lib.drone.property.Battery.java
com.ox3dr.services.android.lib.drone.property.Gps.java
com.ox3dr.services.android.lib.drone.property.Home.java
com.ox3dr.services.android.lib.drone.property.MissionItemMessage.java
com.ox3dr.services.android.lib.drone.property.Mission.java
com.ox3dr.services.android.lib.drone.property.Parameter.java
com.ox3dr.services.android.lib.drone.property.Parameters.java
com.ox3dr.services.android.lib.drone.property.Speed.java
com.ox3dr.services.android.lib.drone.property.State.java
com.ox3dr.services.android.lib.drone.property.Type.java
com.ox3dr.services.android.lib.drone.property.VehicleMode.java