diff --git a/Android/AndroidManifest.xml b/Android/AndroidManifest.xml index 07b520f6f5..2ce6691364 100644 --- a/Android/AndroidManifest.xml +++ b/Android/AndroidManifest.xml @@ -2,7 +2,7 @@ + + Canon S100 + 7.60 + 5.70 + 12.1 + 5.2 + Portrait + diff --git a/Android/res/values-zh-rCN/strings.xml b/Android/res/values-zh-rCN/strings.xml index baf22ca209..ab334ea3fe 100644 --- a/Android/res/values-zh-rCN/strings.xml +++ b/Android/res/values-zh-rCN/strings.xml @@ -1,4 +1,4 @@ - + @@ -14,72 +14,83 @@ 发送任务 加载任务 + + ne0fhyk.ighceofk + 调参 校准 检查清单 遥控 参数 - + 遥测连接方式 - 选择用来连接无人机分链接 + 选择哪一种连接数传的方式与无人机沟通 + 地图 + 使用那一家的地图供应商 + 地图提供商 + MAVLink 流速 - 从无人机接受飞行数据的速度(以Hz为单位) + 接收无人机飞行数据的速率(以Hz为单位) 航点、GPS原始数据、围栏数据、当前航点等 姿态 VFR_Hud数据 - AHRS,硬件状态,风速 + 航姿系统(AHRS),硬件状态,风速 位置数据 - 遥控覆盖 + 遥控通道覆盖 遥控通道数据 传感器原始数据 控制器原始数据 用户界面 将英语作为界面语言 - 使用英语语言(代替系统语言)需要重启应用。 + 使用英文为主要语言(代替系统语言)需要重新启动应用程序。 当连接到无人机时 执行动作或连接到无人机时\n断开并重连生效 保持屏幕常亮 - 如果不勾选屏幕就会在一段时间后变暗(保持电量) + 勾选以防止屏幕进入休眠状态(会影响电池 + 使用时间) 锁定屏幕方向 - 连接时锁定当前屏幕的方向 + 连接无人机时,屏幕将会定在当前的旋转方向 飞行数据 - 飞行路径大小 - 飞行路径的大小,设置为0禁用。 - 长按启动引导模式 - 长按地图进入引导模式。 - 启用跟着我模式 - 在开发 + 飞行路径尺寸 + 飞行路径的尺寸,若要关闭请设为0。 + 长按地图启动Guided引导模式 + 长按在地图上以进入引导模式。 + 启用Flooow Me跟随模式 + 开发中 启动FPV指向模式 - 改变指向模式为FPV(-180°至180°) - 高级 + 改变以FPV的朝向模式(-180°至180°) + PEBBLE + 更新 Pebble + 进阶设定 使用离线地图 使用本地储存的地图块,用于离线地图浏览 地图样式 卫星 使用哪种类型的地图 - 启用文本转语音 - 用于重要事件的语音消息 - 默认模型种类 - 断开连接时的默认模型种类 + 使语音输出 + 重要的讯息以语音方式播放 + 启动时将音量转到最大 + 预设无人机种类 + 断开连接时的默认无人机种类 遥控界面 - 常规 + 一般 遥控模式 - 油门在左摇杆还是右摇杆 - 快速模式左 - 快速模式右 + 左手油门或者右手油门 + 左快捷模式 + 右快捷模式 反向 油门 - 反转油门方向 + 油门方向反转 回到中点 触摸后放开油门回到中点 方向舵 - 反转方向舵/Yaw方向 - 副翼 - 反转副翼/Roll方向 - 升降舵 - 反转升降舵/Pitch方向 + 反转方向轴/Yaw方向 + 副翼横滚 + 反转横滚轴/Roll方向 + 升降俯仰 + 反转俯仰轴/Pitch方向 连接参数 USB连接 遥测连接速度 @@ -91,7 +102,14 @@ UDP服务器端口 关于 版本(由APM中文网-酷酷小狼翻译) - 存储文件夹 + 存储路径 + 启用实时上传(ALPHA版测试中) + 上传无人机数据到Droneshare + + + 长按图示可以启动地图中使用者位置置中 + 长按图示可以启动地图中无人机位置自动置中 + 没有无人机位置资料 连接 @@ -104,6 +122,7 @@ 取消 发送 下一步 + 重置 完成 暂停 OK @@ -112,55 +131,65 @@ 选择要打开的文件: 没有文件 打开文件时出错 + 打开的文件 保存 打开 写入 刷新 - 横向的 - 足迹 - 纵向的 + 横向距离 + 涵盖面积 + 地面解析度 + 纵向距离 区域 相机: 内部航点 - 开口角度: + 方位角: 飞行高度: 重叠: - 侧向重叠: - 网格长度 + 左右重叠: + 任务长度 图片 条数 - 绘制多边形/WPT + 绘制多边形/航点 绘制至少2个多边形点 绘制至少1个多边形点 绘制测量区域 - 任务太长了 + 任务长度过长 Acro特技模式可以让飞手直接控制旋转速率。 - Alt Hold定高模式自动控制油门来保持高度。不需要GPS。 + Alt Hold定高模式自动控制油门来保持高度。此模式不需要GPS参与。 Auto自动模式执行储存在模型上的脚本任务。 - Circle绕圈模式让模型绕着一个目标点转。模型会一直指向中点。需要GPS锁定。 - Drift飘移模式结合roll和yaw产生更自然更直观的飞行。需要GPS锁定。 - Guided引导模式可以让你从地面站进行位置控制。需要GPS锁定。 - Land降落在当前位置。需要GPS锁定。 + Circle绕圈模式让模型绕着一个目标点转。模型会一直指向中点。此模式需要GPS锁定。 + Drift飘移模式结合roll和yaw产生更自然更直观的飞行。此模式需要GPS锁定。 + Guided引导模式可以让你从地面站进行位置控制。此模式需要GPS锁定。 + Land降落在当前位置。此模式需要GPS锁定。 Loiter悬停模式可以让飞手完全通过GPS飞行。 启用光流的悬停模式需要光流传感器来保持位置和高度。 Position定点模式可以让飞手完全通过GPS飞行,但是油门是靠手动控制的。 - RTL返航模式升至最低高度,返回家的位置并降落。需要GPS锁定。 + RTL返航模式升至最低高度,返回家的位置并降落。此模式需要GPS锁定。 Sport运动模式可以让飞手直接控制旋转速率,并附加自动平衡。 Stabilize自稳模式让模型水平飞行。 + PosHold定点模式可以让位置保持(GPS)与直接摇杆控制并用 航点 + 曲线航点 起飞 回到出发点 降落 + 改变速度 + 设定Yaw + 相机快门 + 设定舵机 + EPM 绕圈 悬停 - 感兴趣区域 - 调查多边形 + 兴趣区域 + 勘测多边形 + 结构扫描 在当前位置降落模型。你必须手动退出自动模式来锁定电机。 @@ -175,17 +204,25 @@ 设定达到指定目标角度的条件。 延迟任务状态机,直到在所期望的下一个航点的距离内 家的位置既可以改为当前位置,也可以改为指定位置。 - 改变速度和/或油门设定点。如果不需要改变,设为-1可同时用于速度和油门 + 改变无人机速度,直到任务结束。 + 在定期时间里触发相机快门。 + 移动舵机至特定的PWM值。 + 发布EPM采集的有效载荷 设置一个位置和高度来设定飞行器指向,瞄准可选的相机。 重复航点 + + + PWM: + 在LAND或RTL后无法添加新的航点 距离:200m,飞行时间:3:30s 至家的距离 悬停时间 到下一个航点前的延迟 悬停半径 逆时针 + 圆的半径 高度 Yaw角度 目标高度 @@ -206,7 +243,7 @@ 源数据 跳至航点: 重复航点 - 轨道 + 圈数 清除任务 从地图上清除所有航点? @@ -215,7 +252,7 @@ 地图样式 卫星 混合 - 正常 + 一般 地形 @@ -250,6 +287,7 @@ 罗盘校准 + 点击校准开始磁罗盘校准。进行校准的时候远离金属物 加速度计校准 @@ -264,6 +302,7 @@ 要开始校准,请点击校准。 下一个方向前的剩余时间: + 飞行模式配置 更新飞行模式 @@ -311,15 +350,26 @@ 高度 m m/s + 速度 + 长度 + 通道 地速 空速 --° 控制 编辑 回家 + 解锁 + 上锁 降落 起飞 - 跟随 + 暂停 + 自动 + 跟随 + Drnoie + 改变速度 + 目标角度 + 相对角度 遥测 飞行模式 信息栏 @@ -337,7 +387,80 @@ 扫描设备中 - 可扩展列表视图图标 + 可扩充的清单列表图示 + + + + + 语音输出 + 定期 + 语音广播设定 + 有哪些包含在定期报告中。 + 周期 + 多久广播一次 + 电池电压数 + 广播电池电压数 + 高度 + 广播高度值 + 信号强度(RSSI) + 广播接收的信号强度指数 + 空速 + 广播空速数值 + 警告 + 日冕活跃中 + 这个警示是关于目前太阳日冕正在爆发有影响GPS的可能 + 风速 + 这个警告是关于过高的风速可以会造成难以飞行 + 400英尺超过 + 在许多的情况下飞行高度超过400英尺是非法行为。 + 低信号强度 + 当无人机连接困难时发出警告 + 连接状态 + 当无人机连接中断或恢复时发出提醒 + 自动驾驶仪报告的警告 + 有关解锁失败、低电量等的警告。 + 广播已关闭 + 每个状态 + 秒广播 + 关闭 + + + 你有兴趣使用免费的无人机社群服务www.Droneshare.com嘛? + Droneshare是一个免费的平台,你可以在平台上分析或者分享飞行数据。 + 创建一个账号 + 登陆账号 + 使用者名称 + 密码 + 不适用 Droneshare + 电子邮件地址 + Droneshare 密码 + 输入密码 + 当账号不存在时,则会产生新的账号。 + Droneshare 使用者名称 + 启用 Droneshare + 你想要使用Droneshare吗? + 使用者名称 + 密码 + 上传成功!选择要查看的... + 稍后再试 + 上传至Droneshare + + + 蓝牙连接 + 蓝牙装置 + 移除预设的装置 + 你确定要移除吗? + 移除 + + + 设定选择的地图供应商 + 地图供应商偏好设定 + Google地图偏好设定 + 开放街图偏好设定 + MapBox偏好设定 + 地图供应商偏好设定 + 实时相机脚本 + 实时显示相机在地面上的投影 手动调整roll和pitch参数。Rate_P是要调整的主要数值。 @@ -345,7 +468,71 @@ 将遥控通道5分配在你的遥控器上的开关用来控制飞行模式。移动开关到每个位置并在下方选择期望的飞行模式。 MAVLink错误: 请首先连接 - 日本手:油门在右摇杆 - 美国手:油门在左摇杆 + 日本手:油门在右边的摇杆 + 美国手:油门在左边的摇杆 + 语言 + 界面 + 通知 + 常规 + 曲线 + Mavlink 版本 + 固件版本 + -- + 使用统计 + 发送使用统计 + 发送使用统计资料能帮助DroidPlanner增进平台完成度 + + 启动通知 + 当连接时,在状态列上显示通知内容。 + + 符合显示范围 + 打开任务档 + 保存任务档 + + 在讯息列表上显示卫星的HDOP代替FIX值 + 显示卫星的HDOP值 + + 断线中... + 连接中... + + + 如何规划和执行飞行任务 + + 高级设定 + 步数 + 高度级别 + 切换搜索 + 解锁螺旋桨? + 警告!螺旋桨将会开始转动,无人机也会开始起飞程序。 + 半径 + 删除 + 反向 + 多编辑 + 不再显示 + 文件保存 + 保存文件时出错 + 输入文件名 + + + 定位器 + 打开日志文件 + 等待GPS... + + + 杂项 + 偏好对话框 + 保险按钮的警告 + 自动载入\'TakeOff\'; 和 + \'RTL\';/\';Land\'; 到任务 + 总是 + 永不 + 询问 + 用户界面->选择对话框]]> + 在自动模式起飞? + 警告!飞机将要起飞并开始执行任务 + 创建 dronie? + 在dronie起飞前请站在飞机后面8m远的 + 距离。 + 无法启动校准! diff --git a/Android/res/xml-zh-rCN/checklist_default.xml b/Android/res/xml-zh-rCN/checklist_default.xml new file mode 100644 index 0000000000..a19d8e3cb0 --- /dev/null +++ b/Android/res/xml-zh-rCN/checklist_default.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android/res/xml-zh-rCN/checklist_full.xml b/Android/res/xml-zh-rCN/checklist_full.xml new file mode 100644 index 0000000000..78ec355bd4 --- /dev/null +++ b/Android/res/xml-zh-rCN/checklist_full.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android/src/org/droidplanner/android/activities/EditorActivity.java b/Android/src/org/droidplanner/android/activities/EditorActivity.java index fe9de14023..7d6489b925 100644 --- a/Android/src/org/droidplanner/android/activities/EditorActivity.java +++ b/Android/src/org/droidplanner/android/activities/EditorActivity.java @@ -49,7 +49,7 @@ import android.widget.TextView; import android.widget.Toast; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; import com.google.android.gms.analytics.HitBuilders; /** diff --git a/Android/src/org/droidplanner/android/activities/LocatorActivity.java b/Android/src/org/droidplanner/android/activities/LocatorActivity.java index 9fe2de578f..04b2e20e20 100644 --- a/Android/src/org/droidplanner/android/activities/LocatorActivity.java +++ b/Android/src/org/droidplanner/android/activities/LocatorActivity.java @@ -1,17 +1,7 @@ package org.droidplanner.android.activities; -import android.location.Location; -import android.location.LocationListener; -import android.os.Bundle; -import android.support.v4.app.FragmentManager; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.widget.ImageButton; -import android.widget.LinearLayout; -import android.widget.TextView; - -import com.MAVLink.Messages.ardupilotmega.msg_global_position_int; +import java.util.LinkedList; +import java.util.List; import org.droidplanner.R; import org.droidplanner.android.dialogs.openfile.OpenFileDialog; @@ -23,8 +13,18 @@ import org.droidplanner.core.helpers.coordinates.Coord2D; import org.droidplanner.core.helpers.geoTools.GeoTools; -import java.util.LinkedList; -import java.util.List; +import android.location.Location; +import android.location.LocationListener; +import android.os.Bundle; +import android.support.v4.app.FragmentManager; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ImageButton; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.MAVLink.common.msg_global_position_int; /** * This implements the map locator activity. The map locator activity allows the user to find diff --git a/Android/src/org/droidplanner/android/communication/connection/AndroidMavLinkConnection.java b/Android/src/org/droidplanner/android/communication/connection/AndroidMavLinkConnection.java index 6c38c3c0e0..ca2ec8721b 100644 --- a/Android/src/org/droidplanner/android/communication/connection/AndroidMavLinkConnection.java +++ b/Android/src/org/droidplanner/android/communication/connection/AndroidMavLinkConnection.java @@ -14,7 +14,7 @@ import android.content.Context; import android.content.SharedPreferences; -import com.MAVLink.Messages.MAVLinkPacket; +import com.MAVLink.MAVLinkPacket; public abstract class AndroidMavLinkConnection extends MavLinkConnection { diff --git a/Android/src/org/droidplanner/android/communication/service/MAVLinkClient.java b/Android/src/org/droidplanner/android/communication/service/MAVLinkClient.java index 643cca3f1f..2b78403edd 100644 --- a/Android/src/org/droidplanner/android/communication/service/MAVLinkClient.java +++ b/Android/src/org/droidplanner/android/communication/service/MAVLinkClient.java @@ -1,5 +1,7 @@ package org.droidplanner.android.communication.service; +import java.util.concurrent.atomic.AtomicReference; + import org.droidplanner.R; import org.droidplanner.core.MAVLink.MAVLinkStreams; import org.droidplanner.core.MAVLink.connection.MavLinkConnection; @@ -13,10 +15,8 @@ import android.os.IBinder; import android.widget.Toast; +import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; - -import java.util.concurrent.atomic.AtomicReference; /** * Provide a common class for some ease of use functionality diff --git a/Android/src/org/droidplanner/android/communication/service/MAVLinkService.java b/Android/src/org/droidplanner/android/communication/service/MAVLinkService.java index f319598e6d..5088a0d91f 100644 --- a/Android/src/org/droidplanner/android/communication/service/MAVLinkService.java +++ b/Android/src/org/droidplanner/android/communication/service/MAVLinkService.java @@ -15,7 +15,7 @@ import android.os.IBinder; import android.util.Log; -import com.MAVLink.Messages.MAVLinkPacket; +import com.MAVLink.MAVLinkPacket; import com.google.android.gms.analytics.HitBuilders; /** diff --git a/Android/src/org/droidplanner/android/dialogs/DroneshareDialog.java b/Android/src/org/droidplanner/android/dialogs/DroneshareDialog.java index c5e424e597..7f07019665 100644 --- a/Android/src/org/droidplanner/android/dialogs/DroneshareDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/DroneshareDialog.java @@ -14,7 +14,6 @@ import android.view.View; import android.widget.EditText; import android.widget.RadioButton; -import android.widget.Toast; import com.google.android.gms.analytics.HitBuilders; diff --git a/Android/src/org/droidplanner/android/dialogs/EditInputDialog.java b/Android/src/org/droidplanner/android/dialogs/EditInputDialog.java index cbcee5dd6e..173fc3fe7e 100644 --- a/Android/src/org/droidplanner/android/dialogs/EditInputDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/EditInputDialog.java @@ -1,5 +1,7 @@ package org.droidplanner.android.dialogs; +import org.droidplanner.R; + import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -7,8 +9,6 @@ import android.view.View; import android.widget.EditText; -import org.droidplanner.R; - /** * Created by fhuya on 10/14/14. */ diff --git a/Android/src/org/droidplanner/android/dialogs/YesNoDialog.java b/Android/src/org/droidplanner/android/dialogs/YesNoDialog.java index 404e6fcdcd..452e2684f7 100644 --- a/Android/src/org/droidplanner/android/dialogs/YesNoDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/YesNoDialog.java @@ -1,5 +1,7 @@ package org.droidplanner.android.dialogs; +import org.droidplanner.R; + import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; @@ -9,8 +11,6 @@ import android.view.View; import android.widget.TextView; -import org.droidplanner.R; - public class YesNoDialog extends DialogFragment { protected final static String EXTRA_TITLE = "title"; diff --git a/Android/src/org/droidplanner/android/dialogs/YesNoWithPrefsDialog.java b/Android/src/org/droidplanner/android/dialogs/YesNoWithPrefsDialog.java index e4ec967384..425872c00c 100644 --- a/Android/src/org/droidplanner/android/dialogs/YesNoWithPrefsDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/YesNoWithPrefsDialog.java @@ -1,21 +1,20 @@ package org.droidplanner.android.dialogs; +import org.droidplanner.R; +import org.droidplanner.android.utils.analytics.GAUtils; +import org.droidplanner.android.utils.prefs.DroidPlannerPrefs; + import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.Preference; import android.view.View; import android.widget.CheckBox; import android.widget.Toast; import com.google.android.gms.analytics.HitBuilders; -import org.droidplanner.R; -import org.droidplanner.android.utils.analytics.GAUtils; -import org.droidplanner.android.utils.prefs.DroidPlannerPrefs; - /** * Provides a yes/no (ok/cancel) dialog with the option to permanently disable * the dialog with a checkbox. diff --git a/Android/src/org/droidplanner/android/dialogs/openfile/OpenFileDialog.java b/Android/src/org/droidplanner/android/dialogs/openfile/OpenFileDialog.java index ed4e0433b2..cdd977f26b 100644 --- a/Android/src/org/droidplanner/android/dialogs/openfile/OpenFileDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/openfile/OpenFileDialog.java @@ -1,5 +1,7 @@ package org.droidplanner.android.dialogs.openfile; +import java.lang.ref.WeakReference; + import org.droidplanner.R; import android.app.AlertDialog; @@ -10,8 +12,6 @@ import android.os.AsyncTask; import android.widget.Toast; -import java.lang.ref.WeakReference; - public abstract class OpenFileDialog implements OnClickListener { public interface FileReader { diff --git a/Android/src/org/droidplanner/android/dialogs/openfile/OpenTLogDialog.java b/Android/src/org/droidplanner/android/dialogs/openfile/OpenTLogDialog.java index 673a10c41d..e6a1742531 100644 --- a/Android/src/org/droidplanner/android/dialogs/openfile/OpenTLogDialog.java +++ b/Android/src/org/droidplanner/android/dialogs/openfile/OpenTLogDialog.java @@ -1,9 +1,9 @@ package org.droidplanner.android.dialogs.openfile; -import com.MAVLink.Messages.ardupilotmega.msg_global_position_int; - import org.droidplanner.android.utils.file.IO.TLogReader; +import com.MAVLink.common.msg_global_position_int; + public abstract class OpenTLogDialog extends OpenFileDialog { public abstract void tlogFileLoaded(TLogReader reader); diff --git a/Android/src/org/droidplanner/android/fragments/CopterFlightActionsFragment.java b/Android/src/org/droidplanner/android/fragments/CopterFlightActionsFragment.java index d285d6e4e7..0c598e50cc 100644 --- a/Android/src/org/droidplanner/android/fragments/CopterFlightActionsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/CopterFlightActionsFragment.java @@ -1,18 +1,5 @@ package org.droidplanner.android.fragments; -import android.app.Activity; -import android.graphics.Color; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Button; -import android.widget.Toast; - -import com.MAVLink.Messages.ApmModes; -import com.google.android.gms.analytics.HitBuilders; - import org.droidplanner.R; import org.droidplanner.android.DroidPlannerApp; import org.droidplanner.android.activities.FlightActivity; @@ -28,6 +15,19 @@ import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.model.Drone; +import android.app.Activity; +import android.graphics.Color; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.Toast; + +import com.MAVLink.Messages.ApmModes; +import com.google.android.gms.analytics.HitBuilders; + /** * Provide functionality for flight action button specific to copters. */ diff --git a/Android/src/org/droidplanner/android/fragments/DroneMap.java b/Android/src/org/droidplanner/android/fragments/DroneMap.java index b64ad77676..ffe925f3d0 100644 --- a/Android/src/org/droidplanner/android/fragments/DroneMap.java +++ b/Android/src/org/droidplanner/android/fragments/DroneMap.java @@ -17,13 +17,8 @@ import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; import org.droidplanner.core.helpers.coordinates.Coord2D; -import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.model.Drone; import org.droidplanner.core.survey.CameraInfo; -import org.droidplanner.core.survey.Footprint; - -import com.MAVLink.Messages.ardupilotmega.msg_camera_feedback; -import com.google.android.gms.internal.ln; import android.app.Activity; import android.content.Context; @@ -31,7 +26,6 @@ import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/Android/src/org/droidplanner/android/fragments/EditorMapFragment.java b/Android/src/org/droidplanner/android/fragments/EditorMapFragment.java index 599cde1df6..c2cf17cf69 100644 --- a/Android/src/org/droidplanner/android/fragments/EditorMapFragment.java +++ b/Android/src/org/droidplanner/android/fragments/EditorMapFragment.java @@ -7,7 +7,6 @@ import org.droidplanner.android.maps.MarkerInfo; import org.droidplanner.android.proxy.mission.item.markers.MissionItemMarkerInfo; import org.droidplanner.android.proxy.mission.item.markers.PolygonMarkerInfo; -import org.droidplanner.android.proxy.mission.item.markers.SurveyMarkerInfoProvider; import org.droidplanner.android.utils.prefs.AutoPanMode; import org.droidplanner.core.helpers.coordinates.Coord2D; import org.droidplanner.core.mission.waypoints.SpatialCoordItem; diff --git a/Android/src/org/droidplanner/android/fragments/FlightActionsFragment.java b/Android/src/org/droidplanner/android/fragments/FlightActionsFragment.java index b256cf64a5..d893e1cc46 100644 --- a/Android/src/org/droidplanner/android/fragments/FlightActionsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/FlightActionsFragment.java @@ -2,33 +2,17 @@ import org.droidplanner.R; import org.droidplanner.android.DroidPlannerApp; -import org.droidplanner.android.activities.helpers.SuperUI; -import org.droidplanner.android.dialogs.YesNoDialog; -import org.droidplanner.android.dialogs.YesNoWithPrefsDialog; -import org.droidplanner.android.utils.analytics.GAUtils; -import org.droidplanner.core.MAVLink.MavLinkArm; -import org.droidplanner.core.drone.DroneInterfaces; import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; import org.droidplanner.core.drone.variables.Type; -import org.droidplanner.core.gcs.follow.Follow; -import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.model.Drone; -import android.app.Activity; -import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.view.LayoutInflater; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.Button; -import android.widget.Toast; - -import com.MAVLink.Messages.ApmModes; -import com.google.android.gms.analytics.HitBuilders; public class FlightActionsFragment extends Fragment implements OnDroneListener { diff --git a/Android/src/org/droidplanner/android/fragments/GenericActionsFragment.java b/Android/src/org/droidplanner/android/fragments/GenericActionsFragment.java index 4e85495da9..1c8835a47c 100644 --- a/Android/src/org/droidplanner/android/fragments/GenericActionsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/GenericActionsFragment.java @@ -1,5 +1,9 @@ package org.droidplanner.android.fragments; +import org.droidplanner.R; +import org.droidplanner.android.activities.helpers.SuperUI; +import org.droidplanner.core.model.Drone; + import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; @@ -7,10 +11,6 @@ import android.view.ViewGroup; import android.widget.Button; -import org.droidplanner.R; -import org.droidplanner.android.activities.helpers.SuperUI; -import org.droidplanner.core.model.Drone; - /** * Provides action buttons functionality for generic drone type. */ diff --git a/Android/src/org/droidplanner/android/fragments/LocatorListFragment.java b/Android/src/org/droidplanner/android/fragments/LocatorListFragment.java index f33199364d..4db3878779 100644 --- a/Android/src/org/droidplanner/android/fragments/LocatorListFragment.java +++ b/Android/src/org/droidplanner/android/fragments/LocatorListFragment.java @@ -1,5 +1,13 @@ package org.droidplanner.android.fragments; +import it.sephiroth.android.library.widget.AdapterView; +import it.sephiroth.android.library.widget.AdapterView.OnItemClickListener; +import it.sephiroth.android.library.widget.HListView; + +import org.droidplanner.R; +import org.droidplanner.android.activities.LocatorActivity; +import org.droidplanner.android.widgets.adapterViews.LocatorItemAdapter; + import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -8,15 +16,7 @@ import android.view.ViewGroup; import android.widget.ListView; -import com.MAVLink.Messages.ardupilotmega.msg_global_position_int; - -import org.droidplanner.R; -import org.droidplanner.android.activities.LocatorActivity; -import org.droidplanner.android.widgets.adapterViews.LocatorItemAdapter; - -import it.sephiroth.android.library.widget.AdapterView; -import it.sephiroth.android.library.widget.AdapterView.OnItemClickListener; -import it.sephiroth.android.library.widget.HListView; +import com.MAVLink.common.msg_global_position_int; public class LocatorListFragment extends Fragment implements OnItemClickListener { diff --git a/Android/src/org/droidplanner/android/fragments/LocatorMapFragment.java b/Android/src/org/droidplanner/android/fragments/LocatorMapFragment.java index 2d9957f8a0..287adb957b 100644 --- a/Android/src/org/droidplanner/android/fragments/LocatorMapFragment.java +++ b/Android/src/org/droidplanner/android/fragments/LocatorMapFragment.java @@ -1,14 +1,13 @@ package org.droidplanner.android.fragments; -import android.location.LocationListener; -import android.widget.Toast; +import java.util.Collections; import org.droidplanner.android.graphic.map.GraphicLocator; import org.droidplanner.android.utils.prefs.AutoPanMode; -import org.droidplanner.core.gcs.location.Location; import org.droidplanner.core.helpers.coordinates.Coord2D; -import java.util.Collections; +import android.location.LocationListener; +import android.widget.Toast; public class LocatorMapFragment extends DroneMap { diff --git a/Android/src/org/droidplanner/android/fragments/ParamsFragment.java b/Android/src/org/droidplanner/android/fragments/ParamsFragment.java index eda4625003..25d65fecbd 100644 --- a/Android/src/org/droidplanner/android/fragments/ParamsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/ParamsFragment.java @@ -11,7 +11,6 @@ import org.droidplanner.android.dialogs.openfile.OpenFileDialog; import org.droidplanner.android.dialogs.openfile.OpenParameterDialog; import org.droidplanner.android.dialogs.parameters.DialogParameterInfo; -import org.droidplanner.android.utils.file.FileManager; import org.droidplanner.android.utils.file.FileStream; import org.droidplanner.android.utils.file.IO.ParameterWriter; import org.droidplanner.android.utils.prefs.DroidPlannerPrefs; diff --git a/Android/src/org/droidplanner/android/fragments/PlaneFlightActionsFragment.java b/Android/src/org/droidplanner/android/fragments/PlaneFlightActionsFragment.java index cdc8bb93de..9a89c3dff3 100644 --- a/Android/src/org/droidplanner/android/fragments/PlaneFlightActionsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/PlaneFlightActionsFragment.java @@ -1,5 +1,14 @@ package org.droidplanner.android.fragments; +import org.droidplanner.R; +import org.droidplanner.android.DroidPlannerApp; +import org.droidplanner.android.activities.helpers.SuperUI; +import org.droidplanner.android.utils.analytics.GAUtils; +import org.droidplanner.core.drone.DroneInterfaces; +import org.droidplanner.core.drone.variables.State; +import org.droidplanner.core.gcs.follow.Follow; +import org.droidplanner.core.model.Drone; + import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -12,15 +21,6 @@ import com.MAVLink.Messages.ApmModes; import com.google.android.gms.analytics.HitBuilders; -import org.droidplanner.R; -import org.droidplanner.android.DroidPlannerApp; -import org.droidplanner.android.activities.helpers.SuperUI; -import org.droidplanner.android.utils.analytics.GAUtils; -import org.droidplanner.core.drone.DroneInterfaces; -import org.droidplanner.core.drone.variables.State; -import org.droidplanner.core.gcs.follow.Follow; -import org.droidplanner.core.model.Drone; - /** * Provides functionality for flight action buttons specific to planes. */ diff --git a/Android/src/org/droidplanner/android/fragments/SensorSetupFragment.java b/Android/src/org/droidplanner/android/fragments/SensorSetupFragment.java index 05eed834f8..73d34699ae 100644 --- a/Android/src/org/droidplanner/android/fragments/SensorSetupFragment.java +++ b/Android/src/org/droidplanner/android/fragments/SensorSetupFragment.java @@ -1,5 +1,10 @@ package org.droidplanner.android.fragments; +import org.droidplanner.R; +import org.droidplanner.android.fragments.calibration.imu.FragmentSetupIMU; +import org.droidplanner.android.fragments.calibration.mag.FragmentSetupMAG; +import org.droidplanner.android.widgets.viewPager.TabPageIndicator; + import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -10,11 +15,6 @@ import android.view.View; import android.view.ViewGroup; -import org.droidplanner.R; -import org.droidplanner.android.fragments.calibration.imu.FragmentSetupIMU; -import org.droidplanner.android.fragments.calibration.mag.FragmentSetupMAG; -import org.droidplanner.android.widgets.viewPager.TabPageIndicator; - /** * Used to calibrate the drone's compass and accelerometer. */ diff --git a/Android/src/org/droidplanner/android/fragments/SettingsFragment.java b/Android/src/org/droidplanner/android/fragments/SettingsFragment.java index 424c89fb7f..6090bf1845 100644 --- a/Android/src/org/droidplanner/android/fragments/SettingsFragment.java +++ b/Android/src/org/droidplanner/android/fragments/SettingsFragment.java @@ -10,7 +10,6 @@ import org.droidplanner.R; import org.droidplanner.android.DroidPlannerApp; -import org.droidplanner.android.activities.ConfigurationActivity; import org.droidplanner.android.activities.helpers.MapPreferencesActivity; import org.droidplanner.android.communication.service.UploaderService; import org.droidplanner.android.maps.providers.DPMapProvider; diff --git a/Android/src/org/droidplanner/android/fragments/calibration/imu/FragmentSetupIMU.java b/Android/src/org/droidplanner/android/fragments/calibration/imu/FragmentSetupIMU.java index f329d7483a..d2757a3b55 100644 --- a/Android/src/org/droidplanner/android/fragments/calibration/imu/FragmentSetupIMU.java +++ b/Android/src/org/droidplanner/android/fragments/calibration/imu/FragmentSetupIMU.java @@ -1,5 +1,12 @@ package org.droidplanner.android.fragments.calibration.imu; +import org.droidplanner.R; +import org.droidplanner.android.DroidPlannerApp; +import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; +import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; +import org.droidplanner.core.drone.variables.Calibration; +import org.droidplanner.core.model.Drone; + import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -14,13 +21,6 @@ import android.widget.TextView; import android.widget.Toast; -import org.droidplanner.R; -import org.droidplanner.android.DroidPlannerApp; -import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; -import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; -import org.droidplanner.core.drone.variables.Calibration; -import org.droidplanner.core.model.Drone; - public class FragmentSetupIMU extends Fragment implements OnDroneListener { private final static long TIMEOUT_MAX = 30000l; //ms diff --git a/Android/src/org/droidplanner/android/fragments/mode/ModeGuidedFragment.java b/Android/src/org/droidplanner/android/fragments/mode/ModeGuidedFragment.java index 8cceee04ec..befe6e5baa 100644 --- a/Android/src/org/droidplanner/android/fragments/mode/ModeGuidedFragment.java +++ b/Android/src/org/droidplanner/android/fragments/mode/ModeGuidedFragment.java @@ -11,10 +11,7 @@ import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.Button; -import android.widget.TextView; public class ModeGuidedFragment extends Fragment implements CardWheelHorizontalView.OnCardWheelChangedListener { diff --git a/Android/src/org/droidplanner/android/graphic/map/GraphicLocator.java b/Android/src/org/droidplanner/android/graphic/map/GraphicLocator.java index b57d5f39c3..88e7806a7e 100644 --- a/Android/src/org/droidplanner/android/graphic/map/GraphicLocator.java +++ b/Android/src/org/droidplanner/android/graphic/map/GraphicLocator.java @@ -1,13 +1,13 @@ package org.droidplanner.android.graphic.map; -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; - import org.droidplanner.R; import org.droidplanner.android.maps.MarkerInfo; import org.droidplanner.core.helpers.coordinates.Coord2D; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; + public class GraphicLocator extends MarkerInfo.SimpleMarkerInfo { private Coord2D lastPosition; diff --git a/Android/src/org/droidplanner/android/lib/parcelables/ParcelableThreeSpacePoint.java b/Android/src/org/droidplanner/android/lib/parcelables/ParcelableThreeSpacePoint.java index f56ff2dc86..ce139165d8 100644 --- a/Android/src/org/droidplanner/android/lib/parcelables/ParcelableThreeSpacePoint.java +++ b/Android/src/org/droidplanner/android/lib/parcelables/ParcelableThreeSpacePoint.java @@ -2,7 +2,6 @@ import android.os.Parcel; import android.os.Parcelable; - import ellipsoidFit.ThreeSpacePoint; /** diff --git a/Android/src/org/droidplanner/android/maps/DPMap.java b/Android/src/org/droidplanner/android/maps/DPMap.java index 05a2cf668d..b58409f506 100644 --- a/Android/src/org/droidplanner/android/maps/DPMap.java +++ b/Android/src/org/droidplanner/android/maps/DPMap.java @@ -7,7 +7,6 @@ import org.droidplanner.android.maps.providers.DPMapProvider; import org.droidplanner.android.utils.prefs.AutoPanMode; import org.droidplanner.core.drone.DroneInterfaces; -import org.droidplanner.core.gcs.location.Location; import org.droidplanner.core.helpers.coordinates.Coord2D; import org.droidplanner.core.survey.Footprint; diff --git a/Android/src/org/droidplanner/android/maps/providers/google_map/GoogleMapFragment.java b/Android/src/org/droidplanner/android/maps/providers/google_map/GoogleMapFragment.java index 86fc170646..eb34123e24 100644 --- a/Android/src/org/droidplanner/android/maps/providers/google_map/GoogleMapFragment.java +++ b/Android/src/org/droidplanner/android/maps/providers/google_map/GoogleMapFragment.java @@ -11,19 +11,19 @@ import org.droidplanner.R; import org.droidplanner.android.DroidPlannerApp; import org.droidplanner.android.helpers.LocalMapTileProvider; -import org.droidplanner.android.utils.GoogleApiClientManager; -import org.droidplanner.android.utils.GoogleApiClientManager.GoogleApiClientTask; import org.droidplanner.android.maps.DPMap; import org.droidplanner.android.maps.MarkerInfo; import org.droidplanner.android.maps.providers.DPMapProvider; import org.droidplanner.android.utils.DroneHelper; +import org.droidplanner.android.utils.GoogleApiClientManager; +import org.droidplanner.android.utils.GoogleApiClientManager.GoogleApiClientTask; import org.droidplanner.android.utils.collection.HashBiMap; import org.droidplanner.android.utils.prefs.AutoPanMode; import org.droidplanner.android.utils.prefs.DroidPlannerPrefs; -import org.droidplanner.core.model.Drone; -import org.droidplanner.core.survey.Footprint; import org.droidplanner.core.drone.DroneInterfaces; import org.droidplanner.core.helpers.coordinates.Coord2D; +import org.droidplanner.core.model.Drone; +import org.droidplanner.core.survey.Footprint; import android.content.Context; import android.content.SharedPreferences; diff --git a/Android/src/org/droidplanner/android/notifications/TTSNotificationProvider.java b/Android/src/org/droidplanner/android/notifications/TTSNotificationProvider.java index 64bb381c2e..445c1d0c63 100644 --- a/Android/src/org/droidplanner/android/notifications/TTSNotificationProvider.java +++ b/Android/src/org/droidplanner/android/notifications/TTSNotificationProvider.java @@ -8,7 +8,6 @@ import org.droidplanner.android.fragments.SettingsFragment; import org.droidplanner.android.utils.prefs.DroidPlannerPrefs; import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; -import org.droidplanner.core.drone.variables.Calibration; import org.droidplanner.core.model.Drone; import android.content.BroadcastReceiver; diff --git a/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionConditionYawFragment.java b/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionConditionYawFragment.java index 5678f55458..dccd7c6f71 100644 --- a/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionConditionYawFragment.java +++ b/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionConditionYawFragment.java @@ -3,10 +3,8 @@ import org.droidplanner.R; import org.droidplanner.android.widgets.spinnerWheel.CardWheelHorizontalView; import org.droidplanner.android.widgets.spinnerWheel.adapters.NumericWheelAdapter; -import org.droidplanner.core.helpers.units.Speed; import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import org.droidplanner.core.mission.commands.ChangeSpeed; import org.droidplanner.core.mission.commands.ConditionYaw; import android.os.Bundle; diff --git a/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionSurveyFragment.java b/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionSurveyFragment.java index effa70874d..94dc9040f4 100644 --- a/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionSurveyFragment.java +++ b/Android/src/org/droidplanner/android/proxy/mission/item/fragments/MissionSurveyFragment.java @@ -21,7 +21,6 @@ import android.os.Bundle; import android.util.Log; import android.view.View; -import android.widget.CheckBox; import android.widget.Spinner; import android.widget.TextView; diff --git a/Android/src/org/droidplanner/android/utils/GoogleApiClientManager.java b/Android/src/org/droidplanner/android/utils/GoogleApiClientManager.java index 4d5e07e7ae..ebd5efffe9 100644 --- a/Android/src/org/droidplanner/android/utils/GoogleApiClientManager.java +++ b/Android/src/org/droidplanner/android/utils/GoogleApiClientManager.java @@ -1,5 +1,7 @@ package org.droidplanner.android.utils; +import java.util.concurrent.LinkedBlockingQueue; + import android.content.Context; import android.os.Handler; import android.os.HandlerThread; @@ -9,8 +11,6 @@ import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; -import java.util.concurrent.LinkedBlockingQueue; - /** * Handles the lifecycle for the google api client. Also takes care of running submitted tasks * when the google api client is connected. diff --git a/Android/src/org/droidplanner/android/utils/file/IO/MissionReader.java b/Android/src/org/droidplanner/android/utils/file/IO/MissionReader.java index eebccf4f81..6b7dbcd1b3 100644 --- a/Android/src/org/droidplanner/android/utils/file/IO/MissionReader.java +++ b/Android/src/org/droidplanner/android/utils/file/IO/MissionReader.java @@ -12,7 +12,7 @@ import org.droidplanner.android.utils.file.FileList; import org.droidplanner.android.utils.file.FileManager; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; /** * Read msg_mission_item list as... diff --git a/Android/src/org/droidplanner/android/utils/file/IO/MissionWriter.java b/Android/src/org/droidplanner/android/utils/file/IO/MissionWriter.java index 806160e463..7c0b02f5ff 100644 --- a/Android/src/org/droidplanner/android/utils/file/IO/MissionWriter.java +++ b/Android/src/org/droidplanner/android/utils/file/IO/MissionWriter.java @@ -9,7 +9,7 @@ import org.droidplanner.android.utils.file.FileManager; import org.droidplanner.android.utils.file.FileStream; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; /** * Write msg_mission_item list as... diff --git a/Android/src/org/droidplanner/android/utils/file/IO/TLogReader.java b/Android/src/org/droidplanner/android/utils/file/IO/TLogReader.java index d5ffd79b1c..38fddbae19 100644 --- a/Android/src/org/droidplanner/android/utils/file/IO/TLogReader.java +++ b/Android/src/org/droidplanner/android/utils/file/IO/TLogReader.java @@ -1,14 +1,5 @@ package org.droidplanner.android.utils.file.IO; -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Parser; - -import org.droidplanner.android.dialogs.openfile.OpenFileDialog; -import org.droidplanner.android.utils.file.DirectoryPath; -import org.droidplanner.android.utils.file.FileList; -import org.droidplanner.android.utils.file.FileManager; - import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.EOFException; @@ -17,6 +8,15 @@ import java.util.LinkedList; import java.util.List; +import org.droidplanner.android.dialogs.openfile.OpenFileDialog; +import org.droidplanner.android.utils.file.DirectoryPath; +import org.droidplanner.android.utils.file.FileList; +import org.droidplanner.android.utils.file.FileManager; + +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Parser; +import com.MAVLink.Messages.MAVLinkMessage; + /** * Read tlog file w/ optional message filter * diff --git a/Android/src/org/droidplanner/android/widgets/ProgressView.java b/Android/src/org/droidplanner/android/widgets/ProgressView.java index 705cd8c403..d4fbca139c 100644 --- a/Android/src/org/droidplanner/android/widgets/ProgressView.java +++ b/Android/src/org/droidplanner/android/widgets/ProgressView.java @@ -1,5 +1,7 @@ package org.droidplanner.android.widgets; +import java.util.Arrays; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -8,8 +10,6 @@ import android.util.AttributeSet; import android.widget.ProgressBar; -import java.util.Arrays; - /** * Created by fhuya on 9/25/14. */ diff --git a/Android/src/org/droidplanner/android/widgets/adapterViews/FilterableArrayAdapter.java b/Android/src/org/droidplanner/android/widgets/adapterViews/FilterableArrayAdapter.java index b9ffdc6a15..2e9990528b 100644 --- a/Android/src/org/droidplanner/android/widgets/adapterViews/FilterableArrayAdapter.java +++ b/Android/src/org/droidplanner/android/widgets/adapterViews/FilterableArrayAdapter.java @@ -1,24 +1,23 @@ package org.droidplanner.android.widgets.adapterViews; -import android.widget.ArrayAdapter; -import android.widget.BaseAdapter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; import android.widget.TextView; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - /** * A concrete BaseAdapter that is backed by an array of arbitrary * objects. By default this class expects that the provided resource id references diff --git a/Android/src/org/droidplanner/android/widgets/adapterViews/LocatorItemAdapter.java b/Android/src/org/droidplanner/android/widgets/adapterViews/LocatorItemAdapter.java index 00524e603f..3421e9243b 100644 --- a/Android/src/org/droidplanner/android/widgets/adapterViews/LocatorItemAdapter.java +++ b/Android/src/org/droidplanner/android/widgets/adapterViews/LocatorItemAdapter.java @@ -1,5 +1,9 @@ package org.droidplanner.android.widgets.adapterViews; +import java.util.List; + +import org.droidplanner.R; + import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -7,11 +11,7 @@ import android.widget.ArrayAdapter; import android.widget.TextView; -import com.MAVLink.Messages.ardupilotmega.msg_global_position_int; - -import org.droidplanner.R; - -import java.util.List; +import com.MAVLink.common.msg_global_position_int; /** * MissionItem Adapter for the MissionItem horizontal list view. This adapter diff --git a/Android/src/org/droidplanner/android/widgets/scatterplot/ScatterPlot.java b/Android/src/org/droidplanner/android/widgets/scatterplot/ScatterPlot.java index 0618054056..98b204e448 100644 --- a/Android/src/org/droidplanner/android/widgets/scatterplot/ScatterPlot.java +++ b/Android/src/org/droidplanner/android/widgets/scatterplot/ScatterPlot.java @@ -1,5 +1,7 @@ package org.droidplanner.android.widgets.scatterplot; +import java.util.ArrayList; + import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -8,9 +10,6 @@ import android.util.AttributeSet; import android.view.View; -import java.util.ArrayList; -import java.util.List; - public class ScatterPlot extends View { private static final float SCALE_FACTOR = 1 / 1000f; diff --git a/ChangeLog.md b/ChangeLog.md index 53730d5e98..c4509dcd0e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,6 +9,12 @@ All the changes are logged below (preferable with the pull request numbers in pa # Releases +## Droidplanner v2.8.6 +* Update MAVLink library (#1277) +* Update Chinese translation (#1273) +* Fix desktop project (#1274) +* Added S100 to the avaliable cameraInfo files (#1271) + ## Droidplanner v2.8.5 * Camera footprints (#1265, #1266, #1270) diff --git a/Core/src/org/droidplanner/core/MAVLink/MAVLinkStreams.java b/Core/src/org/droidplanner/core/MAVLink/MAVLinkStreams.java index 86e62d9a7a..7ec3fb8d27 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MAVLinkStreams.java +++ b/Core/src/org/droidplanner/core/MAVLink/MAVLinkStreams.java @@ -1,7 +1,7 @@ package org.droidplanner.core.MAVLink; +import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; public class MAVLinkStreams { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkArm.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkArm.java index 8a6201d738..a3f7102204 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkArm.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkArm.java @@ -2,9 +2,9 @@ import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_command_long; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_COMPONENT; +import com.MAVLink.common.msg_command_long; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_COMPONENT; public class MavLinkArm { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkCalibration.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkCalibration.java index 1208484b7f..67ab89678f 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkCalibration.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkCalibration.java @@ -2,10 +2,10 @@ import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_command_ack; -import com.MAVLink.Messages.ardupilotmega.msg_command_long; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_CMD_ACK; +import com.MAVLink.common.msg_command_ack; +import com.MAVLink.common.msg_command_long; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_CMD_ACK; public class MavLinkCalibration { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkHeartbeat.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkHeartbeat.java index 78ad0d0b04..26b1f432fb 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkHeartbeat.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkHeartbeat.java @@ -2,10 +2,10 @@ import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.ardupilotmega.msg_heartbeat; -import com.MAVLink.Messages.enums.MAV_AUTOPILOT; -import com.MAVLink.Messages.enums.MAV_TYPE; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.common.msg_heartbeat; +import com.MAVLink.enums.MAV_AUTOPILOT; +import com.MAVLink.enums.MAV_TYPE; /** * This class contains logic used to send an heartbeat to a diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkModes.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkModes.java index 303315d915..d9a88580fe 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkModes.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkModes.java @@ -3,10 +3,10 @@ import org.droidplanner.core.model.Drone; import com.MAVLink.Messages.ApmModes; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.ardupilotmega.msg_set_mode; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.common.msg_set_mode; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class MavLinkModes { public static void setGuidedMode(Drone drone, double latitude, double longitude, double d) { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkMsgHandler.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkMsgHandler.java index 0cc8991a9f..b2b7474378 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkMsgHandler.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkMsgHandler.java @@ -7,23 +7,23 @@ import com.MAVLink.Messages.ApmModes; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.ardupilotmega.msg_attitude; -import com.MAVLink.Messages.ardupilotmega.msg_camera_feedback; -import com.MAVLink.Messages.ardupilotmega.msg_global_position_int; -import com.MAVLink.Messages.ardupilotmega.msg_gps_raw_int; -import com.MAVLink.Messages.ardupilotmega.msg_heartbeat; -import com.MAVLink.Messages.ardupilotmega.msg_mission_current; -import com.MAVLink.Messages.ardupilotmega.msg_mount_status; -import com.MAVLink.Messages.ardupilotmega.msg_nav_controller_output; -import com.MAVLink.Messages.ardupilotmega.msg_radio; -import com.MAVLink.Messages.ardupilotmega.msg_raw_imu; -import com.MAVLink.Messages.ardupilotmega.msg_rc_channels_raw; -import com.MAVLink.Messages.ardupilotmega.msg_servo_output_raw; -import com.MAVLink.Messages.ardupilotmega.msg_statustext; -import com.MAVLink.Messages.ardupilotmega.msg_sys_status; -import com.MAVLink.Messages.ardupilotmega.msg_vfr_hud; -import com.MAVLink.Messages.enums.MAV_MODE_FLAG; -import com.MAVLink.Messages.enums.MAV_STATE; +import com.MAVLink.ardupilotmega.msg_camera_feedback; +import com.MAVLink.ardupilotmega.msg_mount_status; +import com.MAVLink.ardupilotmega.msg_radio; +import com.MAVLink.common.msg_attitude; +import com.MAVLink.common.msg_global_position_int; +import com.MAVLink.common.msg_gps_raw_int; +import com.MAVLink.common.msg_heartbeat; +import com.MAVLink.common.msg_mission_current; +import com.MAVLink.common.msg_nav_controller_output; +import com.MAVLink.common.msg_raw_imu; +import com.MAVLink.common.msg_rc_channels_raw; +import com.MAVLink.common.msg_servo_output_raw; +import com.MAVLink.common.msg_statustext; +import com.MAVLink.common.msg_sys_status; +import com.MAVLink.common.msg_vfr_hud; +import com.MAVLink.enums.MAV_MODE_FLAG; +import com.MAVLink.enums.MAV_STATE; public class MavLinkMsgHandler { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkParameters.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkParameters.java index f7e686d46f..92cfa99c46 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkParameters.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkParameters.java @@ -3,9 +3,9 @@ import org.droidplanner.core.model.Drone; import org.droidplanner.core.parameters.Parameter; -import com.MAVLink.Messages.ardupilotmega.msg_param_request_list; -import com.MAVLink.Messages.ardupilotmega.msg_param_request_read; -import com.MAVLink.Messages.ardupilotmega.msg_param_set; +import com.MAVLink.common.msg_param_request_list; +import com.MAVLink.common.msg_param_request_read; +import com.MAVLink.common.msg_param_set; public class MavLinkParameters { public static void requestParametersList(Drone drone) { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkRC.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkRC.java index 98901370e0..7d52a53320 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkRC.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkRC.java @@ -2,7 +2,7 @@ import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_rc_channels_override; +import com.MAVLink.common.msg_rc_channels_override; public class MavLinkRC { public static void sendRcOverrideMsg(Drone drone, int[] rcOutputs) { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkROI.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkROI.java index 9fd4bb7c8d..3c14a3f716 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkROI.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkROI.java @@ -4,9 +4,9 @@ import org.droidplanner.core.mission.commands.EpmGripper; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_command_long; -import com.MAVLink.Messages.ardupilotmega.msg_digicam_control; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.ardupilotmega.msg_digicam_control; +import com.MAVLink.common.msg_command_long; +import com.MAVLink.enums.MAV_CMD; public class MavLinkROI { public static void setROI(Drone drone, Coord3D coord) { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkStreamRates.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkStreamRates.java index dc5271d306..507cf0c801 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkStreamRates.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkStreamRates.java @@ -2,8 +2,8 @@ import org.droidplanner.core.MAVLink.MAVLinkStreams.MAVLinkOutputStream; -import com.MAVLink.Messages.ardupilotmega.msg_request_data_stream; -import com.MAVLink.Messages.enums.MAV_DATA_STREAM; +import com.MAVLink.common.msg_request_data_stream; +import com.MAVLink.enums.MAV_DATA_STREAM; public class MavLinkStreamRates { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkTakeoff.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkTakeoff.java index c5f00727da..98c4a9e780 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkTakeoff.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkTakeoff.java @@ -3,8 +3,8 @@ import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_command_long; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_command_long; +import com.MAVLink.enums.MAV_CMD; public class MavLinkTakeoff { public static void sendTakeoff(Drone drone, Altitude alt) { diff --git a/Core/src/org/droidplanner/core/MAVLink/MavLinkWaypoint.java b/Core/src/org/droidplanner/core/MAVLink/MavLinkWaypoint.java index 57032ebe7a..49c0733b9d 100644 --- a/Core/src/org/droidplanner/core/MAVLink/MavLinkWaypoint.java +++ b/Core/src/org/droidplanner/core/MAVLink/MavLinkWaypoint.java @@ -2,12 +2,12 @@ import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_mission_ack; -import com.MAVLink.Messages.ardupilotmega.msg_mission_count; -import com.MAVLink.Messages.ardupilotmega.msg_mission_request; -import com.MAVLink.Messages.ardupilotmega.msg_mission_request_list; -import com.MAVLink.Messages.ardupilotmega.msg_mission_set_current; -import com.MAVLink.Messages.enums.MAV_MISSION_RESULT; +import com.MAVLink.common.msg_mission_ack; +import com.MAVLink.common.msg_mission_count; +import com.MAVLink.common.msg_mission_request; +import com.MAVLink.common.msg_mission_request_list; +import com.MAVLink.common.msg_mission_set_current; +import com.MAVLink.enums.MAV_MISSION_RESULT; public class MavLinkWaypoint { diff --git a/Core/src/org/droidplanner/core/MAVLink/WaypointManager.java b/Core/src/org/droidplanner/core/MAVLink/WaypointManager.java index 3d2f33e5ab..a1d5659c6d 100644 --- a/Core/src/org/droidplanner/core/MAVLink/WaypointManager.java +++ b/Core/src/org/droidplanner/core/MAVLink/WaypointManager.java @@ -11,12 +11,12 @@ import org.droidplanner.core.model.Drone; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.ardupilotmega.msg_mission_ack; -import com.MAVLink.Messages.ardupilotmega.msg_mission_count; -import com.MAVLink.Messages.ardupilotmega.msg_mission_current; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item_reached; -import com.MAVLink.Messages.ardupilotmega.msg_mission_request; +import com.MAVLink.common.msg_mission_ack; +import com.MAVLink.common.msg_mission_count; +import com.MAVLink.common.msg_mission_current; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.common.msg_mission_item_reached; +import com.MAVLink.common.msg_mission_request; /** * Class to manage the communication of waypoints to the MAV. diff --git a/Core/src/org/droidplanner/core/MAVLink/connection/MavLinkConnection.java b/Core/src/org/droidplanner/core/MAVLink/connection/MavLinkConnection.java index 0886792396..c763038d83 100644 --- a/Core/src/org/droidplanner/core/MAVLink/connection/MavLinkConnection.java +++ b/Core/src/org/droidplanner/core/MAVLink/connection/MavLinkConnection.java @@ -13,9 +13,9 @@ import org.droidplanner.core.model.Logger; +import com.MAVLink.MAVLinkPacket; import com.MAVLink.Parser; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; /** * Base for mavlink connection implementations. diff --git a/Core/src/org/droidplanner/core/drone/DroneEvents.java b/Core/src/org/droidplanner/core/drone/DroneEvents.java index 5b84aca631..574367ea21 100644 --- a/Core/src/org/droidplanner/core/drone/DroneEvents.java +++ b/Core/src/org/droidplanner/core/drone/DroneEvents.java @@ -1,13 +1,11 @@ package org.droidplanner.core.drone; +import java.util.concurrent.ConcurrentLinkedQueue; + import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; import org.droidplanner.core.model.Drone; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; - public class DroneEvents extends DroneVariable { private final ConcurrentLinkedQueue eventsQueue = new ConcurrentLinkedQueue(); diff --git a/Core/src/org/droidplanner/core/drone/DroneImpl.java b/Core/src/org/droidplanner/core/drone/DroneImpl.java index 0ddfa6d689..bc856b452f 100644 --- a/Core/src/org/droidplanner/core/drone/DroneImpl.java +++ b/Core/src/org/droidplanner/core/drone/DroneImpl.java @@ -26,7 +26,7 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_heartbeat; +import com.MAVLink.common.msg_heartbeat; public class DroneImpl implements Drone { diff --git a/Core/src/org/droidplanner/core/drone/profiles/Parameters.java b/Core/src/org/droidplanner/core/drone/profiles/Parameters.java index 13c0589b94..f70bafb86f 100644 --- a/Core/src/org/droidplanner/core/drone/profiles/Parameters.java +++ b/Core/src/org/droidplanner/core/drone/profiles/Parameters.java @@ -14,7 +14,7 @@ import org.droidplanner.core.parameters.Parameter; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.ardupilotmega.msg_param_value; +import com.MAVLink.common.msg_param_value; /** * Class to manage the communication of parameters to the MAV. diff --git a/Core/src/org/droidplanner/core/drone/variables/Calibration.java b/Core/src/org/droidplanner/core/drone/variables/Calibration.java index 8a64c57bf9..60c0c3c263 100644 --- a/Core/src/org/droidplanner/core/drone/variables/Calibration.java +++ b/Core/src/org/droidplanner/core/drone/variables/Calibration.java @@ -6,7 +6,7 @@ import org.droidplanner.core.model.Drone; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.ardupilotmega.msg_statustext; +import com.MAVLink.common.msg_statustext; public class Calibration extends DroneVariable { private Drone myDrone; diff --git a/Core/src/org/droidplanner/core/drone/variables/Camera.java b/Core/src/org/droidplanner/core/drone/variables/Camera.java index 51f4d4f624..a8615ab759 100644 --- a/Core/src/org/droidplanner/core/drone/variables/Camera.java +++ b/Core/src/org/droidplanner/core/drone/variables/Camera.java @@ -10,8 +10,8 @@ import org.droidplanner.core.survey.CameraInfo; import org.droidplanner.core.survey.Footprint; -import com.MAVLink.Messages.ardupilotmega.msg_camera_feedback; -import com.MAVLink.Messages.ardupilotmega.msg_mount_status; +import com.MAVLink.ardupilotmega.msg_camera_feedback; +import com.MAVLink.ardupilotmega.msg_mount_status; public class Camera extends DroneVariable { private CameraInfo camera = new CameraInfo(); diff --git a/Core/src/org/droidplanner/core/drone/variables/HeartBeat.java b/Core/src/org/droidplanner/core/drone/variables/HeartBeat.java index b6152e9691..c0d7bb47a2 100644 --- a/Core/src/org/droidplanner/core/drone/variables/HeartBeat.java +++ b/Core/src/org/droidplanner/core/drone/variables/HeartBeat.java @@ -6,7 +6,7 @@ import org.droidplanner.core.drone.DroneVariable; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_heartbeat; +import com.MAVLink.common.msg_heartbeat; public class HeartBeat extends DroneVariable implements OnDroneListener { diff --git a/Core/src/org/droidplanner/core/drone/variables/Home.java b/Core/src/org/droidplanner/core/drone/variables/Home.java index 04177f03e3..597c72656c 100644 --- a/Core/src/org/droidplanner/core/drone/variables/Home.java +++ b/Core/src/org/droidplanner/core/drone/variables/Home.java @@ -8,9 +8,9 @@ import org.droidplanner.core.helpers.units.Length; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class Home extends DroneVariable { private Coord2D coordinate; diff --git a/Core/src/org/droidplanner/core/drone/variables/Magnetometer.java b/Core/src/org/droidplanner/core/drone/variables/Magnetometer.java index dbbaf40de5..0db4514d53 100644 --- a/Core/src/org/droidplanner/core/drone/variables/Magnetometer.java +++ b/Core/src/org/droidplanner/core/drone/variables/Magnetometer.java @@ -5,7 +5,7 @@ import org.droidplanner.core.model.Drone; import org.droidplanner.core.parameters.Parameter; -import com.MAVLink.Messages.ardupilotmega.msg_raw_imu; +import com.MAVLink.common.msg_raw_imu; public class Magnetometer extends DroneVariable { diff --git a/Core/src/org/droidplanner/core/drone/variables/RC.java b/Core/src/org/droidplanner/core/drone/variables/RC.java index 2d02e50621..d8e5a28847 100644 --- a/Core/src/org/droidplanner/core/drone/variables/RC.java +++ b/Core/src/org/droidplanner/core/drone/variables/RC.java @@ -4,8 +4,8 @@ import org.droidplanner.core.drone.DroneVariable; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ardupilotmega.msg_rc_channels_raw; -import com.MAVLink.Messages.ardupilotmega.msg_servo_output_raw; +import com.MAVLink.common.msg_rc_channels_raw; +import com.MAVLink.common.msg_servo_output_raw; public class RC extends DroneVariable { public int in[] = new int[8]; diff --git a/Core/src/org/droidplanner/core/drone/variables/Type.java b/Core/src/org/droidplanner/core/drone/variables/Type.java index f5e5ed6b1c..11d15a0c32 100644 --- a/Core/src/org/droidplanner/core/drone/variables/Type.java +++ b/Core/src/org/droidplanner/core/drone/variables/Type.java @@ -6,7 +6,7 @@ import org.droidplanner.core.firmware.FirmwareType; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.enums.MAV_TYPE; +import com.MAVLink.enums.MAV_TYPE; public class Type extends DroneVariable implements DroneInterfaces.OnDroneListener{ diff --git a/Core/src/org/droidplanner/core/gcs/follow/Follow.java b/Core/src/org/droidplanner/core/gcs/follow/Follow.java index c3ca087557..8751eec6a2 100644 --- a/Core/src/org/droidplanner/core/gcs/follow/Follow.java +++ b/Core/src/org/droidplanner/core/gcs/follow/Follow.java @@ -6,7 +6,6 @@ import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener; import org.droidplanner.core.drone.variables.GuidedPoint; import org.droidplanner.core.drone.variables.State; -import org.droidplanner.core.drone.variables.Type; import org.droidplanner.core.gcs.follow.FollowAlgorithm.FollowModes; import org.droidplanner.core.gcs.location.Location; import org.droidplanner.core.gcs.location.Location.LocationFinder; @@ -15,8 +14,6 @@ import org.droidplanner.core.helpers.units.Length; import org.droidplanner.core.model.Drone; -import com.MAVLink.Messages.ApmModes; - public class Follow implements OnDroneListener, LocationReceiver { /** Set of return value for the 'toggleFollowMeState' method.*/ diff --git a/Core/src/org/droidplanner/core/mission/Mission.java b/Core/src/org/droidplanner/core/mission/Mission.java index 1fca6858fa..8ea1a63943 100644 --- a/Core/src/org/droidplanner/core/mission/Mission.java +++ b/Core/src/org/droidplanner/core/mission/Mission.java @@ -1,8 +1,8 @@ package org.droidplanner.core.mission; -import com.MAVLink.Messages.ardupilotmega.msg_mission_ack; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType; import org.droidplanner.core.drone.DroneVariable; @@ -28,9 +28,9 @@ import org.droidplanner.core.model.Drone; import org.droidplanner.core.util.Pair; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import com.MAVLink.common.msg_mission_ack; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; /** * This implements a mavlink mission. A mavlink mission is a set of diff --git a/Core/src/org/droidplanner/core/mission/MissionItem.java b/Core/src/org/droidplanner/core/mission/MissionItem.java index 1257d1982e..bcfd007c7f 100644 --- a/Core/src/org/droidplanner/core/mission/MissionItem.java +++ b/Core/src/org/droidplanner/core/mission/MissionItem.java @@ -3,8 +3,8 @@ import java.util.ArrayList; import java.util.List; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_FRAME; public abstract class MissionItem implements Comparable { diff --git a/Core/src/org/droidplanner/core/mission/commands/CameraTrigger.java b/Core/src/org/droidplanner/core/mission/commands/CameraTrigger.java index 7c16cd5299..5d697cfb4b 100644 --- a/Core/src/org/droidplanner/core/mission/commands/CameraTrigger.java +++ b/Core/src/org/droidplanner/core/mission/commands/CameraTrigger.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class CameraTrigger extends MissionCMD { private Length distance = new Length(0); diff --git a/Core/src/org/droidplanner/core/mission/commands/ChangeSpeed.java b/Core/src/org/droidplanner/core/mission/commands/ChangeSpeed.java index 2f599421a6..c95a1c8c90 100644 --- a/Core/src/org/droidplanner/core/mission/commands/ChangeSpeed.java +++ b/Core/src/org/droidplanner/core/mission/commands/ChangeSpeed.java @@ -7,9 +7,9 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class ChangeSpeed extends MissionCMD { private Speed speed = new Speed(5); diff --git a/Core/src/org/droidplanner/core/mission/commands/ConditionYaw.java b/Core/src/org/droidplanner/core/mission/commands/ConditionYaw.java index 83828b15d5..51ff74480b 100644 --- a/Core/src/org/droidplanner/core/mission/commands/ConditionYaw.java +++ b/Core/src/org/droidplanner/core/mission/commands/ConditionYaw.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class ConditionYaw extends MissionCMD { private boolean isRelative = false; diff --git a/Core/src/org/droidplanner/core/mission/commands/EpmGripper.java b/Core/src/org/droidplanner/core/mission/commands/EpmGripper.java index 1360ed7dd9..d59963d8de 100644 --- a/Core/src/org/droidplanner/core/mission/commands/EpmGripper.java +++ b/Core/src/org/droidplanner/core/mission/commands/EpmGripper.java @@ -6,7 +6,7 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; public class EpmGripper extends MissionCMD { // TODO Update mavlink and use the correct enum here diff --git a/Core/src/org/droidplanner/core/mission/commands/MissionCMD.java b/Core/src/org/droidplanner/core/mission/commands/MissionCMD.java index 9fbc360da3..e52a293645 100644 --- a/Core/src/org/droidplanner/core/mission/commands/MissionCMD.java +++ b/Core/src/org/droidplanner/core/mission/commands/MissionCMD.java @@ -5,7 +5,7 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.MissionItem; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; public abstract class MissionCMD extends MissionItem { diff --git a/Core/src/org/droidplanner/core/mission/commands/ReturnToHome.java b/Core/src/org/droidplanner/core/mission/commands/ReturnToHome.java index 0e4e4eea43..1b01d63883 100644 --- a/Core/src/org/droidplanner/core/mission/commands/ReturnToHome.java +++ b/Core/src/org/droidplanner/core/mission/commands/ReturnToHome.java @@ -7,9 +7,9 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class ReturnToHome extends MissionCMD { diff --git a/Core/src/org/droidplanner/core/mission/commands/SetServo.java b/Core/src/org/droidplanner/core/mission/commands/SetServo.java index c52f996992..5507fadba5 100644 --- a/Core/src/org/droidplanner/core/mission/commands/SetServo.java +++ b/Core/src/org/droidplanner/core/mission/commands/SetServo.java @@ -2,13 +2,12 @@ import java.util.List; -import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class SetServo extends MissionCMD { diff --git a/Core/src/org/droidplanner/core/mission/commands/Takeoff.java b/Core/src/org/droidplanner/core/mission/commands/Takeoff.java index 58136ab6b1..a993179f7a 100644 --- a/Core/src/org/droidplanner/core/mission/commands/Takeoff.java +++ b/Core/src/org/droidplanner/core/mission/commands/Takeoff.java @@ -7,9 +7,9 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class Takeoff extends MissionCMD { diff --git a/Core/src/org/droidplanner/core/mission/survey/Survey.java b/Core/src/org/droidplanner/core/mission/survey/Survey.java index 21d24df105..25d094fa54 100644 --- a/Core/src/org/droidplanner/core/mission/survey/Survey.java +++ b/Core/src/org/droidplanner/core/mission/survey/Survey.java @@ -15,9 +15,9 @@ import org.droidplanner.core.polygon.Polygon; import org.droidplanner.core.survey.CameraInfo; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class Survey extends MissionItem { diff --git a/Core/src/org/droidplanner/core/mission/waypoints/Circle.java b/Core/src/org/droidplanner/core/mission/waypoints/Circle.java index 0b5770b042..12b713270f 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/Circle.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/Circle.java @@ -8,9 +8,9 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_FRAME; public class Circle extends SpatialCoordItem { diff --git a/Core/src/org/droidplanner/core/mission/waypoints/Land.java b/Core/src/org/droidplanner/core/mission/waypoints/Land.java index 05ce3a6b9c..04ef4ae58c 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/Land.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/Land.java @@ -9,8 +9,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class Land extends SpatialCoordItem { diff --git a/Core/src/org/droidplanner/core/mission/waypoints/RegionOfInterest.java b/Core/src/org/droidplanner/core/mission/waypoints/RegionOfInterest.java index 61b8fa80c2..0265df8761 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/RegionOfInterest.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/RegionOfInterest.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class RegionOfInterest extends SpatialCoordItem { diff --git a/Core/src/org/droidplanner/core/mission/waypoints/SpatialCoordItem.java b/Core/src/org/droidplanner/core/mission/waypoints/SpatialCoordItem.java index 4b52f40ef7..c44697faa5 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/SpatialCoordItem.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/SpatialCoordItem.java @@ -8,7 +8,7 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.MissionItem; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; +import com.MAVLink.common.msg_mission_item; public abstract class SpatialCoordItem extends MissionItem { diff --git a/Core/src/org/droidplanner/core/mission/waypoints/SplineWaypoint.java b/Core/src/org/droidplanner/core/mission/waypoints/SplineWaypoint.java index 91a5868289..3aaa73a9a6 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/SplineWaypoint.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/SplineWaypoint.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; /** * Handle spline waypoint mavlink packet generation. diff --git a/Core/src/org/droidplanner/core/mission/waypoints/StructureScanner.java b/Core/src/org/droidplanner/core/mission/waypoints/StructureScanner.java index 566a7ac794..28b08f32aa 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/StructureScanner.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/StructureScanner.java @@ -17,8 +17,8 @@ import org.droidplanner.core.polygon.Polygon; import org.droidplanner.core.survey.CameraInfo; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class StructureScanner extends SpatialCoordItem { private Length radius = new Length(10.0); diff --git a/Core/src/org/droidplanner/core/mission/waypoints/Waypoint.java b/Core/src/org/droidplanner/core/mission/waypoints/Waypoint.java index 55c58cef2b..b3ab3906b5 100644 --- a/Core/src/org/droidplanner/core/mission/waypoints/Waypoint.java +++ b/Core/src/org/droidplanner/core/mission/waypoints/Waypoint.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.MissionItemType; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class Waypoint extends SpatialCoordItem { diff --git a/Core/src/org/droidplanner/core/model/Drone.java b/Core/src/org/droidplanner/core/model/Drone.java index f89c2d4ab7..6d74ee7e40 100644 --- a/Core/src/org/droidplanner/core/model/Drone.java +++ b/Core/src/org/droidplanner/core/model/Drone.java @@ -25,7 +25,7 @@ import org.droidplanner.core.firmware.FirmwareType; import org.droidplanner.core.mission.Mission; -import com.MAVLink.Messages.ardupilotmega.msg_heartbeat; +import com.MAVLink.common.msg_heartbeat; public interface Drone { @@ -41,7 +41,7 @@ public interface Drone { public boolean isConnectionAlive(); - public void onHeartbeat(msg_heartbeat msg); + public void onHeartbeat(msg_heartbeat msg_heart); public State getState(); diff --git a/Core/src/org/droidplanner/core/parameters/Parameter.java b/Core/src/org/droidplanner/core/parameters/Parameter.java index 95af597d51..d5d9c7a828 100644 --- a/Core/src/org/droidplanner/core/parameters/Parameter.java +++ b/Core/src/org/droidplanner/core/parameters/Parameter.java @@ -3,7 +3,7 @@ import java.io.Serializable; import java.text.DecimalFormat; -import com.MAVLink.Messages.ardupilotmega.msg_param_value; +import com.MAVLink.common.msg_param_value; public class Parameter implements Comparable, Serializable { diff --git a/Core/src/org/droidplanner/core/survey/Footprint.java b/Core/src/org/droidplanner/core/survey/Footprint.java index 25a69bcfee..425d8ca6df 100644 --- a/Core/src/org/droidplanner/core/survey/Footprint.java +++ b/Core/src/org/droidplanner/core/survey/Footprint.java @@ -9,7 +9,7 @@ import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.helpers.units.Length; -import com.MAVLink.Messages.ardupilotmega.msg_camera_feedback; +import com.MAVLink.ardupilotmega.msg_camera_feedback; public class Footprint { /** diff --git a/Core/test/org/droidplanner/core/mission/waypoints/ChangeCameraTriggerTest.java b/Core/test/org/droidplanner/core/mission/waypoints/ChangeCameraTriggerTest.java index e27f7c1e7f..bb77a0ed0c 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/ChangeCameraTriggerTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/ChangeCameraTriggerTest.java @@ -8,8 +8,8 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.commands.CameraTrigger; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class ChangeCameraTriggerTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/ChangeSpeedTest.java b/Core/test/org/droidplanner/core/mission/waypoints/ChangeSpeedTest.java index 3441d1e0a8..a25ce875ff 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/ChangeSpeedTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/ChangeSpeedTest.java @@ -8,8 +8,8 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.commands.ChangeSpeed; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class ChangeSpeedTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/ConditionYawTest.java b/Core/test/org/droidplanner/core/mission/waypoints/ConditionYawTest.java index 9b54722440..fc163fc6c6 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/ConditionYawTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/ConditionYawTest.java @@ -7,8 +7,8 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.commands.ConditionYaw; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class ConditionYawTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/LandTest.java b/Core/test/org/droidplanner/core/mission/waypoints/LandTest.java index b3897322b4..7285d0fc46 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/LandTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/LandTest.java @@ -6,8 +6,8 @@ import org.droidplanner.core.mission.Mission; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class LandTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/SpatialCoordItemTest.java b/Core/test/org/droidplanner/core/mission/waypoints/SpatialCoordItemTest.java index 83a904c03f..0f174c638f 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/SpatialCoordItemTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/SpatialCoordItemTest.java @@ -6,8 +6,8 @@ import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.mission.Mission; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_FRAME; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_FRAME; public class SpatialCoordItemTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/TakeoffTest.java b/Core/test/org/droidplanner/core/mission/waypoints/TakeoffTest.java index 08e9326898..89a46df0a7 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/TakeoffTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/TakeoffTest.java @@ -8,8 +8,8 @@ import org.droidplanner.core.mission.Mission; import org.droidplanner.core.mission.commands.Takeoff; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class TakeoffTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/mission/waypoints/WaypointTest.java b/Core/test/org/droidplanner/core/mission/waypoints/WaypointTest.java index ad4c43b923..a5a629dedc 100644 --- a/Core/test/org/droidplanner/core/mission/waypoints/WaypointTest.java +++ b/Core/test/org/droidplanner/core/mission/waypoints/WaypointTest.java @@ -8,8 +8,8 @@ import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.mission.Mission; -import com.MAVLink.Messages.ardupilotmega.msg_mission_item; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.common.msg_mission_item; +import com.MAVLink.enums.MAV_CMD; public class WaypointTest extends TestCase { diff --git a/Core/test/org/droidplanner/core/survey/FootprintTest.java b/Core/test/org/droidplanner/core/survey/FootprintTest.java index c6f22289bf..a8ad6d0293 100644 --- a/Core/test/org/droidplanner/core/survey/FootprintTest.java +++ b/Core/test/org/droidplanner/core/survey/FootprintTest.java @@ -7,7 +7,7 @@ import org.droidplanner.core.helpers.coordinates.Coord2D; import org.droidplanner.core.helpers.units.Altitude; -import com.MAVLink.Messages.ardupilotmega.msg_camera_feedback; +import com.MAVLink.ardupilotmega.msg_camera_feedback; public class FootprintTest extends TestCase { diff --git a/Desktop/src/org/droidplanner/desktop/communication/Connection.java b/Desktop/src/org/droidplanner/desktop/communication/Connection.java index 7dc5e70687..df1ba075ba 100644 --- a/Desktop/src/org/droidplanner/desktop/communication/Connection.java +++ b/Desktop/src/org/droidplanner/desktop/communication/Connection.java @@ -9,7 +9,7 @@ import org.droidplanner.core.MAVLink.MAVLinkStreams.MAVLinkOutputStream; import com.MAVLink.Parser; -import com.MAVLink.Messages.MAVLinkPacket; +import com.MAVLink.MAVLinkPacket; public class Connection implements MAVLinkOutputStream { public int localPort = 14550; diff --git a/Desktop/src/org/droidplanner/desktop/logic/Logic.java b/Desktop/src/org/droidplanner/desktop/logic/Logic.java index 2a4ad89377..1364312e91 100644 --- a/Desktop/src/org/droidplanner/desktop/logic/Logic.java +++ b/Desktop/src/org/droidplanner/desktop/logic/Logic.java @@ -12,7 +12,7 @@ import org.droidplanner.desktop.location.FakeLocation; import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; +import com.MAVLink.MAVLinkPacket; public class Logic implements Runnable { public Drone drone; diff --git a/Desktop/src/org/droidplanner/desktop/ui/Map.java b/Desktop/src/org/droidplanner/desktop/ui/Map.java index 21e815028d..2584303120 100644 --- a/Desktop/src/org/droidplanner/desktop/ui/Map.java +++ b/Desktop/src/org/droidplanner/desktop/ui/Map.java @@ -10,13 +10,11 @@ import org.droidplanner.core.helpers.coordinates.Coord3D; import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.waypoints.SpatialCoordItem; -import org.droidplanner.core.survey.Footprint; import org.openstreetmap.gui.jmapviewer.Coordinate; import org.openstreetmap.gui.jmapviewer.JMapViewer; import org.openstreetmap.gui.jmapviewer.MapMarkerDot; import org.openstreetmap.gui.jmapviewer.MapMarkerIcon; import org.openstreetmap.gui.jmapviewer.MapPolygonImpl; -import org.openstreetmap.gui.jmapviewer.MapRectangleImpl; import org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader; import org.openstreetmap.gui.jmapviewer.tilesources.OsmTileSource; @@ -76,7 +74,7 @@ public void onDroneEvent(DroneEventsType event, org.droidplanner.core.model.Dron break; case FOOTPRINT: ArrayList corners = new ArrayList(); - for (Coord2D vertex : drone.getCamera().getLastFootprint().getVertex()) { + for (Coord2D vertex : drone.getCamera().getLastFootprint().getVertexInGlobalFrame()) { corners.add(new Coordinate(vertex.getLat(), vertex.getLng())); } map.addMapPolygon(new MapPolygonImpl(corners)); diff --git a/Mavlink/generate.sh b/Mavlink/generate.sh new file mode 100755 index 0000000000..49d01c97cf --- /dev/null +++ b/Mavlink/generate.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# script to re-generate mavlink C code for APM + +mavdir="$(dirname $0)" + +if ! which mavgen.py > /dev/null; then + echo "mavgen.py must be in your PATH. Get it from http://github.com/mavlink/mavlink in the pymavlink/generator directory" + exit 1 +fi + +echo "Generating Java code" +mavgen.py --lang=Java --wire-protocol=1.0 --output=$mavdir/src/com/MAVLink $mavdir/message_definitions/ardupilotmega.xml diff --git a/Mavlink/mavlinkGenerator/.gitignore b/Mavlink/mavlinkGenerator/.gitignore deleted file mode 100644 index f2a01090b9..0000000000 --- a/Mavlink/mavlinkGenerator/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -pymavlink/tools/ -pymavlink/examples/ -pymavlink/generator/C/ -pymavlink/generator/lib/ -pymavlink/generator/javascript/ -pymavlink/generator/CS/ -pymavlink/generator/javascriptMakefile -pymavlink/generator/*.* -!pymavlink/generator/mavgen.py -!pymavlink/generator/mavgen_java.py - -pymavlink/APM_Mavtest -pymavlink/*.* diff --git a/Mavlink/mavlinkGenerator/README.txt b/Mavlink/mavlinkGenerator/README.txt deleted file mode 100644 index 8900a04173..0000000000 --- a/Mavlink/mavlinkGenerator/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -The mavlink generator files (pymavlink) must be copied to the folder pymavlink. The files can be downloaded from: -https://github.com/mavlink/mavlink/ - -To generate the MAVlink java files run generateMessages.py \ No newline at end of file diff --git a/Mavlink/mavlinkGenerator/generateMessages.py b/Mavlink/mavlinkGenerator/generateMessages.py deleted file mode 100644 index eda80354e3..0000000000 --- a/Mavlink/mavlinkGenerator/generateMessages.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import os -import re -import pprint - -# Python 2.x and 3.x compatability -try: - from tkinter import * - import tkinter.filedialog - import tkinter.messagebox -except ImportError as ex: - # Must be using Python 2.x, import and rename - from Tkinter import * - import tkFileDialog - import tkMessageBox - - tkinter.filedialog = tkFileDialog - del tkFileDialog - tkinter.messagebox = tkMessageBox - del tkMessageBox - -sys.path.append(os.path.join('pymavlink','generator')) -from mavgen import * - -class MavgenOptions: - def __init__(self,language,protocol,output,error_limit): - self.language = language - self.wire_protocol = protocol - self.output = output - self.error_limit = error_limit; - - -if __name__ == '__main__': -# Generate headers - opts = MavgenOptions('Java', '1.0', '../src/com/MAVLink/Messages', '200'); - args = ['./message_definitions/ardupilotmega.xml'] - mavgen(opts,args) diff --git a/Mavlink/mavlinkGenerator/pymavlink/dialects/__init__.py b/Mavlink/mavlinkGenerator/pymavlink/dialects/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Mavlink/mavlinkGenerator/pymavlink/dialects/v09/__init__.py b/Mavlink/mavlinkGenerator/pymavlink/dialects/v09/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Mavlink/mavlinkGenerator/pymavlink/dialects/v10/__init__.py b/Mavlink/mavlinkGenerator/pymavlink/dialects/v10/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen.py b/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen.py deleted file mode 100644 index 8c7361ed64..0000000000 --- a/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python - -''' -parse a MAVLink protocol XML file and generate a python implementation - -Copyright Andrew Tridgell 2011 -Released under GNU GPL version 3 or later - -''' -import sys, textwrap, os -import mavparse - -try: - from lib.genxmlif import GenXmlIfError - from lib.minixsv import pyxsval - performValidation = True -except Exception: - print("Unable to load XML validator libraries. XML validation will not be performed") - performValidation = False - -# XSD schema file -schemaFile = os.path.join(os.path.dirname(os.path.realpath(__file__)), "mavschema.xsd") - - -def mavgen(opts, args) : - """Generate mavlink message formatters and parsers (C and Python ) using options - and args where args are a list of xml files. This function allows python - scripts under Windows to control mavgen using the same interface as - shell scripts under Unix""" - - xml = [] - - for fname in args: - if performValidation: - print("Validating %s" % fname) - mavgen_validate(fname, schemaFile, opts.error_limit); - else: - print("Validation skipped for %s." % fname) - - print("Parsing %s" % fname) - xml.append(mavparse.MAVXML(fname, opts.wire_protocol)) - - # expand includes - for x in xml[:]: - for i in x.include: - fname = os.path.join(os.path.dirname(x.filename), i) - - ## Validate XML file with XSD file if possible. - if performValidation: - print("Validating %s" % fname) - mavgen_validate(fname, schemaFile, opts.error_limit); - else: - print("Validation skipped for %s." % fname) - - ## Parsing - print("Parsing %s" % fname) - xml.append(mavparse.MAVXML(fname, opts.wire_protocol)) - - # include message lengths and CRCs too - for idx in range(0, 256): - if x.message_lengths[idx] == 0: - x.message_lengths[idx] = xml[-1].message_lengths[idx] - x.message_crcs[idx] = xml[-1].message_crcs[idx] - x.message_names[idx] = xml[-1].message_names[idx] - - # work out max payload size across all includes - largest_payload = 0 - for x in xml: - if x.largest_payload > largest_payload: - largest_payload = x.largest_payload - for x in xml: - x.largest_payload = largest_payload - - if mavparse.check_duplicates(xml): - sys.exit(1) - - print("Found %u MAVLink message types in %u XML files" % ( - mavparse.total_msgs(xml), len(xml))) - - # Convert language option to lowercase and validate - opts.language = opts.language.lower() - if opts.language == 'python': - import mavgen_python - mavgen_python.generate(opts.output, xml) - elif opts.language == 'c': - import mavgen_c - mavgen_c.generate(opts.output, xml) - elif opts.language == 'wlua': - import mavgen_wlua - mavgen_wlua.generate(opts.output, xml) - elif opts.language == 'cs': - import mavgen_cs - mavgen_cs.generate(opts.output, xml) - elif opts.language == 'javascript': - import mavgen_javascript - mavgen_javascript.generate(opts.output, xml) - elif opts.language == 'java': - import mavgen_java - mavgen_java.generate(opts.output, xml) - else: - print("Unsupported language %s" % opts.language) - - -# build all the dialects in the dialects subpackage -class Opts: - def __init__(self, wire_protocol, output): - self.wire_protocol = wire_protocol - self.error_limit = 200 - self.language = 'Python' - self.output = output - -def mavgen_python_dialect(dialect, wire_protocol): - '''generate the python code on the fly for a MAVLink dialect''' - dialects = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'dialects') - mdef = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'message_definitions') - if wire_protocol == mavparse.PROTOCOL_0_9: - py = os.path.join(dialects, 'v09', dialect + '.py') - xml = os.path.join(dialects, 'v09', dialect + '.xml') - if not os.path.exists(xml): - xml = os.path.join(mdef, 'v0.9', dialect + '.xml') - else: - py = os.path.join(dialects, 'v10', dialect + '.py') - xml = os.path.join(dialects, 'v10', dialect + '.xml') - if not os.path.exists(xml): - xml = os.path.join(mdef, 'v1.0', dialect + '.xml') - opts = Opts(wire_protocol, py) - import StringIO - - # throw away stdout while generating - stdout_saved = sys.stdout - sys.stdout = StringIO.StringIO() - try: - xml = os.path.relpath(xml) - mavgen( opts, [xml] ) - except Exception: - sys.stdout = stdout_saved - raise - sys.stdout = stdout_saved - - -def mavgen_validate(fname, schema, errorLimitNumber) : - """Uses minixsv to validate an XML file with a given XSD schema file.""" - # use default values of minixsv, location of the schema file must be specified in the XML file - domTreeWrapper = pyxsval.parseAndValidate(fname, xsdFile=schema, errorLimit=errorLimitNumber) - - # domTree is a minidom document object - domTree = domTreeWrapper.getTree() - - -if __name__ == "__main__": - from optparse import OptionParser - - supportedLanguages = ["C", "CS", "JavaScript", "Java", "Python", "WLua"] - parser = OptionParser("%prog [options] ") - parser.add_option("-o", "--output", dest="output", default="mavlink", help="output directory.") - parser.add_option("--lang", dest="language", choices=supportedLanguages, default="Python", help="language of generated code, one of: {0} [default: %default]".format(supportedLanguages)) - parser.add_option("--wire-protocol", dest="wire_protocol", choices=[mavparse.PROTOCOL_0_9, mavparse.PROTOCOL_1_0], default=mavparse.PROTOCOL_1_0, help="MAVLink protocol version: '0.9' or '1.0'. [default: %default]") - parser.add_option("--error-limit", dest="error_limit", default=200, help="maximum number of validation errors.") - (opts, args) = parser.parse_args() - - if len(args) < 1: - parser.error("You must supply at least one MAVLink XML protocol definition") - mavgen(opts, args) diff --git a/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen_java.py b/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen_java.py deleted file mode 100644 index 7b713ff31c..0000000000 --- a/Mavlink/mavlinkGenerator/pymavlink/generator/mavgen_java.py +++ /dev/null @@ -1,642 +0,0 @@ -#!/usr/bin/env python -''' -parse a MAVLink protocol XML file and generate a Java implementation - -Copyright Andrew Tridgell 2011 -Released under GNU GPL version 3 or later -''' - -import sys, textwrap, os, time -import mavparse, mavtemplate - -t = mavtemplate.MAVTemplate() - -def generate_version_h(directory, xml): - '''generate version.h''' - f = open(os.path.join(directory, "version.h"), mode='w') - t.write(f,''' -/** @file - * @brief MAVLink comm protocol built from ${basename}.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ -#ifndef MAVLINK_VERSION_H -#define MAVLINK_VERSION_H - -#define MAVLINK_BUILD_DATE "${parse_time}" -#define MAVLINK_WIRE_PROTOCOL_VERSION "${wire_protocol_version}" -#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE ${largest_payload} - -#endif // MAVLINK_VERSION_H -''', xml) - f.close() - -def generate_mavlink_h(directory, xml): - '''generate mavlink.h''' - f = open(os.path.join(directory, "mavlink.h"), mode='w') - t.write(f,''' -/** @file - * @brief MAVLink comm protocol built from ${basename}.xml - * @see http://pixhawk.ethz.ch/software/mavlink - */ -#ifndef MAVLINK_H -#define MAVLINK_H - -#ifndef MAVLINK_STX -#define MAVLINK_STX ${protocol_marker} -#endif - -#ifndef MAVLINK_ENDIAN -#define MAVLINK_ENDIAN ${mavlink_endian} -#endif - -#ifndef MAVLINK_ALIGNED_FIELDS -#define MAVLINK_ALIGNED_FIELDS ${aligned_fields_define} -#endif - -#ifndef MAVLINK_CRC_EXTRA -#define MAVLINK_CRC_EXTRA ${crc_extra_define} -#endif - -#include "version.h" -#include "${basename}.h" - -#endif // MAVLINK_H -''', xml) - f.close() - - -def generate_enums(basename, xml): - '''generate main header per XML file''' - directory = os.path.join(basename, '''enums''') - mavparse.mkdir_p(directory) - for en in xml.enum: - f = open(os.path.join(directory, en.name+".java"), mode='w') - t.write(f, ''' -/** ${description} -*/ -package com.MAVLink.Messages.enums; - -public class ${name} { -${{entry: public static final int ${name} = ${value}; /* ${description} |${{param:${description}| }} */ -}} -} -''', en) - f.close() - - - -def generate_CRC(directory, xml): - # and message CRCs array - xml.message_crcs_array = '' - for crc in xml.message_crcs: - xml.message_crcs_array += '%u, ' % crc - xml.message_crcs_array = xml.message_crcs_array[:-2] - - f = open(os.path.join(directory, "CRC.java"), mode='w') - t.write(f,''' - package com.MAVLink.Messages; - -/** - * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, - * updated with witch field of the message, and then finished with the message - * id. - * - */ -public class CRC { - private final int[] MAVLINK_MESSAGE_CRCS = {${message_crcs_array}}; - private static final int CRC_INIT_VALUE = 0xffff; - private int CRCvalue; - - /** - * Accumulate the X.25 CRC by adding one char at a time. - * - * The checksum function adds the hash of one char at a time to the 16 bit - * checksum (uint16_t). - * - * @param data - * new char to hash - * @param crcAccum - * the already accumulated checksum - **/ - public void update_checksum(int data) { - int tmp; - data= data & 0xff; //cast because we want an unsigned type - tmp = data ^ (CRCvalue & 0xff); - tmp ^= (tmp << 4) & 0xff; - CRCvalue = ((CRCvalue >> 8) & 0xff) ^ (tmp << 8) ^ (tmp << 3) - ^ ((tmp >> 4) & 0xf); - } - - /** - * Finish the CRC calculation of a message, by running the CRC with the - * Magic Byte. This Magic byte has been defined in MAVlink v1.0. - * - * @param msgid - * The message id number - */ - public void finish_checksum(int msgid) { - update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); - } - - /** - * Initialize the buffer for the X.25 CRC - * - */ - public void start_checksum() { - CRCvalue = CRC_INIT_VALUE; - } - - public int getMSB() { - return ((CRCvalue >> 8) & 0xff); - } - - public int getLSB() { - return (CRCvalue & 0xff); - } - - public CRC() { - start_checksum(); - } - -} -''',xml) - - f.close() - - -def generate_message_h(directory, m): - '''generate per-message header for a XML file''' - f = open(os.path.join(directory, 'msg_%s.java' % m.name_lower), mode='w') - t.write(f, ''' -// MESSAGE ${name} PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* ${description} -*/ -public class msg_${name_lower} extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_${name} = ${id}; - public static final int MAVLINK_MSG_LENGTH = ${wire_length}; - private static final long serialVersionUID = MAVLINK_MSG_ID_${name}; - - -${{ordered_fields: /** - * ${description} - */ - public ${type} ${name}${array_suffix}; -}} - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_${name}; -${{ordered_fields: ${packField} -}} - return packet; - } - - /** - * Decode a ${name_lower} message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); -${{ordered_fields: ${unpackField} -}} - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_${name_lower}(){ - msgid = MAVLINK_MSG_ID_${name}; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_${name_lower}(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_${name}; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "${name}"); - //Log.d("MAVLINK_MSG_ID_${name}", toString()); - } - -${{ordered_fields: ${getText} }} - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_${name} -"+${{ordered_fields:" ${name}:"+${name}+}}""; - } -} -''', m) - f.close() - - -def generate_MAVLinkMessage(directory, xml_list): - f = open(os.path.join(directory, "MAVLinkPacket.java"), mode='w') - f.write('''package com.MAVLink.Messages; - -import java.io.Serializable; -import android.util.Log; -import com.MAVLink.Messages.ardupilotmega.*; - -/** - * Common interface for all MAVLink Messages - * Packet Anatomy - * This is the anatomy of one packet. It is inspired by the CAN and SAE AS-4 standards. - - * Byte Index Content Value Explanation - * 0 Packet start sign v1.0: 0xFE Indicates the start of a new packet. (v0.9: 0x55) - * 1 Payload length 0 - 255 Indicates length of the following payload. - * 2 Packet sequence 0 - 255 Each component counts up his send sequence. Allows to detect packet loss - * 3 System ID 1 - 255 ID of the SENDING system. Allows to differentiate different MAVs on the same network. - * 4 Component ID 0 - 255 ID of the SENDING component. Allows to differentiate different components of the same system, e.g. the IMU and the autopilot. - * 5 Message ID 0 - 255 ID of the message - the id defines what the payload means and how it should be correctly decoded. - * 6 to (n+6) Payload 0 - 255 Data of the message, depends on the message id. - * (n+7)to(n+8) Checksum (low byte, high byte) ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from message fields. Protects the packet from decoding a different version of the same packet but with different variables). - - * The checksum is the same as used in ITU X.25 and SAE AS-4 standards (CRC-16-CCITT), documented in SAE AS5669A. Please see the MAVLink source code for a documented C-implementation of it. LINK TO CHECKSUM - * The minimum packet length is 8 bytes for acknowledgement packets without payload - * The maximum packet length is 263 bytes for full payload - * - */ -public class MAVLinkPacket implements Serializable { - private static final long serialVersionUID = 2095947771227815314L; - - public static final int MAVLINK_STX = 254; - - /** - * Message length. NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - */ - public int len; - /** - * Message sequence - */ - public int seq; - /** - * ID of the SENDING system. Allows to differentiate different MAVs on the - * same network. - */ - public int sysid; - /** - * ID of the SENDING component. Allows to differentiate different components - * of the same system, e.g. the IMU and the autopilot. - */ - public int compid; - /** - * ID of the message - the id defines what the payload means and how it - * should be correctly decoded. - */ - public int msgid; - /** - * Data of the message, depends on the message id. - */ - public MAVLinkPayload payload; - /** - * ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) - * Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from - * message fields. Protects the packet from decoding a different version of - * the same packet but with different variables). - */ - public CRC crc; - - public MAVLinkPacket(){ - payload = new MAVLinkPayload(); - } - - /** - * Check if the size of the Payload is equal to the "len" byte - */ - public boolean payloadIsFilled() { - if (payload.size() >= MAVLinkPayload.MAX_PAYLOAD_SIZE-1) { - Log.d("MAV","Buffer overflow"); - return true; - } - return (payload.size() == len); - } - - /** - * Update CRC for this packet. - */ - public void generateCRC(){ - crc = new CRC(); - crc.update_checksum(len); - crc.update_checksum(seq); - crc.update_checksum(sysid); - crc.update_checksum(compid); - crc.update_checksum(msgid); - payload.resetIndex(); - for (int i = 0; i < payload.size(); i++) { - crc.update_checksum(payload.getByte()); - } - crc.finish_checksum(msgid); - } - - /** - * Encode this packet for transmission. - * - * @return Array with bytes to be transmitted - */ - public byte[] encodePacket() { - byte[] buffer = new byte[6 + len + 2]; - int i = 0; - buffer[i++] = (byte) MAVLINK_STX; - buffer[i++] = (byte) len; - buffer[i++] = (byte) seq; - buffer[i++] = (byte) sysid; - buffer[i++] = (byte) compid; - buffer[i++] = (byte) msgid; - for (int j = 0; j < payload.size(); j++) { - buffer[i++] = payload.payload.get(j); - } - generateCRC(); - buffer[i++] = (byte) (crc.getLSB()); - buffer[i++] = (byte) (crc.getMSB()); - return buffer; - } - - /** - * Unpack the data in this packet and return a MAVLink message - * - * @return MAVLink message decoded from this packet - */ - public MAVLinkMessage unpack() { - switch (msgid) { -''') - for xml in xml_list: - t.write(f, ''' -${{message: case msg_${name_lower}.MAVLINK_MSG_ID_${name}: - return new msg_${name_lower}(this); -}} -''',xml) - f.write(''' default: - Log.d("MAVLink", "UNKNOW MESSAGE - " + msgid); - return null; - } - } - -} - -''') - - f.close() - -def copy_fixed_headers(directory, xml): - '''copy the fixed protocol headers to the target directory''' - import shutil - hlist = [ 'protocol.h', 'mavlink_helpers.h', 'mavlink_types.h', 'checksum.h', 'mavlink_protobuf_manager.hpp' ] - basepath = os.path.dirname(os.path.realpath(__file__)) - srcpath = os.path.join(basepath, 'C/include_v%s' % xml.wire_protocol_version) - print("Copying fixed headers") - for h in hlist: - if (not (h == 'mavlink_protobuf_manager.hpp' and xml.wire_protocol_version == '0.9')): - src = os.path.realpath(os.path.join(srcpath, h)) - dest = os.path.realpath(os.path.join(directory, h)) - if src == dest: - continue - shutil.copy(src, dest) - # XXX This is a hack - to be removed - if (xml.basename == 'pixhawk' and xml.wire_protocol_version == '1.0'): - h = 'pixhawk/pixhawk.pb.h' - src = os.path.realpath(os.path.join(srcpath, h)) - dest = os.path.realpath(os.path.join(directory, h)) - if src != dest: - shutil.copy(src, dest) - -def copy_fixed_sources(directory, xml): - # XXX This is a hack - to be removed - import shutil - basepath = os.path.dirname(os.path.realpath(__file__)) - srcpath = os.path.join(basepath, 'C/src_v%s' % xml.wire_protocol_version) - if (xml.basename == 'pixhawk' and xml.wire_protocol_version == '1.0'): - print("Copying fixed sources") - src = os.path.realpath(os.path.join(srcpath, 'pixhawk/pixhawk.pb.cc')) - dest = os.path.realpath(os.path.join(directory, '../../../share/mavlink/src/v%s/pixhawk/pixhawk.pb.cc' % xml.wire_protocol_version)) - destdir = os.path.realpath(os.path.join(directory, '../../../share/mavlink/src/v%s/pixhawk' % xml.wire_protocol_version)) - try: - os.makedirs(destdir) - except: - print("Not re-creating directory") - shutil.copy(src, dest) - print("Copied to"), - print(dest) - -class mav_include(object): - def __init__(self, base): - self.base = base - - -def mavfmt(field): - '''work out the struct format for a type''' - map = { - 'float' : 'float', - 'double' : 'double', - 'char' : 'byte', - 'int8_t' : 'byte', - 'uint8_t' : 'byte', - 'uint8_t_mavlink_version' : 'byte', - 'int16_t' : 'short', - 'uint16_t' : 'short', - 'int32_t' : 'int', - 'uint32_t' : 'int', - 'int64_t' : 'long', - 'uint64_t' : 'long', - } - - return map[field.type] - -def generate_one(basename, xml): - '''generate headers for one XML file''' - - directory = os.path.join(basename, '''ardupilotmega''') - - print("Generating Java implementation in directory %s" % directory) - mavparse.mkdir_p(directory) - - if xml.little_endian: - xml.mavlink_endian = "MAVLINK_LITTLE_ENDIAN" - else: - xml.mavlink_endian = "MAVLINK_BIG_ENDIAN" - - if xml.crc_extra: - xml.crc_extra_define = "1" - else: - xml.crc_extra_define = "0" - - if xml.sort_fields: - xml.aligned_fields_define = "1" - else: - xml.aligned_fields_define = "0" - - # work out the included headers - xml.include_list = [] - for i in xml.include: - base = i[:-4] - xml.include_list.append(mav_include(base)) - - # form message lengths array - xml.message_lengths_array = '' - for mlen in xml.message_lengths: - xml.message_lengths_array += '%u, ' % mlen - xml.message_lengths_array = xml.message_lengths_array[:-2] - - - - # form message info array - xml.message_info_array = '' - for name in xml.message_names: - if name is not None: - xml.message_info_array += 'MAVLINK_MESSAGE_INFO_%s, ' % name - else: - # Several C compilers don't accept {NULL} for - # multi-dimensional arrays and structs - # feed the compiler a "filled" empty message - xml.message_info_array += '{"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, ' - xml.message_info_array = xml.message_info_array[:-2] - - # add some extra field attributes for convenience with arrays - for m in xml.message: - m.msg_name = m.name - if xml.crc_extra: - m.crc_extra_arg = ", %s" % m.crc_extra - else: - m.crc_extra_arg = "" - for f in m.fields: - if f.print_format is None: - f.c_print_format = 'NULL' - else: - f.c_print_format = '"%s"' % f.print_format - f.getText = '' - if f.array_length != 0: - f.array_suffix = '[] = new %s[%u]' % (mavfmt(f),f.array_length) - f.array_prefix = '*' - f.array_tag = '_array' - f.array_arg = ', %u' % f.array_length - f.array_return_arg = '%s, %u, ' % (f.name, f.array_length) - f.array_const = 'const ' - f.decode_left = '' - f.decode_right = 'm.%s' % (f.name) - - f.unpackField = ''' for (int i = 0; i < %s.length; i++) { - %s[i] = payload.get%s(); - }''' % (f.name, f.name, mavfmt(f).title() ) - f.packField = ''' for (int i = 0; i < %s.length; i++) { - packet.payload.put%s(%s[i]); - }''' % (f.name, mavfmt(f).title(),f.name) - f.return_type = 'uint16_t' - f.get_arg = ', %s *%s' % (f.type, f.name) - if f.type == 'char': - f.c_test_value = '"%s"' % f.test_value - f.getText = '''/** - * Sets the buffer of this message with a string, adds the necessary padding - */ - public void set%s(String str) { - int len = Math.min(str.length(), %d); - for (int i=0; i= MAVLinkPayload.MAX_PAYLOAD_SIZE-1) { + return true; + } + return (payload.size() == len); + } + + /** + * Update CRC for this packet. + */ + public void generateCRC(){ + crc = new CRC(); + crc.update_checksum(len); + crc.update_checksum(seq); + crc.update_checksum(sysid); + crc.update_checksum(compid); + crc.update_checksum(msgid); + payload.resetIndex(); + for (int i = 0; i < payload.size(); i++) { + crc.update_checksum(payload.getByte()); + } + crc.finish_checksum(msgid); + } + + /** + * Encode this packet for transmission. + * + * @return Array with bytes to be transmitted + */ + public byte[] encodePacket() { + byte[] buffer = new byte[6 + len + 2]; + int i = 0; + buffer[i++] = (byte) MAVLINK_STX; + buffer[i++] = (byte) len; + buffer[i++] = (byte) seq; + buffer[i++] = (byte) sysid; + buffer[i++] = (byte) compid; + buffer[i++] = (byte) msgid; + for (int j = 0; j < payload.size(); j++) { + buffer[i++] = payload.payload.get(j); + } + generateCRC(); + buffer[i++] = (byte) (crc.getLSB()); + buffer[i++] = (byte) (crc.getMSB()); + return buffer; + } + + /** + * Unpack the data in this packet and return a MAVLink message + * + * @return MAVLink message decoded from this packet + */ + public MAVLinkMessage unpack() { + switch (msgid) { + case msg_sensor_offsets.MAVLINK_MSG_ID_SENSOR_OFFSETS: + return new msg_sensor_offsets(this); + case msg_set_mag_offsets.MAVLINK_MSG_ID_SET_MAG_OFFSETS: + return new msg_set_mag_offsets(this); + case msg_meminfo.MAVLINK_MSG_ID_MEMINFO: + return new msg_meminfo(this); + case msg_ap_adc.MAVLINK_MSG_ID_AP_ADC: + return new msg_ap_adc(this); + case msg_digicam_configure.MAVLINK_MSG_ID_DIGICAM_CONFIGURE: + return new msg_digicam_configure(this); + case msg_digicam_control.MAVLINK_MSG_ID_DIGICAM_CONTROL: + return new msg_digicam_control(this); + case msg_mount_configure.MAVLINK_MSG_ID_MOUNT_CONFIGURE: + return new msg_mount_configure(this); + case msg_mount_control.MAVLINK_MSG_ID_MOUNT_CONTROL: + return new msg_mount_control(this); + case msg_mount_status.MAVLINK_MSG_ID_MOUNT_STATUS: + return new msg_mount_status(this); + case msg_fence_point.MAVLINK_MSG_ID_FENCE_POINT: + return new msg_fence_point(this); + case msg_fence_fetch_point.MAVLINK_MSG_ID_FENCE_FETCH_POINT: + return new msg_fence_fetch_point(this); + case msg_fence_status.MAVLINK_MSG_ID_FENCE_STATUS: + return new msg_fence_status(this); + case msg_ahrs.MAVLINK_MSG_ID_AHRS: + return new msg_ahrs(this); + case msg_simstate.MAVLINK_MSG_ID_SIMSTATE: + return new msg_simstate(this); + case msg_hwstatus.MAVLINK_MSG_ID_HWSTATUS: + return new msg_hwstatus(this); + case msg_radio.MAVLINK_MSG_ID_RADIO: + return new msg_radio(this); + case msg_limits_status.MAVLINK_MSG_ID_LIMITS_STATUS: + return new msg_limits_status(this); + case msg_wind.MAVLINK_MSG_ID_WIND: + return new msg_wind(this); + case msg_data16.MAVLINK_MSG_ID_DATA16: + return new msg_data16(this); + case msg_data32.MAVLINK_MSG_ID_DATA32: + return new msg_data32(this); + case msg_data64.MAVLINK_MSG_ID_DATA64: + return new msg_data64(this); + case msg_data96.MAVLINK_MSG_ID_DATA96: + return new msg_data96(this); + case msg_rangefinder.MAVLINK_MSG_ID_RANGEFINDER: + return new msg_rangefinder(this); + case msg_airspeed_autocal.MAVLINK_MSG_ID_AIRSPEED_AUTOCAL: + return new msg_airspeed_autocal(this); + case msg_rally_point.MAVLINK_MSG_ID_RALLY_POINT: + return new msg_rally_point(this); + case msg_rally_fetch_point.MAVLINK_MSG_ID_RALLY_FETCH_POINT: + return new msg_rally_fetch_point(this); + case msg_compassmot_status.MAVLINK_MSG_ID_COMPASSMOT_STATUS: + return new msg_compassmot_status(this); + case msg_ahrs2.MAVLINK_MSG_ID_AHRS2: + return new msg_ahrs2(this); + case msg_camera_status.MAVLINK_MSG_ID_CAMERA_STATUS: + return new msg_camera_status(this); + case msg_camera_feedback.MAVLINK_MSG_ID_CAMERA_FEEDBACK: + return new msg_camera_feedback(this); + case msg_battery2.MAVLINK_MSG_ID_BATTERY2: + return new msg_battery2(this); + + case msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT: + return new msg_heartbeat(this); + case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS: + return new msg_sys_status(this); + case msg_system_time.MAVLINK_MSG_ID_SYSTEM_TIME: + return new msg_system_time(this); + case msg_ping.MAVLINK_MSG_ID_PING: + return new msg_ping(this); + case msg_change_operator_control.MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL: + return new msg_change_operator_control(this); + case msg_change_operator_control_ack.MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK: + return new msg_change_operator_control_ack(this); + case msg_auth_key.MAVLINK_MSG_ID_AUTH_KEY: + return new msg_auth_key(this); + case msg_set_mode.MAVLINK_MSG_ID_SET_MODE: + return new msg_set_mode(this); + case msg_param_request_read.MAVLINK_MSG_ID_PARAM_REQUEST_READ: + return new msg_param_request_read(this); + case msg_param_request_list.MAVLINK_MSG_ID_PARAM_REQUEST_LIST: + return new msg_param_request_list(this); + case msg_param_value.MAVLINK_MSG_ID_PARAM_VALUE: + return new msg_param_value(this); + case msg_param_set.MAVLINK_MSG_ID_PARAM_SET: + return new msg_param_set(this); + case msg_gps_raw_int.MAVLINK_MSG_ID_GPS_RAW_INT: + return new msg_gps_raw_int(this); + case msg_gps_status.MAVLINK_MSG_ID_GPS_STATUS: + return new msg_gps_status(this); + case msg_scaled_imu.MAVLINK_MSG_ID_SCALED_IMU: + return new msg_scaled_imu(this); + case msg_raw_imu.MAVLINK_MSG_ID_RAW_IMU: + return new msg_raw_imu(this); + case msg_raw_pressure.MAVLINK_MSG_ID_RAW_PRESSURE: + return new msg_raw_pressure(this); + case msg_scaled_pressure.MAVLINK_MSG_ID_SCALED_PRESSURE: + return new msg_scaled_pressure(this); + case msg_attitude.MAVLINK_MSG_ID_ATTITUDE: + return new msg_attitude(this); + case msg_attitude_quaternion.MAVLINK_MSG_ID_ATTITUDE_QUATERNION: + return new msg_attitude_quaternion(this); + case msg_local_position_ned.MAVLINK_MSG_ID_LOCAL_POSITION_NED: + return new msg_local_position_ned(this); + case msg_global_position_int.MAVLINK_MSG_ID_GLOBAL_POSITION_INT: + return new msg_global_position_int(this); + case msg_rc_channels_scaled.MAVLINK_MSG_ID_RC_CHANNELS_SCALED: + return new msg_rc_channels_scaled(this); + case msg_rc_channels_raw.MAVLINK_MSG_ID_RC_CHANNELS_RAW: + return new msg_rc_channels_raw(this); + case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW: + return new msg_servo_output_raw(this); + case msg_mission_request_partial_list.MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST: + return new msg_mission_request_partial_list(this); + case msg_mission_write_partial_list.MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST: + return new msg_mission_write_partial_list(this); + case msg_mission_item.MAVLINK_MSG_ID_MISSION_ITEM: + return new msg_mission_item(this); + case msg_mission_request.MAVLINK_MSG_ID_MISSION_REQUEST: + return new msg_mission_request(this); + case msg_mission_set_current.MAVLINK_MSG_ID_MISSION_SET_CURRENT: + return new msg_mission_set_current(this); + case msg_mission_current.MAVLINK_MSG_ID_MISSION_CURRENT: + return new msg_mission_current(this); + case msg_mission_request_list.MAVLINK_MSG_ID_MISSION_REQUEST_LIST: + return new msg_mission_request_list(this); + case msg_mission_count.MAVLINK_MSG_ID_MISSION_COUNT: + return new msg_mission_count(this); + case msg_mission_clear_all.MAVLINK_MSG_ID_MISSION_CLEAR_ALL: + return new msg_mission_clear_all(this); + case msg_mission_item_reached.MAVLINK_MSG_ID_MISSION_ITEM_REACHED: + return new msg_mission_item_reached(this); + case msg_mission_ack.MAVLINK_MSG_ID_MISSION_ACK: + return new msg_mission_ack(this); + case msg_set_gps_global_origin.MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN: + return new msg_set_gps_global_origin(this); + case msg_gps_global_origin.MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN: + return new msg_gps_global_origin(this); + case msg_safety_set_allowed_area.MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA: + return new msg_safety_set_allowed_area(this); + case msg_safety_allowed_area.MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA: + return new msg_safety_allowed_area(this); + case msg_attitude_quaternion_cov.MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV: + return new msg_attitude_quaternion_cov(this); + case msg_nav_controller_output.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT: + return new msg_nav_controller_output(this); + case msg_global_position_int_cov.MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV: + return new msg_global_position_int_cov(this); + case msg_local_position_ned_cov.MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV: + return new msg_local_position_ned_cov(this); + case msg_rc_channels.MAVLINK_MSG_ID_RC_CHANNELS: + return new msg_rc_channels(this); + case msg_request_data_stream.MAVLINK_MSG_ID_REQUEST_DATA_STREAM: + return new msg_request_data_stream(this); + case msg_data_stream.MAVLINK_MSG_ID_DATA_STREAM: + return new msg_data_stream(this); + case msg_manual_control.MAVLINK_MSG_ID_MANUAL_CONTROL: + return new msg_manual_control(this); + case msg_rc_channels_override.MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: + return new msg_rc_channels_override(this); + case msg_mission_item_int.MAVLINK_MSG_ID_MISSION_ITEM_INT: + return new msg_mission_item_int(this); + case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD: + return new msg_vfr_hud(this); + case msg_command_int.MAVLINK_MSG_ID_COMMAND_INT: + return new msg_command_int(this); + case msg_command_long.MAVLINK_MSG_ID_COMMAND_LONG: + return new msg_command_long(this); + case msg_command_ack.MAVLINK_MSG_ID_COMMAND_ACK: + return new msg_command_ack(this); + case msg_manual_setpoint.MAVLINK_MSG_ID_MANUAL_SETPOINT: + return new msg_manual_setpoint(this); + case msg_set_attitude_target.MAVLINK_MSG_ID_SET_ATTITUDE_TARGET: + return new msg_set_attitude_target(this); + case msg_attitude_target.MAVLINK_MSG_ID_ATTITUDE_TARGET: + return new msg_attitude_target(this); + case msg_set_position_target_local_ned.MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED: + return new msg_set_position_target_local_ned(this); + case msg_position_target_local_ned.MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED: + return new msg_position_target_local_ned(this); + case msg_set_position_target_global_int.MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT: + return new msg_set_position_target_global_int(this); + case msg_position_target_global_int.MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT: + return new msg_position_target_global_int(this); + case msg_local_position_ned_system_global_offset.MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET: + return new msg_local_position_ned_system_global_offset(this); + case msg_hil_state.MAVLINK_MSG_ID_HIL_STATE: + return new msg_hil_state(this); + case msg_hil_controls.MAVLINK_MSG_ID_HIL_CONTROLS: + return new msg_hil_controls(this); + case msg_hil_rc_inputs_raw.MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW: + return new msg_hil_rc_inputs_raw(this); + case msg_optical_flow.MAVLINK_MSG_ID_OPTICAL_FLOW: + return new msg_optical_flow(this); + case msg_global_vision_position_estimate.MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE: + return new msg_global_vision_position_estimate(this); + case msg_vision_position_estimate.MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE: + return new msg_vision_position_estimate(this); + case msg_vision_speed_estimate.MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE: + return new msg_vision_speed_estimate(this); + case msg_vicon_position_estimate.MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE: + return new msg_vicon_position_estimate(this); + case msg_highres_imu.MAVLINK_MSG_ID_HIGHRES_IMU: + return new msg_highres_imu(this); + case msg_omnidirectional_flow.MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW: + return new msg_omnidirectional_flow(this); + case msg_hil_sensor.MAVLINK_MSG_ID_HIL_SENSOR: + return new msg_hil_sensor(this); + case msg_sim_state.MAVLINK_MSG_ID_SIM_STATE: + return new msg_sim_state(this); + case msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS: + return new msg_radio_status(this); + case msg_file_transfer_protocol.MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL: + return new msg_file_transfer_protocol(this); + case msg_hil_gps.MAVLINK_MSG_ID_HIL_GPS: + return new msg_hil_gps(this); + case msg_hil_optical_flow.MAVLINK_MSG_ID_HIL_OPTICAL_FLOW: + return new msg_hil_optical_flow(this); + case msg_hil_state_quaternion.MAVLINK_MSG_ID_HIL_STATE_QUATERNION: + return new msg_hil_state_quaternion(this); + case msg_scaled_imu2.MAVLINK_MSG_ID_SCALED_IMU2: + return new msg_scaled_imu2(this); + case msg_log_request_list.MAVLINK_MSG_ID_LOG_REQUEST_LIST: + return new msg_log_request_list(this); + case msg_log_entry.MAVLINK_MSG_ID_LOG_ENTRY: + return new msg_log_entry(this); + case msg_log_request_data.MAVLINK_MSG_ID_LOG_REQUEST_DATA: + return new msg_log_request_data(this); + case msg_log_data.MAVLINK_MSG_ID_LOG_DATA: + return new msg_log_data(this); + case msg_log_erase.MAVLINK_MSG_ID_LOG_ERASE: + return new msg_log_erase(this); + case msg_log_request_end.MAVLINK_MSG_ID_LOG_REQUEST_END: + return new msg_log_request_end(this); + case msg_gps_inject_data.MAVLINK_MSG_ID_GPS_INJECT_DATA: + return new msg_gps_inject_data(this); + case msg_gps2_raw.MAVLINK_MSG_ID_GPS2_RAW: + return new msg_gps2_raw(this); + case msg_power_status.MAVLINK_MSG_ID_POWER_STATUS: + return new msg_power_status(this); + case msg_serial_control.MAVLINK_MSG_ID_SERIAL_CONTROL: + return new msg_serial_control(this); + case msg_gps_rtk.MAVLINK_MSG_ID_GPS_RTK: + return new msg_gps_rtk(this); + case msg_gps2_rtk.MAVLINK_MSG_ID_GPS2_RTK: + return new msg_gps2_rtk(this); + case msg_data_transmission_handshake.MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE: + return new msg_data_transmission_handshake(this); + case msg_encapsulated_data.MAVLINK_MSG_ID_ENCAPSULATED_DATA: + return new msg_encapsulated_data(this); + case msg_distance_sensor.MAVLINK_MSG_ID_DISTANCE_SENSOR: + return new msg_distance_sensor(this); + case msg_terrain_request.MAVLINK_MSG_ID_TERRAIN_REQUEST: + return new msg_terrain_request(this); + case msg_terrain_data.MAVLINK_MSG_ID_TERRAIN_DATA: + return new msg_terrain_data(this); + case msg_terrain_check.MAVLINK_MSG_ID_TERRAIN_CHECK: + return new msg_terrain_check(this); + case msg_terrain_report.MAVLINK_MSG_ID_TERRAIN_REPORT: + return new msg_terrain_report(this); + case msg_battery_status.MAVLINK_MSG_ID_BATTERY_STATUS: + return new msg_battery_status(this); + case msg_autopilot_version.MAVLINK_MSG_ID_AUTOPILOT_VERSION: + return new msg_autopilot_version(this); + case msg_v2_extension.MAVLINK_MSG_ID_V2_EXTENSION: + return new msg_v2_extension(this); + case msg_memory_vect.MAVLINK_MSG_ID_MEMORY_VECT: + return new msg_memory_vect(this); + case msg_debug_vect.MAVLINK_MSG_ID_DEBUG_VECT: + return new msg_debug_vect(this); + case msg_named_value_float.MAVLINK_MSG_ID_NAMED_VALUE_FLOAT: + return new msg_named_value_float(this); + case msg_named_value_int.MAVLINK_MSG_ID_NAMED_VALUE_INT: + return new msg_named_value_int(this); + case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT: + return new msg_statustext(this); + case msg_debug.MAVLINK_MSG_ID_DEBUG: + return new msg_debug(this); + + default: + return null; + } + } + + } + + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/Messages/ApmCommands.java b/Mavlink/src/com/MAVLink/Messages/ApmCommands.java index 6fbca2ee17..f259a193ac 100644 --- a/Mavlink/src/com/MAVLink/Messages/ApmCommands.java +++ b/Mavlink/src/com/MAVLink/Messages/ApmCommands.java @@ -2,7 +2,7 @@ import java.util.ArrayList; -import com.MAVLink.Messages.enums.MAV_CMD; +import com.MAVLink.enums.MAV_CMD; public enum ApmCommands { diff --git a/Mavlink/src/com/MAVLink/Messages/ApmModes.java b/Mavlink/src/com/MAVLink/Messages/ApmModes.java index 6ad28781fb..497f1ce4cf 100644 --- a/Mavlink/src/com/MAVLink/Messages/ApmModes.java +++ b/Mavlink/src/com/MAVLink/Messages/ApmModes.java @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -import com.MAVLink.Messages.enums.MAV_TYPE; +import com.MAVLink.enums.MAV_TYPE; public enum ApmModes { FIXED_WING_MANUAL (0,"Manual",MAV_TYPE.MAV_TYPE_FIXED_WING), diff --git a/Mavlink/src/com/MAVLink/Messages/CRC.java b/Mavlink/src/com/MAVLink/Messages/CRC.java deleted file mode 100644 index ca4ca486d8..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/CRC.java +++ /dev/null @@ -1,65 +0,0 @@ - package com.MAVLink.Messages; - -/** - * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, - * updated with witch field of the message, and then finished with the message - * id. - * - */ -public class CRC { - private final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 0, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 29, 12, 241, 233, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 211, 108, 32, 185, 84, 0, 0, 124, 119, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 0, 29, 223, 85, 6, 229, 203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 49, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}; - private static final int CRC_INIT_VALUE = 0xffff; - private int CRCvalue; - - /** - * Accumulate the X.25 CRC by adding one char at a time. - * - * The checksum function adds the hash of one char at a time to the 16 bit - * checksum (uint16_t). - * - * @param data - * new char to hash - * @param crcAccum - * the already accumulated checksum - **/ - public void update_checksum(int data) { - int tmp; - data= data & 0xff; //cast because we want an unsigned type - tmp = data ^ (CRCvalue & 0xff); - tmp ^= (tmp << 4) & 0xff; - CRCvalue = ((CRCvalue >> 8) & 0xff) ^ (tmp << 8) ^ (tmp << 3) - ^ ((tmp >> 4) & 0xf); - } - - /** - * Finish the CRC calculation of a message, by running the CRC with the - * Magic Byte. This Magic byte has been defined in MAVlink v1.0. - * - * @param msgid - * The message id number - */ - public void finish_checksum(int msgid) { - update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); - } - - /** - * Initialize the buffer for the X.25 CRC - * - */ - public void start_checksum() { - CRCvalue = CRC_INIT_VALUE; - } - - public int getMSB() { - return ((CRCvalue >> 8) & 0xff); - } - - public int getLSB() { - return (CRCvalue & 0xff); - } - - public CRC() { - start_checksum(); - } - -} diff --git a/Mavlink/src/com/MAVLink/Messages/MAVLinkMessage.java b/Mavlink/src/com/MAVLink/Messages/MAVLinkMessage.java index 5c7157fd3c..dde64d338c 100644 --- a/Mavlink/src/com/MAVLink/Messages/MAVLinkMessage.java +++ b/Mavlink/src/com/MAVLink/Messages/MAVLinkMessage.java @@ -3,6 +3,8 @@ import java.io.Serializable; +import com.MAVLink.MAVLinkPacket; + public abstract class MAVLinkMessage implements Serializable { private static final long serialVersionUID = -7754622750478538539L; // The MAVLink message classes have been changed to implement Serializable, diff --git a/Mavlink/src/com/MAVLink/Messages/MAVLinkPacket.java b/Mavlink/src/com/MAVLink/Messages/MAVLinkPacket.java deleted file mode 100644 index a7f0f7f276..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/MAVLinkPacket.java +++ /dev/null @@ -1,414 +0,0 @@ -package com.MAVLink.Messages; - -import java.io.Serializable; - -import com.MAVLink.Messages.ardupilotmega.*; - -/** - * Common interface for all MAVLink Messages - * Packet Anatomy - * This is the anatomy of one packet. It is inspired by the CAN and SAE AS-4 standards. - - * Byte Index Content Value Explanation - * 0 Packet start sign v1.0: 0xFE Indicates the start of a new packet. (v0.9: 0x55) - * 1 Payload length 0 - 255 Indicates length of the following payload. - * 2 Packet sequence 0 - 255 Each component counts up his send sequence. Allows to detect packet loss - * 3 System ID 1 - 255 ID of the SENDING system. Allows to differentiate different MAVs on the same network. - * 4 Component ID 0 - 255 ID of the SENDING component. Allows to differentiate different components of the same system, e.g. the IMU and the autopilot. - * 5 Message ID 0 - 255 ID of the message - the id defines what the payload means and how it should be correctly decoded. - * 6 to (n+6) Payload 0 - 255 Data of the message, depends on the message id. - * (n+7)to(n+8) Checksum (low byte, high byte) ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from message fields. Protects the packet from decoding a different version of the same packet but with different variables). - - * The checksum is the same as used in ITU X.25 and SAE AS-4 standards (CRC-16-CCITT), documented in SAE AS5669A. Please see the MAVLink source code for a documented C-implementation of it. LINK TO CHECKSUM - * The minimum packet length is 8 bytes for acknowledgement packets without payload - * The maximum packet length is 263 bytes for full payload - * - * - */ -public class MAVLinkPacket implements Serializable { - private static final long serialVersionUID = 2095947771227815314L; - - public static final int MAVLINK_STX = 254; - - /** - * Message length. NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - */ - public int len; - /** - * Message sequence - */ - public int seq; - /** - * ID of the SENDING system. Allows to differentiate different MAVs on the - * same network. - */ - public int sysid; - /** - * ID of the SENDING component. Allows to differentiate different components - * of the same system, e.g. the IMU and the autopilot. - */ - public int compid; - /** - * ID of the message - the id defines what the payload means and how it - * should be correctly decoded. - */ - public int msgid; - /** - * Data of the message, depends on the message id. - */ - public MAVLinkPayload payload; - /** - * ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) - * Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from - * message fields. Protects the packet from decoding a different version of - * the same packet but with different variables). - */ - public CRC crc; - - public MAVLinkPacket(){ - payload = new MAVLinkPayload(); - } - - /** - * Check if the size of the Payload is equal to the "len" byte - */ - public boolean payloadIsFilled() { - if (payload.size() >= MAVLinkPayload.MAX_PAYLOAD_SIZE-1) { - return true; - } - return (payload.size() == len); - } - - /** - * Update CRC for this packet. - */ - public void generateCRC(){ - crc = new CRC(); - crc.update_checksum(len); - crc.update_checksum(seq); - crc.update_checksum(sysid); - crc.update_checksum(compid); - crc.update_checksum(msgid); - payload.resetIndex(); - for (int i = 0; i < payload.size(); i++) { - crc.update_checksum(payload.getByte()); - } - crc.finish_checksum(msgid); - } - - /** - * Encode this packet for transmission. - * - * @return Array with bytes to be transmitted - */ - public byte[] encodePacket() { - byte[] buffer = new byte[6 + len + 2]; - int i = 0; - buffer[i++] = (byte) MAVLINK_STX; - buffer[i++] = (byte) len; - buffer[i++] = (byte) seq; - buffer[i++] = (byte) sysid; - buffer[i++] = (byte) compid; - buffer[i++] = (byte) msgid; - for (int j = 0; j < payload.size(); j++) { - buffer[i++] = payload.payload.get(j); - } - generateCRC(); - buffer[i++] = (byte) (crc.getLSB()); - buffer[i++] = (byte) (crc.getMSB()); - return buffer; - } - - /** - * Unpack the data in this packet and return a MAVLink message - * - * @return MAVLink message decoded from this packet - */ - public MAVLinkMessage unpack() { - switch (msgid) { - case msg_sensor_offsets.MAVLINK_MSG_ID_SENSOR_OFFSETS: - return new msg_sensor_offsets(this); - case msg_set_mag_offsets.MAVLINK_MSG_ID_SET_MAG_OFFSETS: - return new msg_set_mag_offsets(this); - case msg_meminfo.MAVLINK_MSG_ID_MEMINFO: - return new msg_meminfo(this); - case msg_ap_adc.MAVLINK_MSG_ID_AP_ADC: - return new msg_ap_adc(this); - case msg_digicam_configure.MAVLINK_MSG_ID_DIGICAM_CONFIGURE: - return new msg_digicam_configure(this); - case msg_digicam_control.MAVLINK_MSG_ID_DIGICAM_CONTROL: - return new msg_digicam_control(this); - case msg_mount_configure.MAVLINK_MSG_ID_MOUNT_CONFIGURE: - return new msg_mount_configure(this); - case msg_mount_control.MAVLINK_MSG_ID_MOUNT_CONTROL: - return new msg_mount_control(this); - case msg_mount_status.MAVLINK_MSG_ID_MOUNT_STATUS: - return new msg_mount_status(this); - case msg_fence_point.MAVLINK_MSG_ID_FENCE_POINT: - return new msg_fence_point(this); - case msg_fence_fetch_point.MAVLINK_MSG_ID_FENCE_FETCH_POINT: - return new msg_fence_fetch_point(this); - case msg_fence_status.MAVLINK_MSG_ID_FENCE_STATUS: - return new msg_fence_status(this); - case msg_ahrs.MAVLINK_MSG_ID_AHRS: - return new msg_ahrs(this); - case msg_simstate.MAVLINK_MSG_ID_SIMSTATE: - return new msg_simstate(this); - case msg_hwstatus.MAVLINK_MSG_ID_HWSTATUS: - return new msg_hwstatus(this); - case msg_radio.MAVLINK_MSG_ID_RADIO: - return new msg_radio(this); - case msg_limits_status.MAVLINK_MSG_ID_LIMITS_STATUS: - return new msg_limits_status(this); - case msg_wind.MAVLINK_MSG_ID_WIND: - return new msg_wind(this); - case msg_data16.MAVLINK_MSG_ID_DATA16: - return new msg_data16(this); - case msg_data32.MAVLINK_MSG_ID_DATA32: - return new msg_data32(this); - case msg_data64.MAVLINK_MSG_ID_DATA64: - return new msg_data64(this); - case msg_data96.MAVLINK_MSG_ID_DATA96: - return new msg_data96(this); - case msg_rangefinder.MAVLINK_MSG_ID_RANGEFINDER: - return new msg_rangefinder(this); - case msg_airspeed_autocal.MAVLINK_MSG_ID_AIRSPEED_AUTOCAL: - return new msg_airspeed_autocal(this); - case msg_rally_point.MAVLINK_MSG_ID_RALLY_POINT: - return new msg_rally_point(this); - case msg_rally_fetch_point.MAVLINK_MSG_ID_RALLY_FETCH_POINT: - return new msg_rally_fetch_point(this); - case msg_compassmot_status.MAVLINK_MSG_ID_COMPASSMOT_STATUS: - return new msg_compassmot_status(this); - case msg_ahrs2.MAVLINK_MSG_ID_AHRS2: - return new msg_ahrs2(this); - case msg_camera_status.MAVLINK_MSG_ID_CAMERA_STATUS: - return new msg_camera_status(this); - case msg_camera_feedback.MAVLINK_MSG_ID_CAMERA_FEEDBACK: - return new msg_camera_feedback(this); - case msg_battery2.MAVLINK_MSG_ID_BATTERY2: - return new msg_battery2(this); - case msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT: - return new msg_heartbeat(this); - case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS: - return new msg_sys_status(this); - case msg_system_time.MAVLINK_MSG_ID_SYSTEM_TIME: - return new msg_system_time(this); - case msg_ping.MAVLINK_MSG_ID_PING: - return new msg_ping(this); - case msg_change_operator_control.MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL: - return new msg_change_operator_control(this); - case msg_change_operator_control_ack.MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK: - return new msg_change_operator_control_ack(this); - case msg_auth_key.MAVLINK_MSG_ID_AUTH_KEY: - return new msg_auth_key(this); - case msg_set_mode.MAVLINK_MSG_ID_SET_MODE: - return new msg_set_mode(this); - case msg_param_request_read.MAVLINK_MSG_ID_PARAM_REQUEST_READ: - return new msg_param_request_read(this); - case msg_param_request_list.MAVLINK_MSG_ID_PARAM_REQUEST_LIST: - return new msg_param_request_list(this); - case msg_param_value.MAVLINK_MSG_ID_PARAM_VALUE: - return new msg_param_value(this); - case msg_param_set.MAVLINK_MSG_ID_PARAM_SET: - return new msg_param_set(this); - case msg_gps_raw_int.MAVLINK_MSG_ID_GPS_RAW_INT: - return new msg_gps_raw_int(this); - case msg_gps_status.MAVLINK_MSG_ID_GPS_STATUS: - return new msg_gps_status(this); - case msg_scaled_imu.MAVLINK_MSG_ID_SCALED_IMU: - return new msg_scaled_imu(this); - case msg_raw_imu.MAVLINK_MSG_ID_RAW_IMU: - return new msg_raw_imu(this); - case msg_raw_pressure.MAVLINK_MSG_ID_RAW_PRESSURE: - return new msg_raw_pressure(this); - case msg_scaled_pressure.MAVLINK_MSG_ID_SCALED_PRESSURE: - return new msg_scaled_pressure(this); - case msg_attitude.MAVLINK_MSG_ID_ATTITUDE: - return new msg_attitude(this); - case msg_attitude_quaternion.MAVLINK_MSG_ID_ATTITUDE_QUATERNION: - return new msg_attitude_quaternion(this); - case msg_local_position_ned.MAVLINK_MSG_ID_LOCAL_POSITION_NED: - return new msg_local_position_ned(this); - case msg_global_position_int.MAVLINK_MSG_ID_GLOBAL_POSITION_INT: - return new msg_global_position_int(this); - case msg_rc_channels_scaled.MAVLINK_MSG_ID_RC_CHANNELS_SCALED: - return new msg_rc_channels_scaled(this); - case msg_rc_channels_raw.MAVLINK_MSG_ID_RC_CHANNELS_RAW: - return new msg_rc_channels_raw(this); - case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW: - return new msg_servo_output_raw(this); - case msg_mission_request_partial_list.MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST: - return new msg_mission_request_partial_list(this); - case msg_mission_write_partial_list.MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST: - return new msg_mission_write_partial_list(this); - case msg_mission_item.MAVLINK_MSG_ID_MISSION_ITEM: - return new msg_mission_item(this); - case msg_mission_request.MAVLINK_MSG_ID_MISSION_REQUEST: - return new msg_mission_request(this); - case msg_mission_set_current.MAVLINK_MSG_ID_MISSION_SET_CURRENT: - return new msg_mission_set_current(this); - case msg_mission_current.MAVLINK_MSG_ID_MISSION_CURRENT: - return new msg_mission_current(this); - case msg_mission_request_list.MAVLINK_MSG_ID_MISSION_REQUEST_LIST: - return new msg_mission_request_list(this); - case msg_mission_count.MAVLINK_MSG_ID_MISSION_COUNT: - return new msg_mission_count(this); - case msg_mission_clear_all.MAVLINK_MSG_ID_MISSION_CLEAR_ALL: - return new msg_mission_clear_all(this); - case msg_mission_item_reached.MAVLINK_MSG_ID_MISSION_ITEM_REACHED: - return new msg_mission_item_reached(this); - case msg_mission_ack.MAVLINK_MSG_ID_MISSION_ACK: - return new msg_mission_ack(this); - case msg_set_gps_global_origin.MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN: - return new msg_set_gps_global_origin(this); - case msg_gps_global_origin.MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN: - return new msg_gps_global_origin(this); - case msg_safety_set_allowed_area.MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA: - return new msg_safety_set_allowed_area(this); - case msg_safety_allowed_area.MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA: - return new msg_safety_allowed_area(this); - case msg_attitude_quaternion_cov.MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV: - return new msg_attitude_quaternion_cov(this); - case msg_nav_controller_output.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT: - return new msg_nav_controller_output(this); - case msg_global_position_int_cov.MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV: - return new msg_global_position_int_cov(this); - case msg_local_position_ned_cov.MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV: - return new msg_local_position_ned_cov(this); - case msg_rc_channels.MAVLINK_MSG_ID_RC_CHANNELS: - return new msg_rc_channels(this); - case msg_request_data_stream.MAVLINK_MSG_ID_REQUEST_DATA_STREAM: - return new msg_request_data_stream(this); - case msg_data_stream.MAVLINK_MSG_ID_DATA_STREAM: - return new msg_data_stream(this); - case msg_manual_control.MAVLINK_MSG_ID_MANUAL_CONTROL: - return new msg_manual_control(this); - case msg_rc_channels_override.MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: - return new msg_rc_channels_override(this); - case msg_mission_item_int.MAVLINK_MSG_ID_MISSION_ITEM_INT: - return new msg_mission_item_int(this); - case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD: - return new msg_vfr_hud(this); - case msg_command_int.MAVLINK_MSG_ID_COMMAND_INT: - return new msg_command_int(this); - case msg_command_long.MAVLINK_MSG_ID_COMMAND_LONG: - return new msg_command_long(this); - case msg_command_ack.MAVLINK_MSG_ID_COMMAND_ACK: - return new msg_command_ack(this); - case msg_manual_setpoint.MAVLINK_MSG_ID_MANUAL_SETPOINT: - return new msg_manual_setpoint(this); - case msg_set_attitude_target.MAVLINK_MSG_ID_SET_ATTITUDE_TARGET: - return new msg_set_attitude_target(this); - case msg_attitude_target.MAVLINK_MSG_ID_ATTITUDE_TARGET: - return new msg_attitude_target(this); - case msg_set_position_target_local_ned.MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED: - return new msg_set_position_target_local_ned(this); - case msg_position_target_local_ned.MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED: - return new msg_position_target_local_ned(this); - case msg_set_position_target_global_int.MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT: - return new msg_set_position_target_global_int(this); - case msg_position_target_global_int.MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT: - return new msg_position_target_global_int(this); - case msg_local_position_ned_system_global_offset.MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET: - return new msg_local_position_ned_system_global_offset(this); - case msg_hil_state.MAVLINK_MSG_ID_HIL_STATE: - return new msg_hil_state(this); - case msg_hil_controls.MAVLINK_MSG_ID_HIL_CONTROLS: - return new msg_hil_controls(this); - case msg_hil_rc_inputs_raw.MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW: - return new msg_hil_rc_inputs_raw(this); - case msg_optical_flow.MAVLINK_MSG_ID_OPTICAL_FLOW: - return new msg_optical_flow(this); - case msg_global_vision_position_estimate.MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE: - return new msg_global_vision_position_estimate(this); - case msg_vision_position_estimate.MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE: - return new msg_vision_position_estimate(this); - case msg_vision_speed_estimate.MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE: - return new msg_vision_speed_estimate(this); - case msg_vicon_position_estimate.MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE: - return new msg_vicon_position_estimate(this); - case msg_highres_imu.MAVLINK_MSG_ID_HIGHRES_IMU: - return new msg_highres_imu(this); - case msg_omnidirectional_flow.MAVLINK_MSG_ID_OMNIDIRECTIONAL_FLOW: - return new msg_omnidirectional_flow(this); - case msg_hil_sensor.MAVLINK_MSG_ID_HIL_SENSOR: - return new msg_hil_sensor(this); - case msg_sim_state.MAVLINK_MSG_ID_SIM_STATE: - return new msg_sim_state(this); - case msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS: - return new msg_radio_status(this); - case msg_file_transfer_protocol.MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL: - return new msg_file_transfer_protocol(this); - case msg_hil_gps.MAVLINK_MSG_ID_HIL_GPS: - return new msg_hil_gps(this); - case msg_hil_optical_flow.MAVLINK_MSG_ID_HIL_OPTICAL_FLOW: - return new msg_hil_optical_flow(this); - case msg_hil_state_quaternion.MAVLINK_MSG_ID_HIL_STATE_QUATERNION: - return new msg_hil_state_quaternion(this); - case msg_scaled_imu2.MAVLINK_MSG_ID_SCALED_IMU2: - return new msg_scaled_imu2(this); - case msg_log_request_list.MAVLINK_MSG_ID_LOG_REQUEST_LIST: - return new msg_log_request_list(this); - case msg_log_entry.MAVLINK_MSG_ID_LOG_ENTRY: - return new msg_log_entry(this); - case msg_log_request_data.MAVLINK_MSG_ID_LOG_REQUEST_DATA: - return new msg_log_request_data(this); - case msg_log_data.MAVLINK_MSG_ID_LOG_DATA: - return new msg_log_data(this); - case msg_log_erase.MAVLINK_MSG_ID_LOG_ERASE: - return new msg_log_erase(this); - case msg_log_request_end.MAVLINK_MSG_ID_LOG_REQUEST_END: - return new msg_log_request_end(this); - case msg_gps_inject_data.MAVLINK_MSG_ID_GPS_INJECT_DATA: - return new msg_gps_inject_data(this); - case msg_gps2_raw.MAVLINK_MSG_ID_GPS2_RAW: - return new msg_gps2_raw(this); - case msg_power_status.MAVLINK_MSG_ID_POWER_STATUS: - return new msg_power_status(this); - case msg_serial_control.MAVLINK_MSG_ID_SERIAL_CONTROL: - return new msg_serial_control(this); - case msg_gps_rtk.MAVLINK_MSG_ID_GPS_RTK: - return new msg_gps_rtk(this); - case msg_gps2_rtk.MAVLINK_MSG_ID_GPS2_RTK: - return new msg_gps2_rtk(this); - case msg_data_transmission_handshake.MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE: - return new msg_data_transmission_handshake(this); - case msg_encapsulated_data.MAVLINK_MSG_ID_ENCAPSULATED_DATA: - return new msg_encapsulated_data(this); - case msg_distance_sensor.MAVLINK_MSG_ID_DISTANCE_SENSOR: - return new msg_distance_sensor(this); - case msg_terrain_request.MAVLINK_MSG_ID_TERRAIN_REQUEST: - return new msg_terrain_request(this); - case msg_terrain_data.MAVLINK_MSG_ID_TERRAIN_DATA: - return new msg_terrain_data(this); - case msg_terrain_check.MAVLINK_MSG_ID_TERRAIN_CHECK: - return new msg_terrain_check(this); - case msg_terrain_report.MAVLINK_MSG_ID_TERRAIN_REPORT: - return new msg_terrain_report(this); - case msg_battery_status.MAVLINK_MSG_ID_BATTERY_STATUS: - return new msg_battery_status(this); - case msg_autopilot_version.MAVLINK_MSG_ID_AUTOPILOT_VERSION: - return new msg_autopilot_version(this); - case msg_v2_extension.MAVLINK_MSG_ID_V2_EXTENSION: - return new msg_v2_extension(this); - case msg_memory_vect.MAVLINK_MSG_ID_MEMORY_VECT: - return new msg_memory_vect(this); - case msg_debug_vect.MAVLINK_MSG_ID_DEBUG_VECT: - return new msg_debug_vect(this); - case msg_named_value_float.MAVLINK_MSG_ID_NAMED_VALUE_FLOAT: - return new msg_named_value_float(this); - case msg_named_value_int.MAVLINK_MSG_ID_NAMED_VALUE_INT: - return new msg_named_value_int(this); - case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT: - return new msg_statustext(this); - case msg_debug.MAVLINK_MSG_ID_DEBUG: - return new msg_debug(this); - default: - System.err.println("UNKNOW MESSAGE - " + msgid); - return null; - } - } - -} - diff --git a/Mavlink/src/com/MAVLink/Messages/MAVLinkStats.java b/Mavlink/src/com/MAVLink/Messages/MAVLinkStats.java index 425a8f89d2..e9fa36e84c 100644 --- a/Mavlink/src/com/MAVLink/Messages/MAVLinkStats.java +++ b/Mavlink/src/com/MAVLink/Messages/MAVLinkStats.java @@ -1,5 +1,7 @@ package com.MAVLink.Messages; +import com.MAVLink.MAVLinkPacket; + /** * Storage for MAVLink Packet and Error statistics * diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs.java deleted file mode 100644 index 2ab4b3b2ef..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE AHRS PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status of DCM attitude estimator -*/ -public class msg_ahrs extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_AHRS = 163; - public static final int MAVLINK_MSG_LENGTH = 28; - private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS; - - - /** - * X gyro drift estimate rad/s - */ - public float omegaIx; - /** - * Y gyro drift estimate rad/s - */ - public float omegaIy; - /** - * Z gyro drift estimate rad/s - */ - public float omegaIz; - /** - * average accel_weight - */ - public float accel_weight; - /** - * average renormalisation value - */ - public float renorm_val; - /** - * average error_roll_pitch value - */ - public float error_rp; - /** - * average error_yaw value - */ - public float error_yaw; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_AHRS; - packet.payload.putFloat(omegaIx); - packet.payload.putFloat(omegaIy); - packet.payload.putFloat(omegaIz); - packet.payload.putFloat(accel_weight); - packet.payload.putFloat(renorm_val); - packet.payload.putFloat(error_rp); - packet.payload.putFloat(error_yaw); - return packet; - } - - /** - * Decode a ahrs message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - omegaIx = payload.getFloat(); - omegaIy = payload.getFloat(); - omegaIz = payload.getFloat(); - accel_weight = payload.getFloat(); - renorm_val = payload.getFloat(); - error_rp = payload.getFloat(); - error_yaw = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ahrs(){ - msgid = MAVLINK_MSG_ID_AHRS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_ahrs(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AHRS; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "AHRS"); - //Log.d("MAVLINK_MSG_ID_AHRS", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_AHRS -"+" omegaIx:"+omegaIx+" omegaIy:"+omegaIy+" omegaIz:"+omegaIz+" accel_weight:"+accel_weight+" renorm_val:"+renorm_val+" error_rp:"+error_rp+" error_yaw:"+error_yaw+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs2.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs2.java deleted file mode 100644 index d08293d3b8..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ahrs2.java +++ /dev/null @@ -1,106 +0,0 @@ -// MESSAGE AHRS2 PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status of secondary AHRS filter if available -*/ -public class msg_ahrs2 extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_AHRS2 = 178; - public static final int MAVLINK_MSG_LENGTH = 24; - private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS2; - - - /** - * Roll angle (rad) - */ - public float roll; - /** - * Pitch angle (rad) - */ - public float pitch; - /** - * Yaw angle (rad) - */ - public float yaw; - /** - * Altitude (MSL) - */ - public float altitude; - /** - * Latitude in degrees * 1E7 - */ - public int lat; - /** - * Longitude in degrees * 1E7 - */ - public int lng; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_AHRS2; - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(altitude); - packet.payload.putInt(lat); - packet.payload.putInt(lng); - return packet; - } - - /** - * Decode a ahrs2 message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - altitude = payload.getFloat(); - lat = payload.getInt(); - lng = payload.getInt(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ahrs2(){ - msgid = MAVLINK_MSG_ID_AHRS2; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_ahrs2(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AHRS2; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "AHRS2"); - //Log.d("MAVLINK_MSG_ID_AHRS2", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_AHRS2 -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" altitude:"+altitude+" lat:"+lat+" lng:"+lng+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_airspeed_autocal.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_airspeed_autocal.java deleted file mode 100644 index 8838025d31..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_airspeed_autocal.java +++ /dev/null @@ -1,142 +0,0 @@ -// MESSAGE AIRSPEED_AUTOCAL PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Airspeed auto-calibration -*/ -public class msg_airspeed_autocal extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_AIRSPEED_AUTOCAL = 174; - public static final int MAVLINK_MSG_LENGTH = 48; - private static final long serialVersionUID = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - - - /** - * GPS velocity north m/s - */ - public float vx; - /** - * GPS velocity east m/s - */ - public float vy; - /** - * GPS velocity down m/s - */ - public float vz; - /** - * Differential pressure pascals - */ - public float diff_pressure; - /** - * Estimated to true airspeed ratio - */ - public float EAS2TAS; - /** - * Airspeed ratio - */ - public float ratio; - /** - * EKF state x - */ - public float state_x; - /** - * EKF state y - */ - public float state_y; - /** - * EKF state z - */ - public float state_z; - /** - * EKF Pax - */ - public float Pax; - /** - * EKF Pby - */ - public float Pby; - /** - * EKF Pcz - */ - public float Pcz; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - packet.payload.putFloat(vx); - packet.payload.putFloat(vy); - packet.payload.putFloat(vz); - packet.payload.putFloat(diff_pressure); - packet.payload.putFloat(EAS2TAS); - packet.payload.putFloat(ratio); - packet.payload.putFloat(state_x); - packet.payload.putFloat(state_y); - packet.payload.putFloat(state_z); - packet.payload.putFloat(Pax); - packet.payload.putFloat(Pby); - packet.payload.putFloat(Pcz); - return packet; - } - - /** - * Decode a airspeed_autocal message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - vx = payload.getFloat(); - vy = payload.getFloat(); - vz = payload.getFloat(); - diff_pressure = payload.getFloat(); - EAS2TAS = payload.getFloat(); - ratio = payload.getFloat(); - state_x = payload.getFloat(); - state_y = payload.getFloat(); - state_z = payload.getFloat(); - Pax = payload.getFloat(); - Pby = payload.getFloat(); - Pcz = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_airspeed_autocal(){ - msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_airspeed_autocal(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "AIRSPEED_AUTOCAL"); - //Log.d("MAVLINK_MSG_ID_AIRSPEED_AUTOCAL", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_AIRSPEED_AUTOCAL -"+" vx:"+vx+" vy:"+vy+" vz:"+vz+" diff_pressure:"+diff_pressure+" EAS2TAS:"+EAS2TAS+" ratio:"+ratio+" state_x:"+state_x+" state_y:"+state_y+" state_z:"+state_z+" Pax:"+Pax+" Pby:"+Pby+" Pcz:"+Pcz+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ap_adc.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ap_adc.java deleted file mode 100644 index 26eb84de23..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_ap_adc.java +++ /dev/null @@ -1,106 +0,0 @@ -// MESSAGE AP_ADC PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* raw ADC output -*/ -public class msg_ap_adc extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_AP_ADC = 153; - public static final int MAVLINK_MSG_LENGTH = 12; - private static final long serialVersionUID = MAVLINK_MSG_ID_AP_ADC; - - - /** - * ADC output 1 - */ - public short adc1; - /** - * ADC output 2 - */ - public short adc2; - /** - * ADC output 3 - */ - public short adc3; - /** - * ADC output 4 - */ - public short adc4; - /** - * ADC output 5 - */ - public short adc5; - /** - * ADC output 6 - */ - public short adc6; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_AP_ADC; - packet.payload.putShort(adc1); - packet.payload.putShort(adc2); - packet.payload.putShort(adc3); - packet.payload.putShort(adc4); - packet.payload.putShort(adc5); - packet.payload.putShort(adc6); - return packet; - } - - /** - * Decode a ap_adc message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - adc1 = payload.getShort(); - adc2 = payload.getShort(); - adc3 = payload.getShort(); - adc4 = payload.getShort(); - adc5 = payload.getShort(); - adc6 = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ap_adc(){ - msgid = MAVLINK_MSG_ID_AP_ADC; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_ap_adc(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AP_ADC; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "AP_ADC"); - //Log.d("MAVLINK_MSG_ID_AP_ADC", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_AP_ADC -"+" adc1:"+adc1+" adc2:"+adc2+" adc3:"+adc3+" adc4:"+adc4+" adc5:"+adc5+" adc6:"+adc6+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude.java deleted file mode 100644 index a01ff9be86..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE ATTITUDE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). -*/ -public class msg_attitude extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ATTITUDE = 30; - public static final int MAVLINK_MSG_LENGTH = 28; - private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * Roll angle (rad, -pi..+pi) - */ - public float roll; - /** - * Pitch angle (rad, -pi..+pi) - */ - public float pitch; - /** - * Yaw angle (rad, -pi..+pi) - */ - public float yaw; - /** - * Roll angular speed (rad/s) - */ - public float rollspeed; - /** - * Pitch angular speed (rad/s) - */ - public float pitchspeed; - /** - * Yaw angular speed (rad/s) - */ - public float yawspeed; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ATTITUDE; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(rollspeed); - packet.payload.putFloat(pitchspeed); - packet.payload.putFloat(yawspeed); - return packet; - } - - /** - * Decode a attitude message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - rollspeed = payload.getFloat(); - pitchspeed = payload.getFloat(); - yawspeed = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_attitude(){ - msgid = MAVLINK_MSG_ID_ATTITUDE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_attitude(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ATTITUDE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ATTITUDE"); - //Log.d("MAVLINK_MSG_ID_ATTITUDE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ATTITUDE -"+" time_boot_ms:"+time_boot_ms+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion.java deleted file mode 100644 index 127bbfbbe2..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion.java +++ /dev/null @@ -1,118 +0,0 @@ -// MESSAGE ATTITUDE_QUATERNION PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). -*/ -public class msg_attitude_quaternion extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ATTITUDE_QUATERNION = 31; - public static final int MAVLINK_MSG_LENGTH = 32; - private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * Quaternion component 1, w (1 in null-rotation) - */ - public float q1; - /** - * Quaternion component 2, x (0 in null-rotation) - */ - public float q2; - /** - * Quaternion component 3, y (0 in null-rotation) - */ - public float q3; - /** - * Quaternion component 4, z (0 in null-rotation) - */ - public float q4; - /** - * Roll angular speed (rad/s) - */ - public float rollspeed; - /** - * Pitch angular speed (rad/s) - */ - public float pitchspeed; - /** - * Yaw angular speed (rad/s) - */ - public float yawspeed; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(q1); - packet.payload.putFloat(q2); - packet.payload.putFloat(q3); - packet.payload.putFloat(q4); - packet.payload.putFloat(rollspeed); - packet.payload.putFloat(pitchspeed); - packet.payload.putFloat(yawspeed); - return packet; - } - - /** - * Decode a attitude_quaternion message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - q1 = payload.getFloat(); - q2 = payload.getFloat(); - q3 = payload.getFloat(); - q4 = payload.getFloat(); - rollspeed = payload.getFloat(); - pitchspeed = payload.getFloat(); - yawspeed = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_attitude_quaternion(){ - msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_attitude_quaternion(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ATTITUDE_QUATERNION"); - //Log.d("MAVLINK_MSG_ID_ATTITUDE_QUATERNION", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION -"+" time_boot_ms:"+time_boot_ms+" q1:"+q1+" q2:"+q2+" q3:"+q3+" q4:"+q4+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion_cov.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion_cov.java deleted file mode 100644 index 02fe02b1d4..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_quaternion_cov.java +++ /dev/null @@ -1,114 +0,0 @@ -// MESSAGE ATTITUDE_QUATERNION_COV PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). -*/ -public class msg_attitude_quaternion_cov extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV = 61; - public static final int MAVLINK_MSG_LENGTH = 68; - private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) - */ - public float q[] = new float[4]; - /** - * Roll angular speed (rad/s) - */ - public float rollspeed; - /** - * Pitch angular speed (rad/s) - */ - public float pitchspeed; - /** - * Yaw angular speed (rad/s) - */ - public float yawspeed; - /** - * Attitude covariance - */ - public float covariance[] = new float[9]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; - packet.payload.putInt(time_boot_ms); - for (int i = 0; i < q.length; i++) { - packet.payload.putFloat(q[i]); - } - packet.payload.putFloat(rollspeed); - packet.payload.putFloat(pitchspeed); - packet.payload.putFloat(yawspeed); - for (int i = 0; i < covariance.length; i++) { - packet.payload.putFloat(covariance[i]); - } - return packet; - } - - /** - * Decode a attitude_quaternion_cov message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - for (int i = 0; i < q.length; i++) { - q[i] = payload.getFloat(); - } - rollspeed = payload.getFloat(); - pitchspeed = payload.getFloat(); - yawspeed = payload.getFloat(); - for (int i = 0; i < covariance.length; i++) { - covariance[i] = payload.getFloat(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_attitude_quaternion_cov(){ - msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_attitude_quaternion_cov(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ATTITUDE_QUATERNION_COV"); - //Log.d("MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV -"+" time_boot_ms:"+time_boot_ms+" q:"+q+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+" covariance:"+covariance+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_target.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_target.java deleted file mode 100644 index aef5ed2cce..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_attitude_target.java +++ /dev/null @@ -1,116 +0,0 @@ -// MESSAGE ATTITUDE_TARGET PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the vehicle attitude and body angular rates. -*/ -public class msg_attitude_target extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ATTITUDE_TARGET = 83; - public static final int MAVLINK_MSG_LENGTH = 37; - private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_TARGET; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - */ - public float q[] = new float[4]; - /** - * Body roll rate in radians per second - */ - public float body_roll_rate; - /** - * Body roll rate in radians per second - */ - public float body_pitch_rate; - /** - * Body roll rate in radians per second - */ - public float body_yaw_rate; - /** - * Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) - */ - public float thrust; - /** - * Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude - */ - public byte type_mask; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; - packet.payload.putInt(time_boot_ms); - for (int i = 0; i < q.length; i++) { - packet.payload.putFloat(q[i]); - } - packet.payload.putFloat(body_roll_rate); - packet.payload.putFloat(body_pitch_rate); - packet.payload.putFloat(body_yaw_rate); - packet.payload.putFloat(thrust); - packet.payload.putByte(type_mask); - return packet; - } - - /** - * Decode a attitude_target message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - for (int i = 0; i < q.length; i++) { - q[i] = payload.getFloat(); - } - body_roll_rate = payload.getFloat(); - body_pitch_rate = payload.getFloat(); - body_yaw_rate = payload.getFloat(); - thrust = payload.getFloat(); - type_mask = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_attitude_target(){ - msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_attitude_target(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ATTITUDE_TARGET"); - //Log.d("MAVLINK_MSG_ID_ATTITUDE_TARGET", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ATTITUDE_TARGET -"+" time_boot_ms:"+time_boot_ms+" q:"+q+" body_roll_rate:"+body_roll_rate+" body_pitch_rate:"+body_pitch_rate+" body_yaw_rate:"+body_yaw_rate+" thrust:"+thrust+" type_mask:"+type_mask+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_auth_key.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_auth_key.java deleted file mode 100644 index 1e7d67a836..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_auth_key.java +++ /dev/null @@ -1,106 +0,0 @@ -// MESSAGE AUTH_KEY PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. -*/ -public class msg_auth_key extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_AUTH_KEY = 7; - public static final int MAVLINK_MSG_LENGTH = 32; - private static final long serialVersionUID = MAVLINK_MSG_ID_AUTH_KEY; - - - /** - * key - */ - public byte key[] = new byte[32]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_AUTH_KEY; - for (int i = 0; i < key.length; i++) { - packet.payload.putByte(key[i]); - } - return packet; - } - - /** - * Decode a auth_key message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - for (int i = 0; i < key.length; i++) { - key[i] = payload.getByte(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_auth_key(){ - msgid = MAVLINK_MSG_ID_AUTH_KEY; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_auth_key(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AUTH_KEY; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "AUTH_KEY"); - //Log.d("MAVLINK_MSG_ID_AUTH_KEY", toString()); - } - - /** - * Sets the buffer of this message with a string, adds the necessary padding - */ - public void setKey(String str) { - int len = Math.min(str.length(), 32); - for (int i=0; i MAV. Also used to return a point from MAV -> GCS -*/ -public class msg_fence_point extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_FENCE_POINT = 160; - public static final int MAVLINK_MSG_LENGTH = 12; - private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_POINT; - - - /** - * Latitude of point - */ - public float lat; - /** - * Longitude of point - */ - public float lng; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * point index (first point is 1, 0 is for return point) - */ - public byte idx; - /** - * total number of points (for sanity checking) - */ - public byte count; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_FENCE_POINT; - packet.payload.putFloat(lat); - packet.payload.putFloat(lng); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(idx); - packet.payload.putByte(count); - return packet; - } - - /** - * Decode a fence_point message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - lat = payload.getFloat(); - lng = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - idx = payload.getByte(); - count = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_fence_point(){ - msgid = MAVLINK_MSG_ID_FENCE_POINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_fence_point(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_FENCE_POINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "FENCE_POINT"); - //Log.d("MAVLINK_MSG_ID_FENCE_POINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_FENCE_POINT -"+" lat:"+lat+" lng:"+lng+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_fence_status.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_fence_status.java deleted file mode 100644 index 7e43922959..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_fence_status.java +++ /dev/null @@ -1,95 +0,0 @@ -// MESSAGE FENCE_STATUS PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status of geo-fencing. Sent in extended - status stream when fencing enabled -*/ -public class msg_fence_status extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_FENCE_STATUS = 162; - public static final int MAVLINK_MSG_LENGTH = 8; - private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_STATUS; - - - /** - * time of last breach in milliseconds since boot - */ - public int breach_time; - /** - * number of fence breaches - */ - public short breach_count; - /** - * 0 if currently inside fence, 1 if outside - */ - public byte breach_status; - /** - * last breach type (see FENCE_BREACH_* enum) - */ - public byte breach_type; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_FENCE_STATUS; - packet.payload.putInt(breach_time); - packet.payload.putShort(breach_count); - packet.payload.putByte(breach_status); - packet.payload.putByte(breach_type); - return packet; - } - - /** - * Decode a fence_status message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - breach_time = payload.getInt(); - breach_count = payload.getShort(); - breach_status = payload.getByte(); - breach_type = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_fence_status(){ - msgid = MAVLINK_MSG_ID_FENCE_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_fence_status(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_FENCE_STATUS; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "FENCE_STATUS"); - //Log.d("MAVLINK_MSG_ID_FENCE_STATUS", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_FENCE_STATUS -"+" breach_time:"+breach_time+" breach_count:"+breach_count+" breach_status:"+breach_status+" breach_type:"+breach_type+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_file_transfer_dir_list.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_file_transfer_dir_list.java deleted file mode 100644 index 9cf0259bf8..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_file_transfer_dir_list.java +++ /dev/null @@ -1,118 +0,0 @@ -// MESSAGE FILE_TRANSFER_DIR_LIST PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Get directory listing -*/ -public class msg_file_transfer_dir_list extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST = 111; - public static final int MAVLINK_MSG_LENGTH = 249; - private static final long serialVersionUID = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - - - /** - * Unique transfer ID - */ - public long transfer_uid; - /** - * Directory path to list - */ - public byte dir_path[] = new byte[240]; - /** - * RESERVED - */ - public byte flags; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - packet.payload.putLong(transfer_uid); - for (int i = 0; i < dir_path.length; i++) { - packet.payload.putByte(dir_path[i]); - } - packet.payload.putByte(flags); - return packet; - } - - /** - * Decode a file_transfer_dir_list message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - transfer_uid = payload.getLong(); - for (int i = 0; i < dir_path.length; i++) { - dir_path[i] = payload.getByte(); - } - flags = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_file_transfer_dir_list(){ - msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_file_transfer_dir_list(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "FILE_TRANSFER_DIR_LIST"); - //Log.d("MAVLINK_MSG_ID_FILE_TRANSFER_DIR_LIST", toString()); - } - - /** - * Sets the buffer of this message with a string, adds the necessary padding - */ - public void setDir_Path(String str) { - int len = Math.min(str.length(), 240); - for (int i=0; i value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. -*/ -public class msg_param_request_read extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20; - public static final int MAVLINK_MSG_LENGTH = 20; - private static final long serialVersionUID = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - - - /** - * Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) - */ - public short param_index; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - */ - public byte param_id[] = new byte[16]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - packet.payload.putShort(param_index); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - for (int i = 0; i < param_id.length; i++) { - packet.payload.putByte(param_id[i]); - } - return packet; - } - - /** - * Decode a param_request_read message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - param_index = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - for (int i = 0; i < param_id.length; i++) { - param_id[i] = payload.getByte(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_param_request_read(){ - msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_param_request_read(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "PARAM_REQUEST_READ"); - //Log.d("MAVLINK_MSG_ID_PARAM_REQUEST_READ", toString()); - } - - /** - * Sets the buffer of this message with a string, adds the necessary padding - */ - public void setParam_Id(String str) { - int len = Math.min(str.length(), 16); - for (int i=0; i MAV. Also used to return a point from MAV -> GCS -*/ -public class msg_rally_point extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RALLY_POINT = 175; - public static final int MAVLINK_MSG_LENGTH = 19; - private static final long serialVersionUID = MAVLINK_MSG_ID_RALLY_POINT; - - - /** - * Latitude of point in degrees * 1E7 - */ - public int lat; - /** - * Longitude of point in degrees * 1E7 - */ - public int lng; - /** - * Transit / loiter altitude in meters relative to home - */ - public short alt; - /** - * Break altitude in meters relative to home - */ - public short break_alt; - /** - * Heading to aim for when landing. In centi-degrees. - */ - public short land_dir; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * point index (first point is 0) - */ - public byte idx; - /** - * total number of points (for sanity checking) - */ - public byte count; - /** - * See RALLY_FLAGS enum for definition of the bitmask. - */ - public byte flags; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RALLY_POINT; - packet.payload.putInt(lat); - packet.payload.putInt(lng); - packet.payload.putShort(alt); - packet.payload.putShort(break_alt); - packet.payload.putShort(land_dir); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(idx); - packet.payload.putByte(count); - packet.payload.putByte(flags); - return packet; - } - - /** - * Decode a rally_point message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - lat = payload.getInt(); - lng = payload.getInt(); - alt = payload.getShort(); - break_alt = payload.getShort(); - land_dir = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - idx = payload.getByte(); - count = payload.getByte(); - flags = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rally_point(){ - msgid = MAVLINK_MSG_ID_RALLY_POINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rally_point(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RALLY_POINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RALLY_POINT"); - //Log.d("MAVLINK_MSG_ID_RALLY_POINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RALLY_POINT -"+" lat:"+lat+" lng:"+lng+" alt:"+alt+" break_alt:"+break_alt+" land_dir:"+land_dir+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+" flags:"+flags+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rangefinder.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rangefinder.java deleted file mode 100644 index 51b00438d4..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rangefinder.java +++ /dev/null @@ -1,82 +0,0 @@ -// MESSAGE RANGEFINDER PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Rangefinder reporting -*/ -public class msg_rangefinder extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RANGEFINDER = 173; - public static final int MAVLINK_MSG_LENGTH = 8; - private static final long serialVersionUID = MAVLINK_MSG_ID_RANGEFINDER; - - - /** - * distance in meters - */ - public float distance; - /** - * raw voltage if available, zero otherwise - */ - public float voltage; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RANGEFINDER; - packet.payload.putFloat(distance); - packet.payload.putFloat(voltage); - return packet; - } - - /** - * Decode a rangefinder message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - distance = payload.getFloat(); - voltage = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rangefinder(){ - msgid = MAVLINK_MSG_ID_RANGEFINDER; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rangefinder(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RANGEFINDER; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RANGEFINDER"); - //Log.d("MAVLINK_MSG_ID_RANGEFINDER", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RANGEFINDER -"+" distance:"+distance+" voltage:"+voltage+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_imu.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_imu.java deleted file mode 100644 index 6001aaca38..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_imu.java +++ /dev/null @@ -1,130 +0,0 @@ -// MESSAGE RAW_IMU PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW IMU readings for the usual 9DOF sensor setup. This message should always contain the true raw values without any scaling to allow data capture and system debugging. -*/ -public class msg_raw_imu extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RAW_IMU = 27; - public static final int MAVLINK_MSG_LENGTH = 26; - private static final long serialVersionUID = MAVLINK_MSG_ID_RAW_IMU; - - - /** - * Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ - public long time_usec; - /** - * X acceleration (raw) - */ - public short xacc; - /** - * Y acceleration (raw) - */ - public short yacc; - /** - * Z acceleration (raw) - */ - public short zacc; - /** - * Angular speed around X axis (raw) - */ - public short xgyro; - /** - * Angular speed around Y axis (raw) - */ - public short ygyro; - /** - * Angular speed around Z axis (raw) - */ - public short zgyro; - /** - * X Magnetic field (raw) - */ - public short xmag; - /** - * Y Magnetic field (raw) - */ - public short ymag; - /** - * Z Magnetic field (raw) - */ - public short zmag; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RAW_IMU; - packet.payload.putLong(time_usec); - packet.payload.putShort(xacc); - packet.payload.putShort(yacc); - packet.payload.putShort(zacc); - packet.payload.putShort(xgyro); - packet.payload.putShort(ygyro); - packet.payload.putShort(zgyro); - packet.payload.putShort(xmag); - packet.payload.putShort(ymag); - packet.payload.putShort(zmag); - return packet; - } - - /** - * Decode a raw_imu message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_usec = payload.getLong(); - xacc = payload.getShort(); - yacc = payload.getShort(); - zacc = payload.getShort(); - xgyro = payload.getShort(); - ygyro = payload.getShort(); - zgyro = payload.getShort(); - xmag = payload.getShort(); - ymag = payload.getShort(); - zmag = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_raw_imu(){ - msgid = MAVLINK_MSG_ID_RAW_IMU; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_raw_imu(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RAW_IMU; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RAW_IMU"); - //Log.d("MAVLINK_MSG_ID_RAW_IMU", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RAW_IMU -"+" time_usec:"+time_usec+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" xmag:"+xmag+" ymag:"+ymag+" zmag:"+zmag+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_pressure.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_pressure.java deleted file mode 100644 index ab62f7f8b8..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_raw_pressure.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE RAW_PRESSURE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values. -*/ -public class msg_raw_pressure extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RAW_PRESSURE = 28; - public static final int MAVLINK_MSG_LENGTH = 16; - private static final long serialVersionUID = MAVLINK_MSG_ID_RAW_PRESSURE; - - - /** - * Timestamp (microseconds since UNIX epoch or microseconds since system boot) - */ - public long time_usec; - /** - * Absolute pressure (raw) - */ - public short press_abs; - /** - * Differential pressure 1 (raw) - */ - public short press_diff1; - /** - * Differential pressure 2 (raw) - */ - public short press_diff2; - /** - * Raw Temperature measurement (raw) - */ - public short temperature; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - packet.payload.putLong(time_usec); - packet.payload.putShort(press_abs); - packet.payload.putShort(press_diff1); - packet.payload.putShort(press_diff2); - packet.payload.putShort(temperature); - return packet; - } - - /** - * Decode a raw_pressure message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_usec = payload.getLong(); - press_abs = payload.getShort(); - press_diff1 = payload.getShort(); - press_diff2 = payload.getShort(); - temperature = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_raw_pressure(){ - msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_raw_pressure(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RAW_PRESSURE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RAW_PRESSURE"); - //Log.d("MAVLINK_MSG_ID_RAW_PRESSURE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RAW_PRESSURE -"+" time_usec:"+time_usec+" press_abs:"+press_abs+" press_diff1:"+press_diff1+" press_diff2:"+press_diff2+" temperature:"+temperature+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels.java deleted file mode 100644 index 798d46c9db..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels.java +++ /dev/null @@ -1,196 +0,0 @@ -// MESSAGE RC_CHANNELS PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. -*/ -public class msg_rc_channels extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RC_CHANNELS = 65; - public static final int MAVLINK_MSG_LENGTH = 42; - private static final long serialVersionUID = MAVLINK_MSG_ID_RC_CHANNELS; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan1_raw; - /** - * RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan2_raw; - /** - * RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan3_raw; - /** - * RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan4_raw; - /** - * RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan5_raw; - /** - * RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan6_raw; - /** - * RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan7_raw; - /** - * RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan8_raw; - /** - * RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan9_raw; - /** - * RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan10_raw; - /** - * RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan11_raw; - /** - * RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan12_raw; - /** - * RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan13_raw; - /** - * RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan14_raw; - /** - * RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan15_raw; - /** - * RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan16_raw; - /** - * RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan17_raw; - /** - * RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan18_raw; - /** - * Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available. - */ - public byte chancount; - /** - * Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. - */ - public byte rssi; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RC_CHANNELS; - packet.payload.putInt(time_boot_ms); - packet.payload.putShort(chan1_raw); - packet.payload.putShort(chan2_raw); - packet.payload.putShort(chan3_raw); - packet.payload.putShort(chan4_raw); - packet.payload.putShort(chan5_raw); - packet.payload.putShort(chan6_raw); - packet.payload.putShort(chan7_raw); - packet.payload.putShort(chan8_raw); - packet.payload.putShort(chan9_raw); - packet.payload.putShort(chan10_raw); - packet.payload.putShort(chan11_raw); - packet.payload.putShort(chan12_raw); - packet.payload.putShort(chan13_raw); - packet.payload.putShort(chan14_raw); - packet.payload.putShort(chan15_raw); - packet.payload.putShort(chan16_raw); - packet.payload.putShort(chan17_raw); - packet.payload.putShort(chan18_raw); - packet.payload.putByte(chancount); - packet.payload.putByte(rssi); - return packet; - } - - /** - * Decode a rc_channels message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - chan1_raw = payload.getShort(); - chan2_raw = payload.getShort(); - chan3_raw = payload.getShort(); - chan4_raw = payload.getShort(); - chan5_raw = payload.getShort(); - chan6_raw = payload.getShort(); - chan7_raw = payload.getShort(); - chan8_raw = payload.getShort(); - chan9_raw = payload.getShort(); - chan10_raw = payload.getShort(); - chan11_raw = payload.getShort(); - chan12_raw = payload.getShort(); - chan13_raw = payload.getShort(); - chan14_raw = payload.getShort(); - chan15_raw = payload.getShort(); - chan16_raw = payload.getShort(); - chan17_raw = payload.getShort(); - chan18_raw = payload.getShort(); - chancount = payload.getByte(); - rssi = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rc_channels(){ - msgid = MAVLINK_MSG_ID_RC_CHANNELS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rc_channels(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RC_CHANNELS; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RC_CHANNELS"); - //Log.d("MAVLINK_MSG_ID_RC_CHANNELS", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RC_CHANNELS -"+" time_boot_ms:"+time_boot_ms+" chan1_raw:"+chan1_raw+" chan2_raw:"+chan2_raw+" chan3_raw:"+chan3_raw+" chan4_raw:"+chan4_raw+" chan5_raw:"+chan5_raw+" chan6_raw:"+chan6_raw+" chan7_raw:"+chan7_raw+" chan8_raw:"+chan8_raw+" chan9_raw:"+chan9_raw+" chan10_raw:"+chan10_raw+" chan11_raw:"+chan11_raw+" chan12_raw:"+chan12_raw+" chan13_raw:"+chan13_raw+" chan14_raw:"+chan14_raw+" chan15_raw:"+chan15_raw+" chan16_raw:"+chan16_raw+" chan17_raw:"+chan17_raw+" chan18_raw:"+chan18_raw+" chancount:"+chancount+" rssi:"+rssi+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_override.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_override.java deleted file mode 100644 index f59fc70070..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_override.java +++ /dev/null @@ -1,130 +0,0 @@ -// MESSAGE RC_CHANNELS_OVERRIDE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW values of the RC channels sent to the MAV to override info received from the RC radio. A value of UINT16_MAX means no change to that channel. A value of 0 means control of that channel should be released back to the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. -*/ -public class msg_rc_channels_override extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE = 70; - public static final int MAVLINK_MSG_LENGTH = 18; - private static final long serialVersionUID = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - - - /** - * RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan1_raw; - /** - * RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan2_raw; - /** - * RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan3_raw; - /** - * RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan4_raw; - /** - * RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan5_raw; - /** - * RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan6_raw; - /** - * RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan7_raw; - /** - * RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field. - */ - public short chan8_raw; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - packet.payload.putShort(chan1_raw); - packet.payload.putShort(chan2_raw); - packet.payload.putShort(chan3_raw); - packet.payload.putShort(chan4_raw); - packet.payload.putShort(chan5_raw); - packet.payload.putShort(chan6_raw); - packet.payload.putShort(chan7_raw); - packet.payload.putShort(chan8_raw); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - return packet; - } - - /** - * Decode a rc_channels_override message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - chan1_raw = payload.getShort(); - chan2_raw = payload.getShort(); - chan3_raw = payload.getShort(); - chan4_raw = payload.getShort(); - chan5_raw = payload.getShort(); - chan6_raw = payload.getShort(); - chan7_raw = payload.getShort(); - chan8_raw = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rc_channels_override(){ - msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rc_channels_override(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RC_CHANNELS_OVERRIDE"); - //Log.d("MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE -"+" chan1_raw:"+chan1_raw+" chan2_raw:"+chan2_raw+" chan3_raw:"+chan3_raw+" chan4_raw:"+chan4_raw+" chan5_raw:"+chan5_raw+" chan6_raw:"+chan6_raw+" chan7_raw:"+chan7_raw+" chan8_raw:"+chan8_raw+" target_system:"+target_system+" target_component:"+target_component+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_raw.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_raw.java deleted file mode 100644 index ba8f2177d5..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_raw.java +++ /dev/null @@ -1,136 +0,0 @@ -// MESSAGE RC_CHANNELS_RAW PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. -*/ -public class msg_rc_channels_raw extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RC_CHANNELS_RAW = 35; - public static final int MAVLINK_MSG_LENGTH = 22; - private static final long serialVersionUID = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan1_raw; - /** - * RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan2_raw; - /** - * RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan3_raw; - /** - * RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan4_raw; - /** - * RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan5_raw; - /** - * RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan6_raw; - /** - * RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan7_raw; - /** - * RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused. - */ - public short chan8_raw; - /** - * Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - */ - public byte port; - /** - * Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. - */ - public byte rssi; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - packet.payload.putInt(time_boot_ms); - packet.payload.putShort(chan1_raw); - packet.payload.putShort(chan2_raw); - packet.payload.putShort(chan3_raw); - packet.payload.putShort(chan4_raw); - packet.payload.putShort(chan5_raw); - packet.payload.putShort(chan6_raw); - packet.payload.putShort(chan7_raw); - packet.payload.putShort(chan8_raw); - packet.payload.putByte(port); - packet.payload.putByte(rssi); - return packet; - } - - /** - * Decode a rc_channels_raw message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - chan1_raw = payload.getShort(); - chan2_raw = payload.getShort(); - chan3_raw = payload.getShort(); - chan4_raw = payload.getShort(); - chan5_raw = payload.getShort(); - chan6_raw = payload.getShort(); - chan7_raw = payload.getShort(); - chan8_raw = payload.getShort(); - port = payload.getByte(); - rssi = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rc_channels_raw(){ - msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rc_channels_raw(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RC_CHANNELS_RAW; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RC_CHANNELS_RAW"); - //Log.d("MAVLINK_MSG_ID_RC_CHANNELS_RAW", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RC_CHANNELS_RAW -"+" time_boot_ms:"+time_boot_ms+" chan1_raw:"+chan1_raw+" chan2_raw:"+chan2_raw+" chan3_raw:"+chan3_raw+" chan4_raw:"+chan4_raw+" chan5_raw:"+chan5_raw+" chan6_raw:"+chan6_raw+" chan7_raw:"+chan7_raw+" chan8_raw:"+chan8_raw+" port:"+port+" rssi:"+rssi+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_scaled.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_scaled.java deleted file mode 100644 index 95f6835835..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_rc_channels_scaled.java +++ /dev/null @@ -1,136 +0,0 @@ -// MESSAGE RC_CHANNELS_SCALED PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The scaled values of the RC channels received. (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to UINT16_MAX. -*/ -public class msg_rc_channels_scaled extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_RC_CHANNELS_SCALED = 34; - public static final int MAVLINK_MSG_LENGTH = 22; - private static final long serialVersionUID = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan1_scaled; - /** - * RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan2_scaled; - /** - * RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan3_scaled; - /** - * RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan4_scaled; - /** - * RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan5_scaled; - /** - * RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan6_scaled; - /** - * RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan7_scaled; - /** - * RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX. - */ - public short chan8_scaled; - /** - * Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos. - */ - public byte port; - /** - * Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown. - */ - public byte rssi; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - packet.payload.putInt(time_boot_ms); - packet.payload.putShort(chan1_scaled); - packet.payload.putShort(chan2_scaled); - packet.payload.putShort(chan3_scaled); - packet.payload.putShort(chan4_scaled); - packet.payload.putShort(chan5_scaled); - packet.payload.putShort(chan6_scaled); - packet.payload.putShort(chan7_scaled); - packet.payload.putShort(chan8_scaled); - packet.payload.putByte(port); - packet.payload.putByte(rssi); - return packet; - } - - /** - * Decode a rc_channels_scaled message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - chan1_scaled = payload.getShort(); - chan2_scaled = payload.getShort(); - chan3_scaled = payload.getShort(); - chan4_scaled = payload.getShort(); - chan5_scaled = payload.getShort(); - chan6_scaled = payload.getShort(); - chan7_scaled = payload.getShort(); - chan8_scaled = payload.getShort(); - port = payload.getByte(); - rssi = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rc_channels_scaled(){ - msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_rc_channels_scaled(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "RC_CHANNELS_SCALED"); - //Log.d("MAVLINK_MSG_ID_RC_CHANNELS_SCALED", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_RC_CHANNELS_SCALED -"+" time_boot_ms:"+time_boot_ms+" chan1_scaled:"+chan1_scaled+" chan2_scaled:"+chan2_scaled+" chan3_scaled:"+chan3_scaled+" chan4_scaled:"+chan4_scaled+" chan5_scaled:"+chan5_scaled+" chan6_scaled:"+chan6_scaled+" chan7_scaled:"+chan7_scaled+" chan8_scaled:"+chan8_scaled+" port:"+port+" rssi:"+rssi+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_request_data_stream.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_request_data_stream.java deleted file mode 100644 index ee470392c1..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_request_data_stream.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE REQUEST_DATA_STREAM PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* -*/ -public class msg_request_data_stream extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_REQUEST_DATA_STREAM = 66; - public static final int MAVLINK_MSG_LENGTH = 6; - private static final long serialVersionUID = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - - - /** - * The requested interval between two messages of this type - */ - public short req_message_rate; - /** - * The target requested to send the message stream. - */ - public byte target_system; - /** - * The target requested to send the message stream. - */ - public byte target_component; - /** - * The ID of the requested data stream - */ - public byte req_stream_id; - /** - * 1 to start sending, 0 to stop sending. - */ - public byte start_stop; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - packet.payload.putShort(req_message_rate); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(req_stream_id); - packet.payload.putByte(start_stop); - return packet; - } - - /** - * Decode a request_data_stream message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - req_message_rate = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - req_stream_id = payload.getByte(); - start_stop = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_request_data_stream(){ - msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_request_data_stream(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_REQUEST_DATA_STREAM; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "REQUEST_DATA_STREAM"); - //Log.d("MAVLINK_MSG_ID_REQUEST_DATA_STREAM", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_REQUEST_DATA_STREAM -"+" req_message_rate:"+req_message_rate+" target_system:"+target_system+" target_component:"+target_component+" req_stream_id:"+req_stream_id+" start_stop:"+start_stop+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_rates_thrust_setpoint.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_rates_thrust_setpoint.java deleted file mode 100644 index d07f51b27a..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_rates_thrust_setpoint.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE ROLL_PITCH_YAW_RATES_THRUST_SETPOINT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint in roll, pitch, yaw rates and thrust currently active on the system. -*/ -public class msg_roll_pitch_yaw_rates_thrust_setpoint extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT = 80; - public static final int MAVLINK_MSG_LENGTH = 20; - private static final long serialVersionUID = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * Desired roll rate in radians per second - */ - public float roll_rate; - /** - * Desired pitch rate in radians per second - */ - public float pitch_rate; - /** - * Desired yaw rate in radians per second - */ - public float yaw_rate; - /** - * Collective thrust, normalized to 0 .. 1 - */ - public float thrust; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(roll_rate); - packet.payload.putFloat(pitch_rate); - packet.payload.putFloat(yaw_rate); - packet.payload.putFloat(thrust); - return packet; - } - - /** - * Decode a roll_pitch_yaw_rates_thrust_setpoint message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - roll_rate = payload.getFloat(); - pitch_rate = payload.getFloat(); - yaw_rate = payload.getFloat(); - thrust = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_roll_pitch_yaw_rates_thrust_setpoint(){ - msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_roll_pitch_yaw_rates_thrust_setpoint(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ROLL_PITCH_YAW_RATES_THRUST_SETPOINT"); - //Log.d("MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ROLL_PITCH_YAW_RATES_THRUST_SETPOINT -"+" time_boot_ms:"+time_boot_ms+" roll_rate:"+roll_rate+" pitch_rate:"+pitch_rate+" yaw_rate:"+yaw_rate+" thrust:"+thrust+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_speed_thrust_setpoint.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_speed_thrust_setpoint.java deleted file mode 100644 index c82874bf6b..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_speed_thrust_setpoint.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint in rollspeed, pitchspeed, yawspeed currently active on the system. -*/ -public class msg_roll_pitch_yaw_speed_thrust_setpoint extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT = 59; - public static final int MAVLINK_MSG_LENGTH = 20; - private static final long serialVersionUID = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * Desired roll angular speed in rad/s - */ - public float roll_speed; - /** - * Desired pitch angular speed in rad/s - */ - public float pitch_speed; - /** - * Desired yaw angular speed in rad/s - */ - public float yaw_speed; - /** - * Collective thrust, normalized to 0 .. 1 - */ - public float thrust; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(roll_speed); - packet.payload.putFloat(pitch_speed); - packet.payload.putFloat(yaw_speed); - packet.payload.putFloat(thrust); - return packet; - } - - /** - * Decode a roll_pitch_yaw_speed_thrust_setpoint message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - roll_speed = payload.getFloat(); - pitch_speed = payload.getFloat(); - yaw_speed = payload.getFloat(); - thrust = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_roll_pitch_yaw_speed_thrust_setpoint(){ - msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_roll_pitch_yaw_speed_thrust_setpoint(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT"); - //Log.d("MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT -"+" time_boot_ms:"+time_boot_ms+" roll_speed:"+roll_speed+" pitch_speed:"+pitch_speed+" yaw_speed:"+yaw_speed+" thrust:"+thrust+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_thrust_setpoint.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_thrust_setpoint.java deleted file mode 100644 index 42727c2289..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_roll_pitch_yaw_thrust_setpoint.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE ROLL_PITCH_YAW_THRUST_SETPOINT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint in roll, pitch, yaw currently active on the system. -*/ -public class msg_roll_pitch_yaw_thrust_setpoint extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT = 58; - public static final int MAVLINK_MSG_LENGTH = 20; - private static final long serialVersionUID = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * Desired roll angle in radians - */ - public float roll; - /** - * Desired pitch angle in radians - */ - public float pitch; - /** - * Desired yaw angle in radians - */ - public float yaw; - /** - * Collective thrust, normalized to 0 .. 1 - */ - public float thrust; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(thrust); - return packet; - } - - /** - * Decode a roll_pitch_yaw_thrust_setpoint message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - thrust = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_roll_pitch_yaw_thrust_setpoint(){ - msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_roll_pitch_yaw_thrust_setpoint(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "ROLL_PITCH_YAW_THRUST_SETPOINT"); - //Log.d("MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_ROLL_PITCH_YAW_THRUST_SETPOINT -"+" time_boot_ms:"+time_boot_ms+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" thrust:"+thrust+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_allowed_area.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_allowed_area.java deleted file mode 100644 index 068cefe249..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_allowed_area.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE SAFETY_ALLOWED_AREA PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Read out the safety zone the MAV currently assumes. -*/ -public class msg_safety_allowed_area extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA = 55; - public static final int MAVLINK_MSG_LENGTH = 25; - private static final long serialVersionUID = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - - - /** - * x position 1 / Latitude 1 - */ - public float p1x; - /** - * y position 1 / Longitude 1 - */ - public float p1y; - /** - * z position 1 / Altitude 1 - */ - public float p1z; - /** - * x position 2 / Latitude 2 - */ - public float p2x; - /** - * y position 2 / Longitude 2 - */ - public float p2y; - /** - * z position 2 / Altitude 2 - */ - public float p2z; - /** - * Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - */ - public byte frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - packet.payload.putFloat(p1x); - packet.payload.putFloat(p1y); - packet.payload.putFloat(p1z); - packet.payload.putFloat(p2x); - packet.payload.putFloat(p2y); - packet.payload.putFloat(p2z); - packet.payload.putByte(frame); - return packet; - } - - /** - * Decode a safety_allowed_area message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - p1x = payload.getFloat(); - p1y = payload.getFloat(); - p1z = payload.getFloat(); - p2x = payload.getFloat(); - p2y = payload.getFloat(); - p2z = payload.getFloat(); - frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_safety_allowed_area(){ - msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_safety_allowed_area(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SAFETY_ALLOWED_AREA"); - //Log.d("MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA -"+" p1x:"+p1x+" p1y:"+p1y+" p1z:"+p1z+" p2x:"+p2x+" p2y:"+p2y+" p2z:"+p2z+" frame:"+frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_set_allowed_area.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_set_allowed_area.java deleted file mode 100644 index dc0196451e..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_safety_set_allowed_area.java +++ /dev/null @@ -1,124 +0,0 @@ -// MESSAGE SAFETY_SET_ALLOWED_AREA PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/MISSIONs to accept and which to reject. Safety areas are often enforced by national or competition regulations. -*/ -public class msg_safety_set_allowed_area extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA = 54; - public static final int MAVLINK_MSG_LENGTH = 27; - private static final long serialVersionUID = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - - - /** - * x position 1 / Latitude 1 - */ - public float p1x; - /** - * y position 1 / Longitude 1 - */ - public float p1y; - /** - * z position 1 / Altitude 1 - */ - public float p1z; - /** - * x position 2 / Latitude 2 - */ - public float p2x; - /** - * y position 2 / Longitude 2 - */ - public float p2y; - /** - * z position 2 / Altitude 2 - */ - public float p2z; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. - */ - public byte frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - packet.payload.putFloat(p1x); - packet.payload.putFloat(p1y); - packet.payload.putFloat(p1z); - packet.payload.putFloat(p2x); - packet.payload.putFloat(p2y); - packet.payload.putFloat(p2z); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(frame); - return packet; - } - - /** - * Decode a safety_set_allowed_area message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - p1x = payload.getFloat(); - p1y = payload.getFloat(); - p1z = payload.getFloat(); - p2x = payload.getFloat(); - p2y = payload.getFloat(); - p2z = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_safety_set_allowed_area(){ - msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_safety_set_allowed_area(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SAFETY_SET_ALLOWED_AREA"); - //Log.d("MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA -"+" p1x:"+p1x+" p1y:"+p1y+" p1z:"+p1z+" p2x:"+p2x+" p2y:"+p2y+" p2z:"+p2z+" target_system:"+target_system+" target_component:"+target_component+" frame:"+frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu.java deleted file mode 100644 index bae719c77e..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu.java +++ /dev/null @@ -1,130 +0,0 @@ -// MESSAGE SCALED_IMU PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units -*/ -public class msg_scaled_imu extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SCALED_IMU = 26; - public static final int MAVLINK_MSG_LENGTH = 22; - private static final long serialVersionUID = MAVLINK_MSG_ID_SCALED_IMU; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * X acceleration (mg) - */ - public short xacc; - /** - * Y acceleration (mg) - */ - public short yacc; - /** - * Z acceleration (mg) - */ - public short zacc; - /** - * Angular speed around X axis (millirad /sec) - */ - public short xgyro; - /** - * Angular speed around Y axis (millirad /sec) - */ - public short ygyro; - /** - * Angular speed around Z axis (millirad /sec) - */ - public short zgyro; - /** - * X Magnetic field (milli tesla) - */ - public short xmag; - /** - * Y Magnetic field (milli tesla) - */ - public short ymag; - /** - * Z Magnetic field (milli tesla) - */ - public short zmag; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SCALED_IMU; - packet.payload.putInt(time_boot_ms); - packet.payload.putShort(xacc); - packet.payload.putShort(yacc); - packet.payload.putShort(zacc); - packet.payload.putShort(xgyro); - packet.payload.putShort(ygyro); - packet.payload.putShort(zgyro); - packet.payload.putShort(xmag); - packet.payload.putShort(ymag); - packet.payload.putShort(zmag); - return packet; - } - - /** - * Decode a scaled_imu message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - xacc = payload.getShort(); - yacc = payload.getShort(); - zacc = payload.getShort(); - xgyro = payload.getShort(); - ygyro = payload.getShort(); - zgyro = payload.getShort(); - xmag = payload.getShort(); - ymag = payload.getShort(); - zmag = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_scaled_imu(){ - msgid = MAVLINK_MSG_ID_SCALED_IMU; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_scaled_imu(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SCALED_IMU; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SCALED_IMU"); - //Log.d("MAVLINK_MSG_ID_SCALED_IMU", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SCALED_IMU -"+" time_boot_ms:"+time_boot_ms+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" xmag:"+xmag+" ymag:"+ymag+" zmag:"+zmag+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu2.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu2.java deleted file mode 100644 index 72baad2a48..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_imu2.java +++ /dev/null @@ -1,130 +0,0 @@ -// MESSAGE SCALED_IMU2 PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units -*/ -public class msg_scaled_imu2 extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SCALED_IMU2 = 116; - public static final int MAVLINK_MSG_LENGTH = 22; - private static final long serialVersionUID = MAVLINK_MSG_ID_SCALED_IMU2; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * X acceleration (mg) - */ - public short xacc; - /** - * Y acceleration (mg) - */ - public short yacc; - /** - * Z acceleration (mg) - */ - public short zacc; - /** - * Angular speed around X axis (millirad /sec) - */ - public short xgyro; - /** - * Angular speed around Y axis (millirad /sec) - */ - public short ygyro; - /** - * Angular speed around Z axis (millirad /sec) - */ - public short zgyro; - /** - * X Magnetic field (milli tesla) - */ - public short xmag; - /** - * Y Magnetic field (milli tesla) - */ - public short ymag; - /** - * Z Magnetic field (milli tesla) - */ - public short zmag; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SCALED_IMU2; - packet.payload.putInt(time_boot_ms); - packet.payload.putShort(xacc); - packet.payload.putShort(yacc); - packet.payload.putShort(zacc); - packet.payload.putShort(xgyro); - packet.payload.putShort(ygyro); - packet.payload.putShort(zgyro); - packet.payload.putShort(xmag); - packet.payload.putShort(ymag); - packet.payload.putShort(zmag); - return packet; - } - - /** - * Decode a scaled_imu2 message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - xacc = payload.getShort(); - yacc = payload.getShort(); - zacc = payload.getShort(); - xgyro = payload.getShort(); - ygyro = payload.getShort(); - zgyro = payload.getShort(); - xmag = payload.getShort(); - ymag = payload.getShort(); - zmag = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_scaled_imu2(){ - msgid = MAVLINK_MSG_ID_SCALED_IMU2; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_scaled_imu2(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SCALED_IMU2; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SCALED_IMU2"); - //Log.d("MAVLINK_MSG_ID_SCALED_IMU2", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SCALED_IMU2 -"+" time_boot_ms:"+time_boot_ms+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" xmag:"+xmag+" ymag:"+ymag+" zmag:"+zmag+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_pressure.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_pressure.java deleted file mode 100644 index 424fae14e2..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_scaled_pressure.java +++ /dev/null @@ -1,94 +0,0 @@ -// MESSAGE SCALED_PRESSURE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field. -*/ -public class msg_scaled_pressure extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SCALED_PRESSURE = 29; - public static final int MAVLINK_MSG_LENGTH = 14; - private static final long serialVersionUID = MAVLINK_MSG_ID_SCALED_PRESSURE; - - - /** - * Timestamp (milliseconds since system boot) - */ - public int time_boot_ms; - /** - * Absolute pressure (hectopascal) - */ - public float press_abs; - /** - * Differential pressure 1 (hectopascal) - */ - public float press_diff; - /** - * Temperature measurement (0.01 degrees celsius) - */ - public short temperature; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(press_abs); - packet.payload.putFloat(press_diff); - packet.payload.putShort(temperature); - return packet; - } - - /** - * Decode a scaled_pressure message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - press_abs = payload.getFloat(); - press_diff = payload.getFloat(); - temperature = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_scaled_pressure(){ - msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_scaled_pressure(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SCALED_PRESSURE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SCALED_PRESSURE"); - //Log.d("MAVLINK_MSG_ID_SCALED_PRESSURE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SCALED_PRESSURE -"+" time_boot_ms:"+time_boot_ms+" press_abs:"+press_abs+" press_diff:"+press_diff+" temperature:"+temperature+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sensor_offsets.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sensor_offsets.java deleted file mode 100644 index 6805be8696..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sensor_offsets.java +++ /dev/null @@ -1,143 +0,0 @@ -// MESSAGE SENSOR_OFFSETS PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Offsets and calibrations values for hardware - sensors. This makes it easier to debug the calibration process. -*/ -public class msg_sensor_offsets extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SENSOR_OFFSETS = 150; - public static final int MAVLINK_MSG_LENGTH = 42; - private static final long serialVersionUID = MAVLINK_MSG_ID_SENSOR_OFFSETS; - - - /** - * magnetic declination (radians) - */ - public float mag_declination; - /** - * raw pressure from barometer - */ - public int raw_press; - /** - * raw temperature from barometer - */ - public int raw_temp; - /** - * gyro X calibration - */ - public float gyro_cal_x; - /** - * gyro Y calibration - */ - public float gyro_cal_y; - /** - * gyro Z calibration - */ - public float gyro_cal_z; - /** - * accel X calibration - */ - public float accel_cal_x; - /** - * accel Y calibration - */ - public float accel_cal_y; - /** - * accel Z calibration - */ - public float accel_cal_z; - /** - * magnetometer X offset - */ - public short mag_ofs_x; - /** - * magnetometer Y offset - */ - public short mag_ofs_y; - /** - * magnetometer Z offset - */ - public short mag_ofs_z; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - packet.payload.putFloat(mag_declination); - packet.payload.putInt(raw_press); - packet.payload.putInt(raw_temp); - packet.payload.putFloat(gyro_cal_x); - packet.payload.putFloat(gyro_cal_y); - packet.payload.putFloat(gyro_cal_z); - packet.payload.putFloat(accel_cal_x); - packet.payload.putFloat(accel_cal_y); - packet.payload.putFloat(accel_cal_z); - packet.payload.putShort(mag_ofs_x); - packet.payload.putShort(mag_ofs_y); - packet.payload.putShort(mag_ofs_z); - return packet; - } - - /** - * Decode a sensor_offsets message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - mag_declination = payload.getFloat(); - raw_press = payload.getInt(); - raw_temp = payload.getInt(); - gyro_cal_x = payload.getFloat(); - gyro_cal_y = payload.getFloat(); - gyro_cal_z = payload.getFloat(); - accel_cal_x = payload.getFloat(); - accel_cal_y = payload.getFloat(); - accel_cal_z = payload.getFloat(); - mag_ofs_x = payload.getShort(); - mag_ofs_y = payload.getShort(); - mag_ofs_z = payload.getShort(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_sensor_offsets(){ - msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_sensor_offsets(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SENSOR_OFFSETS"); - //Log.d("MAVLINK_MSG_ID_SENSOR_OFFSETS", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SENSOR_OFFSETS -"+" mag_declination:"+mag_declination+" raw_press:"+raw_press+" raw_temp:"+raw_temp+" gyro_cal_x:"+gyro_cal_x+" gyro_cal_y:"+gyro_cal_y+" gyro_cal_z:"+gyro_cal_z+" accel_cal_x:"+accel_cal_x+" accel_cal_y:"+accel_cal_y+" accel_cal_z:"+accel_cal_z+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_serial_control.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_serial_control.java deleted file mode 100644 index 8397efcf5d..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_serial_control.java +++ /dev/null @@ -1,110 +0,0 @@ -// MESSAGE SERIAL_CONTROL PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate. -*/ -public class msg_serial_control extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SERIAL_CONTROL = 126; - public static final int MAVLINK_MSG_LENGTH = 79; - private static final long serialVersionUID = MAVLINK_MSG_ID_SERIAL_CONTROL; - - - /** - * Baudrate of transfer. Zero means no change. - */ - public int baudrate; - /** - * Timeout for reply data in milliseconds - */ - public short timeout; - /** - * See SERIAL_CONTROL_DEV enum - */ - public byte device; - /** - * See SERIAL_CONTROL_FLAG enum - */ - public byte flags; - /** - * how many bytes in this transfer - */ - public byte count; - /** - * serial data - */ - public byte data[] = new byte[70]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; - packet.payload.putInt(baudrate); - packet.payload.putShort(timeout); - packet.payload.putByte(device); - packet.payload.putByte(flags); - packet.payload.putByte(count); - for (int i = 0; i < data.length; i++) { - packet.payload.putByte(data[i]); - } - return packet; - } - - /** - * Decode a serial_control message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - baudrate = payload.getInt(); - timeout = payload.getShort(); - device = payload.getByte(); - flags = payload.getByte(); - count = payload.getByte(); - for (int i = 0; i < data.length; i++) { - data[i] = payload.getByte(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_serial_control(){ - msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_serial_control(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SERIAL_CONTROL; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SERIAL_CONTROL"); - //Log.d("MAVLINK_MSG_ID_SERIAL_CONTROL", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SERIAL_CONTROL -"+" baudrate:"+baudrate+" timeout:"+timeout+" device:"+device+" flags:"+flags+" count:"+count+" data:"+data+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_servo_output_raw.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_servo_output_raw.java deleted file mode 100644 index 007421bf16..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_servo_output_raw.java +++ /dev/null @@ -1,130 +0,0 @@ -// MESSAGE SERVO_OUTPUT_RAW PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. -*/ -public class msg_servo_output_raw extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SERVO_OUTPUT_RAW = 36; - public static final int MAVLINK_MSG_LENGTH = 21; - private static final long serialVersionUID = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - - - /** - * Timestamp (microseconds since system boot) - */ - public int time_usec; - /** - * Servo output 1 value, in microseconds - */ - public short servo1_raw; - /** - * Servo output 2 value, in microseconds - */ - public short servo2_raw; - /** - * Servo output 3 value, in microseconds - */ - public short servo3_raw; - /** - * Servo output 4 value, in microseconds - */ - public short servo4_raw; - /** - * Servo output 5 value, in microseconds - */ - public short servo5_raw; - /** - * Servo output 6 value, in microseconds - */ - public short servo6_raw; - /** - * Servo output 7 value, in microseconds - */ - public short servo7_raw; - /** - * Servo output 8 value, in microseconds - */ - public short servo8_raw; - /** - * Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows to encode more than 8 servos. - */ - public byte port; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - packet.payload.putInt(time_usec); - packet.payload.putShort(servo1_raw); - packet.payload.putShort(servo2_raw); - packet.payload.putShort(servo3_raw); - packet.payload.putShort(servo4_raw); - packet.payload.putShort(servo5_raw); - packet.payload.putShort(servo6_raw); - packet.payload.putShort(servo7_raw); - packet.payload.putShort(servo8_raw); - packet.payload.putByte(port); - return packet; - } - - /** - * Decode a servo_output_raw message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_usec = payload.getInt(); - servo1_raw = payload.getShort(); - servo2_raw = payload.getShort(); - servo3_raw = payload.getShort(); - servo4_raw = payload.getShort(); - servo5_raw = payload.getShort(); - servo6_raw = payload.getShort(); - servo7_raw = payload.getShort(); - servo8_raw = payload.getShort(); - port = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_servo_output_raw(){ - msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_servo_output_raw(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SERVO_OUTPUT_RAW"); - //Log.d("MAVLINK_MSG_ID_SERVO_OUTPUT_RAW", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SERVO_OUTPUT_RAW -"+" time_usec:"+time_usec+" servo1_raw:"+servo1_raw+" servo2_raw:"+servo2_raw+" servo3_raw:"+servo3_raw+" servo4_raw:"+servo4_raw+" servo5_raw:"+servo5_raw+" servo6_raw:"+servo6_raw+" servo7_raw:"+servo7_raw+" servo8_raw:"+servo8_raw+" port:"+port+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_attitude_target.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_attitude_target.java deleted file mode 100644 index 94fd58f0b7..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_attitude_target.java +++ /dev/null @@ -1,128 +0,0 @@ -// MESSAGE SET_ATTITUDE_TARGET PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the vehicle attitude and body angular rates. -*/ -public class msg_set_attitude_target extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_ATTITUDE_TARGET = 82; - public static final int MAVLINK_MSG_LENGTH = 39; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) - */ - public float q[] = new float[4]; - /** - * Body roll rate in radians per second - */ - public float body_roll_rate; - /** - * Body roll rate in radians per second - */ - public float body_pitch_rate; - /** - * Body roll rate in radians per second - */ - public float body_yaw_rate; - /** - * Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) - */ - public float thrust; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 6: reserved, bit 7: throttle, bit 8: attitude - */ - public byte type_mask; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; - packet.payload.putInt(time_boot_ms); - for (int i = 0; i < q.length; i++) { - packet.payload.putFloat(q[i]); - } - packet.payload.putFloat(body_roll_rate); - packet.payload.putFloat(body_pitch_rate); - packet.payload.putFloat(body_yaw_rate); - packet.payload.putFloat(thrust); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(type_mask); - return packet; - } - - /** - * Decode a set_attitude_target message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - for (int i = 0; i < q.length; i++) { - q[i] = payload.getFloat(); - } - body_roll_rate = payload.getFloat(); - body_pitch_rate = payload.getFloat(); - body_yaw_rate = payload.getFloat(); - thrust = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - type_mask = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_attitude_target(){ - msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_attitude_target(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_ATTITUDE_TARGET"); - //Log.d("MAVLINK_MSG_ID_SET_ATTITUDE_TARGET", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_ATTITUDE_TARGET -"+" time_boot_ms:"+time_boot_ms+" q:"+q+" body_roll_rate:"+body_roll_rate+" body_pitch_rate:"+body_pitch_rate+" body_yaw_rate:"+body_yaw_rate+" thrust:"+thrust+" target_system:"+target_system+" target_component:"+target_component+" type_mask:"+type_mask+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_global_position_setpoint_int.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_global_position_setpoint_int.java deleted file mode 100644 index 5fa1a106d9..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_global_position_setpoint_int.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE SET_GLOBAL_POSITION_SETPOINT_INT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the current global position setpoint. -*/ -public class msg_set_global_position_setpoint_int extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT = 53; - public static final int MAVLINK_MSG_LENGTH = 15; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - - - /** - * Latitude (WGS84), in degrees * 1E7 - */ - public int latitude; - /** - * Longitude (WGS84), in degrees * 1E7 - */ - public int longitude; - /** - * Altitude (WGS84), in meters * 1000 (positive for up) - */ - public int altitude; - /** - * Desired yaw angle in degrees * 100 - */ - public short yaw; - /** - * Coordinate frame - valid values are only MAV_FRAME_GLOBAL or MAV_FRAME_GLOBAL_RELATIVE_ALT - */ - public byte coordinate_frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - packet.payload.putInt(latitude); - packet.payload.putInt(longitude); - packet.payload.putInt(altitude); - packet.payload.putShort(yaw); - packet.payload.putByte(coordinate_frame); - return packet; - } - - /** - * Decode a set_global_position_setpoint_int message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - latitude = payload.getInt(); - longitude = payload.getInt(); - altitude = payload.getInt(); - yaw = payload.getShort(); - coordinate_frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_global_position_setpoint_int(){ - msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_global_position_setpoint_int(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_GLOBAL_POSITION_SETPOINT_INT"); - //Log.d("MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_GLOBAL_POSITION_SETPOINT_INT -"+" latitude:"+latitude+" longitude:"+longitude+" altitude:"+altitude+" yaw:"+yaw+" coordinate_frame:"+coordinate_frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_gps_global_origin.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_gps_global_origin.java deleted file mode 100644 index 1a7dd24279..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_gps_global_origin.java +++ /dev/null @@ -1,94 +0,0 @@ -// MESSAGE SET_GPS_GLOBAL_ORIGIN PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* As local waypoints exist, the global MISSION reference allows to transform between the local coordinate frame and the global (GPS) coordinate frame. This can be necessary when e.g. in- and outdoor settings are connected and the MAV should move from in- to outdoor. -*/ -public class msg_set_gps_global_origin extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN = 48; - public static final int MAVLINK_MSG_LENGTH = 13; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - - - /** - * Latitude (WGS84), in degrees * 1E7 - */ - public int latitude; - /** - * Longitude (WGS84, in degrees * 1E7 - */ - public int longitude; - /** - * Altitude (WGS84), in meters * 1000 (positive for up) - */ - public int altitude; - /** - * System ID - */ - public byte target_system; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - packet.payload.putInt(latitude); - packet.payload.putInt(longitude); - packet.payload.putInt(altitude); - packet.payload.putByte(target_system); - return packet; - } - - /** - * Decode a set_gps_global_origin message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - latitude = payload.getInt(); - longitude = payload.getInt(); - altitude = payload.getInt(); - target_system = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_gps_global_origin(){ - msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_gps_global_origin(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_GPS_GLOBAL_ORIGIN"); - //Log.d("MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN -"+" latitude:"+latitude+" longitude:"+longitude+" altitude:"+altitude+" target_system:"+target_system+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_local_position_setpoint.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_local_position_setpoint.java deleted file mode 100644 index 5166cc7d0f..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_local_position_setpoint.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE SET_LOCAL_POSITION_SETPOINT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the setpoint for a local position controller. This is the position in local coordinates the MAV should fly to. This message is sent by the path/MISSION planner to the onboard position controller. As some MAVs have a degree of freedom in yaw (e.g. all helicopters/quadrotors), the desired yaw angle is part of the message. -*/ -public class msg_set_local_position_setpoint extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT = 50; - public static final int MAVLINK_MSG_LENGTH = 19; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - - - /** - * x position - */ - public float x; - /** - * y position - */ - public float y; - /** - * z position - */ - public float z; - /** - * Desired yaw angle - */ - public float yaw; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Coordinate frame - valid values are only MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_ENU - */ - public byte coordinate_frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - packet.payload.putFloat(x); - packet.payload.putFloat(y); - packet.payload.putFloat(z); - packet.payload.putFloat(yaw); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(coordinate_frame); - return packet; - } - - /** - * Decode a set_local_position_setpoint message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - x = payload.getFloat(); - y = payload.getFloat(); - z = payload.getFloat(); - yaw = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - coordinate_frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_local_position_setpoint(){ - msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_local_position_setpoint(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_LOCAL_POSITION_SETPOINT"); - //Log.d("MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_LOCAL_POSITION_SETPOINT -"+" x:"+x+" y:"+y+" z:"+z+" yaw:"+yaw+" target_system:"+target_system+" target_component:"+target_component+" coordinate_frame:"+coordinate_frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mag_offsets.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mag_offsets.java deleted file mode 100644 index a45e175d9e..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mag_offsets.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE SET_MAG_OFFSETS PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Deprecated. Use MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS instead. Set the magnetometer offsets -*/ -public class msg_set_mag_offsets extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_MAG_OFFSETS = 151; - public static final int MAVLINK_MSG_LENGTH = 8; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - - - /** - * magnetometer X offset - */ - public short mag_ofs_x; - /** - * magnetometer Y offset - */ - public short mag_ofs_y; - /** - * magnetometer Z offset - */ - public short mag_ofs_z; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - packet.payload.putShort(mag_ofs_x); - packet.payload.putShort(mag_ofs_y); - packet.payload.putShort(mag_ofs_z); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - return packet; - } - - /** - * Decode a set_mag_offsets message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - mag_ofs_x = payload.getShort(); - mag_ofs_y = payload.getShort(); - mag_ofs_z = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_mag_offsets(){ - msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_mag_offsets(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_MAG_OFFSETS"); - //Log.d("MAVLINK_MSG_ID_SET_MAG_OFFSETS", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_MAG_OFFSETS -"+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+" target_system:"+target_system+" target_component:"+target_component+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mode.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mode.java deleted file mode 100644 index bbfb32d1f9..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_mode.java +++ /dev/null @@ -1,88 +0,0 @@ -// MESSAGE SET_MODE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component. -*/ -public class msg_set_mode extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_MODE = 11; - public static final int MAVLINK_MSG_LENGTH = 6; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_MODE; - - - /** - * The new autopilot-specific mode. This field can be ignored by an autopilot. - */ - public int custom_mode; - /** - * The system setting the mode - */ - public byte target_system; - /** - * The new base mode - */ - public byte base_mode; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_MODE; - packet.payload.putInt(custom_mode); - packet.payload.putByte(target_system); - packet.payload.putByte(base_mode); - return packet; - } - - /** - * Decode a set_mode message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - custom_mode = payload.getInt(); - target_system = payload.getByte(); - base_mode = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_mode(){ - msgid = MAVLINK_MSG_ID_SET_MODE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_mode(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_MODE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_MODE"); - //Log.d("MAVLINK_MSG_ID_SET_MODE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_MODE -"+" custom_mode:"+custom_mode+" target_system:"+target_system+" base_mode:"+base_mode+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_global_int.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_global_int.java deleted file mode 100644 index 5eedd5fd67..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_global_int.java +++ /dev/null @@ -1,154 +0,0 @@ -// MESSAGE SET_POSITION_TARGET_GLOBAL_INT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set vehicle position, velocity and acceleration setpoint in the WGS84 coordinate system. -*/ -public class msg_set_position_target_global_int extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT = 86; - public static final int MAVLINK_MSG_LENGTH = 45; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; - - - /** - * Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency. - */ - public int time_boot_ms; - /** - * X Position in WGS84 frame in 1e7 * meters - */ - public int lat_int; - /** - * Y Position in WGS84 frame in 1e7 * meters - */ - public int lon_int; - /** - * Altitude in meters in WGS84 altitude, not AMSL if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT - */ - public float alt; - /** - * X velocity in NED frame in meter / s - */ - public float vx; - /** - * Y velocity in NED frame in meter / s - */ - public float vy; - /** - * Z velocity in NED frame in meter / s - */ - public float vz; - /** - * X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afx; - /** - * Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afy; - /** - * Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afz; - /** - * Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint - */ - public short type_mask; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11 - */ - public byte coordinate_frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; - packet.payload.putInt(time_boot_ms); - packet.payload.putInt(lat_int); - packet.payload.putInt(lon_int); - packet.payload.putFloat(alt); - packet.payload.putFloat(vx); - packet.payload.putFloat(vy); - packet.payload.putFloat(vz); - packet.payload.putFloat(afx); - packet.payload.putFloat(afy); - packet.payload.putFloat(afz); - packet.payload.putShort(type_mask); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(coordinate_frame); - return packet; - } - - /** - * Decode a set_position_target_global_int message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - lat_int = payload.getInt(); - lon_int = payload.getInt(); - alt = payload.getFloat(); - vx = payload.getFloat(); - vy = payload.getFloat(); - vz = payload.getFloat(); - afx = payload.getFloat(); - afy = payload.getFloat(); - afz = payload.getFloat(); - type_mask = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - coordinate_frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_position_target_global_int(){ - msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_position_target_global_int(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_POSITION_TARGET_GLOBAL_INT"); - //Log.d("MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT -"+" time_boot_ms:"+time_boot_ms+" lat_int:"+lat_int+" lon_int:"+lon_int+" alt:"+alt+" vx:"+vx+" vy:"+vy+" vz:"+vz+" afx:"+afx+" afy:"+afy+" afz:"+afz+" type_mask:"+type_mask+" target_system:"+target_system+" target_component:"+target_component+" coordinate_frame:"+coordinate_frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_local_ned.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_local_ned.java deleted file mode 100644 index 01b73fd20a..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_position_target_local_ned.java +++ /dev/null @@ -1,154 +0,0 @@ -// MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set vehicle position, velocity and acceleration setpoint in local frame. -*/ -public class msg_set_position_target_local_ned extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED = 84; - public static final int MAVLINK_MSG_LENGTH = 45; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; - - - /** - * Timestamp in milliseconds since system boot - */ - public int time_boot_ms; - /** - * X Position in NED frame in meters - */ - public float x; - /** - * Y Position in NED frame in meters - */ - public float y; - /** - * Z Position in NED frame in meters (note, altitude is negative in NED) - */ - public float z; - /** - * X velocity in NED frame in meter / s - */ - public float vx; - /** - * Y velocity in NED frame in meter / s - */ - public float vy; - /** - * Z velocity in NED frame in meter / s - */ - public float vz; - /** - * X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afx; - /** - * Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afy; - /** - * Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N - */ - public float afz; - /** - * Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint - */ - public short type_mask; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - /** - * Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9 - */ - public byte coordinate_frame; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; - packet.payload.putInt(time_boot_ms); - packet.payload.putFloat(x); - packet.payload.putFloat(y); - packet.payload.putFloat(z); - packet.payload.putFloat(vx); - packet.payload.putFloat(vy); - packet.payload.putFloat(vz); - packet.payload.putFloat(afx); - packet.payload.putFloat(afy); - packet.payload.putFloat(afz); - packet.payload.putShort(type_mask); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - packet.payload.putByte(coordinate_frame); - return packet; - } - - /** - * Decode a set_position_target_local_ned message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - time_boot_ms = payload.getInt(); - x = payload.getFloat(); - y = payload.getFloat(); - z = payload.getFloat(); - vx = payload.getFloat(); - vy = payload.getFloat(); - vz = payload.getFloat(); - afx = payload.getFloat(); - afy = payload.getFloat(); - afz = payload.getFloat(); - type_mask = payload.getShort(); - target_system = payload.getByte(); - target_component = payload.getByte(); - coordinate_frame = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_position_target_local_ned(){ - msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_position_target_local_ned(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_POSITION_TARGET_LOCAL_NED"); - //Log.d("MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED -"+" time_boot_ms:"+time_boot_ms+" x:"+x+" y:"+y+" z:"+z+" vx:"+vx+" vy:"+vy+" vz:"+vz+" afx:"+afx+" afy:"+afy+" afz:"+afz+" type_mask:"+type_mask+" target_system:"+target_system+" target_component:"+target_component+" coordinate_frame:"+coordinate_frame+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_motors_setpoint.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_motors_setpoint.java deleted file mode 100644 index c4fdea68a4..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_motors_setpoint.java +++ /dev/null @@ -1,100 +0,0 @@ -// MESSAGE SET_QUAD_MOTORS_SETPOINT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint in the four motor speeds -*/ -public class msg_set_quad_motors_setpoint extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT = 60; - public static final int MAVLINK_MSG_LENGTH = 9; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - - - /** - * Front motor in + configuration, front left motor in x configuration - */ - public short motor_front_nw; - /** - * Right motor in + configuration, front right motor in x configuration - */ - public short motor_right_ne; - /** - * Back motor in + configuration, back right motor in x configuration - */ - public short motor_back_se; - /** - * Left motor in + configuration, back left motor in x configuration - */ - public short motor_left_sw; - /** - * System ID of the system that should set these motor commands - */ - public byte target_system; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - packet.payload.putShort(motor_front_nw); - packet.payload.putShort(motor_right_ne); - packet.payload.putShort(motor_back_se); - packet.payload.putShort(motor_left_sw); - packet.payload.putByte(target_system); - return packet; - } - - /** - * Decode a set_quad_motors_setpoint message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - motor_front_nw = payload.getShort(); - motor_right_ne = payload.getShort(); - motor_back_se = payload.getShort(); - motor_left_sw = payload.getShort(); - target_system = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_quad_motors_setpoint(){ - msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_quad_motors_setpoint(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_QUAD_MOTORS_SETPOINT"); - //Log.d("MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_QUAD_MOTORS_SETPOINT -"+" motor_front_nw:"+motor_front_nw+" motor_right_ne:"+motor_right_ne+" motor_back_se:"+motor_back_se+" motor_left_sw:"+motor_left_sw+" target_system:"+target_system+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_led_roll_pitch_yaw_thrust.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_led_roll_pitch_yaw_thrust.java deleted file mode 100644 index 78b46f8415..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_led_roll_pitch_yaw_thrust.java +++ /dev/null @@ -1,152 +0,0 @@ -// MESSAGE SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint for up to four quadrotors in a group / wing -*/ -public class msg_set_quad_swarm_led_roll_pitch_yaw_thrust extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST = 63; - public static final int MAVLINK_MSG_LENGTH = 46; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - - - /** - * Desired roll angle in radians +-PI (+-INT16_MAX) - */ - public short roll[] = new short[4]; - /** - * Desired pitch angle in radians +-PI (+-INT16_MAX) - */ - public short pitch[] = new short[4]; - /** - * Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) - */ - public short yaw[] = new short[4]; - /** - * Collective thrust, scaled to uint16 (0..UINT16_MAX) - */ - public short thrust[] = new short[4]; - /** - * ID of the quadrotor group (0 - 255, up to 256 groups supported) - */ - public byte group; - /** - * ID of the flight mode (0 - 255, up to 256 modes supported) - */ - public byte mode; - /** - * RGB red channel (0-255) - */ - public byte led_red[] = new byte[4]; - /** - * RGB green channel (0-255) - */ - public byte led_blue[] = new byte[4]; - /** - * RGB blue channel (0-255) - */ - public byte led_green[] = new byte[4]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - for (int i = 0; i < roll.length; i++) { - packet.payload.putShort(roll[i]); - } - for (int i = 0; i < pitch.length; i++) { - packet.payload.putShort(pitch[i]); - } - for (int i = 0; i < yaw.length; i++) { - packet.payload.putShort(yaw[i]); - } - for (int i = 0; i < thrust.length; i++) { - packet.payload.putShort(thrust[i]); - } - packet.payload.putByte(group); - packet.payload.putByte(mode); - for (int i = 0; i < led_red.length; i++) { - packet.payload.putByte(led_red[i]); - } - for (int i = 0; i < led_blue.length; i++) { - packet.payload.putByte(led_blue[i]); - } - for (int i = 0; i < led_green.length; i++) { - packet.payload.putByte(led_green[i]); - } - return packet; - } - - /** - * Decode a set_quad_swarm_led_roll_pitch_yaw_thrust message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - for (int i = 0; i < roll.length; i++) { - roll[i] = payload.getShort(); - } - for (int i = 0; i < pitch.length; i++) { - pitch[i] = payload.getShort(); - } - for (int i = 0; i < yaw.length; i++) { - yaw[i] = payload.getShort(); - } - for (int i = 0; i < thrust.length; i++) { - thrust[i] = payload.getShort(); - } - group = payload.getByte(); - mode = payload.getByte(); - for (int i = 0; i < led_red.length; i++) { - led_red[i] = payload.getByte(); - } - for (int i = 0; i < led_blue.length; i++) { - led_blue[i] = payload.getByte(); - } - for (int i = 0; i < led_green.length; i++) { - led_green[i] = payload.getByte(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_quad_swarm_led_roll_pitch_yaw_thrust(){ - msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_quad_swarm_led_roll_pitch_yaw_thrust(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST"); - //Log.d("MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_QUAD_SWARM_LED_ROLL_PITCH_YAW_THRUST -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" thrust:"+thrust+" group:"+group+" mode:"+mode+" led_red:"+led_red+" led_blue:"+led_blue+" led_green:"+led_green+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_roll_pitch_yaw_thrust.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_roll_pitch_yaw_thrust.java deleted file mode 100644 index a359cd6e6e..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_quad_swarm_roll_pitch_yaw_thrust.java +++ /dev/null @@ -1,122 +0,0 @@ -// MESSAGE SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Setpoint for up to four quadrotors in a group / wing -*/ -public class msg_set_quad_swarm_roll_pitch_yaw_thrust extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST = 61; - public static final int MAVLINK_MSG_LENGTH = 34; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - - - /** - * Desired roll angle in radians +-PI (+-INT16_MAX) - */ - public short roll[] = new short[4]; - /** - * Desired pitch angle in radians +-PI (+-INT16_MAX) - */ - public short pitch[] = new short[4]; - /** - * Desired yaw angle in radians, scaled to int16 +-PI (+-INT16_MAX) - */ - public short yaw[] = new short[4]; - /** - * Collective thrust, scaled to uint16 (0..UINT16_MAX) - */ - public short thrust[] = new short[4]; - /** - * ID of the quadrotor group (0 - 255, up to 256 groups supported) - */ - public byte group; - /** - * ID of the flight mode (0 - 255, up to 256 modes supported) - */ - public byte mode; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - for (int i = 0; i < roll.length; i++) { - packet.payload.putShort(roll[i]); - } - for (int i = 0; i < pitch.length; i++) { - packet.payload.putShort(pitch[i]); - } - for (int i = 0; i < yaw.length; i++) { - packet.payload.putShort(yaw[i]); - } - for (int i = 0; i < thrust.length; i++) { - packet.payload.putShort(thrust[i]); - } - packet.payload.putByte(group); - packet.payload.putByte(mode); - return packet; - } - - /** - * Decode a set_quad_swarm_roll_pitch_yaw_thrust message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - for (int i = 0; i < roll.length; i++) { - roll[i] = payload.getShort(); - } - for (int i = 0; i < pitch.length; i++) { - pitch[i] = payload.getShort(); - } - for (int i = 0; i < yaw.length; i++) { - yaw[i] = payload.getShort(); - } - for (int i = 0; i < thrust.length; i++) { - thrust[i] = payload.getShort(); - } - group = payload.getByte(); - mode = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_quad_swarm_roll_pitch_yaw_thrust(){ - msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_quad_swarm_roll_pitch_yaw_thrust(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST"); - //Log.d("MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" thrust:"+thrust+" group:"+group+" mode:"+mode+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_speed_thrust.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_speed_thrust.java deleted file mode 100644 index 5bcf84b4ab..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_speed_thrust.java +++ /dev/null @@ -1,106 +0,0 @@ -// MESSAGE SET_ROLL_PITCH_YAW_SPEED_THRUST PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set roll, pitch and yaw. -*/ -public class msg_set_roll_pitch_yaw_speed_thrust extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST = 57; - public static final int MAVLINK_MSG_LENGTH = 18; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - - - /** - * Desired roll angular speed in rad/s - */ - public float roll_speed; - /** - * Desired pitch angular speed in rad/s - */ - public float pitch_speed; - /** - * Desired yaw angular speed in rad/s - */ - public float yaw_speed; - /** - * Collective thrust, normalized to 0 .. 1 - */ - public float thrust; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - packet.payload.putFloat(roll_speed); - packet.payload.putFloat(pitch_speed); - packet.payload.putFloat(yaw_speed); - packet.payload.putFloat(thrust); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - return packet; - } - - /** - * Decode a set_roll_pitch_yaw_speed_thrust message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - roll_speed = payload.getFloat(); - pitch_speed = payload.getFloat(); - yaw_speed = payload.getFloat(); - thrust = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_roll_pitch_yaw_speed_thrust(){ - msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_roll_pitch_yaw_speed_thrust(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_ROLL_PITCH_YAW_SPEED_THRUST"); - //Log.d("MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_SPEED_THRUST -"+" roll_speed:"+roll_speed+" pitch_speed:"+pitch_speed+" yaw_speed:"+yaw_speed+" thrust:"+thrust+" target_system:"+target_system+" target_component:"+target_component+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_thrust.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_thrust.java deleted file mode 100644 index ec5dfd0d83..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_set_roll_pitch_yaw_thrust.java +++ /dev/null @@ -1,106 +0,0 @@ -// MESSAGE SET_ROLL_PITCH_YAW_THRUST PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set roll, pitch and yaw. -*/ -public class msg_set_roll_pitch_yaw_thrust extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST = 56; - public static final int MAVLINK_MSG_LENGTH = 18; - private static final long serialVersionUID = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - - - /** - * Desired roll angle in radians - */ - public float roll; - /** - * Desired pitch angle in radians - */ - public float pitch; - /** - * Desired yaw angle in radians - */ - public float yaw; - /** - * Collective thrust, normalized to 0 .. 1 - */ - public float thrust; - /** - * System ID - */ - public byte target_system; - /** - * Component ID - */ - public byte target_component; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(thrust); - packet.payload.putByte(target_system); - packet.payload.putByte(target_component); - return packet; - } - - /** - * Decode a set_roll_pitch_yaw_thrust message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - thrust = payload.getFloat(); - target_system = payload.getByte(); - target_component = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_roll_pitch_yaw_thrust(){ - msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_set_roll_pitch_yaw_thrust(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SET_ROLL_PITCH_YAW_THRUST"); - //Log.d("MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SET_ROLL_PITCH_YAW_THRUST -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" thrust:"+thrust+" target_system:"+target_system+" target_component:"+target_component+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_6dof.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_6dof.java deleted file mode 100644 index 7f4034c06f..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_6dof.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE SETPOINT_6DOF PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the 6 DOF setpoint for a attitude and position controller. -*/ -public class msg_setpoint_6dof extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SETPOINT_6DOF = 149; - public static final int MAVLINK_MSG_LENGTH = 25; - private static final long serialVersionUID = MAVLINK_MSG_ID_SETPOINT_6DOF; - - - /** - * Translational Component in x - */ - public float trans_x; - /** - * Translational Component in y - */ - public float trans_y; - /** - * Translational Component in z - */ - public float trans_z; - /** - * Rotational Component in x - */ - public float rot_x; - /** - * Rotational Component in y - */ - public float rot_y; - /** - * Rotational Component in z - */ - public float rot_z; - /** - * System ID - */ - public byte target_system; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SETPOINT_6DOF; - packet.payload.putFloat(trans_x); - packet.payload.putFloat(trans_y); - packet.payload.putFloat(trans_z); - packet.payload.putFloat(rot_x); - packet.payload.putFloat(rot_y); - packet.payload.putFloat(rot_z); - packet.payload.putByte(target_system); - return packet; - } - - /** - * Decode a setpoint_6dof message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - trans_x = payload.getFloat(); - trans_y = payload.getFloat(); - trans_z = payload.getFloat(); - rot_x = payload.getFloat(); - rot_y = payload.getFloat(); - rot_z = payload.getFloat(); - target_system = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_setpoint_6dof(){ - msgid = MAVLINK_MSG_ID_SETPOINT_6DOF; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_setpoint_6dof(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SETPOINT_6DOF; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SETPOINT_6DOF"); - //Log.d("MAVLINK_MSG_ID_SETPOINT_6DOF", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SETPOINT_6DOF -"+" trans_x:"+trans_x+" trans_y:"+trans_y+" trans_z:"+trans_z+" rot_x:"+rot_x+" rot_y:"+rot_y+" rot_z:"+rot_z+" target_system:"+target_system+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_8dof.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_8dof.java deleted file mode 100644 index 75849eec50..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_setpoint_8dof.java +++ /dev/null @@ -1,124 +0,0 @@ -// MESSAGE SETPOINT_8DOF PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Set the 8 DOF setpoint for a controller. -*/ -public class msg_setpoint_8dof extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SETPOINT_8DOF = 148; - public static final int MAVLINK_MSG_LENGTH = 33; - private static final long serialVersionUID = MAVLINK_MSG_ID_SETPOINT_8DOF; - - - /** - * Value 1 - */ - public float val1; - /** - * Value 2 - */ - public float val2; - /** - * Value 3 - */ - public float val3; - /** - * Value 4 - */ - public float val4; - /** - * Value 5 - */ - public float val5; - /** - * Value 6 - */ - public float val6; - /** - * Value 7 - */ - public float val7; - /** - * Value 8 - */ - public float val8; - /** - * System ID - */ - public byte target_system; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SETPOINT_8DOF; - packet.payload.putFloat(val1); - packet.payload.putFloat(val2); - packet.payload.putFloat(val3); - packet.payload.putFloat(val4); - packet.payload.putFloat(val5); - packet.payload.putFloat(val6); - packet.payload.putFloat(val7); - packet.payload.putFloat(val8); - packet.payload.putByte(target_system); - return packet; - } - - /** - * Decode a setpoint_8dof message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - val1 = payload.getFloat(); - val2 = payload.getFloat(); - val3 = payload.getFloat(); - val4 = payload.getFloat(); - val5 = payload.getFloat(); - val6 = payload.getFloat(); - val7 = payload.getFloat(); - val8 = payload.getFloat(); - target_system = payload.getByte(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_setpoint_8dof(){ - msgid = MAVLINK_MSG_ID_SETPOINT_8DOF; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_setpoint_8dof(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SETPOINT_8DOF; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SETPOINT_8DOF"); - //Log.d("MAVLINK_MSG_ID_SETPOINT_8DOF", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SETPOINT_8DOF -"+" val1:"+val1+" val2:"+val2+" val3:"+val3+" val4:"+val4+" val5:"+val5+" val6:"+val6+" val7:"+val7+" val8:"+val8+" target_system:"+target_system+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sim_state.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sim_state.java deleted file mode 100644 index ad8cd28634..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_sim_state.java +++ /dev/null @@ -1,196 +0,0 @@ -// MESSAGE SIM_STATE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status of simulation environment, if used -*/ -public class msg_sim_state extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SIM_STATE = 108; - public static final int MAVLINK_MSG_LENGTH = 84; - private static final long serialVersionUID = MAVLINK_MSG_ID_SIM_STATE; - - - /** - * True attitude quaternion component 1, w (1 in null-rotation) - */ - public float q1; - /** - * True attitude quaternion component 2, x (0 in null-rotation) - */ - public float q2; - /** - * True attitude quaternion component 3, y (0 in null-rotation) - */ - public float q3; - /** - * True attitude quaternion component 4, z (0 in null-rotation) - */ - public float q4; - /** - * Attitude roll expressed as Euler angles, not recommended except for human-readable outputs - */ - public float roll; - /** - * Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs - */ - public float pitch; - /** - * Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs - */ - public float yaw; - /** - * X acceleration m/s/s - */ - public float xacc; - /** - * Y acceleration m/s/s - */ - public float yacc; - /** - * Z acceleration m/s/s - */ - public float zacc; - /** - * Angular speed around X axis rad/s - */ - public float xgyro; - /** - * Angular speed around Y axis rad/s - */ - public float ygyro; - /** - * Angular speed around Z axis rad/s - */ - public float zgyro; - /** - * Latitude in degrees - */ - public float lat; - /** - * Longitude in degrees - */ - public float lon; - /** - * Altitude in meters - */ - public float alt; - /** - * Horizontal position standard deviation - */ - public float std_dev_horz; - /** - * Vertical position standard deviation - */ - public float std_dev_vert; - /** - * True velocity in m/s in NORTH direction in earth-fixed NED frame - */ - public float vn; - /** - * True velocity in m/s in EAST direction in earth-fixed NED frame - */ - public float ve; - /** - * True velocity in m/s in DOWN direction in earth-fixed NED frame - */ - public float vd; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SIM_STATE; - packet.payload.putFloat(q1); - packet.payload.putFloat(q2); - packet.payload.putFloat(q3); - packet.payload.putFloat(q4); - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(xacc); - packet.payload.putFloat(yacc); - packet.payload.putFloat(zacc); - packet.payload.putFloat(xgyro); - packet.payload.putFloat(ygyro); - packet.payload.putFloat(zgyro); - packet.payload.putFloat(lat); - packet.payload.putFloat(lon); - packet.payload.putFloat(alt); - packet.payload.putFloat(std_dev_horz); - packet.payload.putFloat(std_dev_vert); - packet.payload.putFloat(vn); - packet.payload.putFloat(ve); - packet.payload.putFloat(vd); - return packet; - } - - /** - * Decode a sim_state message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - q1 = payload.getFloat(); - q2 = payload.getFloat(); - q3 = payload.getFloat(); - q4 = payload.getFloat(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - xacc = payload.getFloat(); - yacc = payload.getFloat(); - zacc = payload.getFloat(); - xgyro = payload.getFloat(); - ygyro = payload.getFloat(); - zgyro = payload.getFloat(); - lat = payload.getFloat(); - lon = payload.getFloat(); - alt = payload.getFloat(); - std_dev_horz = payload.getFloat(); - std_dev_vert = payload.getFloat(); - vn = payload.getFloat(); - ve = payload.getFloat(); - vd = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_sim_state(){ - msgid = MAVLINK_MSG_ID_SIM_STATE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_sim_state(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SIM_STATE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SIM_STATE"); - //Log.d("MAVLINK_MSG_ID_SIM_STATE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SIM_STATE -"+" q1:"+q1+" q2:"+q2+" q3:"+q3+" q4:"+q4+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" lat:"+lat+" lon:"+lon+" alt:"+alt+" std_dev_horz:"+std_dev_horz+" std_dev_vert:"+std_dev_vert+" vn:"+vn+" ve:"+ve+" vd:"+vd+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_simstate.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_simstate.java deleted file mode 100644 index f114e044a8..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_simstate.java +++ /dev/null @@ -1,136 +0,0 @@ -// MESSAGE SIMSTATE PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status of simulation environment, if used -*/ -public class msg_simstate extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_SIMSTATE = 164; - public static final int MAVLINK_MSG_LENGTH = 44; - private static final long serialVersionUID = MAVLINK_MSG_ID_SIMSTATE; - - - /** - * Roll angle (rad) - */ - public float roll; - /** - * Pitch angle (rad) - */ - public float pitch; - /** - * Yaw angle (rad) - */ - public float yaw; - /** - * X acceleration m/s/s - */ - public float xacc; - /** - * Y acceleration m/s/s - */ - public float yacc; - /** - * Z acceleration m/s/s - */ - public float zacc; - /** - * Angular speed around X axis rad/s - */ - public float xgyro; - /** - * Angular speed around Y axis rad/s - */ - public float ygyro; - /** - * Angular speed around Z axis rad/s - */ - public float zgyro; - /** - * Latitude in degrees * 1E7 - */ - public int lat; - /** - * Longitude in degrees * 1E7 - */ - public int lng; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_SIMSTATE; - packet.payload.putFloat(roll); - packet.payload.putFloat(pitch); - packet.payload.putFloat(yaw); - packet.payload.putFloat(xacc); - packet.payload.putFloat(yacc); - packet.payload.putFloat(zacc); - packet.payload.putFloat(xgyro); - packet.payload.putFloat(ygyro); - packet.payload.putFloat(zgyro); - packet.payload.putInt(lat); - packet.payload.putInt(lng); - return packet; - } - - /** - * Decode a simstate message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - roll = payload.getFloat(); - pitch = payload.getFloat(); - yaw = payload.getFloat(); - xacc = payload.getFloat(); - yacc = payload.getFloat(); - zacc = payload.getFloat(); - xgyro = payload.getFloat(); - ygyro = payload.getFloat(); - zgyro = payload.getFloat(); - lat = payload.getInt(); - lng = payload.getInt(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_simstate(){ - msgid = MAVLINK_MSG_ID_SIMSTATE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_simstate(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SIMSTATE; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "SIMSTATE"); - //Log.d("MAVLINK_MSG_ID_SIMSTATE", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_SIMSTATE -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" lat:"+lat+" lng:"+lng+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_state_correction.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_state_correction.java deleted file mode 100644 index 296ccc338e..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_state_correction.java +++ /dev/null @@ -1,124 +0,0 @@ -// MESSAGE STATE_CORRECTION PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle. -*/ -public class msg_state_correction extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_STATE_CORRECTION = 64; - public static final int MAVLINK_MSG_LENGTH = 36; - private static final long serialVersionUID = MAVLINK_MSG_ID_STATE_CORRECTION; - - - /** - * x position error - */ - public float xErr; - /** - * y position error - */ - public float yErr; - /** - * z position error - */ - public float zErr; - /** - * roll error (radians) - */ - public float rollErr; - /** - * pitch error (radians) - */ - public float pitchErr; - /** - * yaw error (radians) - */ - public float yawErr; - /** - * x velocity - */ - public float vxErr; - /** - * y velocity - */ - public float vyErr; - /** - * z velocity - */ - public float vzErr; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - packet.payload.putFloat(xErr); - packet.payload.putFloat(yErr); - packet.payload.putFloat(zErr); - packet.payload.putFloat(rollErr); - packet.payload.putFloat(pitchErr); - packet.payload.putFloat(yawErr); - packet.payload.putFloat(vxErr); - packet.payload.putFloat(vyErr); - packet.payload.putFloat(vzErr); - return packet; - } - - /** - * Decode a state_correction message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - xErr = payload.getFloat(); - yErr = payload.getFloat(); - zErr = payload.getFloat(); - rollErr = payload.getFloat(); - pitchErr = payload.getFloat(); - yawErr = payload.getFloat(); - vxErr = payload.getFloat(); - vyErr = payload.getFloat(); - vzErr = payload.getFloat(); - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_state_correction(){ - msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_state_correction(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_STATE_CORRECTION; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "STATE_CORRECTION"); - //Log.d("MAVLINK_MSG_ID_STATE_CORRECTION", toString()); - } - - - /** - * Returns a string with the MSG name and data - */ - public String toString(){ - return "MAVLINK_MSG_ID_STATE_CORRECTION -"+" xErr:"+xErr+" yErr:"+yErr+" zErr:"+zErr+" rollErr:"+rollErr+" pitchErr:"+pitchErr+" yawErr:"+yawErr+" vxErr:"+vxErr+" vyErr:"+vyErr+" vzErr:"+vzErr+""; - } -} diff --git a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_statustext.java b/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_statustext.java deleted file mode 100644 index 9922384cd3..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/ardupilotmega/msg_statustext.java +++ /dev/null @@ -1,112 +0,0 @@ -// MESSAGE STATUSTEXT PACKING -package com.MAVLink.Messages.ardupilotmega; - -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkPayload; -//import android.util.Log; - -/** -* Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz). -*/ -public class msg_statustext extends MAVLinkMessage{ - - public static final int MAVLINK_MSG_ID_STATUSTEXT = 253; - public static final int MAVLINK_MSG_LENGTH = 51; - private static final long serialVersionUID = MAVLINK_MSG_ID_STATUSTEXT; - - - /** - * Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. - */ - public byte severity; - /** - * Status text message, without null termination character - */ - public byte text[] = new byte[50]; - - /** - * Generates the payload for a mavlink message for a message of this type - * @return - */ - public MAVLinkPacket pack(){ - MAVLinkPacket packet = new MAVLinkPacket(); - packet.len = MAVLINK_MSG_LENGTH; - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_STATUSTEXT; - packet.payload.putByte(severity); - for (int i = 0; i < text.length; i++) { - packet.payload.putByte(text[i]); - } - return packet; - } - - /** - * Decode a statustext message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - severity = payload.getByte(); - for (int i = 0; i < text.length; i++) { - text[i] = payload.getByte(); - } - } - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_statustext(){ - msgid = MAVLINK_MSG_ID_STATUSTEXT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - * - */ - public msg_statustext(MAVLinkPacket mavLinkPacket){ - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_STATUSTEXT; - unpack(mavLinkPacket.payload); - //Log.d("MAVLink", "STATUSTEXT"); - //Log.d("MAVLINK_MSG_ID_STATUSTEXT", toString()); - } - - /** - * Sets the buffer of this message with a string, adds the necessary padding - */ - public void setText(String str) { - int len = Math.min(str.length(), 50); - for (int i=0; i 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_UNLIM = 17; /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_TURNS = 18; /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_TIME = 19; /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_RETURN_TO_LAUNCH = 20; /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_LAND = 21; /* Land at location |Empty| Empty| Empty| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_TAKEOFF = 22; /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_ROI = 80; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - public static final int MAV_CMD_NAV_PATHPLANNING = 81; /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - public static final int MAV_CMD_NAV_SPLINE_WAYPOINT = 82; /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - public static final int MAV_CMD_NAV_GUIDED_ENABLE = 92; /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_LAST = 95; /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_DELAY = 112; /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_CHANGE_ALT = 113; /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ - public static final int MAV_CMD_CONDITION_DISTANCE = 114; /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_YAW = 115; /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_LAST = 159; /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_MODE = 176; /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_JUMP = 177; /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CHANGE_SPEED = 178; /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_HOME = 179; /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_DO_SET_PARAMETER = 180; /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_RELAY = 181; /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_REPEAT_RELAY = 182; /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_SERVO = 183; /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_REPEAT_SERVO = 184; /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_FLIGHTTERMINATION = 185; /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_RALLY_LAND = 190; /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GO_AROUND = 191; /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CONTROL_VIDEO = 200; /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_ROI = 201; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - public static final int MAV_CMD_DO_DIGICAM_CONFIGURE = 202; /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ - public static final int MAV_CMD_DO_DIGICAM_CONTROL = 203; /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ - public static final int MAV_CMD_DO_MOUNT_CONFIGURE = 204; /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_MOUNT_CONTROL = 205; /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */ - public static final int MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206; /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_FENCE_ENABLE = 207; /* Mission command to enable the geofence |enable? (0=disable, 1=enable)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_PARACHUTE = 208; /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_MOTOR_TEST = 209; /* Mission command to perform motor test |motor sequence number (a number from 1 to max number of motors on the vehicle)| throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum)| throttle| timeout (in seconds)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_INVERTED_FLIGHT = 210; /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220; /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GUIDED_MASTER = 221; /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GUIDED_LIMITS = 222; /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, WGS84) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, WGS84) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_LAST = 240; /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_PREFLIGHT_CALIBRATION = 241; /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */ - public static final int MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242; /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ - public static final int MAV_CMD_PREFLIGHT_STORAGE = 245; /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */ - public static final int MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246; /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */ - public static final int MAV_CMD_OVERRIDE_GOTO = 252; /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ - public static final int MAV_CMD_MISSION_START = 300; /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ - public static final int MAV_CMD_COMPONENT_ARM_DISARM = 400; /* Arms / Disarms a component |1 to arm, 0 to disarm| */ - public static final int MAV_CMD_START_RX_PAIR = 500; /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ - public static final int MAV_CMD_IMAGE_START_CAPTURE = 2000; /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ - public static final int MAV_CMD_IMAGE_STOP_CAPTURE = 2001; /* Stop image capture sequence |Reserved| Reserved| */ - public static final int MAV_CMD_VIDEO_START_CAPTURE = 2500; /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ - public static final int MAV_CMD_VIDEO_STOP_CAPTURE = 2501; /* Stop the current video capture |Reserved| Reserved| */ - public static final int MAV_CMD_PANORAMA_CREATE = 2800; /* Create a panorama at the current position |Viewing angle horizontal of the panorama| Viewing angle vertical of panorama| */ - public static final int MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001; /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters WGS84| */ - public static final int MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002; /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - public static final int MAV_CMD_ENUM_END = 30003; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_CMD_ACK.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_CMD_ACK.java deleted file mode 100644 index c17e66b691..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_CMD_ACK.java +++ /dev/null @@ -1,16 +0,0 @@ -/** ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_CMD_ACK { - public static final int MAV_CMD_ACK_OK = 1; /* Command / mission item is ok. | */ - public static final int MAV_CMD_ACK_ERR_FAIL = 2; /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ - public static final int MAV_CMD_ACK_ERR_ACCESS_DENIED = 3; /* The system is refusing to accept this command from this source / communication partner. | */ - public static final int MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4; /* Command or mission item is not supported, other commands would be accepted. | */ - public static final int MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5; /* The coordinate frame of this command / mission item is not supported. | */ - public static final int MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6; /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ - public static final int MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7; /* The X or latitude value is out of range. | */ - public static final int MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8; /* The Y or longitude value is out of range. | */ - public static final int MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9; /* The Z or altitude value is out of range. | */ - public static final int MAV_CMD_ACK_ENUM_END = 10; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_COMPONENT.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_COMPONENT.java deleted file mode 100644 index 2ece0bbbc9..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_COMPONENT.java +++ /dev/null @@ -1,33 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class MAV_COMPONENT { - public static final int MAV_COMP_ID_ALL = 0; /* | */ - public static final int MAV_COMP_ID_CAMERA = 100; /* | */ - public static final int MAV_COMP_ID_SERVO1 = 140; /* | */ - public static final int MAV_COMP_ID_SERVO2 = 141; /* | */ - public static final int MAV_COMP_ID_SERVO3 = 142; /* | */ - public static final int MAV_COMP_ID_SERVO4 = 143; /* | */ - public static final int MAV_COMP_ID_SERVO5 = 144; /* | */ - public static final int MAV_COMP_ID_SERVO6 = 145; /* | */ - public static final int MAV_COMP_ID_SERVO7 = 146; /* | */ - public static final int MAV_COMP_ID_SERVO8 = 147; /* | */ - public static final int MAV_COMP_ID_SERVO9 = 148; /* | */ - public static final int MAV_COMP_ID_SERVO10 = 149; /* | */ - public static final int MAV_COMP_ID_SERVO11 = 150; /* | */ - public static final int MAV_COMP_ID_SERVO12 = 151; /* | */ - public static final int MAV_COMP_ID_SERVO13 = 152; /* | */ - public static final int MAV_COMP_ID_SERVO14 = 153; /* | */ - public static final int MAV_COMP_ID_MAPPER = 180; /* | */ - public static final int MAV_COMP_ID_MISSIONPLANNER = 190; /* | */ - public static final int MAV_COMP_ID_PATHPLANNER = 195; /* | */ - public static final int MAV_COMP_ID_IMU = 200; /* | */ - public static final int MAV_COMP_ID_IMU_2 = 201; /* | */ - public static final int MAV_COMP_ID_IMU_3 = 202; /* | */ - public static final int MAV_COMP_ID_GPS = 220; /* | */ - public static final int MAV_COMP_ID_UDP_BRIDGE = 240; /* | */ - public static final int MAV_COMP_ID_UART_BRIDGE = 241; /* | */ - public static final int MAV_COMP_ID_SYSTEM_CONTROL = 250; /* | */ - public static final int MAV_COMPONENT_ENUM_END = 251; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_DATA_STREAM.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_DATA_STREAM.java deleted file mode 100644 index ca77c2c626..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_DATA_STREAM.java +++ /dev/null @@ -1,18 +0,0 @@ -/** Data stream IDs. A data stream is not a fixed set of messages, but rather a - recommendation to the autopilot software. Individual autopilots may or may not obey - the recommended messages. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_DATA_STREAM { - public static final int MAV_DATA_STREAM_ALL = 0; /* Enable all data streams | */ - public static final int MAV_DATA_STREAM_RAW_SENSORS = 1; /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ - public static final int MAV_DATA_STREAM_EXTENDED_STATUS = 2; /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ - public static final int MAV_DATA_STREAM_RC_CHANNELS = 3; /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ - public static final int MAV_DATA_STREAM_RAW_CONTROLLER = 4; /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ - public static final int MAV_DATA_STREAM_POSITION = 6; /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ - public static final int MAV_DATA_STREAM_EXTRA1 = 10; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_EXTRA2 = 11; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_EXTRA3 = 12; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_ENUM_END = 13; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_DISTANCE_SENSOR.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_DISTANCE_SENSOR.java deleted file mode 100644 index 6bbc6bd9d1..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_DISTANCE_SENSOR.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Enumeration of distance sensor types -*/ -package com.MAVLink.Messages.enums; - -public class MAV_DISTANCE_SENSOR { - public static final int MAV_DISTANCE_SENSOR_LASER = 0; /* Laser altimeter, e.g. LightWare SF02/F or PulsedLight units | */ - public static final int MAV_DISTANCE_SENSOR_ULTRASOUND = 1; /* Ultrasound altimeter, e.g. MaxBotix units | */ - public static final int MAV_DISTANCE_SENSOR_ENUM_END = 2; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_ESTIMATOR_TYPE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_ESTIMATOR_TYPE.java deleted file mode 100644 index 5343c41194..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_ESTIMATOR_TYPE.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Enumeration of estimator types -*/ -package com.MAVLink.Messages.enums; - -public class MAV_ESTIMATOR_TYPE { - public static final int MAV_ESTIMATOR_TYPE_NAIVE = 1; /* This is a naive estimator without any real covariance feedback. | */ - public static final int MAV_ESTIMATOR_TYPE_VISION = 2; /* Computer vision based estimate. Might be up to scale. | */ - public static final int MAV_ESTIMATOR_TYPE_VIO = 3; /* Visual-inertial estimate. | */ - public static final int MAV_ESTIMATOR_TYPE_GPS = 4; /* Plain GPS estimate. | */ - public static final int MAV_ESTIMATOR_TYPE_GPS_INS = 5; /* Estimator integrating GPS and inertial sensing. | */ - public static final int MAV_ESTIMATOR_TYPE_ENUM_END = 6; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_FRAME.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_FRAME.java deleted file mode 100644 index e5b9828c36..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_FRAME.java +++ /dev/null @@ -1,16 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class MAV_FRAME { - public static final int MAV_FRAME_GLOBAL = 0; /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ - public static final int MAV_FRAME_LOCAL_NED = 1; /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ - public static final int MAV_FRAME_MISSION = 2; /* NOT a coordinate frame, indicates a mission command. | */ - public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT = 3; /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - public static final int MAV_FRAME_LOCAL_ENU = 4; /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ - public static final int MAV_FRAME_LOCAL_OFFSET_NED = 7; /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ - public static final int MAV_FRAME_BODY_NED = 8; /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ - public static final int MAV_FRAME_BODY_OFFSET_NED = 9; /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ - public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT = 10; /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - public static final int MAV_FRAME_ENUM_END = 11; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_GOTO.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_GOTO.java deleted file mode 100644 index 58d067bb39..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_GOTO.java +++ /dev/null @@ -1,11 +0,0 @@ -/** Override command, pauses current mission execution and moves immediately to a position -*/ -package com.MAVLink.Messages.enums; - -public class MAV_GOTO { - public static final int MAV_GOTO_DO_HOLD = 0; /* Hold at the current position. | */ - public static final int MAV_GOTO_DO_CONTINUE = 1; /* Continue with the next item in mission execution. | */ - public static final int MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2; /* Hold at the current position of the system | */ - public static final int MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3; /* Hold at the position specified in the parameters of the DO_HOLD action | */ - public static final int MAV_GOTO_ENUM_END = 4; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MISSION_RESULT.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_MISSION_RESULT.java deleted file mode 100644 index f04ea8fa7d..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MISSION_RESULT.java +++ /dev/null @@ -1,22 +0,0 @@ -/** result in a mavlink mission ack -*/ -package com.MAVLink.Messages.enums; - -public class MAV_MISSION_RESULT { - public static final int MAV_MISSION_ACCEPTED = 0; /* mission accepted OK | */ - public static final int MAV_MISSION_ERROR = 1; /* generic error / not accepting mission commands at all right now | */ - public static final int MAV_MISSION_UNSUPPORTED_FRAME = 2; /* coordinate frame is not supported | */ - public static final int MAV_MISSION_UNSUPPORTED = 3; /* command is not supported | */ - public static final int MAV_MISSION_NO_SPACE = 4; /* mission item exceeds storage space | */ - public static final int MAV_MISSION_INVALID = 5; /* one of the parameters has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM1 = 6; /* param1 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM2 = 7; /* param2 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM3 = 8; /* param3 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM4 = 9; /* param4 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM5_X = 10; /* x/param5 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM6_Y = 11; /* y/param6 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM7 = 12; /* param7 has an invalid value | */ - public static final int MAV_MISSION_INVALID_SEQUENCE = 13; /* received waypoint out of sequence | */ - public static final int MAV_MISSION_DENIED = 14; /* not accepting any mission commands from this communication partner | */ - public static final int MAV_MISSION_RESULT_ENUM_END = 15; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE.java deleted file mode 100644 index d1ad8002e1..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE.java +++ /dev/null @@ -1,19 +0,0 @@ -/** These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it - simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_MODE { - public static final int MAV_MODE_PREFLIGHT = 0; /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ - public static final int MAV_MODE_MANUAL_DISARMED = 64; /* System is allowed to be active, under manual (RC) control, no stabilization | */ - public static final int MAV_MODE_TEST_DISARMED = 66; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - public static final int MAV_MODE_STABILIZE_DISARMED = 80; /* System is allowed to be active, under assisted RC control. | */ - public static final int MAV_MODE_GUIDED_DISARMED = 88; /* System is allowed to be active, under autonomous control, manual setpoint | */ - public static final int MAV_MODE_AUTO_DISARMED = 92; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - public static final int MAV_MODE_MANUAL_ARMED = 192; /* System is allowed to be active, under manual (RC) control, no stabilization | */ - public static final int MAV_MODE_TEST_ARMED = 194; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - public static final int MAV_MODE_STABILIZE_ARMED = 208; /* System is allowed to be active, under assisted RC control. | */ - public static final int MAV_MODE_GUIDED_ARMED = 216; /* System is allowed to be active, under autonomous control, manual setpoint | */ - public static final int MAV_MODE_AUTO_ARMED = 220; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - public static final int MAV_MODE_ENUM_END = 221; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG.java deleted file mode 100644 index 8b37620522..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG.java +++ /dev/null @@ -1,15 +0,0 @@ -/** These flags encode the MAV mode. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_MODE_FLAG { - public static final int MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1; /* 0b00000001 Reserved for future use. | */ - public static final int MAV_MODE_FLAG_TEST_ENABLED = 2; /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ - public static final int MAV_MODE_FLAG_AUTO_ENABLED = 4; /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ - public static final int MAV_MODE_FLAG_GUIDED_ENABLED = 8; /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ - public static final int MAV_MODE_FLAG_STABILIZE_ENABLED = 16; /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ - public static final int MAV_MODE_FLAG_HIL_ENABLED = 32; /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ - public static final int MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64; /* 0b01000000 remote control input is enabled. | */ - public static final int MAV_MODE_FLAG_SAFETY_ARMED = 128; /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */ - public static final int MAV_MODE_FLAG_ENUM_END = 129; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG_DECODE_POSITION.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG_DECODE_POSITION.java deleted file mode 100644 index 07ccaca2bb..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MODE_FLAG_DECODE_POSITION.java +++ /dev/null @@ -1,15 +0,0 @@ -/** These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_MODE_FLAG_DECODE_POSITION { - public static final int MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1; /* Eighth bit: 00000001 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_TEST = 2; /* Seventh bit: 00000010 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4; /* Sixt bit: 00000100 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8; /* Fifth bit: 00001000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16; /* Fourth bit: 00010000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_HIL = 32; /* Third bit: 00100000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64; /* Second bit: 01000000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128; /* First bit: 10000000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MOUNT_MODE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_MOUNT_MODE.java deleted file mode 100644 index 2ec2a07eb4..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_MOUNT_MODE.java +++ /dev/null @@ -1,12 +0,0 @@ -/** Enumeration of possible mount operation modes -*/ -package com.MAVLink.Messages.enums; - -public class MAV_MOUNT_MODE { - public static final int MAV_MOUNT_MODE_RETRACT = 0; /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ - public static final int MAV_MOUNT_MODE_NEUTRAL = 1; /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ - public static final int MAV_MOUNT_MODE_MAVLINK_TARGETING = 2; /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ - public static final int MAV_MOUNT_MODE_RC_TARGETING = 3; /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ - public static final int MAV_MOUNT_MODE_GPS_POINT = 4; /* Load neutral position and start to point to Lat,Lon,Alt | */ - public static final int MAV_MOUNT_MODE_ENUM_END = 5; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_PARAM_TYPE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_PARAM_TYPE.java deleted file mode 100644 index 4571ed7e4c..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_PARAM_TYPE.java +++ /dev/null @@ -1,17 +0,0 @@ -/** Specifies the datatype of a MAVLink parameter. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_PARAM_TYPE { - public static final int MAV_PARAM_TYPE_UINT8 = 1; /* 8-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT8 = 2; /* 8-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT16 = 3; /* 16-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT16 = 4; /* 16-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT32 = 5; /* 32-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT32 = 6; /* 32-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT64 = 7; /* 64-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT64 = 8; /* 64-bit signed integer | */ - public static final int MAV_PARAM_TYPE_REAL32 = 9; /* 32-bit floating-point | */ - public static final int MAV_PARAM_TYPE_REAL64 = 10; /* 64-bit floating-point | */ - public static final int MAV_PARAM_TYPE_ENUM_END = 11; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_POWER_STATUS.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_POWER_STATUS.java deleted file mode 100644 index 5a0e48ce39..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_POWER_STATUS.java +++ /dev/null @@ -1,13 +0,0 @@ -/** Power supply status flags (bitmask) -*/ -package com.MAVLink.Messages.enums; - -public class MAV_POWER_STATUS { - public static final int MAV_POWER_STATUS_BRICK_VALID = 1; /* main brick power supply valid | */ - public static final int MAV_POWER_STATUS_SERVO_VALID = 2; /* main servo power supply valid for FMU | */ - public static final int MAV_POWER_STATUS_USB_CONNECTED = 4; /* USB power is connected | */ - public static final int MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8; /* peripheral supply is in over-current state | */ - public static final int MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16; /* hi-power peripheral supply is in over-current state | */ - public static final int MAV_POWER_STATUS_CHANGED = 32; /* Power status has changed since boot | */ - public static final int MAV_POWER_STATUS_ENUM_END = 33; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_PROTOCOL_CAPABILITY.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_PROTOCOL_CAPABILITY.java deleted file mode 100644 index 5d9412cbd1..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_PROTOCOL_CAPABILITY.java +++ /dev/null @@ -1,17 +0,0 @@ -/** Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_PROTOCOL_CAPABILITY { - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1; /* Autopilot supports MISSION float message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2; /* Autopilot supports the new param float message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4; /* Autopilot supports MISSION_INT scaled integer message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8; /* Autopilot supports COMMAND_INT scaled integer message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16; /* Autopilot supports the new param union message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_FTP = 32; /* Autopilot supports the new param union message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64; /* Autopilot supports commanding attitude offboard. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128; /* Autopilot supports commanding position and velocity targets in local NED frame. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256; /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ - public static final int MAV_PROTOCOL_CAPABILITY_TERRAIN = 512; /* Autopilot supports terrain protocol / data handling. | */ - public static final int MAV_PROTOCOL_CAPABILITY_ENUM_END = 513; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_RESULT.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_RESULT.java deleted file mode 100644 index f8686e187b..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_RESULT.java +++ /dev/null @@ -1,12 +0,0 @@ -/** result from a mavlink command -*/ -package com.MAVLink.Messages.enums; - -public class MAV_RESULT { - public static final int MAV_RESULT_ACCEPTED = 0; /* Command ACCEPTED and EXECUTED | */ - public static final int MAV_RESULT_TEMPORARILY_REJECTED = 1; /* Command TEMPORARY REJECTED/DENIED | */ - public static final int MAV_RESULT_DENIED = 2; /* Command PERMANENTLY DENIED | */ - public static final int MAV_RESULT_UNSUPPORTED = 3; /* Command UNKNOWN/UNSUPPORTED | */ - public static final int MAV_RESULT_FAILED = 4; /* Command executed, but failed | */ - public static final int MAV_RESULT_ENUM_END = 5; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_ROI.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_ROI.java deleted file mode 100644 index 51be285a5b..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_ROI.java +++ /dev/null @@ -1,14 +0,0 @@ -/** The ROI (region of interest) for the vehicle. This can be - be used by the vehicle for camera/vehicle attitude alignment (see - MAV_CMD_NAV_ROI). -*/ -package com.MAVLink.Messages.enums; - -public class MAV_ROI { - public static final int MAV_ROI_NONE = 0; /* No region of interest. | */ - public static final int MAV_ROI_WPNEXT = 1; /* Point toward next MISSION. | */ - public static final int MAV_ROI_WPINDEX = 2; /* Point toward given MISSION. | */ - public static final int MAV_ROI_LOCATION = 3; /* Point toward fixed location. | */ - public static final int MAV_ROI_TARGET = 4; /* Point toward of given id. | */ - public static final int MAV_ROI_ENUM_END = 5; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_SEVERITY.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_SEVERITY.java deleted file mode 100644 index 0b8a31717d..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_SEVERITY.java +++ /dev/null @@ -1,15 +0,0 @@ -/** Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_SEVERITY { - public static final int MAV_SEVERITY_EMERGENCY = 0; /* System is unusable. This is a "panic" condition. | */ - public static final int MAV_SEVERITY_ALERT = 1; /* Action should be taken immediately. Indicates error in non-critical systems. | */ - public static final int MAV_SEVERITY_CRITICAL = 2; /* Action must be taken immediately. Indicates failure in a primary system. | */ - public static final int MAV_SEVERITY_ERROR = 3; /* Indicates an error in secondary/redundant systems. | */ - public static final int MAV_SEVERITY_WARNING = 4; /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ - public static final int MAV_SEVERITY_NOTICE = 5; /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ - public static final int MAV_SEVERITY_INFO = 6; /* Normal operational messages. Useful for logging. No action is required for these messages. | */ - public static final int MAV_SEVERITY_DEBUG = 7; /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ - public static final int MAV_SEVERITY_ENUM_END = 8; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_STATE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_STATE.java deleted file mode 100644 index 8cac6a6e49..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_STATE.java +++ /dev/null @@ -1,15 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class MAV_STATE { - public static final int MAV_STATE_UNINIT = 0; /* Uninitialized system, state is unknown. | */ - public static final int MAV_STATE_BOOT = 1; /* System is booting up. | */ - public static final int MAV_STATE_CALIBRATING = 2; /* System is calibrating and not flight-ready. | */ - public static final int MAV_STATE_STANDBY = 3; /* System is grounded and on standby. It can be launched any time. | */ - public static final int MAV_STATE_ACTIVE = 4; /* System is active and might be already airborne. Motors are engaged. | */ - public static final int MAV_STATE_CRITICAL = 5; /* System is in a non-normal flight mode. It can however still navigate. | */ - public static final int MAV_STATE_EMERGENCY = 6; /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ - public static final int MAV_STATE_POWEROFF = 7; /* System just initialized its power-down sequence, will shut down now. | */ - public static final int MAV_STATE_ENUM_END = 8; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_SYS_STATUS_SENSOR.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_SYS_STATUS_SENSOR.java deleted file mode 100644 index 1cdb7e374f..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_SYS_STATUS_SENSOR.java +++ /dev/null @@ -1,30 +0,0 @@ -/** These encode the sensors whose status is sent as part of the SYS_STATUS message. -*/ -package com.MAVLink.Messages.enums; - -public class MAV_SYS_STATUS_SENSOR { - public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO = 1; /* 0x01 3D gyro | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2; /* 0x02 3D accelerometer | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_MAG = 4; /* 0x04 3D magnetometer | */ - public static final int MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8; /* 0x08 absolute pressure | */ - public static final int MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16; /* 0x10 differential pressure | */ - public static final int MAV_SYS_STATUS_SENSOR_GPS = 32; /* 0x20 GPS | */ - public static final int MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64; /* 0x40 optical flow | */ - public static final int MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128; /* 0x80 computer vision position | */ - public static final int MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256; /* 0x100 laser based position | */ - public static final int MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512; /* 0x200 external ground truth (Vicon or Leica) | */ - public static final int MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024; /* 0x400 3D angular rate control | */ - public static final int MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048; /* 0x800 attitude stabilization | */ - public static final int MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096; /* 0x1000 yaw position | */ - public static final int MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192; /* 0x2000 z/altitude control | */ - public static final int MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384; /* 0x4000 x/y position control | */ - public static final int MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768; /* 0x8000 motor outputs / control | */ - public static final int MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536; /* 0x10000 rc receiver | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072; /* 0x20000 2nd 3D gyro | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144; /* 0x40000 2nd 3D accelerometer | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288; /* 0x80000 2nd 3D magnetometer | */ - public static final int MAV_SYS_STATUS_GEOFENCE = 1048576; /* 0x100000 geofence | */ - public static final int MAV_SYS_STATUS_AHRS = 2097152; /* 0x200000 AHRS subsystem health | */ - public static final int MAV_SYS_STATUS_TERRAIN = 4194304; /* 0x400000 Terrain subsystem health | */ - public static final int MAV_SYS_STATUS_SENSOR_ENUM_END = 4194305; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MAV_TYPE.java b/Mavlink/src/com/MAVLink/Messages/enums/MAV_TYPE.java deleted file mode 100644 index f5b9139bfe..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MAV_TYPE.java +++ /dev/null @@ -1,26 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class MAV_TYPE { - public static final int MAV_TYPE_GENERIC = 0; /* Generic micro air vehicle. | */ - public static final int MAV_TYPE_FIXED_WING = 1; /* Fixed wing aircraft. | */ - public static final int MAV_TYPE_QUADROTOR = 2; /* Quadrotor | */ - public static final int MAV_TYPE_COAXIAL = 3; /* Coaxial helicopter | */ - public static final int MAV_TYPE_HELICOPTER = 4; /* Normal helicopter with tail rotor. | */ - public static final int MAV_TYPE_ANTENNA_TRACKER = 5; /* Ground installation | */ - public static final int MAV_TYPE_GCS = 6; /* Operator control unit / ground control station | */ - public static final int MAV_TYPE_AIRSHIP = 7; /* Airship, controlled | */ - public static final int MAV_TYPE_FREE_BALLOON = 8; /* Free balloon, uncontrolled | */ - public static final int MAV_TYPE_ROCKET = 9; /* Rocket | */ - public static final int MAV_TYPE_GROUND_ROVER = 10; /* Ground rover | */ - public static final int MAV_TYPE_SURFACE_BOAT = 11; /* Surface vessel, boat, ship | */ - public static final int MAV_TYPE_SUBMARINE = 12; /* Submarine | */ - public static final int MAV_TYPE_HEXAROTOR = 13; /* Hexarotor | */ - public static final int MAV_TYPE_OCTOROTOR = 14; /* Octorotor | */ - public static final int MAV_TYPE_TRICOPTER = 15; /* Octorotor | */ - public static final int MAV_TYPE_FLAPPING_WING = 16; /* Flapping wing | */ - public static final int MAV_TYPE_KITE = 17; /* Flapping wing | */ - public static final int MAV_TYPE_ONBOARD_CONTROLLER = 18; /* Onboard companion controller | */ - public static final int MAV_TYPE_ENUM_END = 19; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/MOTOR_TEST_THROTTLE_TYPE.java b/Mavlink/src/com/MAVLink/Messages/enums/MOTOR_TEST_THROTTLE_TYPE.java deleted file mode 100644 index 6bbffddd86..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/MOTOR_TEST_THROTTLE_TYPE.java +++ /dev/null @@ -1,10 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class MOTOR_TEST_THROTTLE_TYPE { - public static final int MOTOR_TEST_THROTTLE_PERCENT = 0; /* throttle as a percentage from 0 ~ 100 | */ - public static final int MOTOR_TEST_THROTTLE_PWM = 1; /* throttle as an absolute PWM value (normally in range of 1000~2000) | */ - public static final int MOTOR_TEST_THROTTLE_PILOT = 2; /* throttle pass-through from pilot's transmitter | */ - public static final int MOTOR_TEST_THROTTLE_TYPE_ENUM_END = 3; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/PARACHUTE_ACTION.java b/Mavlink/src/com/MAVLink/Messages/enums/PARACHUTE_ACTION.java deleted file mode 100644 index 820464d761..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/PARACHUTE_ACTION.java +++ /dev/null @@ -1,10 +0,0 @@ -/** -*/ -package com.MAVLink.Messages.enums; - -public class PARACHUTE_ACTION { - public static final int PARACHUTE_DISABLE = 0; /* Disable parachute release | */ - public static final int PARACHUTE_ENABLE = 1; /* Enable parachute release | */ - public static final int PARACHUTE_RELEASE = 2; /* Release parachute | */ - public static final int PARACHUTE_ACTION_ENUM_END = 3; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/RALLY_FLAGS.java b/Mavlink/src/com/MAVLink/Messages/enums/RALLY_FLAGS.java deleted file mode 100644 index d76983e2e5..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/RALLY_FLAGS.java +++ /dev/null @@ -1,9 +0,0 @@ -/** Flags in RALLY_POINT message -*/ -package com.MAVLink.Messages.enums; - -public class RALLY_FLAGS { - public static final int FAVORABLE_WIND = 1; /* Flag set when requiring favorable winds for landing. | */ - public static final int LAND_IMMEDIATELY = 2; /* Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. | */ - public static final int RALLY_FLAGS_ENUM_END = 3; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_DEV.java b/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_DEV.java deleted file mode 100644 index 01ca308e11..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_DEV.java +++ /dev/null @@ -1,11 +0,0 @@ -/** SERIAL_CONTROL device types -*/ -package com.MAVLink.Messages.enums; - -public class SERIAL_CONTROL_DEV { - public static final int SERIAL_CONTROL_DEV_TELEM1 = 0; /* First telemetry port | */ - public static final int SERIAL_CONTROL_DEV_TELEM2 = 1; /* Second telemetry port | */ - public static final int SERIAL_CONTROL_DEV_GPS1 = 2; /* First GPS port | */ - public static final int SERIAL_CONTROL_DEV_GPS2 = 3; /* Second GPS port | */ - public static final int SERIAL_CONTROL_DEV_ENUM_END = 4; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_FLAG.java b/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_FLAG.java deleted file mode 100644 index 45a20e6edb..0000000000 --- a/Mavlink/src/com/MAVLink/Messages/enums/SERIAL_CONTROL_FLAG.java +++ /dev/null @@ -1,12 +0,0 @@ -/** SERIAL_CONTROL flags (bitmask) -*/ -package com.MAVLink.Messages.enums; - -public class SERIAL_CONTROL_FLAG { - public static final int SERIAL_CONTROL_FLAG_REPLY = 1; /* Set if this is a reply | */ - public static final int SERIAL_CONTROL_FLAG_RESPOND = 2; /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ - public static final int SERIAL_CONTROL_FLAG_EXCLUSIVE = 4; /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ - public static final int SERIAL_CONTROL_FLAG_BLOCKING = 8; /* Block on writes to the serial port | */ - public static final int SERIAL_CONTROL_FLAG_MULTI = 16; /* Send multiple replies until port is drained | */ - public static final int SERIAL_CONTROL_FLAG_ENUM_END = 17; /* | */ -} diff --git a/Mavlink/src/com/MAVLink/Parser.java b/Mavlink/src/com/MAVLink/Parser.java index 3d1ec4a1e1..cb31512bfc 100644 --- a/Mavlink/src/com/MAVLink/Parser.java +++ b/Mavlink/src/com/MAVLink/Parser.java @@ -1,6 +1,6 @@ package com.MAVLink; -import com.MAVLink.Messages.MAVLinkPacket; +import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkStats; public class Parser { diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/CRC.java b/Mavlink/src/com/MAVLink/ardupilotmega/CRC.java new file mode 100644 index 0000000000..d0eafba187 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/CRC.java @@ -0,0 +1,66 @@ + package com.MAVLink.ardupilotmega; + + /** + * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, + * updated with witch field of the message, and then finished with the message + * id. + * + */ + public class CRC { + private final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 0, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 29, 12, 241, 233, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 211, 108, 32, 185, 84, 0, 0, 124, 119, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 0, 29, 223, 85, 6, 229, 203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 49, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}; + private static final int CRC_INIT_VALUE = 0xffff; + private int CRCvalue; + + /** + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + * @param crcAccum + * the already accumulated checksum + **/ + public void update_checksum(int data) { + int tmp; + data= data & 0xff; //cast because we want an unsigned type + tmp = data ^ (CRCvalue & 0xff); + tmp ^= (tmp << 4) & 0xff; + CRCvalue = ((CRCvalue >> 8) & 0xff) ^ (tmp << 8) ^ (tmp << 3) + ^ ((tmp >> 4) & 0xf); + } + + /** + * Finish the CRC calculation of a message, by running the CRC with the + * Magic Byte. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ + public void finish_checksum(int msgid) { + update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); + } + + /** + * Initialize the buffer for the X.25 CRC + * + */ + public void start_checksum() { + CRCvalue = CRC_INIT_VALUE; + } + + public int getMSB() { + return ((CRCvalue >> 8) & 0xff); + } + + public int getLSB() { + return (CRCvalue & 0xff); + } + + public CRC() { + start_checksum(); + } + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs.java new file mode 100644 index 0000000000..dc1ac3767a --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs.java @@ -0,0 +1,115 @@ + // MESSAGE AHRS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of DCM attitude estimator + */ + public class msg_ahrs extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AHRS = 163; + public static final int MAVLINK_MSG_LENGTH = 28; + private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS; + + + /** + * X gyro drift estimate rad/s + */ + public float omegaIx; + /** + * Y gyro drift estimate rad/s + */ + public float omegaIy; + /** + * Z gyro drift estimate rad/s + */ + public float omegaIz; + /** + * average accel_weight + */ + public float accel_weight; + /** + * average renormalisation value + */ + public float renorm_val; + /** + * average error_roll_pitch value + */ + public float error_rp; + /** + * average error_yaw value + */ + public float error_yaw; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AHRS; + packet.payload.putFloat(omegaIx); + packet.payload.putFloat(omegaIy); + packet.payload.putFloat(omegaIz); + packet.payload.putFloat(accel_weight); + packet.payload.putFloat(renorm_val); + packet.payload.putFloat(error_rp); + packet.payload.putFloat(error_yaw); + + return packet; + } + + /** + * Decode a ahrs message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.omegaIx = payload.getFloat(); + this.omegaIy = payload.getFloat(); + this.omegaIz = payload.getFloat(); + this.accel_weight = payload.getFloat(); + this.renorm_val = payload.getFloat(); + this.error_rp = payload.getFloat(); + this.error_yaw = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ahrs(){ + msgid = MAVLINK_MSG_ID_AHRS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ahrs(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AHRS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "AHRS"); + //Log.d("MAVLINK_MSG_ID_AHRS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AHRS -"+" omegaIx:"+omegaIx+" omegaIy:"+omegaIy+" omegaIz:"+omegaIz+" accel_weight:"+accel_weight+" renorm_val:"+renorm_val+" error_rp:"+error_rp+" error_yaw:"+error_yaw+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs2.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs2.java new file mode 100644 index 0000000000..71308e1e07 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ahrs2.java @@ -0,0 +1,109 @@ + // MESSAGE AHRS2 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of secondary AHRS filter if available + */ + public class msg_ahrs2 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AHRS2 = 178; + public static final int MAVLINK_MSG_LENGTH = 24; + private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS2; + + + /** + * Roll angle (rad) + */ + public float roll; + /** + * Pitch angle (rad) + */ + public float pitch; + /** + * Yaw angle (rad) + */ + public float yaw; + /** + * Altitude (MSL) + */ + public float altitude; + /** + * Latitude in degrees * 1E7 + */ + public int lat; + /** + * Longitude in degrees * 1E7 + */ + public int lng; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AHRS2; + packet.payload.putFloat(roll); + packet.payload.putFloat(pitch); + packet.payload.putFloat(yaw); + packet.payload.putFloat(altitude); + packet.payload.putInt(lat); + packet.payload.putInt(lng); + + return packet; + } + + /** + * Decode a ahrs2 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.roll = payload.getFloat(); + this.pitch = payload.getFloat(); + this.yaw = payload.getFloat(); + this.altitude = payload.getFloat(); + this.lat = payload.getInt(); + this.lng = payload.getInt(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ahrs2(){ + msgid = MAVLINK_MSG_ID_AHRS2; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ahrs2(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AHRS2; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "AHRS2"); + //Log.d("MAVLINK_MSG_ID_AHRS2", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AHRS2 -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" altitude:"+altitude+" lat:"+lat+" lng:"+lng+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java new file mode 100644 index 0000000000..c10027191f --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java @@ -0,0 +1,145 @@ + // MESSAGE AIRSPEED_AUTOCAL PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Airspeed auto-calibration + */ + public class msg_airspeed_autocal extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AIRSPEED_AUTOCAL = 174; + public static final int MAVLINK_MSG_LENGTH = 48; + private static final long serialVersionUID = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + + + /** + * GPS velocity north m/s + */ + public float vx; + /** + * GPS velocity east m/s + */ + public float vy; + /** + * GPS velocity down m/s + */ + public float vz; + /** + * Differential pressure pascals + */ + public float diff_pressure; + /** + * Estimated to true airspeed ratio + */ + public float EAS2TAS; + /** + * Airspeed ratio + */ + public float ratio; + /** + * EKF state x + */ + public float state_x; + /** + * EKF state y + */ + public float state_y; + /** + * EKF state z + */ + public float state_z; + /** + * EKF Pax + */ + public float Pax; + /** + * EKF Pby + */ + public float Pby; + /** + * EKF Pcz + */ + public float Pcz; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + packet.payload.putFloat(vx); + packet.payload.putFloat(vy); + packet.payload.putFloat(vz); + packet.payload.putFloat(diff_pressure); + packet.payload.putFloat(EAS2TAS); + packet.payload.putFloat(ratio); + packet.payload.putFloat(state_x); + packet.payload.putFloat(state_y); + packet.payload.putFloat(state_z); + packet.payload.putFloat(Pax); + packet.payload.putFloat(Pby); + packet.payload.putFloat(Pcz); + + return packet; + } + + /** + * Decode a airspeed_autocal message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.vx = payload.getFloat(); + this.vy = payload.getFloat(); + this.vz = payload.getFloat(); + this.diff_pressure = payload.getFloat(); + this.EAS2TAS = payload.getFloat(); + this.ratio = payload.getFloat(); + this.state_x = payload.getFloat(); + this.state_y = payload.getFloat(); + this.state_z = payload.getFloat(); + this.Pax = payload.getFloat(); + this.Pby = payload.getFloat(); + this.Pcz = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_airspeed_autocal(){ + msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_airspeed_autocal(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "AIRSPEED_AUTOCAL"); + //Log.d("MAVLINK_MSG_ID_AIRSPEED_AUTOCAL", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AIRSPEED_AUTOCAL -"+" vx:"+vx+" vy:"+vy+" vz:"+vz+" diff_pressure:"+diff_pressure+" EAS2TAS:"+EAS2TAS+" ratio:"+ratio+" state_x:"+state_x+" state_y:"+state_y+" state_z:"+state_z+" Pax:"+Pax+" Pby:"+Pby+" Pcz:"+Pcz+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_ap_adc.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ap_adc.java new file mode 100644 index 0000000000..1a16ef2358 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_ap_adc.java @@ -0,0 +1,109 @@ + // MESSAGE AP_ADC PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * raw ADC output + */ + public class msg_ap_adc extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AP_ADC = 153; + public static final int MAVLINK_MSG_LENGTH = 12; + private static final long serialVersionUID = MAVLINK_MSG_ID_AP_ADC; + + + /** + * ADC output 1 + */ + public short adc1; + /** + * ADC output 2 + */ + public short adc2; + /** + * ADC output 3 + */ + public short adc3; + /** + * ADC output 4 + */ + public short adc4; + /** + * ADC output 5 + */ + public short adc5; + /** + * ADC output 6 + */ + public short adc6; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AP_ADC; + packet.payload.putShort(adc1); + packet.payload.putShort(adc2); + packet.payload.putShort(adc3); + packet.payload.putShort(adc4); + packet.payload.putShort(adc5); + packet.payload.putShort(adc6); + + return packet; + } + + /** + * Decode a ap_adc message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.adc1 = payload.getShort(); + this.adc2 = payload.getShort(); + this.adc3 = payload.getShort(); + this.adc4 = payload.getShort(); + this.adc5 = payload.getShort(); + this.adc6 = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ap_adc(){ + msgid = MAVLINK_MSG_ID_AP_ADC; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ap_adc(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AP_ADC; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "AP_ADC"); + //Log.d("MAVLINK_MSG_ID_AP_ADC", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AP_ADC -"+" adc1:"+adc1+" adc2:"+adc2+" adc3:"+adc3+" adc4:"+adc4+" adc5:"+adc5+" adc6:"+adc6+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_battery2.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_battery2.java new file mode 100644 index 0000000000..0f9243242e --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_battery2.java @@ -0,0 +1,85 @@ + // MESSAGE BATTERY2 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * 2nd Battery status + */ + public class msg_battery2 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_BATTERY2 = 181; + public static final int MAVLINK_MSG_LENGTH = 4; + private static final long serialVersionUID = MAVLINK_MSG_ID_BATTERY2; + + + /** + * voltage in millivolts + */ + public short voltage; + /** + * Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current + */ + public short current_battery; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_BATTERY2; + packet.payload.putShort(voltage); + packet.payload.putShort(current_battery); + + return packet; + } + + /** + * Decode a battery2 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.voltage = payload.getShort(); + this.current_battery = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_battery2(){ + msgid = MAVLINK_MSG_ID_BATTERY2; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_battery2(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_BATTERY2; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "BATTERY2"); + //Log.d("MAVLINK_MSG_ID_BATTERY2", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_BATTERY2 -"+" voltage:"+voltage+" current_battery:"+current_battery+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_feedback.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_feedback.java new file mode 100644 index 0000000000..9546985f06 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_feedback.java @@ -0,0 +1,151 @@ + // MESSAGE CAMERA_FEEDBACK PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Camera Capture Feedback + */ + public class msg_camera_feedback extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_CAMERA_FEEDBACK = 180; + public static final int MAVLINK_MSG_LENGTH = 45; + private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + + + /** + * Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB) + */ + public long time_usec; + /** + * Latitude in (deg * 1E7) + */ + public int lat; + /** + * Longitude in (deg * 1E7) + */ + public int lng; + /** + * Altitude Absolute (meters AMSL) + */ + public float alt_msl; + /** + * Altitude Relative (meters above HOME location) + */ + public float alt_rel; + /** + * Camera Roll angle (earth frame, degrees, +-180) + */ + public float roll; + /** + * Camera Pitch angle (earth frame, degrees, +-180) + */ + public float pitch; + /** + * Camera Yaw (earth frame, degrees, 0-360, true) + */ + public float yaw; + /** + * Focal Length (mm) + */ + public float foc_len; + /** + * Image index + */ + public short img_idx; + /** + * System ID + */ + public byte target_system; + /** + * Camera ID + */ + public byte cam_idx; + /** + * See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask + */ + public byte flags; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + packet.payload.putLong(time_usec); + packet.payload.putInt(lat); + packet.payload.putInt(lng); + packet.payload.putFloat(alt_msl); + packet.payload.putFloat(alt_rel); + packet.payload.putFloat(roll); + packet.payload.putFloat(pitch); + packet.payload.putFloat(yaw); + packet.payload.putFloat(foc_len); + packet.payload.putShort(img_idx); + packet.payload.putByte(target_system); + packet.payload.putByte(cam_idx); + packet.payload.putByte(flags); + + return packet; + } + + /** + * Decode a camera_feedback message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_usec = payload.getLong(); + this.lat = payload.getInt(); + this.lng = payload.getInt(); + this.alt_msl = payload.getFloat(); + this.alt_rel = payload.getFloat(); + this.roll = payload.getFloat(); + this.pitch = payload.getFloat(); + this.yaw = payload.getFloat(); + this.foc_len = payload.getFloat(); + this.img_idx = payload.getShort(); + this.target_system = payload.getByte(); + this.cam_idx = payload.getByte(); + this.flags = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_camera_feedback(){ + msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_camera_feedback(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "CAMERA_FEEDBACK"); + //Log.d("MAVLINK_MSG_ID_CAMERA_FEEDBACK", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_CAMERA_FEEDBACK -"+" time_usec:"+time_usec+" lat:"+lat+" lng:"+lng+" alt_msl:"+alt_msl+" alt_rel:"+alt_rel+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" foc_len:"+foc_len+" img_idx:"+img_idx+" target_system:"+target_system+" cam_idx:"+cam_idx+" flags:"+flags+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_status.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_status.java new file mode 100644 index 0000000000..731b736e56 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_camera_status.java @@ -0,0 +1,127 @@ + // MESSAGE CAMERA_STATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Camera Event + */ + public class msg_camera_status extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_CAMERA_STATUS = 179; + public static final int MAVLINK_MSG_LENGTH = 29; + private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_STATUS; + + + /** + * Image timestamp (microseconds since UNIX epoch, according to camera clock) + */ + public long time_usec; + /** + * Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + */ + public float p1; + /** + * Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + */ + public float p2; + /** + * Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + */ + public float p3; + /** + * Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum) + */ + public float p4; + /** + * Image index + */ + public short img_idx; + /** + * System ID + */ + public byte target_system; + /** + * Camera ID + */ + public byte cam_idx; + /** + * See CAMERA_STATUS_TYPES enum for definition of the bitmask + */ + public byte event_id; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_CAMERA_STATUS; + packet.payload.putLong(time_usec); + packet.payload.putFloat(p1); + packet.payload.putFloat(p2); + packet.payload.putFloat(p3); + packet.payload.putFloat(p4); + packet.payload.putShort(img_idx); + packet.payload.putByte(target_system); + packet.payload.putByte(cam_idx); + packet.payload.putByte(event_id); + + return packet; + } + + /** + * Decode a camera_status message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_usec = payload.getLong(); + this.p1 = payload.getFloat(); + this.p2 = payload.getFloat(); + this.p3 = payload.getFloat(); + this.p4 = payload.getFloat(); + this.img_idx = payload.getShort(); + this.target_system = payload.getByte(); + this.cam_idx = payload.getByte(); + this.event_id = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_camera_status(){ + msgid = MAVLINK_MSG_ID_CAMERA_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_camera_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_CAMERA_STATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "CAMERA_STATUS"); + //Log.d("MAVLINK_MSG_ID_CAMERA_STATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_CAMERA_STATUS -"+" time_usec:"+time_usec+" p1:"+p1+" p2:"+p2+" p3:"+p3+" p4:"+p4+" img_idx:"+img_idx+" target_system:"+target_system+" cam_idx:"+cam_idx+" event_id:"+event_id+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_compassmot_status.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_compassmot_status.java new file mode 100644 index 0000000000..26560a57dd --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_compassmot_status.java @@ -0,0 +1,109 @@ + // MESSAGE COMPASSMOT_STATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of compassmot calibration + */ + public class msg_compassmot_status extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_COMPASSMOT_STATUS = 177; + public static final int MAVLINK_MSG_LENGTH = 20; + private static final long serialVersionUID = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + + + /** + * current (amps) + */ + public float current; + /** + * Motor Compensation X + */ + public float CompensationX; + /** + * Motor Compensation Y + */ + public float CompensationY; + /** + * Motor Compensation Z + */ + public float CompensationZ; + /** + * throttle (percent*10) + */ + public short throttle; + /** + * interference (percent) + */ + public short interference; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + packet.payload.putFloat(current); + packet.payload.putFloat(CompensationX); + packet.payload.putFloat(CompensationY); + packet.payload.putFloat(CompensationZ); + packet.payload.putShort(throttle); + packet.payload.putShort(interference); + + return packet; + } + + /** + * Decode a compassmot_status message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.current = payload.getFloat(); + this.CompensationX = payload.getFloat(); + this.CompensationY = payload.getFloat(); + this.CompensationZ = payload.getFloat(); + this.throttle = payload.getShort(); + this.interference = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_compassmot_status(){ + msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_compassmot_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "COMPASSMOT_STATUS"); + //Log.d("MAVLINK_MSG_ID_COMPASSMOT_STATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_COMPASSMOT_STATUS -"+" current:"+current+" CompensationX:"+CompensationX+" CompensationY:"+CompensationY+" CompensationZ:"+CompensationZ+" throttle:"+throttle+" interference:"+interference+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_data16.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data16.java new file mode 100644 index 0000000000..308336cf00 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data16.java @@ -0,0 +1,95 @@ + // MESSAGE DATA16 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Data packet, size 16 + */ + public class msg_data16 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DATA16 = 169; + public static final int MAVLINK_MSG_LENGTH = 18; + private static final long serialVersionUID = MAVLINK_MSG_ID_DATA16; + + + /** + * data type + */ + public byte type; + /** + * data length + */ + public byte len; + /** + * raw data + */ + public byte data[] = new byte[16]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DATA16; + packet.payload.putByte(type); + packet.payload.putByte(len); + for (int i = 0; i < data.length; i++) { + packet.payload.putByte(data[i]); + } + + return packet; + } + + /** + * Decode a data16 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.type = payload.getByte(); + this.len = payload.getByte(); + for (int i = 0; i < this.data.length; i++) { + this.data[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data16(){ + msgid = MAVLINK_MSG_ID_DATA16; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data16(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA16; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DATA16"); + //Log.d("MAVLINK_MSG_ID_DATA16", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA16 -"+" type:"+type+" len:"+len+" data:"+data+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_data32.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data32.java new file mode 100644 index 0000000000..ed61dba024 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data32.java @@ -0,0 +1,95 @@ + // MESSAGE DATA32 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Data packet, size 32 + */ + public class msg_data32 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DATA32 = 170; + public static final int MAVLINK_MSG_LENGTH = 34; + private static final long serialVersionUID = MAVLINK_MSG_ID_DATA32; + + + /** + * data type + */ + public byte type; + /** + * data length + */ + public byte len; + /** + * raw data + */ + public byte data[] = new byte[32]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DATA32; + packet.payload.putByte(type); + packet.payload.putByte(len); + for (int i = 0; i < data.length; i++) { + packet.payload.putByte(data[i]); + } + + return packet; + } + + /** + * Decode a data32 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.type = payload.getByte(); + this.len = payload.getByte(); + for (int i = 0; i < this.data.length; i++) { + this.data[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data32(){ + msgid = MAVLINK_MSG_ID_DATA32; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data32(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA32; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DATA32"); + //Log.d("MAVLINK_MSG_ID_DATA32", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA32 -"+" type:"+type+" len:"+len+" data:"+data+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_data64.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data64.java new file mode 100644 index 0000000000..3e85151ed6 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data64.java @@ -0,0 +1,95 @@ + // MESSAGE DATA64 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Data packet, size 64 + */ + public class msg_data64 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DATA64 = 171; + public static final int MAVLINK_MSG_LENGTH = 66; + private static final long serialVersionUID = MAVLINK_MSG_ID_DATA64; + + + /** + * data type + */ + public byte type; + /** + * data length + */ + public byte len; + /** + * raw data + */ + public byte data[] = new byte[64]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DATA64; + packet.payload.putByte(type); + packet.payload.putByte(len); + for (int i = 0; i < data.length; i++) { + packet.payload.putByte(data[i]); + } + + return packet; + } + + /** + * Decode a data64 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.type = payload.getByte(); + this.len = payload.getByte(); + for (int i = 0; i < this.data.length; i++) { + this.data[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data64(){ + msgid = MAVLINK_MSG_ID_DATA64; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data64(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA64; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DATA64"); + //Log.d("MAVLINK_MSG_ID_DATA64", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA64 -"+" type:"+type+" len:"+len+" data:"+data+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_data96.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data96.java new file mode 100644 index 0000000000..79ca5e39e8 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_data96.java @@ -0,0 +1,95 @@ + // MESSAGE DATA96 PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Data packet, size 96 + */ + public class msg_data96 extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DATA96 = 172; + public static final int MAVLINK_MSG_LENGTH = 98; + private static final long serialVersionUID = MAVLINK_MSG_ID_DATA96; + + + /** + * data type + */ + public byte type; + /** + * data length + */ + public byte len; + /** + * raw data + */ + public byte data[] = new byte[96]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DATA96; + packet.payload.putByte(type); + packet.payload.putByte(len); + for (int i = 0; i < data.length; i++) { + packet.payload.putByte(data[i]); + } + + return packet; + } + + /** + * Decode a data96 message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.type = payload.getByte(); + this.len = payload.getByte(); + for (int i = 0; i < this.data.length; i++) { + this.data[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data96(){ + msgid = MAVLINK_MSG_ID_DATA96; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data96(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA96; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DATA96"); + //Log.d("MAVLINK_MSG_ID_DATA96", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA96 -"+" type:"+type+" len:"+len+" data:"+data+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_configure.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_configure.java new file mode 100644 index 0000000000..7ff4778094 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_configure.java @@ -0,0 +1,139 @@ + // MESSAGE DIGICAM_CONFIGURE PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Configure on-board Camera Control System. + */ + public class msg_digicam_configure extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DIGICAM_CONFIGURE = 154; + public static final int MAVLINK_MSG_LENGTH = 15; + private static final long serialVersionUID = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; + + + /** + * Correspondent value to given extra_param + */ + public float extra_value; + /** + * Divisor number //e.g. 1000 means 1/1000 (0 means ignore) + */ + public short shutter_speed; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) + */ + public byte mode; + /** + * F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) + */ + public byte aperture; + /** + * ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) + */ + public byte iso; + /** + * Exposure type enumeration from 1 to N (0 means ignore) + */ + public byte exposure_type; + /** + * Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once + */ + public byte command_id; + /** + * Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) + */ + public byte engine_cut_off; + /** + * Extra parameters enumeration (0 means ignore) + */ + public byte extra_param; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; + packet.payload.putFloat(extra_value); + packet.payload.putShort(shutter_speed); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(mode); + packet.payload.putByte(aperture); + packet.payload.putByte(iso); + packet.payload.putByte(exposure_type); + packet.payload.putByte(command_id); + packet.payload.putByte(engine_cut_off); + packet.payload.putByte(extra_param); + + return packet; + } + + /** + * Decode a digicam_configure message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.extra_value = payload.getFloat(); + this.shutter_speed = payload.getShort(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.mode = payload.getByte(); + this.aperture = payload.getByte(); + this.iso = payload.getByte(); + this.exposure_type = payload.getByte(); + this.command_id = payload.getByte(); + this.engine_cut_off = payload.getByte(); + this.extra_param = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_digicam_configure(){ + msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_digicam_configure(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DIGICAM_CONFIGURE"); + //Log.d("MAVLINK_MSG_ID_DIGICAM_CONFIGURE", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DIGICAM_CONFIGURE -"+" extra_value:"+extra_value+" shutter_speed:"+shutter_speed+" target_system:"+target_system+" target_component:"+target_component+" mode:"+mode+" aperture:"+aperture+" iso:"+iso+" exposure_type:"+exposure_type+" command_id:"+command_id+" engine_cut_off:"+engine_cut_off+" extra_param:"+extra_param+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_control.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_control.java new file mode 100644 index 0000000000..32028663f2 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_digicam_control.java @@ -0,0 +1,133 @@ + // MESSAGE DIGICAM_CONTROL PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Control on-board Camera Control System to take shots. + */ + public class msg_digicam_control extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DIGICAM_CONTROL = 155; + public static final int MAVLINK_MSG_LENGTH = 13; + private static final long serialVersionUID = MAVLINK_MSG_ID_DIGICAM_CONTROL; + + + /** + * Correspondent value to given extra_param + */ + public float extra_value; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * 0: stop, 1: start or keep it up //Session control e.g. show/hide lens + */ + public byte session; + /** + * 1 to N //Zoom's absolute position (0 means ignore) + */ + public byte zoom_pos; + /** + * -100 to 100 //Zooming step value to offset zoom from the current position + */ + public byte zoom_step; + /** + * 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus + */ + public byte focus_lock; + /** + * 0: ignore, 1: shot or start filming + */ + public byte shot; + /** + * Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once + */ + public byte command_id; + /** + * Extra parameters enumeration (0 means ignore) + */ + public byte extra_param; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; + packet.payload.putFloat(extra_value); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(session); + packet.payload.putByte(zoom_pos); + packet.payload.putByte(zoom_step); + packet.payload.putByte(focus_lock); + packet.payload.putByte(shot); + packet.payload.putByte(command_id); + packet.payload.putByte(extra_param); + + return packet; + } + + /** + * Decode a digicam_control message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.extra_value = payload.getFloat(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.session = payload.getByte(); + this.zoom_pos = payload.getByte(); + this.zoom_step = payload.getByte(); + this.focus_lock = payload.getByte(); + this.shot = payload.getByte(); + this.command_id = payload.getByte(); + this.extra_param = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_digicam_control(){ + msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_digicam_control(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "DIGICAM_CONTROL"); + //Log.d("MAVLINK_MSG_ID_DIGICAM_CONTROL", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DIGICAM_CONTROL -"+" extra_value:"+extra_value+" target_system:"+target_system+" target_component:"+target_component+" session:"+session+" zoom_pos:"+zoom_pos+" zoom_step:"+zoom_step+" focus_lock:"+focus_lock+" shot:"+shot+" command_id:"+command_id+" extra_param:"+extra_param+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_fetch_point.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_fetch_point.java new file mode 100644 index 0000000000..82d8f14fd8 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_fetch_point.java @@ -0,0 +1,91 @@ + // MESSAGE FENCE_FETCH_POINT PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Request a current fence point from MAV + */ + public class msg_fence_fetch_point extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_FENCE_FETCH_POINT = 161; + public static final int MAVLINK_MSG_LENGTH = 3; + private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_FETCH_POINT; + + + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * point index (first point is 1, 0 is for return point) + */ + public byte idx; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(idx); + + return packet; + } + + /** + * Decode a fence_fetch_point message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.idx = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_fence_fetch_point(){ + msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_fence_fetch_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "FENCE_FETCH_POINT"); + //Log.d("MAVLINK_MSG_ID_FENCE_FETCH_POINT", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_FENCE_FETCH_POINT -"+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_point.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_point.java new file mode 100644 index 0000000000..db72d68e9d --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_point.java @@ -0,0 +1,110 @@ + // MESSAGE FENCE_POINT PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * A fence point. Used to set a point when from + GCS -> MAV. Also used to return a point from MAV -> GCS + */ + public class msg_fence_point extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_FENCE_POINT = 160; + public static final int MAVLINK_MSG_LENGTH = 12; + private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_POINT; + + + /** + * Latitude of point + */ + public float lat; + /** + * Longitude of point + */ + public float lng; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * point index (first point is 1, 0 is for return point) + */ + public byte idx; + /** + * total number of points (for sanity checking) + */ + public byte count; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_FENCE_POINT; + packet.payload.putFloat(lat); + packet.payload.putFloat(lng); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(idx); + packet.payload.putByte(count); + + return packet; + } + + /** + * Decode a fence_point message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.lat = payload.getFloat(); + this.lng = payload.getFloat(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.idx = payload.getByte(); + this.count = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_fence_point(){ + msgid = MAVLINK_MSG_ID_FENCE_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_fence_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_FENCE_POINT; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "FENCE_POINT"); + //Log.d("MAVLINK_MSG_ID_FENCE_POINT", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_FENCE_POINT -"+" lat:"+lat+" lng:"+lng+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_status.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_status.java new file mode 100644 index 0000000000..5d8457b308 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_fence_status.java @@ -0,0 +1,98 @@ + // MESSAGE FENCE_STATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of geo-fencing. Sent in extended + status stream when fencing enabled + */ + public class msg_fence_status extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_FENCE_STATUS = 162; + public static final int MAVLINK_MSG_LENGTH = 8; + private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_STATUS; + + + /** + * time of last breach in milliseconds since boot + */ + public int breach_time; + /** + * number of fence breaches + */ + public short breach_count; + /** + * 0 if currently inside fence, 1 if outside + */ + public byte breach_status; + /** + * last breach type (see FENCE_BREACH_* enum) + */ + public byte breach_type; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_FENCE_STATUS; + packet.payload.putInt(breach_time); + packet.payload.putShort(breach_count); + packet.payload.putByte(breach_status); + packet.payload.putByte(breach_type); + + return packet; + } + + /** + * Decode a fence_status message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.breach_time = payload.getInt(); + this.breach_count = payload.getShort(); + this.breach_status = payload.getByte(); + this.breach_type = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_fence_status(){ + msgid = MAVLINK_MSG_ID_FENCE_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_fence_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_FENCE_STATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "FENCE_STATUS"); + //Log.d("MAVLINK_MSG_ID_FENCE_STATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_FENCE_STATUS -"+" breach_time:"+breach_time+" breach_count:"+breach_count+" breach_status:"+breach_status+" breach_type:"+breach_type+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_hwstatus.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_hwstatus.java new file mode 100644 index 0000000000..f1c85115c1 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_hwstatus.java @@ -0,0 +1,85 @@ + // MESSAGE HWSTATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of key hardware + */ + public class msg_hwstatus extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_HWSTATUS = 165; + public static final int MAVLINK_MSG_LENGTH = 3; + private static final long serialVersionUID = MAVLINK_MSG_ID_HWSTATUS; + + + /** + * board voltage (mV) + */ + public short Vcc; + /** + * I2C error count + */ + public byte I2Cerr; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_HWSTATUS; + packet.payload.putShort(Vcc); + packet.payload.putByte(I2Cerr); + + return packet; + } + + /** + * Decode a hwstatus message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.Vcc = payload.getShort(); + this.I2Cerr = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_hwstatus(){ + msgid = MAVLINK_MSG_ID_HWSTATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_hwstatus(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_HWSTATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "HWSTATUS"); + //Log.d("MAVLINK_MSG_ID_HWSTATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_HWSTATUS -"+" Vcc:"+Vcc+" I2Cerr:"+I2Cerr+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_limits_status.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_limits_status.java new file mode 100644 index 0000000000..529ad49c30 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_limits_status.java @@ -0,0 +1,128 @@ + // MESSAGE LIMITS_STATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of AP_Limits. Sent in extended + status stream when AP_Limits is enabled + */ + public class msg_limits_status extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_LIMITS_STATUS = 167; + public static final int MAVLINK_MSG_LENGTH = 22; + private static final long serialVersionUID = MAVLINK_MSG_ID_LIMITS_STATUS; + + + /** + * time of last breach in milliseconds since boot + */ + public int last_trigger; + /** + * time of last recovery action in milliseconds since boot + */ + public int last_action; + /** + * time of last successful recovery in milliseconds since boot + */ + public int last_recovery; + /** + * time of last all-clear in milliseconds since boot + */ + public int last_clear; + /** + * number of fence breaches + */ + public short breach_count; + /** + * state of AP_Limits, (see enum LimitState, LIMITS_STATE) + */ + public byte limits_state; + /** + * AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE) + */ + public byte mods_enabled; + /** + * AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE) + */ + public byte mods_required; + /** + * AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE) + */ + public byte mods_triggered; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_LIMITS_STATUS; + packet.payload.putInt(last_trigger); + packet.payload.putInt(last_action); + packet.payload.putInt(last_recovery); + packet.payload.putInt(last_clear); + packet.payload.putShort(breach_count); + packet.payload.putByte(limits_state); + packet.payload.putByte(mods_enabled); + packet.payload.putByte(mods_required); + packet.payload.putByte(mods_triggered); + + return packet; + } + + /** + * Decode a limits_status message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.last_trigger = payload.getInt(); + this.last_action = payload.getInt(); + this.last_recovery = payload.getInt(); + this.last_clear = payload.getInt(); + this.breach_count = payload.getShort(); + this.limits_state = payload.getByte(); + this.mods_enabled = payload.getByte(); + this.mods_required = payload.getByte(); + this.mods_triggered = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_limits_status(){ + msgid = MAVLINK_MSG_ID_LIMITS_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_limits_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_LIMITS_STATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "LIMITS_STATUS"); + //Log.d("MAVLINK_MSG_ID_LIMITS_STATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_LIMITS_STATUS -"+" last_trigger:"+last_trigger+" last_action:"+last_action+" last_recovery:"+last_recovery+" last_clear:"+last_clear+" breach_count:"+breach_count+" limits_state:"+limits_state+" mods_enabled:"+mods_enabled+" mods_required:"+mods_required+" mods_triggered:"+mods_triggered+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_meminfo.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_meminfo.java new file mode 100644 index 0000000000..300aab0a7e --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_meminfo.java @@ -0,0 +1,85 @@ + // MESSAGE MEMINFO PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * state of APM memory + */ + public class msg_meminfo extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_MEMINFO = 152; + public static final int MAVLINK_MSG_LENGTH = 4; + private static final long serialVersionUID = MAVLINK_MSG_ID_MEMINFO; + + + /** + * heap top + */ + public short brkval; + /** + * free memory + */ + public short freemem; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_MEMINFO; + packet.payload.putShort(brkval); + packet.payload.putShort(freemem); + + return packet; + } + + /** + * Decode a meminfo message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.brkval = payload.getShort(); + this.freemem = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_meminfo(){ + msgid = MAVLINK_MSG_ID_MEMINFO; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_meminfo(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MEMINFO; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "MEMINFO"); + //Log.d("MAVLINK_MSG_ID_MEMINFO", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MEMINFO -"+" brkval:"+brkval+" freemem:"+freemem+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_configure.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_configure.java new file mode 100644 index 0000000000..1fe183aff1 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_configure.java @@ -0,0 +1,109 @@ + // MESSAGE MOUNT_CONFIGURE PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Message to configure a camera mount, directional antenna, etc. + */ + public class msg_mount_configure extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_MOUNT_CONFIGURE = 156; + public static final int MAVLINK_MSG_LENGTH = 6; + private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + + + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * mount operating mode (see MAV_MOUNT_MODE enum) + */ + public byte mount_mode; + /** + * (1 = yes, 0 = no) + */ + public byte stab_roll; + /** + * (1 = yes, 0 = no) + */ + public byte stab_pitch; + /** + * (1 = yes, 0 = no) + */ + public byte stab_yaw; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(mount_mode); + packet.payload.putByte(stab_roll); + packet.payload.putByte(stab_pitch); + packet.payload.putByte(stab_yaw); + + return packet; + } + + /** + * Decode a mount_configure message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.mount_mode = payload.getByte(); + this.stab_roll = payload.getByte(); + this.stab_pitch = payload.getByte(); + this.stab_yaw = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_configure(){ + msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_configure(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "MOUNT_CONFIGURE"); + //Log.d("MAVLINK_MSG_ID_MOUNT_CONFIGURE", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_CONFIGURE -"+" target_system:"+target_system+" target_component:"+target_component+" mount_mode:"+mount_mode+" stab_roll:"+stab_roll+" stab_pitch:"+stab_pitch+" stab_yaw:"+stab_yaw+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_control.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_control.java new file mode 100644 index 0000000000..fd5f4688ba --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_control.java @@ -0,0 +1,109 @@ + // MESSAGE MOUNT_CONTROL PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Message to control a camera mount, directional antenna, etc. + */ + public class msg_mount_control extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_MOUNT_CONTROL = 157; + public static final int MAVLINK_MSG_LENGTH = 15; + private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_CONTROL; + + + /** + * pitch(deg*100) or lat, depending on mount mode + */ + public int input_a; + /** + * roll(deg*100) or lon depending on mount mode + */ + public int input_b; + /** + * yaw(deg*100) or alt (in cm) depending on mount mode + */ + public int input_c; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) + */ + public byte save_position; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; + packet.payload.putInt(input_a); + packet.payload.putInt(input_b); + packet.payload.putInt(input_c); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(save_position); + + return packet; + } + + /** + * Decode a mount_control message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.input_a = payload.getInt(); + this.input_b = payload.getInt(); + this.input_c = payload.getInt(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.save_position = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_control(){ + msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_control(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "MOUNT_CONTROL"); + //Log.d("MAVLINK_MSG_ID_MOUNT_CONTROL", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_CONTROL -"+" input_a:"+input_a+" input_b:"+input_b+" input_c:"+input_c+" target_system:"+target_system+" target_component:"+target_component+" save_position:"+save_position+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_status.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_status.java new file mode 100644 index 0000000000..7750cb542f --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_mount_status.java @@ -0,0 +1,103 @@ + // MESSAGE MOUNT_STATUS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Message with some status from APM to GCS about camera or antenna mount + */ + public class msg_mount_status extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_MOUNT_STATUS = 158; + public static final int MAVLINK_MSG_LENGTH = 14; + private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_STATUS; + + + /** + * pitch(deg*100) or lat, depending on mount mode + */ + public int pointing_a; + /** + * roll(deg*100) or lon depending on mount mode + */ + public int pointing_b; + /** + * yaw(deg*100) or alt (in cm) depending on mount mode + */ + public int pointing_c; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_MOUNT_STATUS; + packet.payload.putInt(pointing_a); + packet.payload.putInt(pointing_b); + packet.payload.putInt(pointing_c); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + + return packet; + } + + /** + * Decode a mount_status message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.pointing_a = payload.getInt(); + this.pointing_b = payload.getInt(); + this.pointing_c = payload.getInt(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_status(){ + msgid = MAVLINK_MSG_ID_MOUNT_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_STATUS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "MOUNT_STATUS"); + //Log.d("MAVLINK_MSG_ID_MOUNT_STATUS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_STATUS -"+" pointing_a:"+pointing_a+" pointing_b:"+pointing_b+" pointing_c:"+pointing_c+" target_system:"+target_system+" target_component:"+target_component+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_radio.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_radio.java new file mode 100644 index 0000000000..20ba07d5e2 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_radio.java @@ -0,0 +1,115 @@ + // MESSAGE RADIO PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status generated by radio + */ + public class msg_radio extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_RADIO = 166; + public static final int MAVLINK_MSG_LENGTH = 9; + private static final long serialVersionUID = MAVLINK_MSG_ID_RADIO; + + + /** + * receive errors + */ + public short rxerrors; + /** + * count of error corrected packets + */ + public short fixed; + /** + * local signal strength + */ + public byte rssi; + /** + * remote signal strength + */ + public byte remrssi; + /** + * how full the tx buffer is as a percentage + */ + public byte txbuf; + /** + * background noise level + */ + public byte noise; + /** + * remote background noise level + */ + public byte remnoise; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_RADIO; + packet.payload.putShort(rxerrors); + packet.payload.putShort(fixed); + packet.payload.putByte(rssi); + packet.payload.putByte(remrssi); + packet.payload.putByte(txbuf); + packet.payload.putByte(noise); + packet.payload.putByte(remnoise); + + return packet; + } + + /** + * Decode a radio message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.rxerrors = payload.getShort(); + this.fixed = payload.getShort(); + this.rssi = payload.getByte(); + this.remrssi = payload.getByte(); + this.txbuf = payload.getByte(); + this.noise = payload.getByte(); + this.remnoise = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_radio(){ + msgid = MAVLINK_MSG_ID_RADIO; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_radio(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RADIO; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "RADIO"); + //Log.d("MAVLINK_MSG_ID_RADIO", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RADIO -"+" rxerrors:"+rxerrors+" fixed:"+fixed+" rssi:"+rssi+" remrssi:"+remrssi+" txbuf:"+txbuf+" noise:"+noise+" remnoise:"+remnoise+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java new file mode 100644 index 0000000000..5c7f5cb685 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java @@ -0,0 +1,91 @@ + // MESSAGE RALLY_FETCH_POINT PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid. + */ + public class msg_rally_fetch_point extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_RALLY_FETCH_POINT = 176; + public static final int MAVLINK_MSG_LENGTH = 3; + private static final long serialVersionUID = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + + + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * point index (first point is 0) + */ + public byte idx; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(idx); + + return packet; + } + + /** + * Decode a rally_fetch_point message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.idx = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rally_fetch_point(){ + msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rally_fetch_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "RALLY_FETCH_POINT"); + //Log.d("MAVLINK_MSG_ID_RALLY_FETCH_POINT", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RALLY_FETCH_POINT -"+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_point.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_point.java new file mode 100644 index 0000000000..bcc9c12c35 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rally_point.java @@ -0,0 +1,133 @@ + // MESSAGE RALLY_POINT PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * A rally point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS + */ + public class msg_rally_point extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_RALLY_POINT = 175; + public static final int MAVLINK_MSG_LENGTH = 19; + private static final long serialVersionUID = MAVLINK_MSG_ID_RALLY_POINT; + + + /** + * Latitude of point in degrees * 1E7 + */ + public int lat; + /** + * Longitude of point in degrees * 1E7 + */ + public int lng; + /** + * Transit / loiter altitude in meters relative to home + */ + public short alt; + /** + * Break altitude in meters relative to home + */ + public short break_alt; + /** + * Heading to aim for when landing. In centi-degrees. + */ + public short land_dir; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * point index (first point is 0) + */ + public byte idx; + /** + * total number of points (for sanity checking) + */ + public byte count; + /** + * See RALLY_FLAGS enum for definition of the bitmask. + */ + public byte flags; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_RALLY_POINT; + packet.payload.putInt(lat); + packet.payload.putInt(lng); + packet.payload.putShort(alt); + packet.payload.putShort(break_alt); + packet.payload.putShort(land_dir); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + packet.payload.putByte(idx); + packet.payload.putByte(count); + packet.payload.putByte(flags); + + return packet; + } + + /** + * Decode a rally_point message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.lat = payload.getInt(); + this.lng = payload.getInt(); + this.alt = payload.getShort(); + this.break_alt = payload.getShort(); + this.land_dir = payload.getShort(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + this.idx = payload.getByte(); + this.count = payload.getByte(); + this.flags = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rally_point(){ + msgid = MAVLINK_MSG_ID_RALLY_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rally_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RALLY_POINT; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "RALLY_POINT"); + //Log.d("MAVLINK_MSG_ID_RALLY_POINT", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RALLY_POINT -"+" lat:"+lat+" lng:"+lng+" alt:"+alt+" break_alt:"+break_alt+" land_dir:"+land_dir+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+" flags:"+flags+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_rangefinder.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rangefinder.java new file mode 100644 index 0000000000..4ae733b7a0 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_rangefinder.java @@ -0,0 +1,85 @@ + // MESSAGE RANGEFINDER PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Rangefinder reporting + */ + public class msg_rangefinder extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_RANGEFINDER = 173; + public static final int MAVLINK_MSG_LENGTH = 8; + private static final long serialVersionUID = MAVLINK_MSG_ID_RANGEFINDER; + + + /** + * distance in meters + */ + public float distance; + /** + * raw voltage if available, zero otherwise + */ + public float voltage; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_RANGEFINDER; + packet.payload.putFloat(distance); + packet.payload.putFloat(voltage); + + return packet; + } + + /** + * Decode a rangefinder message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.distance = payload.getFloat(); + this.voltage = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rangefinder(){ + msgid = MAVLINK_MSG_ID_RANGEFINDER; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rangefinder(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RANGEFINDER; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "RANGEFINDER"); + //Log.d("MAVLINK_MSG_ID_RANGEFINDER", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RANGEFINDER -"+" distance:"+distance+" voltage:"+voltage+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_sensor_offsets.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_sensor_offsets.java new file mode 100644 index 0000000000..9b3b7a1528 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_sensor_offsets.java @@ -0,0 +1,146 @@ + // MESSAGE SENSOR_OFFSETS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Offsets and calibrations values for hardware + sensors. This makes it easier to debug the calibration process. + */ + public class msg_sensor_offsets extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_SENSOR_OFFSETS = 150; + public static final int MAVLINK_MSG_LENGTH = 42; + private static final long serialVersionUID = MAVLINK_MSG_ID_SENSOR_OFFSETS; + + + /** + * magnetic declination (radians) + */ + public float mag_declination; + /** + * raw pressure from barometer + */ + public int raw_press; + /** + * raw temperature from barometer + */ + public int raw_temp; + /** + * gyro X calibration + */ + public float gyro_cal_x; + /** + * gyro Y calibration + */ + public float gyro_cal_y; + /** + * gyro Z calibration + */ + public float gyro_cal_z; + /** + * accel X calibration + */ + public float accel_cal_x; + /** + * accel Y calibration + */ + public float accel_cal_y; + /** + * accel Z calibration + */ + public float accel_cal_z; + /** + * magnetometer X offset + */ + public short mag_ofs_x; + /** + * magnetometer Y offset + */ + public short mag_ofs_y; + /** + * magnetometer Z offset + */ + public short mag_ofs_z; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; + packet.payload.putFloat(mag_declination); + packet.payload.putInt(raw_press); + packet.payload.putInt(raw_temp); + packet.payload.putFloat(gyro_cal_x); + packet.payload.putFloat(gyro_cal_y); + packet.payload.putFloat(gyro_cal_z); + packet.payload.putFloat(accel_cal_x); + packet.payload.putFloat(accel_cal_y); + packet.payload.putFloat(accel_cal_z); + packet.payload.putShort(mag_ofs_x); + packet.payload.putShort(mag_ofs_y); + packet.payload.putShort(mag_ofs_z); + + return packet; + } + + /** + * Decode a sensor_offsets message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.mag_declination = payload.getFloat(); + this.raw_press = payload.getInt(); + this.raw_temp = payload.getInt(); + this.gyro_cal_x = payload.getFloat(); + this.gyro_cal_y = payload.getFloat(); + this.gyro_cal_z = payload.getFloat(); + this.accel_cal_x = payload.getFloat(); + this.accel_cal_y = payload.getFloat(); + this.accel_cal_z = payload.getFloat(); + this.mag_ofs_x = payload.getShort(); + this.mag_ofs_y = payload.getShort(); + this.mag_ofs_z = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_sensor_offsets(){ + msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_sensor_offsets(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "SENSOR_OFFSETS"); + //Log.d("MAVLINK_MSG_ID_SENSOR_OFFSETS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SENSOR_OFFSETS -"+" mag_declination:"+mag_declination+" raw_press:"+raw_press+" raw_temp:"+raw_temp+" gyro_cal_x:"+gyro_cal_x+" gyro_cal_y:"+gyro_cal_y+" gyro_cal_z:"+gyro_cal_z+" accel_cal_x:"+accel_cal_x+" accel_cal_y:"+accel_cal_y+" accel_cal_z:"+accel_cal_z+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java new file mode 100644 index 0000000000..396a4600ab --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java @@ -0,0 +1,103 @@ + // MESSAGE SET_MAG_OFFSETS PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Deprecated. Use MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS instead. Set the magnetometer offsets + */ + public class msg_set_mag_offsets extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_SET_MAG_OFFSETS = 151; + public static final int MAVLINK_MSG_LENGTH = 8; + private static final long serialVersionUID = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + + + /** + * magnetometer X offset + */ + public short mag_ofs_x; + /** + * magnetometer Y offset + */ + public short mag_ofs_y; + /** + * magnetometer Z offset + */ + public short mag_ofs_z; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + packet.payload.putShort(mag_ofs_x); + packet.payload.putShort(mag_ofs_y); + packet.payload.putShort(mag_ofs_z); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + + return packet; + } + + /** + * Decode a set_mag_offsets message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.mag_ofs_x = payload.getShort(); + this.mag_ofs_y = payload.getShort(); + this.mag_ofs_z = payload.getShort(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_set_mag_offsets(){ + msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_set_mag_offsets(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "SET_MAG_OFFSETS"); + //Log.d("MAVLINK_MSG_ID_SET_MAG_OFFSETS", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SET_MAG_OFFSETS -"+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+" target_system:"+target_system+" target_component:"+target_component+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_simstate.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_simstate.java new file mode 100644 index 0000000000..f8199ca915 --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_simstate.java @@ -0,0 +1,139 @@ + // MESSAGE SIMSTATE PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Status of simulation environment, if used + */ + public class msg_simstate extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_SIMSTATE = 164; + public static final int MAVLINK_MSG_LENGTH = 44; + private static final long serialVersionUID = MAVLINK_MSG_ID_SIMSTATE; + + + /** + * Roll angle (rad) + */ + public float roll; + /** + * Pitch angle (rad) + */ + public float pitch; + /** + * Yaw angle (rad) + */ + public float yaw; + /** + * X acceleration m/s/s + */ + public float xacc; + /** + * Y acceleration m/s/s + */ + public float yacc; + /** + * Z acceleration m/s/s + */ + public float zacc; + /** + * Angular speed around X axis rad/s + */ + public float xgyro; + /** + * Angular speed around Y axis rad/s + */ + public float ygyro; + /** + * Angular speed around Z axis rad/s + */ + public float zgyro; + /** + * Latitude in degrees * 1E7 + */ + public int lat; + /** + * Longitude in degrees * 1E7 + */ + public int lng; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_SIMSTATE; + packet.payload.putFloat(roll); + packet.payload.putFloat(pitch); + packet.payload.putFloat(yaw); + packet.payload.putFloat(xacc); + packet.payload.putFloat(yacc); + packet.payload.putFloat(zacc); + packet.payload.putFloat(xgyro); + packet.payload.putFloat(ygyro); + packet.payload.putFloat(zgyro); + packet.payload.putInt(lat); + packet.payload.putInt(lng); + + return packet; + } + + /** + * Decode a simstate message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.roll = payload.getFloat(); + this.pitch = payload.getFloat(); + this.yaw = payload.getFloat(); + this.xacc = payload.getFloat(); + this.yacc = payload.getFloat(); + this.zacc = payload.getFloat(); + this.xgyro = payload.getFloat(); + this.ygyro = payload.getFloat(); + this.zgyro = payload.getFloat(); + this.lat = payload.getInt(); + this.lng = payload.getInt(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_simstate(){ + msgid = MAVLINK_MSG_ID_SIMSTATE; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_simstate(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SIMSTATE; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "SIMSTATE"); + //Log.d("MAVLINK_MSG_ID_SIMSTATE", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SIMSTATE -"+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" lat:"+lat+" lng:"+lng+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/ardupilotmega/msg_wind.java b/Mavlink/src/com/MAVLink/ardupilotmega/msg_wind.java new file mode 100644 index 0000000000..5cabb1e3ba --- /dev/null +++ b/Mavlink/src/com/MAVLink/ardupilotmega/msg_wind.java @@ -0,0 +1,91 @@ + // MESSAGE WIND PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Wind estimation + */ + public class msg_wind extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_WIND = 168; + public static final int MAVLINK_MSG_LENGTH = 12; + private static final long serialVersionUID = MAVLINK_MSG_ID_WIND; + + + /** + * wind direction that wind is coming from (degrees) + */ + public float direction; + /** + * wind speed in ground plane (m/s) + */ + public float speed; + /** + * vertical wind speed (m/s) + */ + public float speed_z; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_WIND; + packet.payload.putFloat(direction); + packet.payload.putFloat(speed); + packet.payload.putFloat(speed_z); + + return packet; + } + + /** + * Decode a wind message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.direction = payload.getFloat(); + this.speed = payload.getFloat(); + this.speed_z = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_wind(){ + msgid = MAVLINK_MSG_ID_WIND; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_wind(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_WIND; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "WIND"); + //Log.d("MAVLINK_MSG_ID_WIND", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_WIND -"+" direction:"+direction+" speed:"+speed+" speed_z:"+speed_z+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/CRC.java b/Mavlink/src/com/MAVLink/common/CRC.java new file mode 100644 index 0000000000..5939e4f494 --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/CRC.java @@ -0,0 +1,66 @@ + package com.MAVLink.common; + + /** + * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, + * updated with witch field of the message, and then finished with the message + * id. + * + */ + public class CRC { + private final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 0, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 29, 12, 241, 233, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 211, 108, 32, 185, 84, 0, 0, 124, 119, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 0, 29, 223, 85, 6, 229, 203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 204, 49, 170, 44, 83, 46, 0}; + private static final int CRC_INIT_VALUE = 0xffff; + private int CRCvalue; + + /** + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + * @param crcAccum + * the already accumulated checksum + **/ + public void update_checksum(int data) { + int tmp; + data= data & 0xff; //cast because we want an unsigned type + tmp = data ^ (CRCvalue & 0xff); + tmp ^= (tmp << 4) & 0xff; + CRCvalue = ((CRCvalue >> 8) & 0xff) ^ (tmp << 8) ^ (tmp << 3) + ^ ((tmp >> 4) & 0xf); + } + + /** + * Finish the CRC calculation of a message, by running the CRC with the + * Magic Byte. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ + public void finish_checksum(int msgid) { + update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); + } + + /** + * Initialize the buffer for the X.25 CRC + * + */ + public void start_checksum() { + CRCvalue = CRC_INIT_VALUE; + } + + public int getMSB() { + return ((CRCvalue >> 8) & 0xff); + } + + public int getLSB() { + return (CRCvalue & 0xff); + } + + public CRC() { + start_checksum(); + } + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/msg_attitude.java b/Mavlink/src/com/MAVLink/common/msg_attitude.java new file mode 100644 index 0000000000..914ea9249f --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/msg_attitude.java @@ -0,0 +1,115 @@ + // MESSAGE ATTITUDE PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right). + */ + public class msg_attitude extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ATTITUDE = 30; + public static final int MAVLINK_MSG_LENGTH = 28; + private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE; + + + /** + * Timestamp (milliseconds since system boot) + */ + public int time_boot_ms; + /** + * Roll angle (rad, -pi..+pi) + */ + public float roll; + /** + * Pitch angle (rad, -pi..+pi) + */ + public float pitch; + /** + * Yaw angle (rad, -pi..+pi) + */ + public float yaw; + /** + * Roll angular speed (rad/s) + */ + public float rollspeed; + /** + * Pitch angular speed (rad/s) + */ + public float pitchspeed; + /** + * Yaw angular speed (rad/s) + */ + public float yawspeed; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ATTITUDE; + packet.payload.putInt(time_boot_ms); + packet.payload.putFloat(roll); + packet.payload.putFloat(pitch); + packet.payload.putFloat(yaw); + packet.payload.putFloat(rollspeed); + packet.payload.putFloat(pitchspeed); + packet.payload.putFloat(yawspeed); + + return packet; + } + + /** + * Decode a attitude message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_boot_ms = payload.getInt(); + this.roll = payload.getFloat(); + this.pitch = payload.getFloat(); + this.yaw = payload.getFloat(); + this.rollspeed = payload.getFloat(); + this.pitchspeed = payload.getFloat(); + this.yawspeed = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_attitude(){ + msgid = MAVLINK_MSG_ID_ATTITUDE; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_attitude(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ATTITUDE; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "ATTITUDE"); + //Log.d("MAVLINK_MSG_ID_ATTITUDE", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ATTITUDE -"+" time_boot_ms:"+time_boot_ms+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion.java b/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion.java new file mode 100644 index 0000000000..0b86bd0678 --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion.java @@ -0,0 +1,121 @@ + // MESSAGE ATTITUDE_QUATERNION PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + */ + public class msg_attitude_quaternion extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ATTITUDE_QUATERNION = 31; + public static final int MAVLINK_MSG_LENGTH = 32; + private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + + + /** + * Timestamp (milliseconds since system boot) + */ + public int time_boot_ms; + /** + * Quaternion component 1, w (1 in null-rotation) + */ + public float q1; + /** + * Quaternion component 2, x (0 in null-rotation) + */ + public float q2; + /** + * Quaternion component 3, y (0 in null-rotation) + */ + public float q3; + /** + * Quaternion component 4, z (0 in null-rotation) + */ + public float q4; + /** + * Roll angular speed (rad/s) + */ + public float rollspeed; + /** + * Pitch angular speed (rad/s) + */ + public float pitchspeed; + /** + * Yaw angular speed (rad/s) + */ + public float yawspeed; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + packet.payload.putInt(time_boot_ms); + packet.payload.putFloat(q1); + packet.payload.putFloat(q2); + packet.payload.putFloat(q3); + packet.payload.putFloat(q4); + packet.payload.putFloat(rollspeed); + packet.payload.putFloat(pitchspeed); + packet.payload.putFloat(yawspeed); + + return packet; + } + + /** + * Decode a attitude_quaternion message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_boot_ms = payload.getInt(); + this.q1 = payload.getFloat(); + this.q2 = payload.getFloat(); + this.q3 = payload.getFloat(); + this.q4 = payload.getFloat(); + this.rollspeed = payload.getFloat(); + this.pitchspeed = payload.getFloat(); + this.yawspeed = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_attitude_quaternion(){ + msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_attitude_quaternion(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "ATTITUDE_QUATERNION"); + //Log.d("MAVLINK_MSG_ID_ATTITUDE_QUATERNION", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION -"+" time_boot_ms:"+time_boot_ms+" q1:"+q1+" q2:"+q2+" q3:"+q3+" q4:"+q4+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion_cov.java b/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion_cov.java new file mode 100644 index 0000000000..0e5631a548 --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/msg_attitude_quaternion_cov.java @@ -0,0 +1,117 @@ + // MESSAGE ATTITUDE_QUATERNION_COV PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0). + */ + public class msg_attitude_quaternion_cov extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV = 61; + public static final int MAVLINK_MSG_LENGTH = 68; + private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + + + /** + * Timestamp (milliseconds since system boot) + */ + public int time_boot_ms; + /** + * Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation) + */ + public float q[] = new float[4]; + /** + * Roll angular speed (rad/s) + */ + public float rollspeed; + /** + * Pitch angular speed (rad/s) + */ + public float pitchspeed; + /** + * Yaw angular speed (rad/s) + */ + public float yawspeed; + /** + * Attitude covariance + */ + public float covariance[] = new float[9]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + packet.payload.putInt(time_boot_ms); + for (int i = 0; i < q.length; i++) { + packet.payload.putFloat(q[i]); + } + packet.payload.putFloat(rollspeed); + packet.payload.putFloat(pitchspeed); + packet.payload.putFloat(yawspeed); + for (int i = 0; i < covariance.length; i++) { + packet.payload.putFloat(covariance[i]); + } + + return packet; + } + + /** + * Decode a attitude_quaternion_cov message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_boot_ms = payload.getInt(); + for (int i = 0; i < this.q.length; i++) { + this.q[i] = payload.getFloat(); + } + this.rollspeed = payload.getFloat(); + this.pitchspeed = payload.getFloat(); + this.yawspeed = payload.getFloat(); + for (int i = 0; i < this.covariance.length; i++) { + this.covariance[i] = payload.getFloat(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_attitude_quaternion_cov(){ + msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_attitude_quaternion_cov(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "ATTITUDE_QUATERNION_COV"); + //Log.d("MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV -"+" time_boot_ms:"+time_boot_ms+" q:"+q+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+" covariance:"+covariance+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/msg_attitude_target.java b/Mavlink/src/com/MAVLink/common/msg_attitude_target.java new file mode 100644 index 0000000000..d7828bf76a --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/msg_attitude_target.java @@ -0,0 +1,119 @@ + // MESSAGE ATTITUDE_TARGET PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Set the vehicle attitude and body angular rates. + */ + public class msg_attitude_target extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ATTITUDE_TARGET = 83; + public static final int MAVLINK_MSG_LENGTH = 37; + private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_TARGET; + + + /** + * Timestamp in milliseconds since system boot + */ + public int time_boot_ms; + /** + * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) + */ + public float q[] = new float[4]; + /** + * Body roll rate in radians per second + */ + public float body_roll_rate; + /** + * Body roll rate in radians per second + */ + public float body_pitch_rate; + /** + * Body roll rate in radians per second + */ + public float body_yaw_rate; + /** + * Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust) + */ + public float thrust; + /** + * Mappings: If any of these bits are set, the corresponding input should be ignored: bit 1: body roll rate, bit 2: body pitch rate, bit 3: body yaw rate. bit 4-bit 7: reserved, bit 8: attitude + */ + public byte type_mask; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; + packet.payload.putInt(time_boot_ms); + for (int i = 0; i < q.length; i++) { + packet.payload.putFloat(q[i]); + } + packet.payload.putFloat(body_roll_rate); + packet.payload.putFloat(body_pitch_rate); + packet.payload.putFloat(body_yaw_rate); + packet.payload.putFloat(thrust); + packet.payload.putByte(type_mask); + + return packet; + } + + /** + * Decode a attitude_target message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.time_boot_ms = payload.getInt(); + for (int i = 0; i < this.q.length; i++) { + this.q[i] = payload.getFloat(); + } + this.body_roll_rate = payload.getFloat(); + this.body_pitch_rate = payload.getFloat(); + this.body_yaw_rate = payload.getFloat(); + this.thrust = payload.getFloat(); + this.type_mask = payload.getByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_attitude_target(){ + msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_attitude_target(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "ATTITUDE_TARGET"); + //Log.d("MAVLINK_MSG_ID_ATTITUDE_TARGET", toString()); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ATTITUDE_TARGET -"+" time_boot_ms:"+time_boot_ms+" q:"+q+" body_roll_rate:"+body_roll_rate+" body_pitch_rate:"+body_pitch_rate+" body_yaw_rate:"+body_yaw_rate+" thrust:"+thrust+" type_mask:"+type_mask+""; + } + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/common/msg_auth_key.java b/Mavlink/src/com/MAVLink/common/msg_auth_key.java new file mode 100644 index 0000000000..e7d278c660 --- /dev/null +++ b/Mavlink/src/com/MAVLink/common/msg_auth_key.java @@ -0,0 +1,109 @@ + // MESSAGE AUTH_KEY PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + //import android.util.Log; + + /** + * Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety. + */ + public class msg_auth_key extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AUTH_KEY = 7; + public static final int MAVLINK_MSG_LENGTH = 32; + private static final long serialVersionUID = MAVLINK_MSG_ID_AUTH_KEY; + + + /** + * key + */ + public byte key[] = new byte[32]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AUTH_KEY; + for (int i = 0; i < key.length; i++) { + packet.payload.putByte(key[i]); + } + + return packet; + } + + /** + * Decode a auth_key message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + for (int i = 0; i < this.key.length; i++) { + this.key[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_auth_key(){ + msgid = MAVLINK_MSG_ID_AUTH_KEY; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_auth_key(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AUTH_KEY; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "AUTH_KEY"); + //Log.d("MAVLINK_MSG_ID_AUTH_KEY", toString()); + } + + /** + * Sets the buffer of this message with a string, adds the necessary padding + */ + public void setKey(String str) { + int len = Math.min(str.length(), 32); + for (int i=0; i value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. + */ + public class msg_param_request_read extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20; + public static final int MAVLINK_MSG_LENGTH = 20; + private static final long serialVersionUID = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + + + /** + * Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + */ + public short param_index; + /** + * System ID + */ + public byte target_system; + /** + * Component ID + */ + public byte target_component; + /** + * Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + */ + public byte param_id[] = new byte[16]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(); + packet.len = MAVLINK_MSG_LENGTH; + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + packet.payload.putShort(param_index); + packet.payload.putByte(target_system); + packet.payload.putByte(target_component); + for (int i = 0; i < param_id.length; i++) { + packet.payload.putByte(param_id[i]); + } + + return packet; + } + + /** + * Decode a param_request_read message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + this.param_index = payload.getShort(); + this.target_system = payload.getByte(); + this.target_component = payload.getByte(); + for (int i = 0; i < this.param_id.length; i++) { + this.param_id[i] = payload.getByte(); + } + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_param_request_read(){ + msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_param_request_read(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + unpack(mavLinkPacket.payload); + //Log.d("MAVLink", "PARAM_REQUEST_READ"); + //Log.d("MAVLINK_MSG_ID_PARAM_REQUEST_READ", toString()); + } + + /** + * Sets the buffer of this message with a string, adds the necessary padding + */ + public void setParam_Id(String str) { + int len = Math.min(str.length(), 16); + for (int i=0; i 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_UNLIM = 17; /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_TURNS = 18; /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_TIME = 19; /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_RETURN_TO_LAUNCH = 20; /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_NAV_LAND = 21; /* Land at location |Empty| Empty| Empty| Desired yaw angle.| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_TAKEOFF = 22; /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_ROI = 80; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + public static final int MAV_CMD_NAV_PATHPLANNING = 81; /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + public static final int MAV_CMD_NAV_SPLINE_WAYPOINT = 82; /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + public static final int MAV_CMD_NAV_GUIDED_ENABLE = 92; /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_NAV_LAST = 95; /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_DELAY = 112; /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_CHANGE_ALT = 113; /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ + public static final int MAV_CMD_CONDITION_DISTANCE = 114; /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_YAW = 115; /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_LAST = 159; /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_MODE = 176; /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_JUMP = 177; /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_CHANGE_SPEED = 178; /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_HOME = 179; /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_DO_SET_PARAMETER = 180; /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_RELAY = 181; /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_REPEAT_RELAY = 182; /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_SERVO = 183; /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_REPEAT_SERVO = 184; /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_FLIGHTTERMINATION = 185; /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_RALLY_LAND = 190; /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GO_AROUND = 191; /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_CONTROL_VIDEO = 200; /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_ROI = 201; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + public static final int MAV_CMD_DO_DIGICAM_CONFIGURE = 202; /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ + public static final int MAV_CMD_DO_DIGICAM_CONTROL = 203; /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ + public static final int MAV_CMD_DO_MOUNT_CONFIGURE = 204; /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_MOUNT_CONTROL = 205; /* Mission command to control a camera or antenna mount |pitch or lat in degrees, depending on mount mode.| roll or lon in degrees depending on mount mode| yaw or alt (in meters) depending on mount mode| reserved| reserved| reserved| MAV_MOUNT_MODE enum value| */ + public static final int MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206; /* Mission command to set CAM_TRIGG_DIST for this flight |Camera trigger distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_FENCE_ENABLE = 207; /* Mission command to enable the geofence |enable? (0=disable, 1=enable)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_PARACHUTE = 208; /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_MOTOR_TEST = 209; /* Mission command to perform motor test |motor sequence number (a number from 1 to max number of motors on the vehicle)| throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum)| throttle| timeout (in seconds)| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_INVERTED_FLIGHT = 210; /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220; /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GUIDED_MASTER = 221; /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GUIDED_LIMITS = 222; /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, WGS84) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, WGS84) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_LAST = 240; /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_PREFLIGHT_CALIBRATION = 241; /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Accelerometer calibration: 0: no, 1: yes| Compass/Motor interference calibration: 0: no, 1: yes| Empty| */ + public static final int MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242; /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ + public static final int MAV_CMD_PREFLIGHT_STORAGE = 245; /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */ + public static final int MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246; /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */ + public static final int MAV_CMD_OVERRIDE_GOTO = 252; /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ + public static final int MAV_CMD_MISSION_START = 300; /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ + public static final int MAV_CMD_COMPONENT_ARM_DISARM = 400; /* Arms / Disarms a component |1 to arm, 0 to disarm| */ + public static final int MAV_CMD_START_RX_PAIR = 500; /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ + public static final int MAV_CMD_IMAGE_START_CAPTURE = 2000; /* Start image capture sequence |Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ + public static final int MAV_CMD_IMAGE_STOP_CAPTURE = 2001; /* Stop image capture sequence |Reserved| Reserved| */ + public static final int MAV_CMD_VIDEO_START_CAPTURE = 2500; /* Starts video capture |Camera ID (0 for all cameras), 1 for first, 2 for second, etc.| Frames per second| Resolution in megapixels (0.3 for 640x480, 1.3 for 1280x720, etc)| */ + public static final int MAV_CMD_VIDEO_STOP_CAPTURE = 2501; /* Stop the current video capture |Reserved| Reserved| */ + public static final int MAV_CMD_PANORAMA_CREATE = 2800; /* Create a panorama at the current position |Viewing angle horizontal of the panorama| Viewing angle vertical of panorama| */ + public static final int MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001; /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters WGS84| */ + public static final int MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002; /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + public static final int MAV_CMD_ENUM_END = 30003; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_CMD_ACK.java b/Mavlink/src/com/MAVLink/enums/MAV_CMD_ACK.java new file mode 100644 index 0000000000..034d2aa6aa --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_CMD_ACK.java @@ -0,0 +1,18 @@ + /** ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. + */ + package com.MAVLink.enums; + + public class MAV_CMD_ACK { + public static final int MAV_CMD_ACK_OK = 1; /* Command / mission item is ok. | */ + public static final int MAV_CMD_ACK_ERR_FAIL = 2; /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ + public static final int MAV_CMD_ACK_ERR_ACCESS_DENIED = 3; /* The system is refusing to accept this command from this source / communication partner. | */ + public static final int MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4; /* Command or mission item is not supported, other commands would be accepted. | */ + public static final int MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5; /* The coordinate frame of this command / mission item is not supported. | */ + public static final int MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6; /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ + public static final int MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7; /* The X or latitude value is out of range. | */ + public static final int MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8; /* The Y or longitude value is out of range. | */ + public static final int MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9; /* The Z or altitude value is out of range. | */ + public static final int MAV_CMD_ACK_ENUM_END = 10; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_COMPONENT.java b/Mavlink/src/com/MAVLink/enums/MAV_COMPONENT.java new file mode 100644 index 0000000000..86ec29c691 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_COMPONENT.java @@ -0,0 +1,35 @@ + /** + */ + package com.MAVLink.enums; + + public class MAV_COMPONENT { + public static final int MAV_COMP_ID_ALL = 0; /* | */ + public static final int MAV_COMP_ID_CAMERA = 100; /* | */ + public static final int MAV_COMP_ID_SERVO1 = 140; /* | */ + public static final int MAV_COMP_ID_SERVO2 = 141; /* | */ + public static final int MAV_COMP_ID_SERVO3 = 142; /* | */ + public static final int MAV_COMP_ID_SERVO4 = 143; /* | */ + public static final int MAV_COMP_ID_SERVO5 = 144; /* | */ + public static final int MAV_COMP_ID_SERVO6 = 145; /* | */ + public static final int MAV_COMP_ID_SERVO7 = 146; /* | */ + public static final int MAV_COMP_ID_SERVO8 = 147; /* | */ + public static final int MAV_COMP_ID_SERVO9 = 148; /* | */ + public static final int MAV_COMP_ID_SERVO10 = 149; /* | */ + public static final int MAV_COMP_ID_SERVO11 = 150; /* | */ + public static final int MAV_COMP_ID_SERVO12 = 151; /* | */ + public static final int MAV_COMP_ID_SERVO13 = 152; /* | */ + public static final int MAV_COMP_ID_SERVO14 = 153; /* | */ + public static final int MAV_COMP_ID_MAPPER = 180; /* | */ + public static final int MAV_COMP_ID_MISSIONPLANNER = 190; /* | */ + public static final int MAV_COMP_ID_PATHPLANNER = 195; /* | */ + public static final int MAV_COMP_ID_IMU = 200; /* | */ + public static final int MAV_COMP_ID_IMU_2 = 201; /* | */ + public static final int MAV_COMP_ID_IMU_3 = 202; /* | */ + public static final int MAV_COMP_ID_GPS = 220; /* | */ + public static final int MAV_COMP_ID_UDP_BRIDGE = 240; /* | */ + public static final int MAV_COMP_ID_UART_BRIDGE = 241; /* | */ + public static final int MAV_COMP_ID_SYSTEM_CONTROL = 250; /* | */ + public static final int MAV_COMPONENT_ENUM_END = 251; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_DATA_STREAM.java b/Mavlink/src/com/MAVLink/enums/MAV_DATA_STREAM.java new file mode 100644 index 0000000000..b29770505b --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_DATA_STREAM.java @@ -0,0 +1,20 @@ + /** Data stream IDs. A data stream is not a fixed set of messages, but rather a + recommendation to the autopilot software. Individual autopilots may or may not obey + the recommended messages. + */ + package com.MAVLink.enums; + + public class MAV_DATA_STREAM { + public static final int MAV_DATA_STREAM_ALL = 0; /* Enable all data streams | */ + public static final int MAV_DATA_STREAM_RAW_SENSORS = 1; /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ + public static final int MAV_DATA_STREAM_EXTENDED_STATUS = 2; /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ + public static final int MAV_DATA_STREAM_RC_CHANNELS = 3; /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ + public static final int MAV_DATA_STREAM_RAW_CONTROLLER = 4; /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ + public static final int MAV_DATA_STREAM_POSITION = 6; /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ + public static final int MAV_DATA_STREAM_EXTRA1 = 10; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_EXTRA2 = 11; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_EXTRA3 = 12; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_ENUM_END = 13; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java b/Mavlink/src/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java new file mode 100644 index 0000000000..2fa398f286 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java @@ -0,0 +1,11 @@ + /** Enumeration of distance sensor types + */ + package com.MAVLink.enums; + + public class MAV_DISTANCE_SENSOR { + public static final int MAV_DISTANCE_SENSOR_LASER = 0; /* Laser altimeter, e.g. LightWare SF02/F or PulsedLight units | */ + public static final int MAV_DISTANCE_SENSOR_ULTRASOUND = 1; /* Ultrasound altimeter, e.g. MaxBotix units | */ + public static final int MAV_DISTANCE_SENSOR_ENUM_END = 2; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java b/Mavlink/src/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java new file mode 100644 index 0000000000..fd1672f542 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java @@ -0,0 +1,14 @@ + /** Enumeration of estimator types + */ + package com.MAVLink.enums; + + public class MAV_ESTIMATOR_TYPE { + public static final int MAV_ESTIMATOR_TYPE_NAIVE = 1; /* This is a naive estimator without any real covariance feedback. | */ + public static final int MAV_ESTIMATOR_TYPE_VISION = 2; /* Computer vision based estimate. Might be up to scale. | */ + public static final int MAV_ESTIMATOR_TYPE_VIO = 3; /* Visual-inertial estimate. | */ + public static final int MAV_ESTIMATOR_TYPE_GPS = 4; /* Plain GPS estimate. | */ + public static final int MAV_ESTIMATOR_TYPE_GPS_INS = 5; /* Estimator integrating GPS and inertial sensing. | */ + public static final int MAV_ESTIMATOR_TYPE_ENUM_END = 6; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_FRAME.java b/Mavlink/src/com/MAVLink/enums/MAV_FRAME.java new file mode 100644 index 0000000000..d867613bc8 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_FRAME.java @@ -0,0 +1,18 @@ + /** + */ + package com.MAVLink.enums; + + public class MAV_FRAME { + public static final int MAV_FRAME_GLOBAL = 0; /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ + public static final int MAV_FRAME_LOCAL_NED = 1; /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ + public static final int MAV_FRAME_MISSION = 2; /* NOT a coordinate frame, indicates a mission command. | */ + public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT = 3; /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + public static final int MAV_FRAME_LOCAL_ENU = 4; /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ + public static final int MAV_FRAME_LOCAL_OFFSET_NED = 7; /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ + public static final int MAV_FRAME_BODY_NED = 8; /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ + public static final int MAV_FRAME_BODY_OFFSET_NED = 9; /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ + public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT = 10; /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + public static final int MAV_FRAME_ENUM_END = 11; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_GOTO.java b/Mavlink/src/com/MAVLink/enums/MAV_GOTO.java new file mode 100644 index 0000000000..217def5117 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_GOTO.java @@ -0,0 +1,13 @@ + /** Override command, pauses current mission execution and moves immediately to a position + */ + package com.MAVLink.enums; + + public class MAV_GOTO { + public static final int MAV_GOTO_DO_HOLD = 0; /* Hold at the current position. | */ + public static final int MAV_GOTO_DO_CONTINUE = 1; /* Continue with the next item in mission execution. | */ + public static final int MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2; /* Hold at the current position of the system | */ + public static final int MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3; /* Hold at the position specified in the parameters of the DO_HOLD action | */ + public static final int MAV_GOTO_ENUM_END = 4; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_MISSION_RESULT.java b/Mavlink/src/com/MAVLink/enums/MAV_MISSION_RESULT.java new file mode 100644 index 0000000000..2ca5b3c3ea --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_MISSION_RESULT.java @@ -0,0 +1,24 @@ + /** result in a mavlink mission ack + */ + package com.MAVLink.enums; + + public class MAV_MISSION_RESULT { + public static final int MAV_MISSION_ACCEPTED = 0; /* mission accepted OK | */ + public static final int MAV_MISSION_ERROR = 1; /* generic error / not accepting mission commands at all right now | */ + public static final int MAV_MISSION_UNSUPPORTED_FRAME = 2; /* coordinate frame is not supported | */ + public static final int MAV_MISSION_UNSUPPORTED = 3; /* command is not supported | */ + public static final int MAV_MISSION_NO_SPACE = 4; /* mission item exceeds storage space | */ + public static final int MAV_MISSION_INVALID = 5; /* one of the parameters has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM1 = 6; /* param1 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM2 = 7; /* param2 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM3 = 8; /* param3 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM4 = 9; /* param4 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM5_X = 10; /* x/param5 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM6_Y = 11; /* y/param6 has an invalid value | */ + public static final int MAV_MISSION_INVALID_PARAM7 = 12; /* param7 has an invalid value | */ + public static final int MAV_MISSION_INVALID_SEQUENCE = 13; /* received waypoint out of sequence | */ + public static final int MAV_MISSION_DENIED = 14; /* not accepting any mission commands from this communication partner | */ + public static final int MAV_MISSION_RESULT_ENUM_END = 15; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_MODE.java b/Mavlink/src/com/MAVLink/enums/MAV_MODE.java new file mode 100644 index 0000000000..1277ae5ba0 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_MODE.java @@ -0,0 +1,21 @@ + /** These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it + simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. + */ + package com.MAVLink.enums; + + public class MAV_MODE { + public static final int MAV_MODE_PREFLIGHT = 0; /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ + public static final int MAV_MODE_MANUAL_DISARMED = 64; /* System is allowed to be active, under manual (RC) control, no stabilization | */ + public static final int MAV_MODE_TEST_DISARMED = 66; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + public static final int MAV_MODE_STABILIZE_DISARMED = 80; /* System is allowed to be active, under assisted RC control. | */ + public static final int MAV_MODE_GUIDED_DISARMED = 88; /* System is allowed to be active, under autonomous control, manual setpoint | */ + public static final int MAV_MODE_AUTO_DISARMED = 92; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ + public static final int MAV_MODE_MANUAL_ARMED = 192; /* System is allowed to be active, under manual (RC) control, no stabilization | */ + public static final int MAV_MODE_TEST_ARMED = 194; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + public static final int MAV_MODE_STABILIZE_ARMED = 208; /* System is allowed to be active, under assisted RC control. | */ + public static final int MAV_MODE_GUIDED_ARMED = 216; /* System is allowed to be active, under autonomous control, manual setpoint | */ + public static final int MAV_MODE_AUTO_ARMED = 220; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ + public static final int MAV_MODE_ENUM_END = 221; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG.java b/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG.java new file mode 100644 index 0000000000..ae65aa4ed4 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG.java @@ -0,0 +1,17 @@ + /** These flags encode the MAV mode. + */ + package com.MAVLink.enums; + + public class MAV_MODE_FLAG { + public static final int MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1; /* 0b00000001 Reserved for future use. | */ + public static final int MAV_MODE_FLAG_TEST_ENABLED = 2; /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ + public static final int MAV_MODE_FLAG_AUTO_ENABLED = 4; /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ + public static final int MAV_MODE_FLAG_GUIDED_ENABLED = 8; /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ + public static final int MAV_MODE_FLAG_STABILIZE_ENABLED = 16; /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ + public static final int MAV_MODE_FLAG_HIL_ENABLED = 32; /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ + public static final int MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64; /* 0b01000000 remote control input is enabled. | */ + public static final int MAV_MODE_FLAG_SAFETY_ARMED = 128; /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. | */ + public static final int MAV_MODE_FLAG_ENUM_END = 129; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java b/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java new file mode 100644 index 0000000000..9db492a8cd --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java @@ -0,0 +1,17 @@ + /** These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. + */ + package com.MAVLink.enums; + + public class MAV_MODE_FLAG_DECODE_POSITION { + public static final int MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1; /* Eighth bit: 00000001 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_TEST = 2; /* Seventh bit: 00000010 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4; /* Sixt bit: 00000100 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8; /* Fifth bit: 00001000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16; /* Fourth bit: 00010000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_HIL = 32; /* Third bit: 00100000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64; /* Second bit: 01000000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128; /* First bit: 10000000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_MOUNT_MODE.java b/Mavlink/src/com/MAVLink/enums/MAV_MOUNT_MODE.java new file mode 100644 index 0000000000..f86bf4c5e2 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_MOUNT_MODE.java @@ -0,0 +1,14 @@ + /** Enumeration of possible mount operation modes + */ + package com.MAVLink.enums; + + public class MAV_MOUNT_MODE { + public static final int MAV_MOUNT_MODE_RETRACT = 0; /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ + public static final int MAV_MOUNT_MODE_NEUTRAL = 1; /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ + public static final int MAV_MOUNT_MODE_MAVLINK_TARGETING = 2; /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ + public static final int MAV_MOUNT_MODE_RC_TARGETING = 3; /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ + public static final int MAV_MOUNT_MODE_GPS_POINT = 4; /* Load neutral position and start to point to Lat,Lon,Alt | */ + public static final int MAV_MOUNT_MODE_ENUM_END = 5; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_PARAM_TYPE.java b/Mavlink/src/com/MAVLink/enums/MAV_PARAM_TYPE.java new file mode 100644 index 0000000000..145848c8f9 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_PARAM_TYPE.java @@ -0,0 +1,19 @@ + /** Specifies the datatype of a MAVLink parameter. + */ + package com.MAVLink.enums; + + public class MAV_PARAM_TYPE { + public static final int MAV_PARAM_TYPE_UINT8 = 1; /* 8-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT8 = 2; /* 8-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT16 = 3; /* 16-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT16 = 4; /* 16-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT32 = 5; /* 32-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT32 = 6; /* 32-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT64 = 7; /* 64-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT64 = 8; /* 64-bit signed integer | */ + public static final int MAV_PARAM_TYPE_REAL32 = 9; /* 32-bit floating-point | */ + public static final int MAV_PARAM_TYPE_REAL64 = 10; /* 64-bit floating-point | */ + public static final int MAV_PARAM_TYPE_ENUM_END = 11; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_POWER_STATUS.java b/Mavlink/src/com/MAVLink/enums/MAV_POWER_STATUS.java new file mode 100644 index 0000000000..c4f0ceebff --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_POWER_STATUS.java @@ -0,0 +1,15 @@ + /** Power supply status flags (bitmask) + */ + package com.MAVLink.enums; + + public class MAV_POWER_STATUS { + public static final int MAV_POWER_STATUS_BRICK_VALID = 1; /* main brick power supply valid | */ + public static final int MAV_POWER_STATUS_SERVO_VALID = 2; /* main servo power supply valid for FMU | */ + public static final int MAV_POWER_STATUS_USB_CONNECTED = 4; /* USB power is connected | */ + public static final int MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8; /* peripheral supply is in over-current state | */ + public static final int MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16; /* hi-power peripheral supply is in over-current state | */ + public static final int MAV_POWER_STATUS_CHANGED = 32; /* Power status has changed since boot | */ + public static final int MAV_POWER_STATUS_ENUM_END = 33; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java b/Mavlink/src/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java new file mode 100644 index 0000000000..e7ed7298aa --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java @@ -0,0 +1,19 @@ + /** Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. + */ + package com.MAVLink.enums; + + public class MAV_PROTOCOL_CAPABILITY { + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1; /* Autopilot supports MISSION float message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2; /* Autopilot supports the new param float message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4; /* Autopilot supports MISSION_INT scaled integer message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8; /* Autopilot supports COMMAND_INT scaled integer message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16; /* Autopilot supports the new param union message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_FTP = 32; /* Autopilot supports the new param union message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64; /* Autopilot supports commanding attitude offboard. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128; /* Autopilot supports commanding position and velocity targets in local NED frame. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256; /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ + public static final int MAV_PROTOCOL_CAPABILITY_TERRAIN = 512; /* Autopilot supports terrain protocol / data handling. | */ + public static final int MAV_PROTOCOL_CAPABILITY_ENUM_END = 513; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_RESULT.java b/Mavlink/src/com/MAVLink/enums/MAV_RESULT.java new file mode 100644 index 0000000000..981b262f3f --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_RESULT.java @@ -0,0 +1,14 @@ + /** result from a mavlink command + */ + package com.MAVLink.enums; + + public class MAV_RESULT { + public static final int MAV_RESULT_ACCEPTED = 0; /* Command ACCEPTED and EXECUTED | */ + public static final int MAV_RESULT_TEMPORARILY_REJECTED = 1; /* Command TEMPORARY REJECTED/DENIED | */ + public static final int MAV_RESULT_DENIED = 2; /* Command PERMANENTLY DENIED | */ + public static final int MAV_RESULT_UNSUPPORTED = 3; /* Command UNKNOWN/UNSUPPORTED | */ + public static final int MAV_RESULT_FAILED = 4; /* Command executed, but failed | */ + public static final int MAV_RESULT_ENUM_END = 5; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_ROI.java b/Mavlink/src/com/MAVLink/enums/MAV_ROI.java new file mode 100644 index 0000000000..6c04dcd0f1 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_ROI.java @@ -0,0 +1,16 @@ + /** The ROI (region of interest) for the vehicle. This can be + be used by the vehicle for camera/vehicle attitude alignment (see + MAV_CMD_NAV_ROI). + */ + package com.MAVLink.enums; + + public class MAV_ROI { + public static final int MAV_ROI_NONE = 0; /* No region of interest. | */ + public static final int MAV_ROI_WPNEXT = 1; /* Point toward next MISSION. | */ + public static final int MAV_ROI_WPINDEX = 2; /* Point toward given MISSION. | */ + public static final int MAV_ROI_LOCATION = 3; /* Point toward fixed location. | */ + public static final int MAV_ROI_TARGET = 4; /* Point toward of given id. | */ + public static final int MAV_ROI_ENUM_END = 5; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_SEVERITY.java b/Mavlink/src/com/MAVLink/enums/MAV_SEVERITY.java new file mode 100644 index 0000000000..88489325d9 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_SEVERITY.java @@ -0,0 +1,17 @@ + /** Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. + */ + package com.MAVLink.enums; + + public class MAV_SEVERITY { + public static final int MAV_SEVERITY_EMERGENCY = 0; /* System is unusable. This is a "panic" condition. | */ + public static final int MAV_SEVERITY_ALERT = 1; /* Action should be taken immediately. Indicates error in non-critical systems. | */ + public static final int MAV_SEVERITY_CRITICAL = 2; /* Action must be taken immediately. Indicates failure in a primary system. | */ + public static final int MAV_SEVERITY_ERROR = 3; /* Indicates an error in secondary/redundant systems. | */ + public static final int MAV_SEVERITY_WARNING = 4; /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ + public static final int MAV_SEVERITY_NOTICE = 5; /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ + public static final int MAV_SEVERITY_INFO = 6; /* Normal operational messages. Useful for logging. No action is required for these messages. | */ + public static final int MAV_SEVERITY_DEBUG = 7; /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ + public static final int MAV_SEVERITY_ENUM_END = 8; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_STATE.java b/Mavlink/src/com/MAVLink/enums/MAV_STATE.java new file mode 100644 index 0000000000..40c5fca0c5 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_STATE.java @@ -0,0 +1,17 @@ + /** + */ + package com.MAVLink.enums; + + public class MAV_STATE { + public static final int MAV_STATE_UNINIT = 0; /* Uninitialized system, state is unknown. | */ + public static final int MAV_STATE_BOOT = 1; /* System is booting up. | */ + public static final int MAV_STATE_CALIBRATING = 2; /* System is calibrating and not flight-ready. | */ + public static final int MAV_STATE_STANDBY = 3; /* System is grounded and on standby. It can be launched any time. | */ + public static final int MAV_STATE_ACTIVE = 4; /* System is active and might be already airborne. Motors are engaged. | */ + public static final int MAV_STATE_CRITICAL = 5; /* System is in a non-normal flight mode. It can however still navigate. | */ + public static final int MAV_STATE_EMERGENCY = 6; /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ + public static final int MAV_STATE_POWEROFF = 7; /* System just initialized its power-down sequence, will shut down now. | */ + public static final int MAV_STATE_ENUM_END = 8; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java b/Mavlink/src/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java new file mode 100644 index 0000000000..9cde757b81 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java @@ -0,0 +1,32 @@ + /** These encode the sensors whose status is sent as part of the SYS_STATUS message. + */ + package com.MAVLink.enums; + + public class MAV_SYS_STATUS_SENSOR { + public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO = 1; /* 0x01 3D gyro | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2; /* 0x02 3D accelerometer | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_MAG = 4; /* 0x04 3D magnetometer | */ + public static final int MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8; /* 0x08 absolute pressure | */ + public static final int MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16; /* 0x10 differential pressure | */ + public static final int MAV_SYS_STATUS_SENSOR_GPS = 32; /* 0x20 GPS | */ + public static final int MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64; /* 0x40 optical flow | */ + public static final int MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128; /* 0x80 computer vision position | */ + public static final int MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256; /* 0x100 laser based position | */ + public static final int MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512; /* 0x200 external ground truth (Vicon or Leica) | */ + public static final int MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024; /* 0x400 3D angular rate control | */ + public static final int MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048; /* 0x800 attitude stabilization | */ + public static final int MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096; /* 0x1000 yaw position | */ + public static final int MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192; /* 0x2000 z/altitude control | */ + public static final int MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384; /* 0x4000 x/y position control | */ + public static final int MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768; /* 0x8000 motor outputs / control | */ + public static final int MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536; /* 0x10000 rc receiver | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072; /* 0x20000 2nd 3D gyro | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144; /* 0x40000 2nd 3D accelerometer | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288; /* 0x80000 2nd 3D magnetometer | */ + public static final int MAV_SYS_STATUS_GEOFENCE = 1048576; /* 0x100000 geofence | */ + public static final int MAV_SYS_STATUS_AHRS = 2097152; /* 0x200000 AHRS subsystem health | */ + public static final int MAV_SYS_STATUS_TERRAIN = 4194304; /* 0x400000 Terrain subsystem health | */ + public static final int MAV_SYS_STATUS_SENSOR_ENUM_END = 4194305; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MAV_TYPE.java b/Mavlink/src/com/MAVLink/enums/MAV_TYPE.java new file mode 100644 index 0000000000..2e8adf0ab4 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MAV_TYPE.java @@ -0,0 +1,28 @@ + /** + */ + package com.MAVLink.enums; + + public class MAV_TYPE { + public static final int MAV_TYPE_GENERIC = 0; /* Generic micro air vehicle. | */ + public static final int MAV_TYPE_FIXED_WING = 1; /* Fixed wing aircraft. | */ + public static final int MAV_TYPE_QUADROTOR = 2; /* Quadrotor | */ + public static final int MAV_TYPE_COAXIAL = 3; /* Coaxial helicopter | */ + public static final int MAV_TYPE_HELICOPTER = 4; /* Normal helicopter with tail rotor. | */ + public static final int MAV_TYPE_ANTENNA_TRACKER = 5; /* Ground installation | */ + public static final int MAV_TYPE_GCS = 6; /* Operator control unit / ground control station | */ + public static final int MAV_TYPE_AIRSHIP = 7; /* Airship, controlled | */ + public static final int MAV_TYPE_FREE_BALLOON = 8; /* Free balloon, uncontrolled | */ + public static final int MAV_TYPE_ROCKET = 9; /* Rocket | */ + public static final int MAV_TYPE_GROUND_ROVER = 10; /* Ground rover | */ + public static final int MAV_TYPE_SURFACE_BOAT = 11; /* Surface vessel, boat, ship | */ + public static final int MAV_TYPE_SUBMARINE = 12; /* Submarine | */ + public static final int MAV_TYPE_HEXAROTOR = 13; /* Hexarotor | */ + public static final int MAV_TYPE_OCTOROTOR = 14; /* Octorotor | */ + public static final int MAV_TYPE_TRICOPTER = 15; /* Octorotor | */ + public static final int MAV_TYPE_FLAPPING_WING = 16; /* Flapping wing | */ + public static final int MAV_TYPE_KITE = 17; /* Flapping wing | */ + public static final int MAV_TYPE_ONBOARD_CONTROLLER = 18; /* Onboard companion controller | */ + public static final int MAV_TYPE_ENUM_END = 19; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java b/Mavlink/src/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java new file mode 100644 index 0000000000..457c92de96 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java @@ -0,0 +1,12 @@ + /** + */ + package com.MAVLink.enums; + + public class MOTOR_TEST_THROTTLE_TYPE { + public static final int MOTOR_TEST_THROTTLE_PERCENT = 0; /* throttle as a percentage from 0 ~ 100 | */ + public static final int MOTOR_TEST_THROTTLE_PWM = 1; /* throttle as an absolute PWM value (normally in range of 1000~2000) | */ + public static final int MOTOR_TEST_THROTTLE_PILOT = 2; /* throttle pass-through from pilot's transmitter | */ + public static final int MOTOR_TEST_THROTTLE_TYPE_ENUM_END = 3; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/PARACHUTE_ACTION.java b/Mavlink/src/com/MAVLink/enums/PARACHUTE_ACTION.java new file mode 100644 index 0000000000..54f67b5bbd --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/PARACHUTE_ACTION.java @@ -0,0 +1,12 @@ + /** + */ + package com.MAVLink.enums; + + public class PARACHUTE_ACTION { + public static final int PARACHUTE_DISABLE = 0; /* Disable parachute release | */ + public static final int PARACHUTE_ENABLE = 1; /* Enable parachute release | */ + public static final int PARACHUTE_RELEASE = 2; /* Release parachute | */ + public static final int PARACHUTE_ACTION_ENUM_END = 3; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/RALLY_FLAGS.java b/Mavlink/src/com/MAVLink/enums/RALLY_FLAGS.java new file mode 100644 index 0000000000..c105d02da2 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/RALLY_FLAGS.java @@ -0,0 +1,11 @@ + /** Flags in RALLY_POINT message + */ + package com.MAVLink.enums; + + public class RALLY_FLAGS { + public static final int FAVORABLE_WIND = 1; /* Flag set when requiring favorable winds for landing. | */ + public static final int LAND_IMMEDIATELY = 2; /* Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. | */ + public static final int RALLY_FLAGS_ENUM_END = 3; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_DEV.java b/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_DEV.java new file mode 100644 index 0000000000..6c9eb24856 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_DEV.java @@ -0,0 +1,13 @@ + /** SERIAL_CONTROL device types + */ + package com.MAVLink.enums; + + public class SERIAL_CONTROL_DEV { + public static final int SERIAL_CONTROL_DEV_TELEM1 = 0; /* First telemetry port | */ + public static final int SERIAL_CONTROL_DEV_TELEM2 = 1; /* Second telemetry port | */ + public static final int SERIAL_CONTROL_DEV_GPS1 = 2; /* First GPS port | */ + public static final int SERIAL_CONTROL_DEV_GPS2 = 3; /* Second GPS port | */ + public static final int SERIAL_CONTROL_DEV_ENUM_END = 4; /* | */ + + } + \ No newline at end of file diff --git a/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java b/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java new file mode 100644 index 0000000000..9d2f39f976 --- /dev/null +++ b/Mavlink/src/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java @@ -0,0 +1,14 @@ + /** SERIAL_CONTROL flags (bitmask) + */ + package com.MAVLink.enums; + + public class SERIAL_CONTROL_FLAG { + public static final int SERIAL_CONTROL_FLAG_REPLY = 1; /* Set if this is a reply | */ + public static final int SERIAL_CONTROL_FLAG_RESPOND = 2; /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ + public static final int SERIAL_CONTROL_FLAG_EXCLUSIVE = 4; /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ + public static final int SERIAL_CONTROL_FLAG_BLOCKING = 8; /* Block on writes to the serial port | */ + public static final int SERIAL_CONTROL_FLAG_MULTI = 16; /* Send multiple replies until port is drained | */ + public static final int SERIAL_CONTROL_FLAG_ENUM_END = 17; /* | */ + + } + \ No newline at end of file