This commit is contained in:
cuijingzhou 2025-07-11 18:21:26 +08:00
commit 816b847cf4
557 changed files with 64143 additions and 0 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

3
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

1
.idea/.name generated Normal file
View File

@ -0,0 +1 @@
LongYi-GroundStation

6
.idea/AndroidProjectSystem.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

6
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

18
.idea/deploymentTargetSelector.xml generated Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-06-27T06:06:37.137599900Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=235cb949" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>
</project>

3
.idea/dictionaries/11504.xml generated Normal file
View File

@ -0,0 +1,3 @@
<component name="ProjectDictionaryState">
<dictionary name="11504" />
</component>

19
.idea/gradle.xml generated Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

10
.idea/migrations.xml generated Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

16
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,16 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="VisualizationToolProject">
<option name="state">
<ProjectState>
<option name="scale" value="0.26853027343749997" />
</ProjectState>
</option>
</component>
</project>

17
.idea/runConfigurations.xml generated Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

74
app/build.gradle Normal file
View File

@ -0,0 +1,74 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}
android {
namespace 'com.example.longyi_groundstation'
compileSdk 35
defaultConfig {
applicationId "com.example.longyi_groundstation"
minSdk 24
targetSdk 35
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
//SO库架构so
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
kotlinOptions {
jvmTarget = '11'
}
}
dependencies {
implementation files(fileTree(include: ['*.jar'], dir: 'libs'))
implementation libs.appcompat
implementation libs.material
implementation libs.activity
implementation libs.constraintlayout
implementation libs.core.ktx
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core
implementation 'io.dronefleet.mavlink:mavlink:1.1.11'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'io.github.xmaihh:serialport:2.1.1' //
implementation 'com.licheedev:android-serialport:2.1.5'
implementation 'com.google.android.flexbox:flexbox:3.0.0'//
implementation files("libs/fpvplayer-v3.2.2.aar")
implementation files("libs/sky-ijkplayer-v1.1.aar")
implementation files("libs/rcsdk-v1.2.1.aar")
implementation files("libs/isoparser-1.1.9.jar")//H264封装为MP4
implementation files('libs/AIKit.aar')
// implementation 'com.github.licheedev.Android-SerialPort-API:serialport:2.0.0'
}

BIN
app/debug/app-debug.apk Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.example.longyi_groundstation",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-debug.apk"
}
],
"elementType": "File",
"minSdkVersionForDexing": 24
}

BIN
app/libs/AIKit.aar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

10
app/libs/build.properties Normal file
View File

@ -0,0 +1,10 @@
iid=11738
sid=3590694
bid=1406899
version=13.08.0.10009104
time=2025-05-09 16:22:08
FEATURE_LOCATION=1
FEATURE_ROUTE_OVERLAY=1
FEATURE_MVT=1
FEATURE_3DTiles=1
FEATURE_GLTF=1

Binary file not shown.

Binary file not shown.

BIN
app/libs/rcsdk-v1.2.1.aar Normal file

Binary file not shown.

Binary file not shown.

21
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,26 @@
package com.example.longyi_groundstation;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.longyi_groundstation", appContext.getPackageName());
}
}

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- 地图SDK包含其搜索功能需要的基础权限 -->
<!-- 允许访问网络,必选权限 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 允许获取粗略位置若用GPS实现定位小蓝点功能则必选 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 允许获取网络状态用于网络定位若无gps但仍需实现定位小蓝点功能则此权限必选 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 允许获取wifi网络信息用于网络定位若无gps但仍需实现定位小蓝点功能则此权限必选 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许获取wifi状态改变用于网络定位若无gps但仍需实现定位小蓝点功能则此权限必选 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许写设备缓存,用于问题排查 -->
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> <!-- 高精度定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".MyApp"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/logo"
android:label="LYUAV"
android:roundIcon="@mipmap/logo"
android:supportsRtl="true"
android:theme="@style/Theme.LongYiGroundStation"
tools:targetApi="31">
<activity
android:name=".Funcation.Activity.FuncationActivity"
android:exported="true" >
</activity>
<activity
android:name=".Main.Setting.Activity.SettingActivity"
android:exported="false" />
<activity
android:name=".MainActivity2"
android:exported="true"></activity>
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="9df7f5853e1af0e8d07afb0b94a57d51"
tools:ignore="ExtraText" />
<activity
android:name=".Login.Activity.LoginActivity"
android:exported="true"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main.Activity.MainActivity"
android:exported="true"
android:screenOrientation="landscape" />
<service android:name=".Main.Service.MyBoundService" />
</application>
</manifest>

View File

@ -0,0 +1,82 @@
package com.example.longyi_groundstation.Funcation.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.example.longyi_groundstation.Funcation.Void.AllView;
import com.example.longyi_groundstation.Main.Activity.MainActivity;
import com.example.longyi_groundstation.Main.Service.MyBoundService;
import com.example.longyi_groundstation.R;
public class FuncationActivity extends AppCompatActivity {
private AllView allView;
private Intent intent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_funcation);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
initData();
initView();
initOnClick();
}
/**
* 方法初始化数据
*
* @cuijingzhou
*/
private void initData() {
intent = getIntent();
}
/**
* 方法初始化视图
*
* @cuijingzhou
*/
private void initView() {
allView = new AllView(this);
}
/**
* 方法初始化点击事件
*
* @cuijingzhou
*/
private void initOnClick() {
allView.ll_work.setOnClickListener(v -> {
// 绑定服务
Intent intents = new Intent(this, MainActivity.class);
intents.putExtra("type", intent.getIntExtra("type", 0));
if (intent.getIntExtra("type", 0) != 0) {
intents.putExtra("port", intent.getStringExtra("port"));
}
startActivity(intents);
});
}
}

View File

@ -0,0 +1,33 @@
package com.example.longyi_groundstation.Funcation.Void;
import android.app.Activity;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.MapView;
import com.example.longyi_groundstation.Main.View.AttitudeIndicatorView;
import com.example.longyi_groundstation.R;
import com.skydroid.fpvplayer.FPVWidget;
public class AllView {
public Activity activity;
public LinearLayout ll_work;
public AllView(Activity activity) {
this.activity = activity;
init();
}
public void init() {
ll_work = activity.findViewById(R.id.ll_work);
}
}

View File

@ -0,0 +1,37 @@
package com.example.longyi_groundstation.Funcation.Void;
import android.content.Context;
import android.content.SharedPreferences;
public class SharedPrefsHelper {
private static final String PREFS_NAME = "AccountPrefs";
private static final String KEY_USERNAME = "username";
private static final String KEY_PASSWORD = "password";
// 保存账号密码
public static void saveCredentials(Context context, String username, String password) {
SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(KEY_USERNAME, username);
editor.putString(KEY_PASSWORD, password);
editor.apply(); // 异步提交
}
// 获取保存的账号
public static String getUsername(Context context) {
SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
return sharedPref.getString(KEY_USERNAME, null);
}
// 获取保存的密码
public static String getPassword(Context context) {
SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
return sharedPref.getString(KEY_PASSWORD, null);
}
// 清除存储的账号密码
public static void clearCredentials(Context context) {
SharedPreferences sharedPref = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
sharedPref.edit().clear().apply();
}
}

View File

@ -0,0 +1,113 @@
package com.example.longyi_groundstation.Login.Activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.example.longyi_groundstation.Funcation.Activity.FuncationActivity;
import com.example.longyi_groundstation.Login.Void.AllView;
import com.example.longyi_groundstation.Main.Activity.MainActivity;
import com.example.longyi_groundstation.R;
public class LoginActivity extends AppCompatActivity {
private AllView allView;
private int type = 0;//0=串口 1=UDP
private boolean isSelect = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_login);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
initData();
initView();
initOnClick();
}
/**
* 方法初始化数据
*
* @cuijingzhou
*/
private void initData() {
}
/**
* 方法初始化视图
*
* @cuijingzhou
*/
private void initView() {
//所有组件
allView = new AllView(this);
}
/**
* 方法初始化点击事件
*
* @cuijingzhou
*/
@SuppressLint("NonConstantResourceId")
private void initOnClick() {
allView.btn_login.setOnClickListener(v -> {
//todo 没有用
if (allView.et_username.getText().toString().equals("admin1")){
type = 1;
}
Intent intent = new Intent(LoginActivity.this, FuncationActivity.class);
intent.putExtra("type", type);
if (type != 0){
intent.putExtra("port", "14551");
}
startActivity(intent);
finish();
});
//选择是否记住密码
allView.ll_select_password.setOnClickListener(v -> {
if (isSelect){
isSelect = false;
allView.iv_select.setImageResource(R.mipmap.icon_select_no);
}else {
isSelect = true;
allView.iv_select.setImageResource(R.mipmap.icon_select_yes);
}
});
// allView.rb_bt1.setOnClickListener(v -> {
// type = 0;
// });
// allView.rb_bt2.setOnClickListener(v -> {
// type = 1;
// });
}
@Override
protected void onDestroy() {
// allView.rg_layout.setOnCheckedChangeListener(null);
super.onDestroy();
}
}

View File

@ -0,0 +1,6 @@
package com.example.longyi_groundstation.Login.Base;
public class User {
}

View File

@ -0,0 +1,53 @@
package com.example.longyi_groundstation.Login.Void;
import android.app.Activity;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.amap.api.maps.MapView;
import com.example.longyi_groundstation.Main.View.AttitudeIndicatorView;
import com.example.longyi_groundstation.R;
import com.skydroid.fpvplayer.FPVWidget;
public class AllView {
public RelativeLayout main;
public Activity activity;
public EditText et_username;
public EditText et_password;
public TextView btn_login;
public TextView tv_restart;
// public RadioGroup rg_layout;
// public RadioButton rb_bt1,rb_bt2;
public LinearLayout ll_select_password;
public ImageView iv_select;
public AllView(Activity activity) {
this.activity = activity;
init();
}
public void init() {
et_username = activity.findViewById(R.id.et_username);
et_password = activity.findViewById(R.id.et_password);
btn_login = activity.findViewById(R.id.btn_login);
// tv_restart = activity.findViewById(R.id.tv_restart);
main = activity.findViewById(R.id.main);
// rg_layout = activity.findViewById(R.id.rg_layout);
// rb_bt1 = activity.findViewById(R.id.rb_bt1);
// rb_bt2 = activity.findViewById(R.id.rb_bt2);
// et_port = activity.findViewById(R.id.et_port);
ll_select_password = activity.findViewById(R.id.ll_select_password);
iv_select = activity.findViewById(R.id.iv_select);
}
}

View File

@ -0,0 +1,749 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink;
import static com.example.longyi_groundstation.MAVLink.common.msg_local_position_ned.*;
import static com.example.longyi_groundstation.MAVLink.common.msg_mission_item_reached.*;
import static com.example.longyi_groundstation.MAVLink.common.msg_servo_output_raw.*;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.common.*;
import com.example.longyi_groundstation.MAVLink.minimal.msg_heartbeat;
import com.example.longyi_groundstation.MAVLink.minimal.msg_protocol_version;
import com.example.longyi_groundstation.MAVLink.paparazzi.CRC;
import com.example.longyi_groundstation.MAVLink.paparazzi.msg_script_count;
import com.example.longyi_groundstation.MAVLink.paparazzi.msg_script_current;
import com.example.longyi_groundstation.MAVLink.paparazzi.msg_script_item;
import com.example.longyi_groundstation.MAVLink.paparazzi.msg_script_request;
import com.example.longyi_groundstation.MAVLink.paparazzi.msg_script_request_list;
import java.io.Serializable;
/**
* 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.
*
* MAVLink 1 Packet Format
*
* Byte Index Content Value Explanation
* 0 Packet start sign v1.0: 0xFE Indicates the start of a new packet. (v0.9: 0x55; v1.0: 0xFE; v2.0 0xFD)
* 1 Payload length 0 - 255 Indicates length of the following payload.
* 2 Packet sequence 0 - 255 Each component counts up its 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) CRC16/MCRF4XX 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 CRC16/MCRF4XX. 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
*
*
* MAVLink 2 Packet Format
*
* Byte Index Content Value Explanation
* 0 Packet start sign v2.0: 0xFD Indicates the start of a new packet. (v0.9: 0x55; v1.0: 0xFE; v2.0 0xFD)
* 1 Payload length 0 - 255 Indicates length of the following payload.
* 2 Incompatible Flags 0 - 255 Flags that must be understood
* 3 Compatible Flags 0 - 255 Flags that can be ignored if not understood
* 4 Packet sequence 0 - 255 Each component counts up its send sequence. Allows to detect packet loss
* 5 System ID 1 - 255 ID of the SENDING system. Allows to differentiate different MAVs on the same network.
* 6 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.
* 7 to 9 Message ID 0 - 16777216 ID of the message - the id defines what the payload means and how it should be correctly decoded.
* 10 Target System ID 1 - 255 (OPTIONAL) ID of the TARGET system. Only used for point-to-point mode
* 11 Target Component ID 0 - 255 (OPTIONAL) ID of the TARGET component. Only used for point-to-point mode
* 12 to (n+12) Payload 0 - 255 Data of the message, depends on the message id.
* (n+13)to(n+14) Checksum (low byte, high byte) CRC16/MCRF4XX 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).
* (n+15)to(n+27) Signature (typeid, timestamp, sha256) (OPTIONAL) Signature which allows ensuring that the link is tamper-proof; 13 bytes containing typeid (1 byte), timestamp (6 bytes), and last 6 bytes of SHA256 hash
*
* The signature is a combination of a typeid, timestamp, and SHA256 hash.
* OPTIONAL fields mean that, if they are not used, they do not exist in the MAVLink frame at all. Typically target sysid and target compid are not used, and signature is only used if signing is set up between both ends.
*
* @see <a href="https://mavlink.io">mavlink.io</a> for more documentation on the MAVLink protocol
*/
public class MAVLinkPacket implements Serializable {
private static final long serialVersionUID = 2095947771227815314L;
public static final int MAVLINK_STX_MAVLINK1 = 0xFE; // 254
public static final int MAVLINK_STX_MAVLINK2 = 0xFD; // 253
public static final int MAVLINK1_HEADER_LEN = 6;
public static final int MAVLINK2_HEADER_LEN = 10;
public static final int MAVLINK1_NONPAYLOAD_LEN = MAVLINK1_HEADER_LEN + 2;
public static final int MAVLINK2_NONPAYLOAD_LEN = MAVLINK2_HEADER_LEN + 2;
static final boolean V = false;
static void logv(String str) {
if(V) System.out.println(String.format("MAVLinkPacket: %s", str));
}
/**
* Payload length
*/
public final 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;
/**
* CRC-16/MCRF4XX hash, excluding packet start sign, so bytes 1..(n+HEADER-LENGTH)
* 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;
// MAVLink 2.0 fields
/**
* Flag to indicate which MAVLink version this packet is
*/
public boolean isMavlink2;
/**
* Flags that must be understood
* 标志
*/
public int incompatFlags;
/**
* Flags that can be ignored if not understood
*/
public int compatFlags;
public MAVLinkPacket(int payloadLength) {
this(payloadLength, false);
}
public MAVLinkPacket(final int payloadLength, final boolean isMavlink2) {
len = payloadLength;
payload = new MAVLinkPayload();
this.isMavlink2 = isMavlink2;
}
/**
* Check if the size of the Payload is equal to the "len" byte
*/
public boolean payloadIsFilled() {
return payload.size() >= len;
}
/**
* Update CRC for this packet.
* @return boolean True if the CRC was successfully updated. Otherwise false
*/
public boolean generateCRC(final int payloadSize) {
if (crc == null) {
crc = new CRC();
} else {
crc.start_checksum();
}
if (isMavlink2) {
crc.update_checksum(payloadSize);
crc.update_checksum(incompatFlags);
crc.update_checksum(compatFlags);
crc.update_checksum(seq);
crc.update_checksum(sysid);
crc.update_checksum(compid);
crc.update_checksum(msgid);
crc.update_checksum(msgid >>> 8);
crc.update_checksum(msgid >>> 16);
} else {
crc.update_checksum(payloadSize);
crc.update_checksum(seq);
crc.update_checksum(sysid);
crc.update_checksum(compid);
crc.update_checksum(msgid);
}
payload.resetIndex();
for (int i = 0; i < payloadSize; i++) {
crc.update_checksum(payload.getByte());
}
return crc.finish_checksum(msgid);
}
/**
* Return length of actual data after trimming zeros at the end.
* @param payload
* @return minimum length of valid data
*/
private int mavTrimPayload(final byte[] payload)
{
int length = payload.length;
while (length > 1 && payload[length-1] == 0) {
length--;
}
return length;
}
/**
* Encode this packet for transmission.
*
* @return Array with bytes to be transmitted
*/
public byte[] encodePacket() {
final int bufLen;
final int payloadSize;
if (isMavlink2) {
payloadSize = mavTrimPayload(payload.payload.array());
bufLen = MAVLINK2_HEADER_LEN + payloadSize + 2;
} else {
payloadSize = payload.size();
bufLen = MAVLINK1_HEADER_LEN + payloadSize + 2;
}
byte[] buffer = new byte[bufLen];
int i = 0;
if (isMavlink2) {
buffer[i++] = (byte) MAVLINK_STX_MAVLINK2;
buffer[i++] = (byte) payloadSize;
buffer[i++] = (byte) incompatFlags;
buffer[i++] = (byte) compatFlags;
buffer[i++] = (byte) seq;
buffer[i++] = (byte) sysid;
buffer[i++] = (byte) compid;
buffer[i++] = (byte) (msgid & 0XFF);
buffer[i++] = (byte) ((msgid >>> 8) & 0XFF);
buffer[i++] = (byte) ((msgid >>> 16) & 0XFF);
} else {
buffer[i++] = (byte) MAVLINK_STX_MAVLINK1;
buffer[i++] = (byte) payloadSize;
buffer[i++] = (byte) seq;
buffer[i++] = (byte) sysid;
buffer[i++] = (byte) compid;
buffer[i++] = (byte) msgid;
}
for (int j = 0; j < payloadSize; ++j) {
buffer[i++] = payload.payload.get(j);
}
generateCRC(payloadSize);
buffer[i++] = (byte) (crc.getLSB());
buffer[i++] = (byte) (crc.getMSB());
logv(String.format("encode: isMavlink2=%s msgid=%d", isMavlink2, msgid));
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_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_link_node_status.MAVLINK_MSG_ID_LINK_NODE_STATUS:
return new msg_link_node_status(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 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 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 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_param_map_rc.MAVLINK_MSG_ID_PARAM_MAP_RC:
return new msg_param_map_rc(this);
case msg_mission_request_int.MAVLINK_MSG_ID_MISSION_REQUEST_INT:
return new msg_mission_request_int(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_command_cancel.MAVLINK_MSG_ID_COMMAND_CANCEL:
return new msg_command_cancel(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_hil_actuator_controls.MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS:
return new msg_hil_actuator_controls(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_optical_flow_rad.MAVLINK_MSG_ID_OPTICAL_FLOW_RAD:
return new msg_optical_flow_rad(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_timesync.MAVLINK_MSG_ID_TIMESYNC:
return new msg_timesync(this);
case msg_camera_trigger.MAVLINK_MSG_ID_CAMERA_TRIGGER:
return new msg_camera_trigger(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_scaled_imu3.MAVLINK_MSG_ID_SCALED_IMU3:
return new msg_scaled_imu3(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_scaled_pressure2.MAVLINK_MSG_ID_SCALED_PRESSURE2:
return new msg_scaled_pressure2(this);
case msg_att_pos_mocap.MAVLINK_MSG_ID_ATT_POS_MOCAP:
return new msg_att_pos_mocap(this);
case msg_set_actuator_control_target.MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET:
return new msg_set_actuator_control_target(this);
case msg_actuator_control_target.MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET:
return new msg_actuator_control_target(this);
case msg_altitude.MAVLINK_MSG_ID_ALTITUDE:
return new msg_altitude(this);
case msg_resource_request.MAVLINK_MSG_ID_RESOURCE_REQUEST:
return new msg_resource_request(this);
case msg_scaled_pressure3.MAVLINK_MSG_ID_SCALED_PRESSURE3:
return new msg_scaled_pressure3(this);
case msg_follow_target.MAVLINK_MSG_ID_FOLLOW_TARGET:
return new msg_follow_target(this);
case msg_control_system_state.MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE:
return new msg_control_system_state(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_landing_target.MAVLINK_MSG_ID_LANDING_TARGET:
return new msg_landing_target(this);
case msg_fence_status.MAVLINK_MSG_ID_FENCE_STATUS:
return new msg_fence_status(this);
case msg_script_item.MAVLINK_MSG_ID_SCRIPT_ITEM:
return new msg_script_item(this);
case msg_script_request.MAVLINK_MSG_ID_SCRIPT_REQUEST:
return new msg_script_request(this);
case msg_script_request_list.MAVLINK_MSG_ID_SCRIPT_REQUEST_LIST:
return new msg_script_request_list(this);
case msg_script_count.MAVLINK_MSG_ID_SCRIPT_COUNT:
return new msg_script_count(this);
case msg_script_current.MAVLINK_MSG_ID_SCRIPT_CURRENT:
return new msg_script_current(this);
case msg_mag_cal_report.MAVLINK_MSG_ID_MAG_CAL_REPORT:
return new msg_mag_cal_report(this);
case msg_efi_status.MAVLINK_MSG_ID_EFI_STATUS:
return new msg_efi_status(this);
case msg_estimator_status.MAVLINK_MSG_ID_ESTIMATOR_STATUS:
return new msg_estimator_status(this);
case msg_wind_cov.MAVLINK_MSG_ID_WIND_COV:
return new msg_wind_cov(this);
case msg_gps_input.MAVLINK_MSG_ID_GPS_INPUT:
return new msg_gps_input(this);
case msg_gps_rtcm_data.MAVLINK_MSG_ID_GPS_RTCM_DATA:
return new msg_gps_rtcm_data(this);
case msg_high_latency.MAVLINK_MSG_ID_HIGH_LATENCY:
return new msg_high_latency(this);
case msg_high_latency2.MAVLINK_MSG_ID_HIGH_LATENCY2:
return new msg_high_latency2(this);
case msg_vibration.MAVLINK_MSG_ID_VIBRATION:
return new msg_vibration(this);
case msg_home_position.MAVLINK_MSG_ID_HOME_POSITION:
return new msg_home_position(this);
case msg_set_home_position.MAVLINK_MSG_ID_SET_HOME_POSITION:
return new msg_set_home_position(this);
case msg_message_interval.MAVLINK_MSG_ID_MESSAGE_INTERVAL:
return new msg_message_interval(this);
case msg_extended_sys_state.MAVLINK_MSG_ID_EXTENDED_SYS_STATE:
return new msg_extended_sys_state(this);
case msg_adsb_vehicle.MAVLINK_MSG_ID_ADSB_VEHICLE:
return new msg_adsb_vehicle(this);
case msg_collision.MAVLINK_MSG_ID_COLLISION:
return new msg_collision(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);
case msg_setup_signing.MAVLINK_MSG_ID_SETUP_SIGNING:
return new msg_setup_signing(this);
case msg_button_change.MAVLINK_MSG_ID_BUTTON_CHANGE:
return new msg_button_change(this);
case msg_play_tune.MAVLINK_MSG_ID_PLAY_TUNE:
return new msg_play_tune(this);
case msg_camera_information.MAVLINK_MSG_ID_CAMERA_INFORMATION:
return new msg_camera_information(this);
case msg_camera_settings.MAVLINK_MSG_ID_CAMERA_SETTINGS:
return new msg_camera_settings(this);
case msg_storage_information.MAVLINK_MSG_ID_STORAGE_INFORMATION:
return new msg_storage_information(this);
case msg_camera_capture_status.MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS:
return new msg_camera_capture_status(this);
case msg_camera_image_captured.MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED:
return new msg_camera_image_captured(this);
case msg_flight_information.MAVLINK_MSG_ID_FLIGHT_INFORMATION:
return new msg_flight_information(this);
case msg_mount_orientation.MAVLINK_MSG_ID_MOUNT_ORIENTATION:
return new msg_mount_orientation(this);
case msg_logging_data.MAVLINK_MSG_ID_LOGGING_DATA:
return new msg_logging_data(this);
case msg_logging_data_acked.MAVLINK_MSG_ID_LOGGING_DATA_ACKED:
return new msg_logging_data_acked(this);
case msg_logging_ack.MAVLINK_MSG_ID_LOGGING_ACK:
return new msg_logging_ack(this);
case msg_video_stream_information.MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION:
return new msg_video_stream_information(this);
case msg_video_stream_status.MAVLINK_MSG_ID_VIDEO_STREAM_STATUS:
return new msg_video_stream_status(this);
case msg_camera_fov_status.MAVLINK_MSG_ID_CAMERA_FOV_STATUS:
return new msg_camera_fov_status(this);
case msg_camera_tracking_image_status.MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS:
return new msg_camera_tracking_image_status(this);
case msg_camera_tracking_geo_status.MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS:
return new msg_camera_tracking_geo_status(this);
case msg_camera_thermal_range.MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE:
return new msg_camera_thermal_range(this);
case msg_gimbal_manager_information.MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION:
return new msg_gimbal_manager_information(this);
case msg_gimbal_manager_status.MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS:
return new msg_gimbal_manager_status(this);
case msg_gimbal_manager_set_attitude.MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE:
return new msg_gimbal_manager_set_attitude(this);
case msg_gimbal_device_information.MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION:
return new msg_gimbal_device_information(this);
case msg_gimbal_device_set_attitude.MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE:
return new msg_gimbal_device_set_attitude(this);
case msg_gimbal_device_attitude_status.MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS:
return new msg_gimbal_device_attitude_status(this);
case msg_autopilot_state_for_gimbal_device.MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE:
return new msg_autopilot_state_for_gimbal_device(this);
case msg_gimbal_manager_set_pitchyaw.MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW:
return new msg_gimbal_manager_set_pitchyaw(this);
case msg_gimbal_manager_set_manual_control.MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL:
return new msg_gimbal_manager_set_manual_control(this);
case msg_esc_info.MAVLINK_MSG_ID_ESC_INFO:
return new msg_esc_info(this);
case msg_esc_status.MAVLINK_MSG_ID_ESC_STATUS:
return new msg_esc_status(this);
case msg_wifi_config_ap.MAVLINK_MSG_ID_WIFI_CONFIG_AP:
return new msg_wifi_config_ap(this);
case msg_protocol_version.MAVLINK_MSG_ID_PROTOCOL_VERSION:
return new msg_protocol_version(this);
case msg_ais_vessel.MAVLINK_MSG_ID_AIS_VESSEL:
return new msg_ais_vessel(this);
case msg_uavcan_node_status.MAVLINK_MSG_ID_UAVCAN_NODE_STATUS:
return new msg_uavcan_node_status(this);
case msg_uavcan_node_info.MAVLINK_MSG_ID_UAVCAN_NODE_INFO:
return new msg_uavcan_node_info(this);
case msg_param_ext_request_read.MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ:
return new msg_param_ext_request_read(this);
case msg_param_ext_request_list.MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST:
return new msg_param_ext_request_list(this);
case msg_param_ext_value.MAVLINK_MSG_ID_PARAM_EXT_VALUE:
return new msg_param_ext_value(this);
case msg_param_ext_set.MAVLINK_MSG_ID_PARAM_EXT_SET:
return new msg_param_ext_set(this);
case msg_param_ext_ack.MAVLINK_MSG_ID_PARAM_EXT_ACK:
return new msg_param_ext_ack(this);
case msg_obstacle_distance.MAVLINK_MSG_ID_OBSTACLE_DISTANCE:
return new msg_obstacle_distance(this);
case msg_odometry.MAVLINK_MSG_ID_ODOMETRY:
return new msg_odometry(this);
case msg_trajectory_representation_waypoints.MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS:
return new msg_trajectory_representation_waypoints(this);
case msg_trajectory_representation_bezier.MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER:
return new msg_trajectory_representation_bezier(this);
case msg_cellular_status.MAVLINK_MSG_ID_CELLULAR_STATUS:
return new msg_cellular_status(this);
case msg_isbd_link_status.MAVLINK_MSG_ID_ISBD_LINK_STATUS:
return new msg_isbd_link_status(this);
case msg_cellular_config.MAVLINK_MSG_ID_CELLULAR_CONFIG:
return new msg_cellular_config(this);
case msg_raw_rpm.MAVLINK_MSG_ID_RAW_RPM:
return new msg_raw_rpm(this);
case msg_utm_global_position.MAVLINK_MSG_ID_UTM_GLOBAL_POSITION:
return new msg_utm_global_position(this);
case msg_debug_float_array.MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY:
return new msg_debug_float_array(this);
case msg_orbit_execution_status.MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS:
return new msg_orbit_execution_status(this);
case msg_smart_battery_info.MAVLINK_MSG_ID_SMART_BATTERY_INFO:
return new msg_smart_battery_info(this);
case msg_fuel_status.MAVLINK_MSG_ID_FUEL_STATUS:
return new msg_fuel_status(this);
case msg_battery_info.MAVLINK_MSG_ID_BATTERY_INFO:
return new msg_battery_info(this);
case msg_generator_status.MAVLINK_MSG_ID_GENERATOR_STATUS:
return new msg_generator_status(this);
case msg_actuator_output_status.MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS:
return new msg_actuator_output_status(this);
case msg_time_estimate_to_target.MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET:
return new msg_time_estimate_to_target(this);
case msg_tunnel.MAVLINK_MSG_ID_TUNNEL:
return new msg_tunnel(this);
case msg_can_frame.MAVLINK_MSG_ID_CAN_FRAME:
return new msg_can_frame(this);
case msg_canfd_frame.MAVLINK_MSG_ID_CANFD_FRAME:
return new msg_canfd_frame(this);
case msg_can_filter_modify.MAVLINK_MSG_ID_CAN_FILTER_MODIFY:
return new msg_can_filter_modify(this);
case msg_onboard_computer_status.MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS:
return new msg_onboard_computer_status(this);
case msg_component_information.MAVLINK_MSG_ID_COMPONENT_INFORMATION:
return new msg_component_information(this);
case msg_component_information_basic.MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC:
return new msg_component_information_basic(this);
case msg_component_metadata.MAVLINK_MSG_ID_COMPONENT_METADATA:
return new msg_component_metadata(this);
case msg_play_tune_v2.MAVLINK_MSG_ID_PLAY_TUNE_V2:
return new msg_play_tune_v2(this);
case msg_supported_tunes.MAVLINK_MSG_ID_SUPPORTED_TUNES:
return new msg_supported_tunes(this);
case msg_event.MAVLINK_MSG_ID_EVENT:
return new msg_event(this);
case msg_current_event_sequence.MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE:
return new msg_current_event_sequence(this);
case msg_request_event.MAVLINK_MSG_ID_REQUEST_EVENT:
return new msg_request_event(this);
case msg_response_event_error.MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR:
return new msg_response_event_error(this);
case msg_available_modes.MAVLINK_MSG_ID_AVAILABLE_MODES:
return new msg_available_modes(this);
case msg_current_mode.MAVLINK_MSG_ID_CURRENT_MODE:
return new msg_current_mode(this);
case msg_available_modes_monitor.MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR:
return new msg_available_modes_monitor(this);
case msg_illuminator_status.MAVLINK_MSG_ID_ILLUMINATOR_STATUS:
return new msg_illuminator_status(this);
case msg_wheel_distance.MAVLINK_MSG_ID_WHEEL_DISTANCE:
return new msg_wheel_distance(this);
case msg_winch_status.MAVLINK_MSG_ID_WINCH_STATUS:
return new msg_winch_status(this);
case msg_open_drone_id_basic_id.MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID:
return new msg_open_drone_id_basic_id(this);
case msg_open_drone_id_location.MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION:
return new msg_open_drone_id_location(this);
case msg_open_drone_id_authentication.MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION:
return new msg_open_drone_id_authentication(this);
case msg_open_drone_id_self_id.MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID:
return new msg_open_drone_id_self_id(this);
case msg_open_drone_id_system.MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM:
return new msg_open_drone_id_system(this);
case msg_open_drone_id_operator_id.MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID:
return new msg_open_drone_id_operator_id(this);
case msg_open_drone_id_message_pack.MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK:
return new msg_open_drone_id_message_pack(this);
case msg_open_drone_id_arm_status.MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS:
return new msg_open_drone_id_arm_status(this);
case msg_open_drone_id_system_update.MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE:
return new msg_open_drone_id_system_update(this);
case msg_hygrometer_sensor.MAVLINK_MSG_ID_HYGROMETER_SENSOR:
return new msg_hygrometer_sensor(this);
default:
return null;
}
}
}

View File

@ -0,0 +1,32 @@
package com.example.longyi_groundstation.MAVLink.Messages;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@SuppressWarnings("unchecked")
/**
* Description annotation to provide programmatic access to the MAVLink description for each field
*/
public @interface Description {
String value();
class Test {
@Description("The speed of the drone")
public float speed;
public static void main(String[] args) throws Exception {
Field f = Test.class.getField("speed");
Description anno = (Description) f.getAnnotation(Description.class);
System.out.println(anno.value());
}
}
}

View File

@ -0,0 +1,30 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink.Messages;
import java.io.Serializable;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
/**
* Common interface for all MAVLink messages
*/
public abstract class MAVLinkMessage implements Serializable {
private static final long serialVersionUID = -7754622750478538539L;
// The MAVLink message classes have been changed to implement Serializable,
// this way is possible to pass a mavlink message through the Service-Acctivity interface
public int sysid;
public int compid;
public int msgid;
public boolean isMavlink2;
public abstract MAVLinkPacket pack();
public abstract void unpack(com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload payload);
public abstract String toString();
public abstract String name();
}

View File

@ -0,0 +1,210 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink.Messages;
import java.nio.ByteBuffer;
/**
* Wrapper around {@link ByteBuffer} to represent a MAVLink message payload
*/
public class MAVLinkPayload {
private static final byte UNSIGNED_BYTE_MIN_VALUE = 0;
private static final short UNSIGNED_BYTE_MAX_VALUE = Byte.MAX_VALUE - Byte.MIN_VALUE;
private static final short UNSIGNED_SHORT_MIN_VALUE = 0;
private static final int UNSIGNED_SHORT_MAX_VALUE = Short.MAX_VALUE - Short.MIN_VALUE;
private static final int UNSIGNED_INT_MIN_VALUE = 0;
private static final long UNSIGNED_INT_MAX_VALUE = (long) Integer.MAX_VALUE - Integer.MIN_VALUE;
private static final long UNSIGNED_LONG_MIN_VALUE = 0;
public static final int MAX_PAYLOAD_SIZE = 255;
public final ByteBuffer payload;
public int index;
public MAVLinkPayload() {
// This has to be larger than the received payloadSize since MAVLINK V2 will truncate the payloads to the last non-zero value
payload = ByteBuffer.allocate(MAX_PAYLOAD_SIZE);
}
public ByteBuffer getData() {
return payload;
}
public int size() {
return payload.position();
}
public void add(byte c) {
payload.put(c);
}
public void resetIndex() {
index = 0;
}
public byte getByte() {
byte result = 0;
result |= (payload.get(index + 0) & 0xFF);
index += 1;
return result;
}
public short getUnsignedByte() {
short result = 0;
result |= payload.get(index + 0) & 0xFF;
index += 1;
return result;
}
public short getShort() {
short result = 0;
result |= (payload.get(index + 1) & 0xFF) << 8;
result |= (payload.get(index + 0) & 0xFF);
index += 2;
return result;
}
public int getUnsignedShort() {
int result = 0;
result |= (payload.get(index + 1) & 0xFF) << 8;
result |= (payload.get(index + 0) & 0xFF);
index += 2;
return result;
}
public int getInt() {
int result = 0;
result |= (payload.get(index + 3) & 0xFF) << 24;
result |= (payload.get(index + 2) & 0xFF) << 16;
result |= (payload.get(index + 1) & 0xFF) << 8;
result |= (payload.get(index + 0) & 0xFF);
index += 4;
return result;
}
public long getUnsignedInt() {
long result = 0;
result |= (payload.get(index + 3) & 0xFFL) << 24;
result |= (payload.get(index + 2) & 0xFFL) << 16;
result |= (payload.get(index + 1) & 0xFFL) << 8;
result |= (payload.get(index + 0) & 0xFFL);
index += 4;
return result;
}
public long getLong() {
long result = 0;
result |= (payload.get(index + 7) & 0xFFL) << 56;
result |= (payload.get(index + 6) & 0xFFL) << 48;
result |= (payload.get(index + 5) & 0xFFL) << 40;
result |= (payload.get(index + 4) & 0xFFL) << 32;
result |= (payload.get(index + 3) & 0xFFL) << 24;
result |= (payload.get(index + 2) & 0xFFL) << 16;
result |= (payload.get(index + 1) & 0xFFL) << 8;
result |= (payload.get(index + 0) & 0xFFL);
index += 8;
return result;
}
public long getUnsignedLong(){
return getLong();
}
public long getLongReverse() {
long result = 0;
result |= (payload.get(index + 0) & 0xFFL) << 56;
result |= (payload.get(index + 1) & 0xFFL) << 48;
result |= (payload.get(index + 2) & 0xFFL) << 40;
result |= (payload.get(index + 3) & 0xFFL) << 32;
result |= (payload.get(index + 4) & 0xFFL) << 24;
result |= (payload.get(index + 5) & 0xFFL) << 16;
result |= (payload.get(index + 6) & 0xFFL) << 8;
result |= (payload.get(index + 7) & 0xFFL);
index += 8;
return result;
}
public float getFloat() {
return Float.intBitsToFloat(getInt());
}
public double getDouble() {
return Double.longBitsToDouble(getLong());
}
public void putByte(byte data) {
add(data);
}
public void putUnsignedByte(short data) {
if (data < UNSIGNED_BYTE_MIN_VALUE || data > UNSIGNED_BYTE_MAX_VALUE) {
throw new IllegalArgumentException("Value is outside of the range of an unsigned byte: " + data);
}
putByte((byte) data);
}
public void putShort(short data) {
add((byte) (data >> 0));
add((byte) (data >> 8));
}
public void putUnsignedShort(int data) {
if (data < UNSIGNED_SHORT_MIN_VALUE || data > UNSIGNED_SHORT_MAX_VALUE) {
throw new IllegalArgumentException("Value is outside of the range of an unsigned short: " + data);
}
putShort((short) data);
}
public void putInt(int data) {
add((byte) (data >> 0));
add((byte) (data >> 8));
add((byte) (data >> 16));
add((byte) (data >> 24));
}
public void putUnsignedInt(long data) {
if (data < UNSIGNED_INT_MIN_VALUE || data > UNSIGNED_INT_MAX_VALUE) {
throw new IllegalArgumentException("Value is outside of the range of an unsigned int: " + data);
}
putInt((int) data);
}
public void putLong(long data) {
add((byte) (data >> 0));
add((byte) (data >> 8));
add((byte) (data >> 16));
add((byte) (data >> 24));
add((byte) (data >> 32));
add((byte) (data >> 40));
add((byte) (data >> 48));
add((byte) (data >> 56));
}
public void putUnsignedLong(long data) {
if (data < UNSIGNED_LONG_MIN_VALUE) {
throw new IllegalArgumentException("Value is outside of the range of an unsigned long: " + data);
}
putLong(data);
}
public void putFloat(float data) {
putInt(Float.floatToIntBits(data));
}
public void putDouble(double data) {
putLong(Double.doubleToLongBits(data));
}
}

View File

@ -0,0 +1,153 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink.Messages;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.common.msg_radio_status;
/**
* Storage for MAVLink Packet and Error statistics
*/
public class MAVLinkStats /* implements Serializable */{
public int receivedPacketCount; // total received packet count for all sources
public int crcErrorCount;
public int lostPacketCount; // total lost packet count for all sources
public boolean ignoreRadioPackets;
// stats are nil for a system id until a packet has been received from a system
public SystemStat[] systemStats; // stats for each system that is known
public MAVLinkStats() {
this(false);
}
public MAVLinkStats(boolean ignoreRadioPackets) {
this.ignoreRadioPackets = ignoreRadioPackets;
resetStats();
}
/**
* Check the new received packet to see if has lost someone between this and
* the last packet
*
* @param packet Packet that should be checked
*/
public void newPacket(MAVLinkPacket packet) {
if (ignoreRadioPackets && packet.msgid == msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS) {
return;
}
if (systemStats[packet.sysid] == null) {
// only allocate stats for systems that exist on the network
systemStats[packet.sysid] = new SystemStat();
}
lostPacketCount += systemStats[packet.sysid].newPacket(packet);
receivedPacketCount++;
}
/**
* Called when a CRC error happens on the parser
*/
public void crcError() {
crcErrorCount++;
}
public void resetStats() {
crcErrorCount = 0;
lostPacketCount = 0;
receivedPacketCount = 0;
systemStats = new SystemStat[256];
}
/**
* Stat structure for every system id
*/
public static class SystemStat {
public int lostPacketCount; // the lost count for this source
public int receivedPacketCount;
// stats are nil for a component id until a packet has been received from a system
public ComponentStat[] componentStats; // stats for each component that is known
public SystemStat() {
resetStats();
}
public int newPacket(MAVLinkPacket packet) {
int newLostPackets = 0;
if (componentStats[packet.compid] == null) {
// only allocate stats for systems that exist on the network
componentStats[packet.compid] = new ComponentStat();
}
newLostPackets = componentStats[packet.compid].newPacket(packet);
lostPacketCount += newLostPackets;
receivedPacketCount++;
return newLostPackets;
}
public void resetStats() {
lostPacketCount = 0;
receivedPacketCount = 0;
componentStats = new ComponentStat[256];
}
}
/**
* stat structure for every system id
*/
public static class ComponentStat {
public int lastPacketSeq;
public int lostPacketCount; // the lost count for this source
public int receivedPacketCount;
public ComponentStat() {
resetStats();
}
public int newPacket(MAVLinkPacket packet) {
int newLostPackets = 0;
if (hasLostPackets(packet)) {
newLostPackets = updateLostPacketCount(packet);
}
lastPacketSeq = packet.seq;
advanceLastPacketSequence(packet.seq);
receivedPacketCount++;
return newLostPackets;
}
public void resetStats() {
lastPacketSeq = -1;
lostPacketCount = 0;
receivedPacketCount = 0;
}
private int updateLostPacketCount(MAVLinkPacket packet) {
int lostPackets;
if (packet.seq - lastPacketSeq < 0) {
lostPackets = (packet.seq - lastPacketSeq) + 255;
} else {
lostPackets = (packet.seq - lastPacketSeq);
}
lostPacketCount += lostPackets;
return lostPackets;
}
private void advanceLastPacketSequence(int lastSeq) {
// wrap from 255 to 0 if necessary
lastPacketSeq = (lastSeq + 1) & 0xFF;
}
private boolean hasLostPackets(MAVLinkPacket packet) {
return lastPacketSeq >= 0 && packet.seq != lastPacketSeq;
}
}
}

View File

@ -0,0 +1,42 @@
package com.example.longyi_groundstation.MAVLink.Messages;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@SuppressWarnings("unchecked")
/**
* Units annotation to provide programmatic access to the MAVLink units for a given field.
*
* The standard list of units can be found in the MAVLink Schema.
*
* @see <a href="https://github.com/ArduPilot/pymavlink/blob/master/generator/mavschema.xsd#L81">MAVLink Schema</a>
*
* A snapshot of the allowable units is available in the UnitsEnum class to prevent typos
* @see {@link com.example.longyi_groundstation.MAVLink.Messages.UnitsEnum}
*
*/
public @interface Units {
/**
* The string value of the units. A string was used to prevent brittleness as the list of valid units change
* @return
*/
String value();
class Test {
@Units("m/s")
public float speed;
public static void main(String[] args) throws Exception {
Field field = Test.class.getField("speed");
Units annotation = (Units) field.getAnnotation(Units.class);
System.out.println(UnitsEnum.fromName(annotation.value()));
}
}
}

View File

@ -0,0 +1,127 @@
package com.example.longyi_groundstation.MAVLink.Messages;
import java.util.HashMap;
import java.util.Map;
/**
* Units enumeration to be used to prevent typos.
*
* This enumerated list is a snapshot of the the standard list of units found in the MAVLink Schema.
*
* @see <a href="https://github.com/ArduPilot/pymavlink/blob/master/generator/mavschema.xsd#L81">MAVLink Schema</a>
*
*/
public enum UnitsEnum {
// time
S("s"), // seconds
DS("ds"),// deciseconds
CS("cs"),// centiseconds
MS("ms"),// milliseconds
US("us"),// microseconds
HZ("Hz"),// Herz
MHZ("MHz"),// Mega-Herz
// distance
KM("km"),// kilometres
DAM("dam"),// decametres
M("m"),// metres
M_PER_SEC("m/s"),// metres per second
M_PER_SEC_SEC("m/s/s"),// metres per second per second
M_PER_SEC_5("m/s*5"),// metres per second * 5 required from dagar for HIGH_LATENCY2 message
DM("dm"),// decimetres
DM_PER_S("dm/s"),// decimetres per second
CM("cm"),// centimetres
CM2("cm^2"),// centimetres squared (typically used in variance)
CM_PER_S("cm/s"),// centimetres per second
MM("mm"),// millimetres
MM_PER_S("mm/s"),// millimetres per second
MM_PER_H("mm/h"),// millimetres per hour
//temperature
K("K"),// Kelvin
DEG_C("degC"),// degrees Celsius
CDEG_C("cdegC"),// centi degrees Celsius
//angle
RAD("rad"),// radians
RAD_PER_S("rad/s"),// radians per second
MRAD_PER_S("mrad/s"),// milli-radians per second
DEG("deg"),// degrees
DEG_OVER_2("deg/2"),// degrees/2 required from dagar for HIGH_LATENCY2 message
DEG_PER_S("deg/s"),// degrees per second
CDEG("cdeg"),// centidegrees
CDEG_PER_S("cdeg/s"),// centidegrees per second
DEGe5("degE5"),// degrees * 10E5
DEGE7("degE7"),// degrees * 10E7
RPM("rpm"),// rotations per minute
//electricity
V("V"),// Volt
CV("cV"),// centi-Volt
MV("mV"),// milli-Volt
A("A"),// Ampere
CA("cA"),// centi-Ampere
MA("mA"),// milli-Ampere
MAH("mAh"),// milli-Ampere hour
//magnetism
MT("mT"),// milli-Tesla
GAUSS("gauss"),// Gauss
MGAUSS("mgauss"),// milli-Gauss
// energy
HJ("hJ"),// hecto-Joule
//power
W("W"),// Watt
//force
MG("mG"),// milli-G
//mass
G("g"),// grams
KG("kg"),// kilograms
//pressure
PA("Pa"),// Pascal
HPA("hPa"),// hecto-Pascal
KPA("kPa"),// kilo-Pascal
MBAR("mbar"),// millibar
//ratio
PERCENT("%"),// percent
DPERCENT("d%"),// decipercent
CPERCENT("c%"),// centipercent
DB("dB"),// Deci-Bell
DBM("dBm"),// Deci-Bell-milliwatts
//digital
KIB("KiB"),// Kibibyte (1024 bytes)
KIB_PER_S("KiB/s"),// Kibibyte (1024 bytes) per second
MIB("MiB"),// Mebibyte (1024*1024 bytes)
MIB_PER_S("MiB/s"),// Mebibyte (1024*1024 bytes) per second
BYTES("bytes"),// bytes
BYTES_PER_S("bytes/s"),// bytes per second
BITS_PER_S("bits/s"),// bits per second
PIX("pix"),// pixels
DPIX("dpix"),// decipixels
//flow
G_PER_MIN("g/min"),// grams/minute
CM3_PER_MIN("cm^3/min"),// cubic centimetres/minute
//volume
CM3("cm^3"),// cubic centimetres
L("l");// liters
private final String name;
private static final Map<String, UnitsEnum> toEnum = new HashMap<>();
static {
for (UnitsEnum ue : UnitsEnum.values()) {
toEnum.put(ue.getName(), ue);
}
}
UnitsEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
@Override
public String toString() {
return this.name;
}
public static UnitsEnum fromName(String name) {
return toEnum.get(name);
}
}

View File

@ -0,0 +1,216 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkStats;
/**
* MAVLink parser that parses @{link MAVLinkPacket}s from a byte stream one byte
* at a time.
*
* After creating an instance of this class, simply use the @{link #mavlink_parse_char}
* method to parse a byte stream.
*/
public class Parser {
static final String TAG = Parser.class.getSimpleName();
static final boolean V = false;
static void logv(String tag, String msg) {
if(V) System.out.println(String.format("%s: %s", tag, msg));
}
/**
* States from the parsing state machine
*/
enum MAV_states {
MAVLINK_PARSE_STATE_UNINIT,
MAVLINK_PARSE_STATE_IDLE,
MAVLINK_PARSE_STATE_GOT_STX,
MAVLINK_PARSE_STATE_GOT_LENGTH,
MAVLINK_PARSE_STATE_GOT_INCOMPAT_FLAGS, // MAVLink 2
MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS, // MAVLink 2
MAVLINK_PARSE_STATE_GOT_SEQ,
MAVLINK_PARSE_STATE_GOT_SYSID,
MAVLINK_PARSE_STATE_GOT_COMPID,
MAVLINK_PARSE_STATE_GOT_MSGID1,
MAVLINK_PARSE_STATE_GOT_MSGID2, // MAVLink 2
MAVLINK_PARSE_STATE_GOT_MSGID3, // MAVLink 2
MAVLINK_PARSE_STATE_GOT_CRC1,
MAVLINK_PARSE_STATE_GOT_CRC2, // MAVLink 2
MAVLINK_PARSE_STATE_GOT_PAYLOAD,
MAVLINK_PARSE_STATE_GOT_SIGNATURE, // MAVLink 2
}
private MAV_states state = MAV_states.MAVLINK_PARSE_STATE_UNINIT;
public MAVLinkStats stats;
private MAVLinkPacket m;
private boolean isMavlink2;
public Parser() {
this(false);
}
public Parser(boolean ignoreRadioPacketStats) {
stats = new MAVLinkStats(ignoreRadioPacketStats);
isMavlink2 = false;
}
/**
* This is a convenience function which handles the complete MAVLink
* parsing. the function will parse one byte at a time and return the
* complete packet once it could be successfully decoded. Checksum and other
* failures will be silently ignored.
*
* @param c The char to parse
* @return the complete @{link MAVLinkPacket} if successfully decoded, else null
*/
public MAVLinkPacket mavlink_parse_char(int c) {
// force to 8 bits
c &= 0xFF;
switch (state) {
case MAVLINK_PARSE_STATE_UNINIT:
case MAVLINK_PARSE_STATE_IDLE:
// MAVLink 1 and 2
if (c == MAVLinkPacket.MAVLINK_STX_MAVLINK2) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX;
if (!isMavlink2) {
isMavlink2 = true;
logv(TAG, "Turning mavlink2 ON");
}
} else if (c == MAVLinkPacket.MAVLINK_STX_MAVLINK1) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX;
if (isMavlink2) {
isMavlink2 = false;
logv(TAG, "Turning mavlink2 OFF");
}
}
break;
case MAVLINK_PARSE_STATE_GOT_STX:
// MAVLink 1 and 2
m = new MAVLinkPacket(c, isMavlink2);
if (isMavlink2) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_LENGTH;
} else {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS;
}
break;
case MAVLINK_PARSE_STATE_GOT_LENGTH:
// MAVLink 1 and 2
m.incompatFlags = c;
if (c != 0 && c != 1) {
// message includes an incompatible feature flag
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
break;
}
state = MAV_states.MAVLINK_PARSE_STATE_GOT_INCOMPAT_FLAGS;
break;
case MAVLINK_PARSE_STATE_GOT_INCOMPAT_FLAGS:
// MAVLink 2 only
m.compatFlags = c;
state = MAV_states.MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS;
break;
case MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS:
m.seq = c;
state = MAV_states.MAVLINK_PARSE_STATE_GOT_SEQ;
break;
case MAVLINK_PARSE_STATE_GOT_SEQ:
// back to MAVLink 1 and 2
m.sysid = c;
state = MAV_states.MAVLINK_PARSE_STATE_GOT_SYSID;
break;
case MAVLINK_PARSE_STATE_GOT_SYSID:
// MAVLink 1 and 2
m.compid = c;
state = MAV_states.MAVLINK_PARSE_STATE_GOT_COMPID;
break;
case MAVLINK_PARSE_STATE_GOT_COMPID:
// MAVLink 1 and 2
m.msgid = c;
if (isMavlink2) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID1;
} else if (m.len > 0) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID3;
} else {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD;
}
break;
case MAVLINK_PARSE_STATE_GOT_MSGID1:
// MAVLink 2 only
m.msgid |= c << 8;
state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID2;
break;
case MAVLINK_PARSE_STATE_GOT_MSGID2:
// MAVLink 2 only
m.msgid |= c << 16;
if (m.len > 0) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID3;
} else {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD;
}
break;
case MAVLINK_PARSE_STATE_GOT_MSGID3:
// back to MAVLink 1 and 2
m.payload.add((byte) c);
if (m.payloadIsFilled()) {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD;
}
break;
case MAVLINK_PARSE_STATE_GOT_PAYLOAD:
boolean crcGen = m.generateCRC(m.payload.size());
// Check first checksum byte and verify the CRC was successfully generated (msg extra exists)
if (c != m.crc.getLSB() || !crcGen) {
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
stats.crcError();
} else {
state = MAV_states.MAVLINK_PARSE_STATE_GOT_CRC1;
}
break;
case MAVLINK_PARSE_STATE_GOT_CRC1:
// Check second checksum byte
if (c != m.crc.getMSB()) {
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
stats.crcError();
} else { // crc is good
stats.newPacket(m);
if (!isMavlink2 || (m.incompatFlags != 0x01)) {
// If no signature, then return the message.
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
return m;
} else {
// TODO: MAVLink 2 - signed
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
stats.crcError();
}
}
break;
case MAVLINK_PARSE_STATE_GOT_CRC2:
// TODO: implement signature parsing and validation
state = MAV_states.MAVLINK_PARSE_STATE_IDLE;
stats.crcError();
break;
} // switch
return null;
}
}

View File

@ -0,0 +1,310 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
package com.example.longyi_groundstation.MAVLink.common;
import java.util.HashMap;
import java.util.Map;
/**
* CRC-16/MCRF4XX calculation for MAVlink messages. The checksum must be
* initialized, updated with which field of the message, and then finished with
* the message id.
*
*/
public class CRC {
private static final Map<Integer, Integer> MAVLINK_MESSAGE_CRCS;
private static final int CRC_INIT_VALUE = 0xffff;
private int crcValue;
static {
MAVLINK_MESSAGE_CRCS = new HashMap<>();
MAVLINK_MESSAGE_CRCS.put(0, 50);
MAVLINK_MESSAGE_CRCS.put(1, 124);
MAVLINK_MESSAGE_CRCS.put(2, 137);
MAVLINK_MESSAGE_CRCS.put(4, 237);
MAVLINK_MESSAGE_CRCS.put(5, 217);
MAVLINK_MESSAGE_CRCS.put(6, 104);
MAVLINK_MESSAGE_CRCS.put(7, 119);
MAVLINK_MESSAGE_CRCS.put(8, 117);
MAVLINK_MESSAGE_CRCS.put(11, 89);
MAVLINK_MESSAGE_CRCS.put(20, 214);
MAVLINK_MESSAGE_CRCS.put(21, 159);
MAVLINK_MESSAGE_CRCS.put(22, 220);
MAVLINK_MESSAGE_CRCS.put(23, 168);
MAVLINK_MESSAGE_CRCS.put(24, 24);
MAVLINK_MESSAGE_CRCS.put(25, 23);
MAVLINK_MESSAGE_CRCS.put(26, 170);
MAVLINK_MESSAGE_CRCS.put(27, 144);
MAVLINK_MESSAGE_CRCS.put(28, 67);
MAVLINK_MESSAGE_CRCS.put(29, 115);
MAVLINK_MESSAGE_CRCS.put(30, 39);
MAVLINK_MESSAGE_CRCS.put(31, 246);
MAVLINK_MESSAGE_CRCS.put(32, 185);
MAVLINK_MESSAGE_CRCS.put(33, 104);
MAVLINK_MESSAGE_CRCS.put(34, 237);
MAVLINK_MESSAGE_CRCS.put(35, 244);
MAVLINK_MESSAGE_CRCS.put(36, 222);
MAVLINK_MESSAGE_CRCS.put(37, 212);
MAVLINK_MESSAGE_CRCS.put(38, 9);
MAVLINK_MESSAGE_CRCS.put(39, 254);
MAVLINK_MESSAGE_CRCS.put(40, 230);
MAVLINK_MESSAGE_CRCS.put(41, 28);
MAVLINK_MESSAGE_CRCS.put(42, 28);
MAVLINK_MESSAGE_CRCS.put(43, 132);
MAVLINK_MESSAGE_CRCS.put(44, 221);
MAVLINK_MESSAGE_CRCS.put(45, 232);
MAVLINK_MESSAGE_CRCS.put(46, 11);
MAVLINK_MESSAGE_CRCS.put(47, 153);
MAVLINK_MESSAGE_CRCS.put(48, 41);
MAVLINK_MESSAGE_CRCS.put(49, 39);
MAVLINK_MESSAGE_CRCS.put(50, 78);
MAVLINK_MESSAGE_CRCS.put(51, 196);
MAVLINK_MESSAGE_CRCS.put(54, 15);
MAVLINK_MESSAGE_CRCS.put(55, 3);
MAVLINK_MESSAGE_CRCS.put(61, 167);
MAVLINK_MESSAGE_CRCS.put(62, 183);
MAVLINK_MESSAGE_CRCS.put(63, 119);
MAVLINK_MESSAGE_CRCS.put(64, 191);
MAVLINK_MESSAGE_CRCS.put(65, 118);
MAVLINK_MESSAGE_CRCS.put(66, 148);
MAVLINK_MESSAGE_CRCS.put(67, 21);
MAVLINK_MESSAGE_CRCS.put(69, 243);
MAVLINK_MESSAGE_CRCS.put(70, 124);
MAVLINK_MESSAGE_CRCS.put(73, 38);
MAVLINK_MESSAGE_CRCS.put(74, 20);
MAVLINK_MESSAGE_CRCS.put(75, 158);
MAVLINK_MESSAGE_CRCS.put(76, 152);
MAVLINK_MESSAGE_CRCS.put(77, 143);
MAVLINK_MESSAGE_CRCS.put(80, 14);
MAVLINK_MESSAGE_CRCS.put(81, 106);
MAVLINK_MESSAGE_CRCS.put(82, 49);
MAVLINK_MESSAGE_CRCS.put(83, 22);
MAVLINK_MESSAGE_CRCS.put(84, 143);
MAVLINK_MESSAGE_CRCS.put(85, 140);
MAVLINK_MESSAGE_CRCS.put(86, 5);
MAVLINK_MESSAGE_CRCS.put(87, 150);
MAVLINK_MESSAGE_CRCS.put(89, 231);
MAVLINK_MESSAGE_CRCS.put(90, 183);
MAVLINK_MESSAGE_CRCS.put(91, 63);
MAVLINK_MESSAGE_CRCS.put(92, 54);
MAVLINK_MESSAGE_CRCS.put(93, 47);
MAVLINK_MESSAGE_CRCS.put(100, 175);
MAVLINK_MESSAGE_CRCS.put(101, 102);
MAVLINK_MESSAGE_CRCS.put(102, 158);
MAVLINK_MESSAGE_CRCS.put(103, 208);
MAVLINK_MESSAGE_CRCS.put(104, 56);
MAVLINK_MESSAGE_CRCS.put(105, 93);
MAVLINK_MESSAGE_CRCS.put(106, 138);
MAVLINK_MESSAGE_CRCS.put(107, 108);
MAVLINK_MESSAGE_CRCS.put(108, 32);
MAVLINK_MESSAGE_CRCS.put(109, 185);
MAVLINK_MESSAGE_CRCS.put(110, 84);
MAVLINK_MESSAGE_CRCS.put(111, 34);
MAVLINK_MESSAGE_CRCS.put(112, 174);
MAVLINK_MESSAGE_CRCS.put(113, 124);
MAVLINK_MESSAGE_CRCS.put(114, 237);
MAVLINK_MESSAGE_CRCS.put(115, 4);
MAVLINK_MESSAGE_CRCS.put(116, 76);
MAVLINK_MESSAGE_CRCS.put(117, 128);
MAVLINK_MESSAGE_CRCS.put(118, 56);
MAVLINK_MESSAGE_CRCS.put(119, 116);
MAVLINK_MESSAGE_CRCS.put(120, 134);
MAVLINK_MESSAGE_CRCS.put(121, 237);
MAVLINK_MESSAGE_CRCS.put(122, 203);
MAVLINK_MESSAGE_CRCS.put(123, 250);
MAVLINK_MESSAGE_CRCS.put(124, 87);
MAVLINK_MESSAGE_CRCS.put(125, 203);
MAVLINK_MESSAGE_CRCS.put(126, 220);
MAVLINK_MESSAGE_CRCS.put(127, 25);
MAVLINK_MESSAGE_CRCS.put(128, 226);
MAVLINK_MESSAGE_CRCS.put(129, 46);
MAVLINK_MESSAGE_CRCS.put(130, 29);
MAVLINK_MESSAGE_CRCS.put(131, 223);
MAVLINK_MESSAGE_CRCS.put(132, 85);
MAVLINK_MESSAGE_CRCS.put(133, 6);
MAVLINK_MESSAGE_CRCS.put(134, 229);
MAVLINK_MESSAGE_CRCS.put(135, 203);
MAVLINK_MESSAGE_CRCS.put(136, 1);
MAVLINK_MESSAGE_CRCS.put(137, 195);
MAVLINK_MESSAGE_CRCS.put(138, 109);
MAVLINK_MESSAGE_CRCS.put(139, 168);
MAVLINK_MESSAGE_CRCS.put(140, 181);
MAVLINK_MESSAGE_CRCS.put(141, 47);
MAVLINK_MESSAGE_CRCS.put(142, 72);
MAVLINK_MESSAGE_CRCS.put(143, 131);
MAVLINK_MESSAGE_CRCS.put(144, 127);
MAVLINK_MESSAGE_CRCS.put(146, 103);
MAVLINK_MESSAGE_CRCS.put(147, 154);
MAVLINK_MESSAGE_CRCS.put(148, 178);
MAVLINK_MESSAGE_CRCS.put(149, 200);
MAVLINK_MESSAGE_CRCS.put(162, 189);
MAVLINK_MESSAGE_CRCS.put(192, 36);
MAVLINK_MESSAGE_CRCS.put(225, 208);
MAVLINK_MESSAGE_CRCS.put(230, 163);
MAVLINK_MESSAGE_CRCS.put(231, 105);
MAVLINK_MESSAGE_CRCS.put(232, 151);
MAVLINK_MESSAGE_CRCS.put(233, 35);
MAVLINK_MESSAGE_CRCS.put(234, 150);
MAVLINK_MESSAGE_CRCS.put(235, 179);
MAVLINK_MESSAGE_CRCS.put(241, 90);
MAVLINK_MESSAGE_CRCS.put(242, 104);
MAVLINK_MESSAGE_CRCS.put(243, 85);
MAVLINK_MESSAGE_CRCS.put(244, 95);
MAVLINK_MESSAGE_CRCS.put(245, 130);
MAVLINK_MESSAGE_CRCS.put(246, 184);
MAVLINK_MESSAGE_CRCS.put(247, 81);
MAVLINK_MESSAGE_CRCS.put(248, 8);
MAVLINK_MESSAGE_CRCS.put(249, 204);
MAVLINK_MESSAGE_CRCS.put(250, 49);
MAVLINK_MESSAGE_CRCS.put(251, 170);
MAVLINK_MESSAGE_CRCS.put(252, 44);
MAVLINK_MESSAGE_CRCS.put(253, 83);
MAVLINK_MESSAGE_CRCS.put(254, 46);
MAVLINK_MESSAGE_CRCS.put(256, 71);
MAVLINK_MESSAGE_CRCS.put(257, 131);
MAVLINK_MESSAGE_CRCS.put(258, 187);
MAVLINK_MESSAGE_CRCS.put(259, 92);
MAVLINK_MESSAGE_CRCS.put(260, 146);
MAVLINK_MESSAGE_CRCS.put(261, 179);
MAVLINK_MESSAGE_CRCS.put(262, 12);
MAVLINK_MESSAGE_CRCS.put(263, 133);
MAVLINK_MESSAGE_CRCS.put(264, 49);
MAVLINK_MESSAGE_CRCS.put(265, 26);
MAVLINK_MESSAGE_CRCS.put(266, 193);
MAVLINK_MESSAGE_CRCS.put(267, 35);
MAVLINK_MESSAGE_CRCS.put(268, 14);
MAVLINK_MESSAGE_CRCS.put(269, 109);
MAVLINK_MESSAGE_CRCS.put(270, 59);
MAVLINK_MESSAGE_CRCS.put(271, 22);
MAVLINK_MESSAGE_CRCS.put(275, 126);
MAVLINK_MESSAGE_CRCS.put(276, 18);
MAVLINK_MESSAGE_CRCS.put(277, 62);
MAVLINK_MESSAGE_CRCS.put(280, 70);
MAVLINK_MESSAGE_CRCS.put(281, 48);
MAVLINK_MESSAGE_CRCS.put(282, 123);
MAVLINK_MESSAGE_CRCS.put(283, 74);
MAVLINK_MESSAGE_CRCS.put(284, 99);
MAVLINK_MESSAGE_CRCS.put(285, 137);
MAVLINK_MESSAGE_CRCS.put(286, 210);
MAVLINK_MESSAGE_CRCS.put(287, 1);
MAVLINK_MESSAGE_CRCS.put(288, 20);
MAVLINK_MESSAGE_CRCS.put(290, 251);
MAVLINK_MESSAGE_CRCS.put(291, 10);
MAVLINK_MESSAGE_CRCS.put(299, 19);
MAVLINK_MESSAGE_CRCS.put(300, 217);
MAVLINK_MESSAGE_CRCS.put(301, 243);
MAVLINK_MESSAGE_CRCS.put(310, 28);
MAVLINK_MESSAGE_CRCS.put(311, 95);
MAVLINK_MESSAGE_CRCS.put(320, 243);
MAVLINK_MESSAGE_CRCS.put(321, 88);
MAVLINK_MESSAGE_CRCS.put(322, 243);
MAVLINK_MESSAGE_CRCS.put(323, 78);
MAVLINK_MESSAGE_CRCS.put(324, 132);
MAVLINK_MESSAGE_CRCS.put(330, 23);
MAVLINK_MESSAGE_CRCS.put(331, 91);
MAVLINK_MESSAGE_CRCS.put(332, 236);
MAVLINK_MESSAGE_CRCS.put(333, 231);
MAVLINK_MESSAGE_CRCS.put(334, 72);
MAVLINK_MESSAGE_CRCS.put(335, 225);
MAVLINK_MESSAGE_CRCS.put(336, 245);
MAVLINK_MESSAGE_CRCS.put(339, 199);
MAVLINK_MESSAGE_CRCS.put(340, 99);
MAVLINK_MESSAGE_CRCS.put(350, 232);
MAVLINK_MESSAGE_CRCS.put(360, 11);
MAVLINK_MESSAGE_CRCS.put(370, 75);
MAVLINK_MESSAGE_CRCS.put(371, 10);
MAVLINK_MESSAGE_CRCS.put(372, 26);
MAVLINK_MESSAGE_CRCS.put(373, 117);
MAVLINK_MESSAGE_CRCS.put(375, 251);
MAVLINK_MESSAGE_CRCS.put(380, 232);
MAVLINK_MESSAGE_CRCS.put(385, 147);
MAVLINK_MESSAGE_CRCS.put(386, 132);
MAVLINK_MESSAGE_CRCS.put(387, 4);
MAVLINK_MESSAGE_CRCS.put(388, 8);
MAVLINK_MESSAGE_CRCS.put(390, 156);
MAVLINK_MESSAGE_CRCS.put(395, 0);
MAVLINK_MESSAGE_CRCS.put(396, 50);
MAVLINK_MESSAGE_CRCS.put(397, 182);
MAVLINK_MESSAGE_CRCS.put(400, 110);
MAVLINK_MESSAGE_CRCS.put(401, 183);
MAVLINK_MESSAGE_CRCS.put(410, 160);
MAVLINK_MESSAGE_CRCS.put(411, 106);
MAVLINK_MESSAGE_CRCS.put(412, 33);
MAVLINK_MESSAGE_CRCS.put(413, 77);
MAVLINK_MESSAGE_CRCS.put(435, 134);
MAVLINK_MESSAGE_CRCS.put(436, 193);
MAVLINK_MESSAGE_CRCS.put(437, 30);
MAVLINK_MESSAGE_CRCS.put(440, 66);
MAVLINK_MESSAGE_CRCS.put(9000, 113);
MAVLINK_MESSAGE_CRCS.put(9005, 117);
MAVLINK_MESSAGE_CRCS.put(12900, 114);
MAVLINK_MESSAGE_CRCS.put(12901, 254);
MAVLINK_MESSAGE_CRCS.put(12902, 140);
MAVLINK_MESSAGE_CRCS.put(12903, 249);
MAVLINK_MESSAGE_CRCS.put(12904, 77);
MAVLINK_MESSAGE_CRCS.put(12905, 49);
MAVLINK_MESSAGE_CRCS.put(12915, 94);
MAVLINK_MESSAGE_CRCS.put(12918, 139);
MAVLINK_MESSAGE_CRCS.put(12919, 7);
MAVLINK_MESSAGE_CRCS.put(12920, 20);
}
/**
* Accumulate the 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
**/
public void update_checksum(int data) {
data = data & 0xff; //cast because we want an unsigned type
int 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.
*
* @param msgid The message id number
* @return boolean True if the checksum was successfully finished. Otherwise false
*/
public boolean finish_checksum(int msgid) {
if (MAVLINK_MESSAGE_CRCS.containsKey(msgid)) {
update_checksum(MAVLINK_MESSAGE_CRCS.get(msgid));
return true;
}
return false;
}
/**
* Initialize the buffer for the CRC16/MCRF4XX
*/
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();
}
public CRC(int crcValue) {
this.crcValue = crcValue;
}
}

View File

@ -0,0 +1,176 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ACTUATOR_CONTROL_TARGET PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Set the vehicle attitude and body angular rates.
*/
public class msg_actuator_control_target extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET = 140;
public static final int MAVLINK_MSG_LENGTH = 41;
private static final long serialVersionUID = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.
*/
@Description("Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs.")
@Units("")
public float controls[] = new float[8];
/**
* Actuator group. The '_mlx' indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.
*/
@Description("Actuator group. The '_mlx' indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances.")
@Units("")
public short group_mlx;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
packet.payload.putUnsignedLong(time_usec);
for (int i = 0; i < controls.length; i++) {
packet.payload.putFloat(controls[i]);
}
packet.payload.putUnsignedByte(group_mlx);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a actuator_control_target message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
for (int i = 0; i < this.controls.length; i++) {
this.controls[i] = payload.getFloat();
}
this.group_mlx = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_actuator_control_target() {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_actuator_control_target( long time_usec, float[] controls, short group_mlx) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
this.time_usec = time_usec;
this.controls = controls;
this.group_mlx = group_mlx;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_actuator_control_target( long time_usec, float[] controls, short group_mlx, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.controls = controls;
this.group_mlx = group_mlx;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_actuator_control_target(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("msgid",MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET);
jsonObject.put("sysid",sysid);
jsonObject.put("time_usec",time_usec);
jsonObject.put("controls",controls);
jsonObject.put("group_mlx",group_mlx);
return jsonObject.toString();
} catch (JSONException e) {
return null;
}
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET";
}
}

View File

@ -0,0 +1,161 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ACTUATOR_OUTPUT_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
/**
* The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW.
*/
public class msg_actuator_output_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS = 375;
public static final int MAVLINK_MSG_LENGTH = 140;
private static final long serialVersionUID = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
/**
* Timestamp (since system boot).
*/
@Description("Timestamp (since system boot).")
@Units("us")
public long time_usec;
/**
* Active outputs
*/
@Description("Active outputs")
@Units("")
public long active;
/**
* Servo / motor output array values. Zero values indicate unused channels.
*/
@Description("Servo / motor output array values. Zero values indicate unused channels.")
@Units("")
public float actuator[] = new float[32];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putUnsignedInt(active);
for (int i = 0; i < actuator.length; i++) {
packet.payload.putFloat(actuator[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a actuator_output_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.active = payload.getUnsignedInt();
for (int i = 0; i < this.actuator.length; i++) {
this.actuator[i] = payload.getFloat();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_actuator_output_status() {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_actuator_output_status( long time_usec, long active, float[] actuator) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
this.time_usec = time_usec;
this.active = active;
this.actuator = actuator;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_actuator_output_status( long time_usec, long active, float[] actuator, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.active = active;
this.actuator = actuator;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_actuator_output_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" active:"+active+" actuator:"+actuator+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS";
}
}

View File

@ -0,0 +1,298 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ADSB_VEHICLE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* The location and information of an ADSB vehicle
*/
public class msg_adsb_vehicle extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ADSB_VEHICLE = 246;
public static final int MAVLINK_MSG_LENGTH = 38;
private static final long serialVersionUID = MAVLINK_MSG_ID_ADSB_VEHICLE;
/**
* ICAO address
*/
@Description("ICAO address")
@Units("")
public long ICAO_address;
/**
* Latitude
*/
@Description("Latitude")
@Units("degE7")
public int lat;
/**
* Longitude
*/
@Description("Longitude")
@Units("degE7")
public int lon;
/**
* Altitude(ASL)
*/
@Description("Altitude(ASL)")
@Units("mm")
public int altitude;
/**
* Course over ground
*/
@Description("Course over ground")
@Units("cdeg")
public int heading;
/**
* The horizontal velocity
*/
@Description("The horizontal velocity")
@Units("cm/s")
public int hor_velocity;
/**
* The vertical velocity. Positive is up
*/
@Description("The vertical velocity. Positive is up")
@Units("cm/s")
public short ver_velocity;
/**
* Bitmap to indicate various statuses including valid data fields
*/
@Description("Bitmap to indicate various statuses including valid data fields")
@Units("")
public int flags;
/**
* Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000
*/
@Description("Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000")
@Units("")
public int squawk;
/**
* ADSB altitude type.
*/
@Description("ADSB altitude type.")
@Units("")
public short altitude_type;
/**
* The callsign, 8+null
*/
@Description("The callsign, 8+null")
@Units("")
public byte callsign[] = new byte[9];
/**
* ADSB emitter type.
*/
@Description("ADSB emitter type.")
@Units("")
public short emitter_type;
/**
* Time since last communication in seconds
*/
@Description("Time since last communication in seconds")
@Units("s")
public short tslc;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
packet.payload.putUnsignedInt(ICAO_address);
packet.payload.putInt(lat);
packet.payload.putInt(lon);
packet.payload.putInt(altitude);
packet.payload.putUnsignedShort(heading);
packet.payload.putUnsignedShort(hor_velocity);
packet.payload.putShort(ver_velocity);
packet.payload.putUnsignedShort(flags);
packet.payload.putUnsignedShort(squawk);
packet.payload.putUnsignedByte(altitude_type);
for (int i = 0; i < callsign.length; i++) {
packet.payload.putByte(callsign[i]);
}
packet.payload.putUnsignedByte(emitter_type);
packet.payload.putUnsignedByte(tslc);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a adsb_vehicle message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.ICAO_address = payload.getUnsignedInt();
this.lat = payload.getInt();
this.lon = payload.getInt();
this.altitude = payload.getInt();
this.heading = payload.getUnsignedShort();
this.hor_velocity = payload.getUnsignedShort();
this.ver_velocity = payload.getShort();
this.flags = payload.getUnsignedShort();
this.squawk = payload.getUnsignedShort();
this.altitude_type = payload.getUnsignedByte();
for (int i = 0; i < this.callsign.length; i++) {
this.callsign[i] = payload.getByte();
}
this.emitter_type = payload.getUnsignedByte();
this.tslc = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_adsb_vehicle() {
this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_adsb_vehicle( long ICAO_address, int lat, int lon, int altitude, int heading, int hor_velocity, short ver_velocity, int flags, int squawk, short altitude_type, byte[] callsign, short emitter_type, short tslc) {
this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
this.ICAO_address = ICAO_address;
this.lat = lat;
this.lon = lon;
this.altitude = altitude;
this.heading = heading;
this.hor_velocity = hor_velocity;
this.ver_velocity = ver_velocity;
this.flags = flags;
this.squawk = squawk;
this.altitude_type = altitude_type;
this.callsign = callsign;
this.emitter_type = emitter_type;
this.tslc = tslc;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_adsb_vehicle( long ICAO_address, int lat, int lon, int altitude, int heading, int hor_velocity, short ver_velocity, int flags, int squawk, short altitude_type, byte[] callsign, short emitter_type, short tslc, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.ICAO_address = ICAO_address;
this.lat = lat;
this.lon = lon;
this.altitude = altitude;
this.heading = heading;
this.hor_velocity = hor_velocity;
this.ver_velocity = ver_velocity;
this.flags = flags;
this.squawk = squawk;
this.altitude_type = altitude_type;
this.callsign = callsign;
this.emitter_type = emitter_type;
this.tslc = tslc;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_adsb_vehicle(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setCallsign(String str) {
int len = Math.min(str.length(), 9);
for (int i=0; i<len; i++) {
callsign[i] = (byte) str.charAt(i);
}
for (int i=len; i<9; i++) { // padding for the rest of the buffer
callsign[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getCallsign() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 9; i++) {
if (callsign[i] != 0)
buf.append((char) callsign[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ADSB_VEHICLE - sysid:"+sysid+" compid:"+compid+" ICAO_address:"+ICAO_address+" lat:"+lat+" lon:"+lon+" altitude:"+altitude+" heading:"+heading+" hor_velocity:"+hor_velocity+" ver_velocity:"+ver_velocity+" flags:"+flags+" squawk:"+squawk+" altitude_type:"+altitude_type+" callsign:"+callsign+" emitter_type:"+emitter_type+" tslc:"+tslc+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ADSB_VEHICLE";
}
}

View File

@ -0,0 +1,379 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AIS_VESSEL PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* The location and information of an AIS vessel
*/
public class msg_ais_vessel extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_AIS_VESSEL = 301;
public static final int MAVLINK_MSG_LENGTH = 58;
private static final long serialVersionUID = MAVLINK_MSG_ID_AIS_VESSEL;
/**
* Mobile Marine Service Identifier, 9 decimal digits
*/
@Description("Mobile Marine Service Identifier, 9 decimal digits")
@Units("")
public long MMSI;
/**
* Latitude
*/
@Description("Latitude")
@Units("degE7")
public int lat;
/**
* Longitude
*/
@Description("Longitude")
@Units("degE7")
public int lon;
/**
* Course over ground
*/
@Description("Course over ground")
@Units("cdeg")
public int COG;
/**
* True heading
*/
@Description("True heading")
@Units("cdeg")
public int heading;
/**
* Speed over ground
*/
@Description("Speed over ground")
@Units("cm/s")
public int velocity;
/**
* Distance from lat/lon location to bow
*/
@Description("Distance from lat/lon location to bow")
@Units("m")
public int dimension_bow;
/**
* Distance from lat/lon location to stern
*/
@Description("Distance from lat/lon location to stern")
@Units("m")
public int dimension_stern;
/**
* Time since last communication in seconds
*/
@Description("Time since last communication in seconds")
@Units("s")
public int tslc;
/**
* Bitmask to indicate various statuses including valid data fields
*/
@Description("Bitmask to indicate various statuses including valid data fields")
@Units("")
public int flags;
/**
* Turn rate
*/
@Description("Turn rate")
@Units("cdeg/s")
public byte turn_rate;
/**
* Navigational status
*/
@Description("Navigational status")
@Units("")
public short navigational_status;
/**
* Type of vessels
*/
@Description("Type of vessels")
@Units("")
public short type;
/**
* Distance from lat/lon location to port side
*/
@Description("Distance from lat/lon location to port side")
@Units("m")
public short dimension_port;
/**
* Distance from lat/lon location to starboard side
*/
@Description("Distance from lat/lon location to starboard side")
@Units("m")
public short dimension_starboard;
/**
* The vessel callsign
*/
@Description("The vessel callsign")
@Units("")
public byte callsign[] = new byte[7];
/**
* The vessel name
*/
@Description("The vessel name")
@Units("")
public byte name[] = new byte[20];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AIS_VESSEL;
packet.payload.putUnsignedInt(MMSI);
packet.payload.putInt(lat);
packet.payload.putInt(lon);
packet.payload.putUnsignedShort(COG);
packet.payload.putUnsignedShort(heading);
packet.payload.putUnsignedShort(velocity);
packet.payload.putUnsignedShort(dimension_bow);
packet.payload.putUnsignedShort(dimension_stern);
packet.payload.putUnsignedShort(tslc);
packet.payload.putUnsignedShort(flags);
packet.payload.putByte(turn_rate);
packet.payload.putUnsignedByte(navigational_status);
packet.payload.putUnsignedByte(type);
packet.payload.putUnsignedByte(dimension_port);
packet.payload.putUnsignedByte(dimension_starboard);
for (int i = 0; i < callsign.length; i++) {
packet.payload.putByte(callsign[i]);
}
for (int i = 0; i < name.length; i++) {
packet.payload.putByte(name[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a ais_vessel message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.MMSI = payload.getUnsignedInt();
this.lat = payload.getInt();
this.lon = payload.getInt();
this.COG = payload.getUnsignedShort();
this.heading = payload.getUnsignedShort();
this.velocity = payload.getUnsignedShort();
this.dimension_bow = payload.getUnsignedShort();
this.dimension_stern = payload.getUnsignedShort();
this.tslc = payload.getUnsignedShort();
this.flags = payload.getUnsignedShort();
this.turn_rate = payload.getByte();
this.navigational_status = payload.getUnsignedByte();
this.type = payload.getUnsignedByte();
this.dimension_port = payload.getUnsignedByte();
this.dimension_starboard = payload.getUnsignedByte();
for (int i = 0; i < this.callsign.length; i++) {
this.callsign[i] = payload.getByte();
}
for (int i = 0; i < this.name.length; i++) {
this.name[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_ais_vessel() {
this.msgid = MAVLINK_MSG_ID_AIS_VESSEL;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_ais_vessel( long MMSI, int lat, int lon, int COG, int heading, int velocity, int dimension_bow, int dimension_stern, int tslc, int flags, byte turn_rate, short navigational_status, short type, short dimension_port, short dimension_starboard, byte[] callsign, byte[] name) {
this.msgid = MAVLINK_MSG_ID_AIS_VESSEL;
this.MMSI = MMSI;
this.lat = lat;
this.lon = lon;
this.COG = COG;
this.heading = heading;
this.velocity = velocity;
this.dimension_bow = dimension_bow;
this.dimension_stern = dimension_stern;
this.tslc = tslc;
this.flags = flags;
this.turn_rate = turn_rate;
this.navigational_status = navigational_status;
this.type = type;
this.dimension_port = dimension_port;
this.dimension_starboard = dimension_starboard;
this.callsign = callsign;
this.name = name;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_ais_vessel( long MMSI, int lat, int lon, int COG, int heading, int velocity, int dimension_bow, int dimension_stern, int tslc, int flags, byte turn_rate, short navigational_status, short type, short dimension_port, short dimension_starboard, byte[] callsign, byte[] name, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AIS_VESSEL;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.MMSI = MMSI;
this.lat = lat;
this.lon = lon;
this.COG = COG;
this.heading = heading;
this.velocity = velocity;
this.dimension_bow = dimension_bow;
this.dimension_stern = dimension_stern;
this.tslc = tslc;
this.flags = flags;
this.turn_rate = turn_rate;
this.navigational_status = navigational_status;
this.type = type;
this.dimension_port = dimension_port;
this.dimension_starboard = dimension_starboard;
this.callsign = callsign;
this.name = name;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_ais_vessel(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AIS_VESSEL;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setCallsign(String str) {
int len = Math.min(str.length(), 7);
for (int i=0; i<len; i++) {
callsign[i] = (byte) str.charAt(i);
}
for (int i=len; i<7; i++) { // padding for the rest of the buffer
callsign[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getCallsign() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 7; i++) {
if (callsign[i] != 0)
buf.append((char) callsign[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setName(String str) {
int len = Math.min(str.length(), 20);
for (int i=0; i<len; i++) {
name[i] = (byte) str.charAt(i);
}
for (int i=len; i<20; i++) { // padding for the rest of the buffer
name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getName() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 20; i++) {
if (name[i] != 0)
buf.append((char) name[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AIS_VESSEL - sysid:"+sysid+" compid:"+compid+" MMSI:"+MMSI+" lat:"+lat+" lon:"+lon+" COG:"+COG+" heading:"+heading+" velocity:"+velocity+" dimension_bow:"+dimension_bow+" dimension_stern:"+dimension_stern+" tslc:"+tslc+" flags:"+flags+" turn_rate:"+turn_rate+" navigational_status:"+navigational_status+" type:"+type+" dimension_port:"+dimension_port+" dimension_starboard:"+dimension_starboard+" callsign:"+callsign+" name:"+name+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AIS_VESSEL";
}
}

View File

@ -0,0 +1,195 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ALTITUDE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* The current system altitude.
*/
public class msg_altitude extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ALTITUDE = 141;
public static final int MAVLINK_MSG_LENGTH = 32;
private static final long serialVersionUID = MAVLINK_MSG_ID_ALTITUDE;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.
*/
@Description("This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights.")
@Units("m")
public float altitude_monotonic;
/**
* This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude.
*/
@Description("This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude.")
@Units("m")
public float altitude_amsl;
/**
* This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.
*/
@Description("This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive.")
@Units("m")
public float altitude_local;
/**
* This is the altitude above the home position. It resets on each change of the current home position.
*/
@Description("This is the altitude above the home position. It resets on each change of the current home position.")
@Units("m")
public float altitude_relative;
/**
* This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.
*/
@Description("This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown.")
@Units("m")
public float altitude_terrain;
/**
* This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.
*/
@Description("This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available.")
@Units("m")
public float bottom_clearance;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ALTITUDE;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putFloat(altitude_monotonic);
packet.payload.putFloat(altitude_amsl);
packet.payload.putFloat(altitude_local);
packet.payload.putFloat(altitude_relative);
packet.payload.putFloat(altitude_terrain);
packet.payload.putFloat(bottom_clearance);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a altitude message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.altitude_monotonic = payload.getFloat();
this.altitude_amsl = payload.getFloat();
this.altitude_local = payload.getFloat();
this.altitude_relative = payload.getFloat();
this.altitude_terrain = payload.getFloat();
this.bottom_clearance = payload.getFloat();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_altitude() {
this.msgid = MAVLINK_MSG_ID_ALTITUDE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_altitude( long time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance) {
this.msgid = MAVLINK_MSG_ID_ALTITUDE;
this.time_usec = time_usec;
this.altitude_monotonic = altitude_monotonic;
this.altitude_amsl = altitude_amsl;
this.altitude_local = altitude_local;
this.altitude_relative = altitude_relative;
this.altitude_terrain = altitude_terrain;
this.bottom_clearance = bottom_clearance;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_altitude( long time_usec, float altitude_monotonic, float altitude_amsl, float altitude_local, float altitude_relative, float altitude_terrain, float bottom_clearance, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ALTITUDE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.altitude_monotonic = altitude_monotonic;
this.altitude_amsl = altitude_amsl;
this.altitude_local = altitude_local;
this.altitude_relative = altitude_relative;
this.altitude_terrain = altitude_terrain;
this.bottom_clearance = bottom_clearance;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_altitude(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ALTITUDE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ALTITUDE - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" altitude_monotonic:"+altitude_monotonic+" altitude_amsl:"+altitude_amsl+" altitude_local:"+altitude_local+" altitude_relative:"+altitude_relative+" altitude_terrain:"+altitude_terrain+" bottom_clearance:"+bottom_clearance+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ALTITUDE";
}
}

View File

@ -0,0 +1,200 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ATT_POS_MOCAP PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Motion capture attitude and position
*/
public class msg_att_pos_mocap extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ATT_POS_MOCAP = 138;
public static final int MAVLINK_MSG_LENGTH = 120;
private static final long serialVersionUID = MAVLINK_MSG_ID_ATT_POS_MOCAP;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
*/
@Description("Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)")
@Units("")
public float q[] = new float[4];
/**
* X position (NED)
*/
@Description("X position (NED)")
@Units("m")
public float x;
/**
* Y position (NED)
*/
@Description("Y position (NED)")
@Units("m")
public float y;
/**
* Z position (NED)
*/
@Description("Z position (NED)")
@Units("m")
public float z;
/**
* Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.
*/
@Description("Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array.")
@Units("")
public float covariance[] = new float[21];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
packet.payload.putUnsignedLong(time_usec);
for (int i = 0; i < q.length; i++) {
packet.payload.putFloat(q[i]);
}
packet.payload.putFloat(x);
packet.payload.putFloat(y);
packet.payload.putFloat(z);
if (isMavlink2) {
for (int i = 0; i < covariance.length; i++) {
packet.payload.putFloat(covariance[i]);
}
}
return packet;
}
/**
* Decode a att_pos_mocap message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
for (int i = 0; i < this.q.length; i++) {
this.q[i] = payload.getFloat();
}
this.x = payload.getFloat();
this.y = payload.getFloat();
this.z = payload.getFloat();
if (isMavlink2) {
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_att_pos_mocap() {
this.msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_att_pos_mocap( long time_usec, float[] q, float x, float y, float z, float[] covariance) {
this.msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
this.time_usec = time_usec;
this.q = q;
this.x = x;
this.y = y;
this.z = z;
this.covariance = covariance;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_att_pos_mocap( long time_usec, float[] q, float x, float y, float z, float[] covariance, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.q = q;
this.x = x;
this.y = y;
this.z = z;
this.covariance = covariance;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_att_pos_mocap(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ATT_POS_MOCAP;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ATT_POS_MOCAP - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" q:"+q+" x:"+x+" y:"+y+" z:"+z+" covariance:"+covariance+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ATT_POS_MOCAP";
}
}

View File

@ -0,0 +1,223 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ATTITUDE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import org.json.JSONException;
import org.json.JSONObject;
/**
* The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic).
*/
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 (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Roll angle (-pi..+pi)
*/
@Description("Roll angle (-pi..+pi)")
@Units("rad")
public float roll;
/**
* Pitch angle (-pi..+pi)
*/
@Description("Pitch angle (-pi..+pi)")
@Units("rad")
public float pitch;
/**
* Yaw angle (-pi..+pi)
*/
@Description("Yaw angle (-pi..+pi)")
@Units("rad")
public float yaw;
/**
* Roll angular speed
*/
@Description("Roll angular speed")
@Units("rad/s")
public float rollspeed;
/**
* Pitch angular speed
*/
@Description("Pitch angular speed")
@Units("rad/s")
public float pitchspeed;
/**
* Yaw angular speed
*/
@Description("Yaw angular speed")
@Units("rad/s")
public float yawspeed;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ATTITUDE;
packet.payload.putUnsignedInt(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);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a attitude message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.roll = payload.getFloat();
this.pitch = payload.getFloat();
this.yaw = payload.getFloat();
this.rollspeed = payload.getFloat();
this.pitchspeed = payload.getFloat();
this.yawspeed = payload.getFloat();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_attitude() {
this.msgid = MAVLINK_MSG_ID_ATTITUDE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_attitude( long time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE;
this.time_boot_ms = time_boot_ms;
this.roll = roll;
this.pitch = pitch;
this.yaw = yaw;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_attitude( long time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.roll = roll;
this.pitch = pitch;
this.yaw = yaw;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_attitude(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("msgid",MAVLINK_MSG_ID_ATTITUDE);
jsonObject.put("sysid",sysid);
jsonObject.put("compid",compid);
jsonObject.put("time_boot_ms",time_boot_ms);
jsonObject.put("roll",roll);
jsonObject.put("pitch",pitch);
jsonObject.put("yaw",yaw);
jsonObject.put("rollspeed",rollspeed);
jsonObject.put("pitchspeed",pitchspeed);
jsonObject.put("yawspeed",yawspeed);
return jsonObject.toString();
} catch (JSONException e) {
return null;
}
// return "MAVLINK_MSG_ID_ATTITUDE - sysid:"+sysid
// +" compid:"+compid
// +" time_boot_ms:"+time_boot_ms
// +" roll:"+roll
// +" pitch:"+pitch
// +" yaw:"+yaw
// +" rollspeed:"+rollspeed
// +" pitchspeed:"+pitchspeed
// +" yawspeed:"+yawspeed+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ATTITUDE";
}
}

View File

@ -0,0 +1,227 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ATTITUDE_QUATERNION PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
/**
* 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 = 48;
private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Quaternion component 1, w (1 in null-rotation)
*/
@Description("Quaternion component 1, w (1 in null-rotation)")
@Units("")
public float q1;
/**
* Quaternion component 2, x (0 in null-rotation)
*/
@Description("Quaternion component 2, x (0 in null-rotation)")
@Units("")
public float q2;
/**
* Quaternion component 3, y (0 in null-rotation)
*/
@Description("Quaternion component 3, y (0 in null-rotation)")
@Units("")
public float q3;
/**
* Quaternion component 4, z (0 in null-rotation)
*/
@Description("Quaternion component 4, z (0 in null-rotation)")
@Units("")
public float q4;
/**
* Roll angular speed
*/
@Description("Roll angular speed")
@Units("rad/s")
public float rollspeed;
/**
* Pitch angular speed
*/
@Description("Pitch angular speed")
@Units("rad/s")
public float pitchspeed;
/**
* Yaw angular speed
*/
@Description("Yaw angular speed")
@Units("rad/s")
public float yawspeed;
/**
* Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode.
*/
@Description("Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode.")
@Units("")
public float repr_offset_q[] = new float[4];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
packet.payload.putUnsignedInt(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);
if (isMavlink2) {
for (int i = 0; i < repr_offset_q.length; i++) {
packet.payload.putFloat(repr_offset_q[i]);
}
}
return packet;
}
/**
* Decode a attitude_quaternion message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
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();
if (isMavlink2) {
for (int i = 0; i < this.repr_offset_q.length; i++) {
this.repr_offset_q[i] = payload.getFloat();
}
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_attitude_quaternion() {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_attitude_quaternion( long time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed, float[] repr_offset_q) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
this.time_boot_ms = time_boot_ms;
this.q1 = q1;
this.q2 = q2;
this.q3 = q3;
this.q4 = q4;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
this.repr_offset_q = repr_offset_q;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_attitude_quaternion( long time_boot_ms, float q1, float q2, float q3, float q4, float rollspeed, float pitchspeed, float yawspeed, float[] repr_offset_q, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.q1 = q1;
this.q2 = q2;
this.q3 = q3;
this.q4 = q4;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
this.repr_offset_q = repr_offset_q;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_attitude_quaternion(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" q1:"+q1+" q2:"+q2+" q3:"+q3+" q4:"+q4+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+" repr_offset_q:"+repr_offset_q+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION";
}
}

View File

@ -0,0 +1,200 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ATTITUDE_QUATERNION_COV PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* 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 = 72;
private static final long serialVersionUID = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)
*/
@Description("Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)")
@Units("")
public float q[] = new float[4];
/**
* Roll angular speed
*/
@Description("Roll angular speed")
@Units("rad/s")
public float rollspeed;
/**
* Pitch angular speed
*/
@Description("Pitch angular speed")
@Units("rad/s")
public float pitchspeed;
/**
* Yaw angular speed
*/
@Description("Yaw angular speed")
@Units("rad/s")
public float yawspeed;
/**
* Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.
*/
@Description("Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array.")
@Units("")
public float covariance[] = new float[9];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
packet.payload.putUnsignedLong(time_usec);
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]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a attitude_quaternion_cov message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
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();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_attitude_quaternion_cov() {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_attitude_quaternion_cov( long time_usec, float[] q, float rollspeed, float pitchspeed, float yawspeed, float[] covariance) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
this.time_usec = time_usec;
this.q = q;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
this.covariance = covariance;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_attitude_quaternion_cov( long time_usec, float[] q, float rollspeed, float pitchspeed, float yawspeed, float[] covariance, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.q = q;
this.rollspeed = rollspeed;
this.pitchspeed = pitchspeed;
this.yawspeed = yawspeed;
this.covariance = covariance;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_attitude_quaternion_cov(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" q:"+q+" rollspeed:"+rollspeed+" pitchspeed:"+pitchspeed+" yawspeed:"+yawspeed+" covariance:"+covariance+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV";
}
}

View File

@ -0,0 +1,203 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ATTITUDE_TARGET PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way.
*/
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 (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
*/
@Description("Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)")
@Units("")
public float q[] = new float[4];
/**
* Body roll rate
*/
@Description("Body roll rate")
@Units("rad/s")
public float body_roll_rate;
/**
* Body pitch rate
*/
@Description("Body pitch rate")
@Units("rad/s")
public float body_pitch_rate;
/**
* Body yaw rate
*/
@Description("Body yaw rate")
@Units("rad/s")
public float body_yaw_rate;
/**
* Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)
*/
@Description("Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)")
@Units("")
public float thrust;
/**
* Bitmap to indicate which dimensions should be ignored by the vehicle.
*/
@Description("Bitmap to indicate which dimensions should be ignored by the vehicle.")
@Units("")
public short type_mask;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
packet.payload.putUnsignedInt(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.putUnsignedByte(type_mask);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a attitude_target message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
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.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_attitude_target() {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_attitude_target( long time_boot_ms, float[] q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust, short type_mask) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
this.time_boot_ms = time_boot_ms;
this.q = q;
this.body_roll_rate = body_roll_rate;
this.body_pitch_rate = body_pitch_rate;
this.body_yaw_rate = body_yaw_rate;
this.thrust = thrust;
this.type_mask = type_mask;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_attitude_target( long time_boot_ms, float[] q, float body_roll_rate, float body_pitch_rate, float body_yaw_rate, float thrust, short type_mask, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.q = q;
this.body_roll_rate = body_roll_rate;
this.body_pitch_rate = body_pitch_rate;
this.body_yaw_rate = body_yaw_rate;
this.thrust = thrust;
this.type_mask = type_mask;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_attitude_target(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ATTITUDE_TARGET;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ATTITUDE_TARGET - sysid:"+sysid+" compid:"+compid+" 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+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ATTITUDE_TARGET";
}
}

View File

@ -0,0 +1,166 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AUTH_KEY PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
/**
* 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
*/
@Description("key")
@Units("")
public byte key[] = new byte[32];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AUTH_KEY;
for (int i = 0; i < key.length; i++) {
packet.payload.putByte(key[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a auth_key message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
for (int i = 0; i < this.key.length; i++) {
this.key[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_auth_key() {
this.msgid = MAVLINK_MSG_ID_AUTH_KEY;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_auth_key( byte[] key) {
this.msgid = MAVLINK_MSG_ID_AUTH_KEY;
this.key = key;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_auth_key( byte[] key, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AUTH_KEY;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.key = key;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_auth_key(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AUTH_KEY;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* 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<len; i++) {
key[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
key[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getKey() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (key[i] != 0)
buf.append((char) key[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AUTH_KEY - sysid:"+sysid+" compid:"+compid+" key:"+key+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AUTH_KEY";
}
}

View File

@ -0,0 +1,269 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AUTOPILOT_STATE_FOR_GIMBAL_DEVICE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis.
*/
public class msg_autopilot_state_for_gimbal_device extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE = 286;
public static final int MAVLINK_MSG_LENGTH = 57;
private static final long serialVersionUID = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("us")
public long time_boot_us;
/**
* Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).
*/
@Description("Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention).")
@Units("")
public float q[] = new float[4];
/**
* Estimated delay of the attitude data. 0 if unknown.
*/
@Description("Estimated delay of the attitude data. 0 if unknown.")
@Units("us")
public long q_estimated_delay_us;
/**
* X Speed in NED (North, East, Down). NAN if unknown.
*/
@Description("X Speed in NED (North, East, Down). NAN if unknown.")
@Units("m/s")
public float vx;
/**
* Y Speed in NED (North, East, Down). NAN if unknown.
*/
@Description("Y Speed in NED (North, East, Down). NAN if unknown.")
@Units("m/s")
public float vy;
/**
* Z Speed in NED (North, East, Down). NAN if unknown.
*/
@Description("Z Speed in NED (North, East, Down). NAN if unknown.")
@Units("m/s")
public float vz;
/**
* Estimated delay of the speed data. 0 if unknown.
*/
@Description("Estimated delay of the speed data. 0 if unknown.")
@Units("us")
public long v_estimated_delay_us;
/**
* Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.
*/
@Description("Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing.")
@Units("rad/s")
public float feed_forward_angular_velocity_z;
/**
* Bitmap indicating which estimator outputs are valid.
*/
@Description("Bitmap indicating which estimator outputs are valid.")
@Units("")
public int estimator_status;
/**
* System ID
*/
@Description("System ID")
@Units("")
public short target_system;
/**
* Component ID
*/
@Description("Component ID")
@Units("")
public short target_component;
/**
* The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
*/
@Description("The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.")
@Units("")
public short landed_state;
/**
* Z component of angular velocity in NED (North, East, Down). NaN if unknown.
*/
@Description("Z component of angular velocity in NED (North, East, Down). NaN if unknown.")
@Units("rad/s")
public float angular_velocity_z;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
packet.payload.putUnsignedLong(time_boot_us);
for (int i = 0; i < q.length; i++) {
packet.payload.putFloat(q[i]);
}
packet.payload.putUnsignedInt(q_estimated_delay_us);
packet.payload.putFloat(vx);
packet.payload.putFloat(vy);
packet.payload.putFloat(vz);
packet.payload.putUnsignedInt(v_estimated_delay_us);
packet.payload.putFloat(feed_forward_angular_velocity_z);
packet.payload.putUnsignedShort(estimator_status);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(landed_state);
if (isMavlink2) {
packet.payload.putFloat(angular_velocity_z);
}
return packet;
}
/**
* Decode a autopilot_state_for_gimbal_device message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_us = payload.getUnsignedLong();
for (int i = 0; i < this.q.length; i++) {
this.q[i] = payload.getFloat();
}
this.q_estimated_delay_us = payload.getUnsignedInt();
this.vx = payload.getFloat();
this.vy = payload.getFloat();
this.vz = payload.getFloat();
this.v_estimated_delay_us = payload.getUnsignedInt();
this.feed_forward_angular_velocity_z = payload.getFloat();
this.estimator_status = payload.getUnsignedShort();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.landed_state = payload.getUnsignedByte();
if (isMavlink2) {
this.angular_velocity_z = payload.getFloat();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_autopilot_state_for_gimbal_device() {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_autopilot_state_for_gimbal_device( long time_boot_us, float[] q, long q_estimated_delay_us, float vx, float vy, float vz, long v_estimated_delay_us, float feed_forward_angular_velocity_z, int estimator_status, short target_system, short target_component, short landed_state, float angular_velocity_z) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
this.time_boot_us = time_boot_us;
this.q = q;
this.q_estimated_delay_us = q_estimated_delay_us;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.v_estimated_delay_us = v_estimated_delay_us;
this.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
this.estimator_status = estimator_status;
this.target_system = target_system;
this.target_component = target_component;
this.landed_state = landed_state;
this.angular_velocity_z = angular_velocity_z;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_autopilot_state_for_gimbal_device( long time_boot_us, float[] q, long q_estimated_delay_us, float vx, float vy, float vz, long v_estimated_delay_us, float feed_forward_angular_velocity_z, int estimator_status, short target_system, short target_component, short landed_state, float angular_velocity_z, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_us = time_boot_us;
this.q = q;
this.q_estimated_delay_us = q_estimated_delay_us;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.v_estimated_delay_us = v_estimated_delay_us;
this.feed_forward_angular_velocity_z = feed_forward_angular_velocity_z;
this.estimator_status = estimator_status;
this.target_system = target_system;
this.target_component = target_component;
this.landed_state = landed_state;
this.angular_velocity_z = angular_velocity_z;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_autopilot_state_for_gimbal_device(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE - sysid:"+sysid+" compid:"+compid+" time_boot_us:"+time_boot_us+" q:"+q+" q_estimated_delay_us:"+q_estimated_delay_us+" vx:"+vx+" vy:"+vy+" vz:"+vz+" v_estimated_delay_us:"+v_estimated_delay_us+" feed_forward_angular_velocity_z:"+feed_forward_angular_velocity_z+" estimator_status:"+estimator_status+" target_system:"+target_system+" target_component:"+target_component+" landed_state:"+landed_state+" angular_velocity_z:"+angular_velocity_z+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
}
}

View File

@ -0,0 +1,282 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AUTOPILOT_VERSION PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE.
*/
public class msg_autopilot_version extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_AUTOPILOT_VERSION = 148;
public static final int MAVLINK_MSG_LENGTH = 78;
private static final long serialVersionUID = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
/**
* Bitmap of capabilities
*/
@Description("Bitmap of capabilities")
@Units("")
public long capabilities;
/**
* UID if provided by hardware (see uid2)
*/
@Description("UID if provided by hardware (see uid2)")
@Units("")
public long uid;
/**
* Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE).
*/
@Description("Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE). ")
@Units("")
public long flight_sw_version;
/**
* Middleware version number
*/
@Description("Middleware version number")
@Units("")
public long middleware_sw_version;
/**
* Operating system version number
*/
@Description("Operating system version number")
@Units("")
public long os_sw_version;
/**
* HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt
*/
@Description("HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt")
@Units("")
public long board_version;
/**
* ID of the board vendor
*/
@Description("ID of the board vendor")
@Units("")
public int vendor_id;
/**
* ID of the product
*/
@Description("ID of the product")
@Units("")
public int product_id;
/**
* Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
*/
@Description("Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.")
@Units("")
public short flight_custom_version[] = new short[8];
/**
* Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
*/
@Description("Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.")
@Units("")
public short middleware_custom_version[] = new short[8];
/**
* Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
*/
@Description("Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.")
@Units("")
public short os_custom_version[] = new short[8];
/**
* UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
*/
@Description("UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)")
@Units("")
public short uid2[] = new short[18];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
packet.payload.putUnsignedLong(capabilities);
packet.payload.putUnsignedLong(uid);
packet.payload.putUnsignedInt(flight_sw_version);
packet.payload.putUnsignedInt(middleware_sw_version);
packet.payload.putUnsignedInt(os_sw_version);
packet.payload.putUnsignedInt(board_version);
packet.payload.putUnsignedShort(vendor_id);
packet.payload.putUnsignedShort(product_id);
for (int i = 0; i < flight_custom_version.length; i++) {
packet.payload.putUnsignedByte(flight_custom_version[i]);
}
for (int i = 0; i < middleware_custom_version.length; i++) {
packet.payload.putUnsignedByte(middleware_custom_version[i]);
}
for (int i = 0; i < os_custom_version.length; i++) {
packet.payload.putUnsignedByte(os_custom_version[i]);
}
if (isMavlink2) {
for (int i = 0; i < uid2.length; i++) {
packet.payload.putUnsignedByte(uid2[i]);
}
}
return packet;
}
/**
* Decode a autopilot_version message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.capabilities = payload.getUnsignedLong();
this.uid = payload.getUnsignedLong();
this.flight_sw_version = payload.getUnsignedInt();
this.middleware_sw_version = payload.getUnsignedInt();
this.os_sw_version = payload.getUnsignedInt();
this.board_version = payload.getUnsignedInt();
this.vendor_id = payload.getUnsignedShort();
this.product_id = payload.getUnsignedShort();
for (int i = 0; i < this.flight_custom_version.length; i++) {
this.flight_custom_version[i] = payload.getUnsignedByte();
}
for (int i = 0; i < this.middleware_custom_version.length; i++) {
this.middleware_custom_version[i] = payload.getUnsignedByte();
}
for (int i = 0; i < this.os_custom_version.length; i++) {
this.os_custom_version[i] = payload.getUnsignedByte();
}
if (isMavlink2) {
for (int i = 0; i < this.uid2.length; i++) {
this.uid2[i] = payload.getUnsignedByte();
}
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_autopilot_version() {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_autopilot_version( long capabilities, long uid, long flight_sw_version, long middleware_sw_version, long os_sw_version, long board_version, int vendor_id, int product_id, short[] flight_custom_version, short[] middleware_custom_version, short[] os_custom_version, short[] uid2) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
this.capabilities = capabilities;
this.uid = uid;
this.flight_sw_version = flight_sw_version;
this.middleware_sw_version = middleware_sw_version;
this.os_sw_version = os_sw_version;
this.board_version = board_version;
this.vendor_id = vendor_id;
this.product_id = product_id;
this.flight_custom_version = flight_custom_version;
this.middleware_custom_version = middleware_custom_version;
this.os_custom_version = os_custom_version;
this.uid2 = uid2;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_autopilot_version( long capabilities, long uid, long flight_sw_version, long middleware_sw_version, long os_sw_version, long board_version, int vendor_id, int product_id, short[] flight_custom_version, short[] middleware_custom_version, short[] os_custom_version, short[] uid2, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.capabilities = capabilities;
this.uid = uid;
this.flight_sw_version = flight_sw_version;
this.middleware_sw_version = middleware_sw_version;
this.os_sw_version = os_sw_version;
this.board_version = board_version;
this.vendor_id = vendor_id;
this.product_id = product_id;
this.flight_custom_version = flight_custom_version;
this.middleware_custom_version = middleware_custom_version;
this.os_custom_version = os_custom_version;
this.uid2 = uid2;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_autopilot_version(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AUTOPILOT_VERSION - sysid:"+sysid+" compid:"+compid+" capabilities:"+capabilities+" uid:"+uid+" flight_sw_version:"+flight_sw_version+" middleware_sw_version:"+middleware_sw_version+" os_sw_version:"+os_sw_version+" board_version:"+board_version+" vendor_id:"+vendor_id+" product_id:"+product_id+" flight_custom_version:"+flight_custom_version+" middleware_custom_version:"+middleware_custom_version+" os_custom_version:"+os_custom_version+" uid2:"+uid2+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AUTOPILOT_VERSION";
}
}

View File

@ -0,0 +1,229 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AVAILABLE_MODES PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about a flight mode.
The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE.
Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode.
The modes must be available/settable for the current vehicle/frame type.
Each mode should only be emitted once (even if it is both standard and custom).
Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed.
See https://mavlink.io/en/services/standard_modes.html
*/
public class msg_available_modes extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_AVAILABLE_MODES = 435;
public static final int MAVLINK_MSG_LENGTH = 46;
private static final long serialVersionUID = MAVLINK_MSG_ID_AVAILABLE_MODES;
/**
* A bitfield for use for autopilot-specific flags
*/
@Description("A bitfield for use for autopilot-specific flags")
@Units("")
public long custom_mode;
/**
* Mode properties.
*/
@Description("Mode properties.")
@Units("")
public long properties;
/**
* The total number of available modes for the current vehicle type.
*/
@Description("The total number of available modes for the current vehicle type.")
@Units("")
public short number_modes;
/**
* The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change.
*/
@Description("The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change.")
@Units("")
public short mode_index;
/**
* Standard mode.
*/
@Description("Standard mode.")
@Units("")
public short standard_mode;
/**
* Name of custom mode, with null termination character. Should be omitted for standard modes.
*/
@Description("Name of custom mode, with null termination character. Should be omitted for standard modes.")
@Units("")
public byte mode_name[] = new byte[35];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES;
packet.payload.putUnsignedInt(custom_mode);
packet.payload.putUnsignedInt(properties);
packet.payload.putUnsignedByte(number_modes);
packet.payload.putUnsignedByte(mode_index);
packet.payload.putUnsignedByte(standard_mode);
for (int i = 0; i < mode_name.length; i++) {
packet.payload.putByte(mode_name[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a available_modes message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.custom_mode = payload.getUnsignedInt();
this.properties = payload.getUnsignedInt();
this.number_modes = payload.getUnsignedByte();
this.mode_index = payload.getUnsignedByte();
this.standard_mode = payload.getUnsignedByte();
for (int i = 0; i < this.mode_name.length; i++) {
this.mode_name[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_available_modes() {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_available_modes( long custom_mode, long properties, short number_modes, short mode_index, short standard_mode, byte[] mode_name) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES;
this.custom_mode = custom_mode;
this.properties = properties;
this.number_modes = number_modes;
this.mode_index = mode_index;
this.standard_mode = standard_mode;
this.mode_name = mode_name;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_available_modes( long custom_mode, long properties, short number_modes, short mode_index, short standard_mode, byte[] mode_name, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.custom_mode = custom_mode;
this.properties = properties;
this.number_modes = number_modes;
this.mode_index = mode_index;
this.standard_mode = standard_mode;
this.mode_name = mode_name;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_available_modes(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setMode_Name(String str) {
int len = Math.min(str.length(), 35);
for (int i=0; i<len; i++) {
mode_name[i] = (byte) str.charAt(i);
}
for (int i=len; i<35; i++) { // padding for the rest of the buffer
mode_name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getMode_Name() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 35; i++) {
if (mode_name[i] != 0)
buf.append((char) mode_name[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AVAILABLE_MODES - sysid:"+sysid+" compid:"+compid+" custom_mode:"+custom_mode+" properties:"+properties+" number_modes:"+number_modes+" mode_index:"+mode_index+" standard_mode:"+standard_mode+" mode_name:"+mode_name+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AVAILABLE_MODES";
}
}

View File

@ -0,0 +1,133 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE AVAILABLE_MODES_MONITOR PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* A change to the sequence number indicates that the set of AVAILABLE_MODES has changed.
A receiver must re-request all available modes whenever the sequence number changes.
This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change.
See https://mavlink.io/en/services/standard_modes.html
*/
public class msg_available_modes_monitor extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR = 437;
public static final int MAVLINK_MSG_LENGTH = 1;
private static final long serialVersionUID = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
/**
* Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
*/
@Description("Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).")
@Units("")
public short seq;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
packet.payload.putUnsignedByte(seq);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a available_modes_monitor message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.seq = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_available_modes_monitor() {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_available_modes_monitor( short seq) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
this.seq = seq;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_available_modes_monitor( short seq, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.seq = seq;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_available_modes_monitor(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR - sysid:"+sysid+" compid:"+compid+" seq:"+seq+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR";
}
}

View File

@ -0,0 +1,453 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE BATTERY_INFO PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
*
Battery information that is static, or requires infrequent update.
This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate.
BATTERY_STATUS_V2 is used for higher-rate battery status information.
*/
public class msg_battery_info extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_BATTERY_INFO = 372;
public static final int MAVLINK_MSG_LENGTH = 140;
private static final long serialVersionUID = MAVLINK_MSG_ID_BATTERY_INFO;
/**
* Minimum per-cell voltage when discharging. 0: field not provided.
*/
@Description("Minimum per-cell voltage when discharging. 0: field not provided.")
@Units("V")
public float discharge_minimum_voltage;
/**
* Minimum per-cell voltage when charging. 0: field not provided.
*/
@Description("Minimum per-cell voltage when charging. 0: field not provided.")
@Units("V")
public float charging_minimum_voltage;
/**
* Minimum per-cell voltage when resting. 0: field not provided.
*/
@Description("Minimum per-cell voltage when resting. 0: field not provided.")
@Units("V")
public float resting_minimum_voltage;
/**
* Maximum per-cell voltage when charged. 0: field not provided.
*/
@Description("Maximum per-cell voltage when charged. 0: field not provided.")
@Units("V")
public float charging_maximum_voltage;
/**
* Maximum pack continuous charge current. 0: field not provided.
*/
@Description("Maximum pack continuous charge current. 0: field not provided.")
@Units("A")
public float charging_maximum_current;
/**
* Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided.
*/
@Description("Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided.")
@Units("V")
public float nominal_voltage;
/**
* Maximum pack discharge current. 0: field not provided.
*/
@Description("Maximum pack discharge current. 0: field not provided.")
@Units("A")
public float discharge_maximum_current;
/**
* Maximum pack discharge burst current. 0: field not provided.
*/
@Description("Maximum pack discharge burst current. 0: field not provided.")
@Units("A")
public float discharge_maximum_burst_current;
/**
* Fully charged design capacity. 0: field not provided.
*/
@Description("Fully charged design capacity. 0: field not provided.")
@Units("Ah")
public float design_capacity;
/**
* Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided.
*/
@Description("Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided.")
@Units("Ah")
public float full_charge_capacity;
/**
* Lifetime count of the number of charge/discharge cycles (https://en.wikipedia.org/wiki/Charge_cycle). UINT16_MAX: field not provided.
*/
@Description("Lifetime count of the number of charge/discharge cycles (https://en.wikipedia.org/wiki/Charge_cycle). UINT16_MAX: field not provided.")
@Units("")
public int cycle_count;
/**
* Battery weight. 0: field not provided.
*/
@Description("Battery weight. 0: field not provided.")
@Units("g")
public int weight;
/**
* Battery ID
*/
@Description("Battery ID")
@Units("")
public short id;
/**
* Function of the battery.
*/
@Description("Function of the battery.")
@Units("")
public short battery_function;
/**
* Type (chemistry) of the battery.
*/
@Description("Type (chemistry) of the battery.")
@Units("")
public short type;
/**
* State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided.
*/
@Description("State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided.")
@Units("%")
public short state_of_health;
/**
* Number of battery cells in series. 0: field not provided.
*/
@Description("Number of battery cells in series. 0: field not provided.")
@Units("")
public short cells_in_series;
/**
* Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided.
*/
@Description("Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided.")
@Units("")
public byte manufacture_date[] = new byte[9];
/**
* Serial number in ASCII characters, 0 terminated. All 0: field not provided.
*/
@Description("Serial number in ASCII characters, 0 terminated. All 0: field not provided.")
@Units("")
public byte serial_number[] = new byte[32];
/**
* Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided.
*/
@Description("Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided.")
@Units("")
public byte name[] = new byte[50];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_BATTERY_INFO;
packet.payload.putFloat(discharge_minimum_voltage);
packet.payload.putFloat(charging_minimum_voltage);
packet.payload.putFloat(resting_minimum_voltage);
packet.payload.putFloat(charging_maximum_voltage);
packet.payload.putFloat(charging_maximum_current);
packet.payload.putFloat(nominal_voltage);
packet.payload.putFloat(discharge_maximum_current);
packet.payload.putFloat(discharge_maximum_burst_current);
packet.payload.putFloat(design_capacity);
packet.payload.putFloat(full_charge_capacity);
packet.payload.putUnsignedShort(cycle_count);
packet.payload.putUnsignedShort(weight);
packet.payload.putUnsignedByte(id);
packet.payload.putUnsignedByte(battery_function);
packet.payload.putUnsignedByte(type);
packet.payload.putUnsignedByte(state_of_health);
packet.payload.putUnsignedByte(cells_in_series);
for (int i = 0; i < manufacture_date.length; i++) {
packet.payload.putByte(manufacture_date[i]);
}
for (int i = 0; i < serial_number.length; i++) {
packet.payload.putByte(serial_number[i]);
}
for (int i = 0; i < name.length; i++) {
packet.payload.putByte(name[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a battery_info message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.discharge_minimum_voltage = payload.getFloat();
this.charging_minimum_voltage = payload.getFloat();
this.resting_minimum_voltage = payload.getFloat();
this.charging_maximum_voltage = payload.getFloat();
this.charging_maximum_current = payload.getFloat();
this.nominal_voltage = payload.getFloat();
this.discharge_maximum_current = payload.getFloat();
this.discharge_maximum_burst_current = payload.getFloat();
this.design_capacity = payload.getFloat();
this.full_charge_capacity = payload.getFloat();
this.cycle_count = payload.getUnsignedShort();
this.weight = payload.getUnsignedShort();
this.id = payload.getUnsignedByte();
this.battery_function = payload.getUnsignedByte();
this.type = payload.getUnsignedByte();
this.state_of_health = payload.getUnsignedByte();
this.cells_in_series = payload.getUnsignedByte();
for (int i = 0; i < this.manufacture_date.length; i++) {
this.manufacture_date[i] = payload.getByte();
}
for (int i = 0; i < this.serial_number.length; i++) {
this.serial_number[i] = payload.getByte();
}
for (int i = 0; i < this.name.length; i++) {
this.name[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_battery_info() {
this.msgid = MAVLINK_MSG_ID_BATTERY_INFO;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_battery_info( float discharge_minimum_voltage, float charging_minimum_voltage, float resting_minimum_voltage, float charging_maximum_voltage, float charging_maximum_current, float nominal_voltage, float discharge_maximum_current, float discharge_maximum_burst_current, float design_capacity, float full_charge_capacity, int cycle_count, int weight, short id, short battery_function, short type, short state_of_health, short cells_in_series, byte[] manufacture_date, byte[] serial_number, byte[] name) {
this.msgid = MAVLINK_MSG_ID_BATTERY_INFO;
this.discharge_minimum_voltage = discharge_minimum_voltage;
this.charging_minimum_voltage = charging_minimum_voltage;
this.resting_minimum_voltage = resting_minimum_voltage;
this.charging_maximum_voltage = charging_maximum_voltage;
this.charging_maximum_current = charging_maximum_current;
this.nominal_voltage = nominal_voltage;
this.discharge_maximum_current = discharge_maximum_current;
this.discharge_maximum_burst_current = discharge_maximum_burst_current;
this.design_capacity = design_capacity;
this.full_charge_capacity = full_charge_capacity;
this.cycle_count = cycle_count;
this.weight = weight;
this.id = id;
this.battery_function = battery_function;
this.type = type;
this.state_of_health = state_of_health;
this.cells_in_series = cells_in_series;
this.manufacture_date = manufacture_date;
this.serial_number = serial_number;
this.name = name;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_battery_info( float discharge_minimum_voltage, float charging_minimum_voltage, float resting_minimum_voltage, float charging_maximum_voltage, float charging_maximum_current, float nominal_voltage, float discharge_maximum_current, float discharge_maximum_burst_current, float design_capacity, float full_charge_capacity, int cycle_count, int weight, short id, short battery_function, short type, short state_of_health, short cells_in_series, byte[] manufacture_date, byte[] serial_number, byte[] name, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_BATTERY_INFO;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.discharge_minimum_voltage = discharge_minimum_voltage;
this.charging_minimum_voltage = charging_minimum_voltage;
this.resting_minimum_voltage = resting_minimum_voltage;
this.charging_maximum_voltage = charging_maximum_voltage;
this.charging_maximum_current = charging_maximum_current;
this.nominal_voltage = nominal_voltage;
this.discharge_maximum_current = discharge_maximum_current;
this.discharge_maximum_burst_current = discharge_maximum_burst_current;
this.design_capacity = design_capacity;
this.full_charge_capacity = full_charge_capacity;
this.cycle_count = cycle_count;
this.weight = weight;
this.id = id;
this.battery_function = battery_function;
this.type = type;
this.state_of_health = state_of_health;
this.cells_in_series = cells_in_series;
this.manufacture_date = manufacture_date;
this.serial_number = serial_number;
this.name = name;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_battery_info(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_BATTERY_INFO;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setManufacture_Date(String str) {
int len = Math.min(str.length(), 9);
for (int i=0; i<len; i++) {
manufacture_date[i] = (byte) str.charAt(i);
}
for (int i=len; i<9; i++) { // padding for the rest of the buffer
manufacture_date[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getManufacture_Date() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 9; i++) {
if (manufacture_date[i] != 0)
buf.append((char) manufacture_date[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setSerial_Number(String str) {
int len = Math.min(str.length(), 32);
for (int i=0; i<len; i++) {
serial_number[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
serial_number[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getSerial_Number() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (serial_number[i] != 0)
buf.append((char) serial_number[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setName(String str) {
int len = Math.min(str.length(), 50);
for (int i=0; i<len; i++) {
name[i] = (byte) str.charAt(i);
}
for (int i=len; i<50; i++) { // padding for the rest of the buffer
name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getName() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 50; i++) {
if (name[i] != 0)
buf.append((char) name[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_BATTERY_INFO - sysid:"+sysid+" compid:"+compid+" discharge_minimum_voltage:"+discharge_minimum_voltage+" charging_minimum_voltage:"+charging_minimum_voltage+" resting_minimum_voltage:"+resting_minimum_voltage+" charging_maximum_voltage:"+charging_maximum_voltage+" charging_maximum_current:"+charging_maximum_current+" nominal_voltage:"+nominal_voltage+" discharge_maximum_current:"+discharge_maximum_current+" discharge_maximum_burst_current:"+discharge_maximum_burst_current+" design_capacity:"+design_capacity+" full_charge_capacity:"+full_charge_capacity+" cycle_count:"+cycle_count+" weight:"+weight+" id:"+id+" battery_function:"+battery_function+" type:"+type+" state_of_health:"+state_of_health+" cells_in_series:"+cells_in_series+" manufacture_date:"+manufacture_date+" serial_number:"+serial_number+" name:"+name+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_BATTERY_INFO";
}
}

View File

@ -0,0 +1,288 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE BATTERY_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO.
*/
public class msg_battery_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_BATTERY_STATUS = 147;
public static final int MAVLINK_MSG_LENGTH = 54;
private static final long serialVersionUID = MAVLINK_MSG_ID_BATTERY_STATUS;
/**
* Consumed charge, -1: autopilot does not provide consumption estimate
*/
@Description("Consumed charge, -1: autopilot does not provide consumption estimate")
@Units("mAh")
public int current_consumed;
/**
* Consumed energy, -1: autopilot does not provide energy consumption estimate
*/
@Description("Consumed energy, -1: autopilot does not provide energy consumption estimate")
@Units("hJ")
public int energy_consumed;
/**
* Temperature of the battery. INT16_MAX for unknown temperature.
*/
@Description("Temperature of the battery. INT16_MAX for unknown temperature.")
@Units("cdegC")
public short temperature;
/**
* Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1).
*/
@Description("Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1).")
@Units("mV")
public int voltages[] = new int[10];
/**
* Battery current, -1: autopilot does not measure the current
*/
@Description("Battery current, -1: autopilot does not measure the current")
@Units("cA")
public short current_battery;
/**
* Battery ID
*/
@Description("Battery ID")
@Units("")
public short id;
/**
* Function of the battery
*/
@Description("Function of the battery")
@Units("")
public short battery_function;
/**
* Type (chemistry) of the battery
*/
@Description("Type (chemistry) of the battery")
@Units("")
public short type;
/**
* Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.
*/
@Description("Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery.")
@Units("%")
public byte battery_remaining;
/**
* Remaining battery time, 0: autopilot does not provide remaining battery time estimate
*/
@Description("Remaining battery time, 0: autopilot does not provide remaining battery time estimate")
@Units("s")
public int time_remaining;
/**
* State for extent of discharge, provided by autopilot for warning or external reactions
*/
@Description("State for extent of discharge, provided by autopilot for warning or external reactions")
@Units("")
public short charge_state;
/**
* Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead.
*/
@Description("Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead.")
@Units("mV")
public int voltages_ext[] = new int[4];
/**
* Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode.
*/
@Description("Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode.")
@Units("")
public short mode;
/**
* Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported).
*/
@Description("Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported).")
@Units("")
public long fault_bitmask;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
packet.payload.putInt(current_consumed);
packet.payload.putInt(energy_consumed);
packet.payload.putShort(temperature);
for (int i = 0; i < voltages.length; i++) {
packet.payload.putUnsignedShort(voltages[i]);
}
packet.payload.putShort(current_battery);
packet.payload.putUnsignedByte(id);
packet.payload.putUnsignedByte(battery_function);
packet.payload.putUnsignedByte(type);
packet.payload.putByte(battery_remaining);
if (isMavlink2) {
packet.payload.putInt(time_remaining);
packet.payload.putUnsignedByte(charge_state);
for (int i = 0; i < voltages_ext.length; i++) {
packet.payload.putUnsignedShort(voltages_ext[i]);
}
packet.payload.putUnsignedByte(mode);
packet.payload.putUnsignedInt(fault_bitmask);
}
return packet;
}
/**
* Decode a battery_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.current_consumed = payload.getInt();
this.energy_consumed = payload.getInt();
this.temperature = payload.getShort();
for (int i = 0; i < this.voltages.length; i++) {
this.voltages[i] = payload.getUnsignedShort();
}
this.current_battery = payload.getShort();
this.id = payload.getUnsignedByte();
this.battery_function = payload.getUnsignedByte();
this.type = payload.getUnsignedByte();
this.battery_remaining = payload.getByte();
if (isMavlink2) {
this.time_remaining = payload.getInt();
this.charge_state = payload.getUnsignedByte();
for (int i = 0; i < this.voltages_ext.length; i++) {
this.voltages_ext[i] = payload.getUnsignedShort();
}
this.mode = payload.getUnsignedByte();
this.fault_bitmask = payload.getUnsignedInt();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_battery_status() {
this.msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_battery_status( int current_consumed, int energy_consumed, short temperature, int[] voltages, short current_battery, short id, short battery_function, short type, byte battery_remaining, int time_remaining, short charge_state, int[] voltages_ext, short mode, long fault_bitmask) {
this.msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
this.current_consumed = current_consumed;
this.energy_consumed = energy_consumed;
this.temperature = temperature;
this.voltages = voltages;
this.current_battery = current_battery;
this.id = id;
this.battery_function = battery_function;
this.type = type;
this.battery_remaining = battery_remaining;
this.time_remaining = time_remaining;
this.charge_state = charge_state;
this.voltages_ext = voltages_ext;
this.mode = mode;
this.fault_bitmask = fault_bitmask;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_battery_status( int current_consumed, int energy_consumed, short temperature, int[] voltages, short current_battery, short id, short battery_function, short type, byte battery_remaining, int time_remaining, short charge_state, int[] voltages_ext, short mode, long fault_bitmask, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.current_consumed = current_consumed;
this.energy_consumed = energy_consumed;
this.temperature = temperature;
this.voltages = voltages;
this.current_battery = current_battery;
this.id = id;
this.battery_function = battery_function;
this.type = type;
this.battery_remaining = battery_remaining;
this.time_remaining = time_remaining;
this.charge_state = charge_state;
this.voltages_ext = voltages_ext;
this.mode = mode;
this.fault_bitmask = fault_bitmask;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_battery_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_BATTERY_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_BATTERY_STATUS - sysid:"+sysid+" compid:"+compid+" current_consumed:"+current_consumed+" energy_consumed:"+energy_consumed+" temperature:"+temperature+" voltages:"+voltages+" current_battery:"+current_battery+" id:"+id+" battery_function:"+battery_function+" type:"+type+" battery_remaining:"+battery_remaining+" time_remaining:"+time_remaining+" charge_state:"+charge_state+" voltages_ext:"+voltages_ext+" mode:"+mode+" fault_bitmask:"+fault_bitmask+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_BATTERY_STATUS";
}
}

View File

@ -0,0 +1,151 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE BUTTON_CHANGE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Report button state change.
*/
public class msg_button_change extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_BUTTON_CHANGE = 257;
public static final int MAVLINK_MSG_LENGTH = 9;
private static final long serialVersionUID = MAVLINK_MSG_ID_BUTTON_CHANGE;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Time of last change of button state.
*/
@Description("Time of last change of button state.")
@Units("ms")
public long last_change_ms;
/**
* Bitmap for state of buttons.
*/
@Description("Bitmap for state of buttons.")
@Units("")
public short state;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedInt(last_change_ms);
packet.payload.putUnsignedByte(state);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a button_change message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.last_change_ms = payload.getUnsignedInt();
this.state = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_button_change() {
this.msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_button_change( long time_boot_ms, long last_change_ms, short state) {
this.msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
this.time_boot_ms = time_boot_ms;
this.last_change_ms = last_change_ms;
this.state = state;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_button_change( long time_boot_ms, long last_change_ms, short state, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.last_change_ms = last_change_ms;
this.state = state;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_button_change(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_BUTTON_CHANGE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_BUTTON_CHANGE - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" last_change_ms:"+last_change_ms+" state:"+state+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_BUTTON_CHANGE";
}
}

View File

@ -0,0 +1,206 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_CAPTURE_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
public class msg_camera_capture_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS = 262;
public static final int MAVLINK_MSG_LENGTH = 23;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Image capture interval
*/
@Description("Image capture interval")
@Units("s")
public float image_interval;
/**
* Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
*/
@Description("Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.")
@Units("ms")
public long recording_time_ms;
/**
* Available storage capacity.
*/
@Description("Available storage capacity.")
@Units("MiB")
public float available_capacity;
/**
* Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
*/
@Description("Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)")
@Units("")
public short image_status;
/**
* Current status of video capturing (0: idle, 1: capture in progress)
*/
@Description("Current status of video capturing (0: idle, 1: capture in progress)")
@Units("")
public short video_status;
/**
* Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
*/
@Description("Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).")
@Units("")
public int image_count;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putFloat(image_interval);
packet.payload.putUnsignedInt(recording_time_ms);
packet.payload.putFloat(available_capacity);
packet.payload.putUnsignedByte(image_status);
packet.payload.putUnsignedByte(video_status);
if (isMavlink2) {
packet.payload.putInt(image_count);
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_capture_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.image_interval = payload.getFloat();
this.recording_time_ms = payload.getUnsignedInt();
this.available_capacity = payload.getFloat();
this.image_status = payload.getUnsignedByte();
this.video_status = payload.getUnsignedByte();
if (isMavlink2) {
this.image_count = payload.getInt();
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_capture_status() {
this.msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_capture_status( long time_boot_ms, float image_interval, long recording_time_ms, float available_capacity, short image_status, short video_status, int image_count, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
this.time_boot_ms = time_boot_ms;
this.image_interval = image_interval;
this.recording_time_ms = recording_time_ms;
this.available_capacity = available_capacity;
this.image_status = image_status;
this.video_status = video_status;
this.image_count = image_count;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_capture_status( long time_boot_ms, float image_interval, long recording_time_ms, float available_capacity, short image_status, short video_status, int image_count, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.image_interval = image_interval;
this.recording_time_ms = recording_time_ms;
this.available_capacity = available_capacity;
this.image_status = image_status;
this.video_status = video_status;
this.image_count = image_count;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_capture_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" image_interval:"+image_interval+" recording_time_ms:"+recording_time_ms+" available_capacity:"+available_capacity+" image_status:"+image_status+" video_status:"+video_status+" image_count:"+image_count+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS";
}
}

View File

@ -0,0 +1,247 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_FOV_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
public class msg_camera_fov_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_FOV_STATUS = 271;
public static final int MAVLINK_MSG_LENGTH = 53;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Latitude of camera (INT32_MAX if unknown).
*/
@Description("Latitude of camera (INT32_MAX if unknown).")
@Units("degE7")
public int lat_camera;
/**
* Longitude of camera (INT32_MAX if unknown).
*/
@Description("Longitude of camera (INT32_MAX if unknown).")
@Units("degE7")
public int lon_camera;
/**
* Altitude (MSL) of camera (INT32_MAX if unknown).
*/
@Description("Altitude (MSL) of camera (INT32_MAX if unknown).")
@Units("mm")
public int alt_camera;
/**
* Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
*/
@Description("Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).")
@Units("degE7")
public int lat_image;
/**
* Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
*/
@Description("Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).")
@Units("degE7")
public int lon_image;
/**
* Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).
*/
@Description("Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon).")
@Units("mm")
public int alt_image;
/**
* Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
*/
@Description("Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)")
@Units("")
public float q[] = new float[4];
/**
* Horizontal field of view (NaN if unknown).
*/
@Description("Horizontal field of view (NaN if unknown).")
@Units("deg")
public float hfov;
/**
* Vertical field of view (NaN if unknown).
*/
@Description("Vertical field of view (NaN if unknown).")
@Units("deg")
public float vfov;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putInt(lat_camera);
packet.payload.putInt(lon_camera);
packet.payload.putInt(alt_camera);
packet.payload.putInt(lat_image);
packet.payload.putInt(lon_image);
packet.payload.putInt(alt_image);
for (int i = 0; i < q.length; i++) {
packet.payload.putFloat(q[i]);
}
packet.payload.putFloat(hfov);
packet.payload.putFloat(vfov);
if (isMavlink2) {
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_fov_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.lat_camera = payload.getInt();
this.lon_camera = payload.getInt();
this.alt_camera = payload.getInt();
this.lat_image = payload.getInt();
this.lon_image = payload.getInt();
this.alt_image = payload.getInt();
for (int i = 0; i < this.q.length; i++) {
this.q[i] = payload.getFloat();
}
this.hfov = payload.getFloat();
this.vfov = payload.getFloat();
if (isMavlink2) {
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_fov_status() {
this.msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_fov_status( long time_boot_ms, int lat_camera, int lon_camera, int alt_camera, int lat_image, int lon_image, int alt_image, float[] q, float hfov, float vfov, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
this.time_boot_ms = time_boot_ms;
this.lat_camera = lat_camera;
this.lon_camera = lon_camera;
this.alt_camera = alt_camera;
this.lat_image = lat_image;
this.lon_image = lon_image;
this.alt_image = alt_image;
this.q = q;
this.hfov = hfov;
this.vfov = vfov;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_fov_status( long time_boot_ms, int lat_camera, int lon_camera, int alt_camera, int lat_image, int lon_image, int alt_image, float[] q, float hfov, float vfov, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.lat_camera = lat_camera;
this.lon_camera = lon_camera;
this.alt_camera = alt_camera;
this.lat_image = lat_image;
this.lon_image = lon_image;
this.alt_image = alt_image;
this.q = q;
this.hfov = hfov;
this.vfov = vfov;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_fov_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_FOV_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_FOV_STATUS - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" lat_camera:"+lat_camera+" lon_camera:"+lon_camera+" alt_camera:"+alt_camera+" lat_image:"+lat_image+" lon_image:"+lon_image+" alt_image:"+alt_image+" q:"+q+" hfov:"+hfov+" vfov:"+vfov+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_FOV_STATUS";
}
}

View File

@ -0,0 +1,290 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_IMAGE_CAPTURED PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about a captured image. This is emitted every time a message is captured.
MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers:
MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers.
MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send:
set to 0 (default) to send just the the message for the sequence number in param 2,
set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers,
set to the sequence number of the final message in the range.
*/
public class msg_camera_image_captured extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED = 263;
public static final int MAVLINK_MSG_LENGTH = 255;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
/**
* Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
*/
@Description("Timestamp (time since UNIX epoch) in UTC. 0 for unknown.")
@Units("us")
public long time_utc;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Latitude where image was taken
*/
@Description("Latitude where image was taken")
@Units("degE7")
public int lat;
/**
* Longitude where capture was taken
*/
@Description("Longitude where capture was taken")
@Units("degE7")
public int lon;
/**
* Altitude (MSL) where image was taken
*/
@Description("Altitude (MSL) where image was taken")
@Units("mm")
public int alt;
/**
* Altitude above ground
*/
@Description("Altitude above ground")
@Units("mm")
public int relative_alt;
/**
* Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
*/
@Description("Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)")
@Units("")
public float q[] = new float[4];
/**
* Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
*/
@Description("Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)")
@Units("")
public int image_index;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id.
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id.")
@Units("")
public short camera_id;
/**
* Boolean indicating success (1) or failure (0) while capturing this image.
*/
@Description("Boolean indicating success (1) or failure (0) while capturing this image.")
@Units("")
public byte capture_result;
/**
* URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
*/
@Description("URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.")
@Units("")
public byte file_url[] = new byte[205];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
packet.payload.putUnsignedLong(time_utc);
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putInt(lat);
packet.payload.putInt(lon);
packet.payload.putInt(alt);
packet.payload.putInt(relative_alt);
for (int i = 0; i < q.length; i++) {
packet.payload.putFloat(q[i]);
}
packet.payload.putInt(image_index);
packet.payload.putUnsignedByte(camera_id);
packet.payload.putByte(capture_result);
for (int i = 0; i < file_url.length; i++) {
packet.payload.putByte(file_url[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a camera_image_captured message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_utc = payload.getUnsignedLong();
this.time_boot_ms = payload.getUnsignedInt();
this.lat = payload.getInt();
this.lon = payload.getInt();
this.alt = payload.getInt();
this.relative_alt = payload.getInt();
for (int i = 0; i < this.q.length; i++) {
this.q[i] = payload.getFloat();
}
this.image_index = payload.getInt();
this.camera_id = payload.getUnsignedByte();
this.capture_result = payload.getByte();
for (int i = 0; i < this.file_url.length; i++) {
this.file_url[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_image_captured() {
this.msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_image_captured( long time_utc, long time_boot_ms, int lat, int lon, int alt, int relative_alt, float[] q, int image_index, short camera_id, byte capture_result, byte[] file_url) {
this.msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
this.time_utc = time_utc;
this.time_boot_ms = time_boot_ms;
this.lat = lat;
this.lon = lon;
this.alt = alt;
this.relative_alt = relative_alt;
this.q = q;
this.image_index = image_index;
this.camera_id = camera_id;
this.capture_result = capture_result;
this.file_url = file_url;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_image_captured( long time_utc, long time_boot_ms, int lat, int lon, int alt, int relative_alt, float[] q, int image_index, short camera_id, byte capture_result, byte[] file_url, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_utc = time_utc;
this.time_boot_ms = time_boot_ms;
this.lat = lat;
this.lon = lon;
this.alt = alt;
this.relative_alt = relative_alt;
this.q = q;
this.image_index = image_index;
this.camera_id = camera_id;
this.capture_result = capture_result;
this.file_url = file_url;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_image_captured(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setFile_Url(String str) {
int len = Math.min(str.length(), 205);
for (int i=0; i<len; i++) {
file_url[i] = (byte) str.charAt(i);
}
for (int i=len; i<205; i++) { // padding for the rest of the buffer
file_url[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getFile_Url() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 205; i++) {
if (file_url[i] != 0)
buf.append((char) file_url[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED - sysid:"+sysid+" compid:"+compid+" time_utc:"+time_utc+" time_boot_ms:"+time_boot_ms+" lat:"+lat+" lon:"+lon+" alt:"+alt+" relative_alt:"+relative_alt+" q:"+q+" image_index:"+image_index+" camera_id:"+camera_id+" capture_result:"+capture_result+" file_url:"+file_url+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED";
}
}

View File

@ -0,0 +1,336 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_INFORMATION PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
public class msg_camera_information extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_INFORMATION = 259;
public static final int MAVLINK_MSG_LENGTH = 237;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_INFORMATION;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Version of the camera firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff). Use 0 if not known.
*/
@Description("Version of the camera firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff). Use 0 if not known.")
@Units("")
public long firmware_version;
/**
* Focal length. Use NaN if not known.
*/
@Description("Focal length. Use NaN if not known.")
@Units("mm")
public float focal_length;
/**
* Image sensor size horizontal. Use NaN if not known.
*/
@Description("Image sensor size horizontal. Use NaN if not known.")
@Units("mm")
public float sensor_size_h;
/**
* Image sensor size vertical. Use NaN if not known.
*/
@Description("Image sensor size vertical. Use NaN if not known.")
@Units("mm")
public float sensor_size_v;
/**
* Bitmap of camera capability flags.
*/
@Description("Bitmap of camera capability flags.")
@Units("")
public long flags;
/**
* Horizontal image resolution. Use 0 if not known.
*/
@Description("Horizontal image resolution. Use 0 if not known.")
@Units("pix")
public int resolution_h;
/**
* Vertical image resolution. Use 0 if not known.
*/
@Description("Vertical image resolution. Use 0 if not known.")
@Units("pix")
public int resolution_v;
/**
* Camera definition version (iteration). Use 0 if not known.
*/
@Description("Camera definition version (iteration). Use 0 if not known.")
@Units("")
public int cam_definition_version;
/**
* Name of the camera vendor
*/
@Description("Name of the camera vendor")
@Units("")
public short vendor_name[] = new short[32];
/**
* Name of the camera model
*/
@Description("Name of the camera model")
@Units("")
public short model_name[] = new short[32];
/**
* Reserved for a lens ID. Use 0 if not known.
*/
@Description("Reserved for a lens ID. Use 0 if not known.")
@Units("")
public short lens_id;
/**
* Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known.
*/
@Description("Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known.")
@Units("")
public byte cam_definition_uri[] = new byte[140];
/**
* Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera.
*/
@Description("Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera.")
@Units("")
public short gimbal_device_id;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedInt(firmware_version);
packet.payload.putFloat(focal_length);
packet.payload.putFloat(sensor_size_h);
packet.payload.putFloat(sensor_size_v);
packet.payload.putUnsignedInt(flags);
packet.payload.putUnsignedShort(resolution_h);
packet.payload.putUnsignedShort(resolution_v);
packet.payload.putUnsignedShort(cam_definition_version);
for (int i = 0; i < vendor_name.length; i++) {
packet.payload.putUnsignedByte(vendor_name[i]);
}
for (int i = 0; i < model_name.length; i++) {
packet.payload.putUnsignedByte(model_name[i]);
}
packet.payload.putUnsignedByte(lens_id);
for (int i = 0; i < cam_definition_uri.length; i++) {
packet.payload.putByte(cam_definition_uri[i]);
}
if (isMavlink2) {
packet.payload.putUnsignedByte(gimbal_device_id);
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_information message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.firmware_version = payload.getUnsignedInt();
this.focal_length = payload.getFloat();
this.sensor_size_h = payload.getFloat();
this.sensor_size_v = payload.getFloat();
this.flags = payload.getUnsignedInt();
this.resolution_h = payload.getUnsignedShort();
this.resolution_v = payload.getUnsignedShort();
this.cam_definition_version = payload.getUnsignedShort();
for (int i = 0; i < this.vendor_name.length; i++) {
this.vendor_name[i] = payload.getUnsignedByte();
}
for (int i = 0; i < this.model_name.length; i++) {
this.model_name[i] = payload.getUnsignedByte();
}
this.lens_id = payload.getUnsignedByte();
for (int i = 0; i < this.cam_definition_uri.length; i++) {
this.cam_definition_uri[i] = payload.getByte();
}
if (isMavlink2) {
this.gimbal_device_id = payload.getUnsignedByte();
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_information() {
this.msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_information( long time_boot_ms, long firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, long flags, int resolution_h, int resolution_v, int cam_definition_version, short[] vendor_name, short[] model_name, short lens_id, byte[] cam_definition_uri, short gimbal_device_id, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
this.time_boot_ms = time_boot_ms;
this.firmware_version = firmware_version;
this.focal_length = focal_length;
this.sensor_size_h = sensor_size_h;
this.sensor_size_v = sensor_size_v;
this.flags = flags;
this.resolution_h = resolution_h;
this.resolution_v = resolution_v;
this.cam_definition_version = cam_definition_version;
this.vendor_name = vendor_name;
this.model_name = model_name;
this.lens_id = lens_id;
this.cam_definition_uri = cam_definition_uri;
this.gimbal_device_id = gimbal_device_id;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_information( long time_boot_ms, long firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, long flags, int resolution_h, int resolution_v, int cam_definition_version, short[] vendor_name, short[] model_name, short lens_id, byte[] cam_definition_uri, short gimbal_device_id, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.firmware_version = firmware_version;
this.focal_length = focal_length;
this.sensor_size_h = sensor_size_h;
this.sensor_size_v = sensor_size_v;
this.flags = flags;
this.resolution_h = resolution_h;
this.resolution_v = resolution_v;
this.cam_definition_version = cam_definition_version;
this.vendor_name = vendor_name;
this.model_name = model_name;
this.lens_id = lens_id;
this.cam_definition_uri = cam_definition_uri;
this.gimbal_device_id = gimbal_device_id;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_information(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setCam_Definition_Uri(String str) {
int len = Math.min(str.length(), 140);
for (int i=0; i<len; i++) {
cam_definition_uri[i] = (byte) str.charAt(i);
}
for (int i=len; i<140; i++) { // padding for the rest of the buffer
cam_definition_uri[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getCam_Definition_Uri() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 140; i++) {
if (cam_definition_uri[i] != 0)
buf.append((char) cam_definition_uri[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_INFORMATION - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" firmware_version:"+firmware_version+" focal_length:"+focal_length+" sensor_size_h:"+sensor_size_h+" sensor_size_v:"+sensor_size_v+" flags:"+flags+" resolution_h:"+resolution_h+" resolution_v:"+resolution_v+" cam_definition_version:"+cam_definition_version+" vendor_name:"+vendor_name+" model_name:"+model_name+" lens_id:"+lens_id+" cam_definition_uri:"+cam_definition_uri+" gimbal_device_id:"+gimbal_device_id+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_INFORMATION";
}
}

View File

@ -0,0 +1,173 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_SETTINGS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command.
*/
public class msg_camera_settings extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_SETTINGS = 260;
public static final int MAVLINK_MSG_LENGTH = 14;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_SETTINGS;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Camera mode
*/
@Description("Camera mode")
@Units("")
public short mode_id;
/**
* Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)
*/
@Description("Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)")
@Units("")
public float zoomLevel;
/**
* Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)
*/
@Description("Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)")
@Units("")
public float focusLevel;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedByte(mode_id);
if (isMavlink2) {
packet.payload.putFloat(zoomLevel);
packet.payload.putFloat(focusLevel);
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_settings message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.mode_id = payload.getUnsignedByte();
if (isMavlink2) {
this.zoomLevel = payload.getFloat();
this.focusLevel = payload.getFloat();
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_settings() {
this.msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_settings( long time_boot_ms, short mode_id, float zoomLevel, float focusLevel, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
this.time_boot_ms = time_boot_ms;
this.mode_id = mode_id;
this.zoomLevel = zoomLevel;
this.focusLevel = focusLevel;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_settings( long time_boot_ms, short mode_id, float zoomLevel, float focusLevel, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.mode_id = mode_id;
this.zoomLevel = zoomLevel;
this.focusLevel = focusLevel;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_settings(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_SETTINGS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_SETTINGS - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" mode_id:"+mode_id+" zoomLevel:"+zoomLevel+" focusLevel:"+focusLevel+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_SETTINGS";
}
}

View File

@ -0,0 +1,217 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_THERMAL_RANGE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras).
*/
public class msg_camera_thermal_range extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE = 277;
public static final int MAVLINK_MSG_LENGTH = 30;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Temperature max.
*/
@Description("Temperature max.")
@Units("degC")
public float max;
/**
* Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown.
*/
@Description("Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown.")
@Units("")
public float max_point_x;
/**
* Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown.
*/
@Description("Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown.")
@Units("")
public float max_point_y;
/**
* Temperature min.
*/
@Description("Temperature min.")
@Units("degC")
public float min;
/**
* Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown.
*/
@Description("Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown.")
@Units("")
public float min_point_x;
/**
* Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown.
*/
@Description("Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown.")
@Units("")
public float min_point_y;
/**
* Video Stream ID (1 for first, 2 for second, etc.)
*/
@Description("Video Stream ID (1 for first, 2 for second, etc.)")
@Units("")
public short stream_id;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putFloat(max);
packet.payload.putFloat(max_point_x);
packet.payload.putFloat(max_point_y);
packet.payload.putFloat(min);
packet.payload.putFloat(min_point_x);
packet.payload.putFloat(min_point_y);
packet.payload.putUnsignedByte(stream_id);
packet.payload.putUnsignedByte(camera_device_id);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a camera_thermal_range message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.max = payload.getFloat();
this.max_point_x = payload.getFloat();
this.max_point_y = payload.getFloat();
this.min = payload.getFloat();
this.min_point_x = payload.getFloat();
this.min_point_y = payload.getFloat();
this.stream_id = payload.getUnsignedByte();
this.camera_device_id = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_thermal_range() {
this.msgid = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_thermal_range( long time_boot_ms, float max, float max_point_x, float max_point_y, float min, float min_point_x, float min_point_y, short stream_id, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
this.time_boot_ms = time_boot_ms;
this.max = max;
this.max_point_x = max_point_x;
this.max_point_y = max_point_y;
this.min = min;
this.min_point_x = min_point_x;
this.min_point_y = min_point_y;
this.stream_id = stream_id;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_thermal_range( long time_boot_ms, float max, float max_point_x, float max_point_y, float min, float min_point_x, float min_point_y, short stream_id, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.max = max;
this.max_point_x = max_point_x;
this.max_point_y = max_point_y;
this.min = min;
this.min_point_x = min_point_x;
this.min_point_y = min_point_y;
this.stream_id = stream_id;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_thermal_range(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" max:"+max+" max_point_x:"+max_point_x+" max_point_y:"+max_point_y+" min:"+min+" min_point_x:"+min_point_x+" min_point_y:"+min_point_y+" stream_id:"+stream_id+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE";
}
}

View File

@ -0,0 +1,272 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_TRACKING_GEO_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval.
*/
public class msg_camera_tracking_geo_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS = 276;
public static final int MAVLINK_MSG_LENGTH = 50;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
/**
* Latitude of tracked object
*/
@Description("Latitude of tracked object")
@Units("degE7")
public int lat;
/**
* Longitude of tracked object
*/
@Description("Longitude of tracked object")
@Units("degE7")
public int lon;
/**
* Altitude of tracked object(AMSL, WGS84)
*/
@Description("Altitude of tracked object(AMSL, WGS84)")
@Units("m")
public float alt;
/**
* Horizontal accuracy. NAN if unknown
*/
@Description("Horizontal accuracy. NAN if unknown")
@Units("m")
public float h_acc;
/**
* Vertical accuracy. NAN if unknown
*/
@Description("Vertical accuracy. NAN if unknown")
@Units("m")
public float v_acc;
/**
* North velocity of tracked object. NAN if unknown
*/
@Description("North velocity of tracked object. NAN if unknown")
@Units("m/s")
public float vel_n;
/**
* East velocity of tracked object. NAN if unknown
*/
@Description("East velocity of tracked object. NAN if unknown")
@Units("m/s")
public float vel_e;
/**
* Down velocity of tracked object. NAN if unknown
*/
@Description("Down velocity of tracked object. NAN if unknown")
@Units("m/s")
public float vel_d;
/**
* Velocity accuracy. NAN if unknown
*/
@Description("Velocity accuracy. NAN if unknown")
@Units("m/s")
public float vel_acc;
/**
* Distance between camera and tracked object. NAN if unknown
*/
@Description("Distance between camera and tracked object. NAN if unknown")
@Units("m")
public float dist;
/**
* Heading in radians, in NED. NAN if unknown
*/
@Description("Heading in radians, in NED. NAN if unknown")
@Units("rad")
public float hdg;
/**
* Accuracy of heading, in NED. NAN if unknown
*/
@Description("Accuracy of heading, in NED. NAN if unknown")
@Units("rad")
public float hdg_acc;
/**
* Current tracking status
*/
@Description("Current tracking status")
@Units("")
public short tracking_status;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
packet.payload.putInt(lat);
packet.payload.putInt(lon);
packet.payload.putFloat(alt);
packet.payload.putFloat(h_acc);
packet.payload.putFloat(v_acc);
packet.payload.putFloat(vel_n);
packet.payload.putFloat(vel_e);
packet.payload.putFloat(vel_d);
packet.payload.putFloat(vel_acc);
packet.payload.putFloat(dist);
packet.payload.putFloat(hdg);
packet.payload.putFloat(hdg_acc);
packet.payload.putUnsignedByte(tracking_status);
if (isMavlink2) {
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_tracking_geo_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.lat = payload.getInt();
this.lon = payload.getInt();
this.alt = payload.getFloat();
this.h_acc = payload.getFloat();
this.v_acc = payload.getFloat();
this.vel_n = payload.getFloat();
this.vel_e = payload.getFloat();
this.vel_d = payload.getFloat();
this.vel_acc = payload.getFloat();
this.dist = payload.getFloat();
this.hdg = payload.getFloat();
this.hdg_acc = payload.getFloat();
this.tracking_status = payload.getUnsignedByte();
if (isMavlink2) {
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_tracking_geo_status() {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_tracking_geo_status( int lat, int lon, float alt, float h_acc, float v_acc, float vel_n, float vel_e, float vel_d, float vel_acc, float dist, float hdg, float hdg_acc, short tracking_status, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
this.lat = lat;
this.lon = lon;
this.alt = alt;
this.h_acc = h_acc;
this.v_acc = v_acc;
this.vel_n = vel_n;
this.vel_e = vel_e;
this.vel_d = vel_d;
this.vel_acc = vel_acc;
this.dist = dist;
this.hdg = hdg;
this.hdg_acc = hdg_acc;
this.tracking_status = tracking_status;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_tracking_geo_status( int lat, int lon, float alt, float h_acc, float v_acc, float vel_n, float vel_e, float vel_d, float vel_acc, float dist, float hdg, float hdg_acc, short tracking_status, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.lat = lat;
this.lon = lon;
this.alt = alt;
this.h_acc = h_acc;
this.v_acc = v_acc;
this.vel_n = vel_n;
this.vel_e = vel_e;
this.vel_d = vel_d;
this.vel_acc = vel_acc;
this.dist = dist;
this.hdg = hdg;
this.hdg_acc = hdg_acc;
this.tracking_status = tracking_status;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_tracking_geo_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS - sysid:"+sysid+" compid:"+compid+" lat:"+lat+" lon:"+lon+" alt:"+alt+" h_acc:"+h_acc+" v_acc:"+v_acc+" vel_n:"+vel_n+" vel_e:"+vel_e+" vel_d:"+vel_d+" vel_acc:"+vel_acc+" dist:"+dist+" hdg:"+hdg+" hdg_acc:"+hdg_acc+" tracking_status:"+tracking_status+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS";
}
}

View File

@ -0,0 +1,239 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_TRACKING_IMAGE_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval.
*/
public class msg_camera_tracking_image_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS = 275;
public static final int MAVLINK_MSG_LENGTH = 32;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
/**
* Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown
*/
@Description("Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown")
@Units("")
public float point_x;
/**
* Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
*/
@Description("Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown")
@Units("")
public float point_y;
/**
* Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown
*/
@Description("Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown")
@Units("")
public float radius;
/**
* Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
*/
@Description("Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown")
@Units("")
public float rec_top_x;
/**
* Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
*/
@Description("Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown")
@Units("")
public float rec_top_y;
/**
* Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown
*/
@Description("Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown")
@Units("")
public float rec_bottom_x;
/**
* Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown
*/
@Description("Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown")
@Units("")
public float rec_bottom_y;
/**
* Current tracking status
*/
@Description("Current tracking status")
@Units("")
public short tracking_status;
/**
* Current tracking mode
*/
@Description("Current tracking mode")
@Units("")
public short tracking_mode;
/**
* Defines location of target data
*/
@Description("Defines location of target data")
@Units("")
public short target_data;
/**
* Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
*/
@Description("Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).")
@Units("")
public short camera_device_id;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
packet.payload.putFloat(point_x);
packet.payload.putFloat(point_y);
packet.payload.putFloat(radius);
packet.payload.putFloat(rec_top_x);
packet.payload.putFloat(rec_top_y);
packet.payload.putFloat(rec_bottom_x);
packet.payload.putFloat(rec_bottom_y);
packet.payload.putUnsignedByte(tracking_status);
packet.payload.putUnsignedByte(tracking_mode);
packet.payload.putUnsignedByte(target_data);
if (isMavlink2) {
packet.payload.putUnsignedByte(camera_device_id);
}
return packet;
}
/**
* Decode a camera_tracking_image_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.point_x = payload.getFloat();
this.point_y = payload.getFloat();
this.radius = payload.getFloat();
this.rec_top_x = payload.getFloat();
this.rec_top_y = payload.getFloat();
this.rec_bottom_x = payload.getFloat();
this.rec_bottom_y = payload.getFloat();
this.tracking_status = payload.getUnsignedByte();
this.tracking_mode = payload.getUnsignedByte();
this.target_data = payload.getUnsignedByte();
if (isMavlink2) {
this.camera_device_id = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_tracking_image_status() {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_tracking_image_status( float point_x, float point_y, float radius, float rec_top_x, float rec_top_y, float rec_bottom_x, float rec_bottom_y, short tracking_status, short tracking_mode, short target_data, short camera_device_id) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
this.point_x = point_x;
this.point_y = point_y;
this.radius = radius;
this.rec_top_x = rec_top_x;
this.rec_top_y = rec_top_y;
this.rec_bottom_x = rec_bottom_x;
this.rec_bottom_y = rec_bottom_y;
this.tracking_status = tracking_status;
this.tracking_mode = tracking_mode;
this.target_data = target_data;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_tracking_image_status( float point_x, float point_y, float radius, float rec_top_x, float rec_top_y, float rec_bottom_x, float rec_bottom_y, short tracking_status, short tracking_mode, short target_data, short camera_device_id, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.point_x = point_x;
this.point_y = point_y;
this.radius = radius;
this.rec_top_x = rec_top_x;
this.rec_top_y = rec_top_y;
this.rec_bottom_x = rec_bottom_x;
this.rec_bottom_y = rec_bottom_y;
this.tracking_status = tracking_status;
this.tracking_mode = tracking_mode;
this.target_data = target_data;
this.camera_device_id = camera_device_id;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_tracking_image_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS - sysid:"+sysid+" compid:"+compid+" point_x:"+point_x+" point_y:"+point_y+" radius:"+radius+" rec_top_x:"+rec_top_x+" rec_top_y:"+rec_top_y+" rec_bottom_x:"+rec_bottom_x+" rec_bottom_y:"+rec_bottom_y+" tracking_status:"+tracking_status+" tracking_mode:"+tracking_mode+" target_data:"+target_data+" camera_device_id:"+camera_device_id+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS";
}
}

View File

@ -0,0 +1,140 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAMERA_TRIGGER PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Camera-IMU triggering and synchronisation message.
*/
public class msg_camera_trigger extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAMERA_TRIGGER = 112;
public static final int MAVLINK_MSG_LENGTH = 12;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_TRIGGER;
/**
* Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Image frame sequence
*/
@Description("Image frame sequence")
@Units("")
public long seq;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putUnsignedInt(seq);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a camera_trigger message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.seq = payload.getUnsignedInt();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_camera_trigger() {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_camera_trigger( long time_usec, long seq) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
this.time_usec = time_usec;
this.seq = seq;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_camera_trigger( long time_usec, long seq, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.seq = seq;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_camera_trigger(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAMERA_TRIGGER;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAMERA_TRIGGER - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" seq:"+seq+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAMERA_TRIGGER";
}
}

View File

@ -0,0 +1,192 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAN_FILTER_MODIFY PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages.
*/
public class msg_can_filter_modify extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAN_FILTER_MODIFY = 388;
public static final int MAVLINK_MSG_LENGTH = 37;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
/**
* filter IDs, length num_ids
*/
@Description("filter IDs, length num_ids")
@Units("")
public int ids[] = new int[16];
/**
* System ID.
*/
@Description("System ID.")
@Units("")
public short target_system;
/**
* Component ID.
*/
@Description("Component ID.")
@Units("")
public short target_component;
/**
* bus number
*/
@Description("bus number")
@Units("")
public short bus;
/**
* what operation to perform on the filter list. See CAN_FILTER_OP enum.
*/
@Description("what operation to perform on the filter list. See CAN_FILTER_OP enum.")
@Units("")
public short operation;
/**
* number of IDs in filter list
*/
@Description("number of IDs in filter list")
@Units("")
public short num_ids;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
for (int i = 0; i < ids.length; i++) {
packet.payload.putUnsignedShort(ids[i]);
}
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(bus);
packet.payload.putUnsignedByte(operation);
packet.payload.putUnsignedByte(num_ids);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a can_filter_modify message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
for (int i = 0; i < this.ids.length; i++) {
this.ids[i] = payload.getUnsignedShort();
}
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.bus = payload.getUnsignedByte();
this.operation = payload.getUnsignedByte();
this.num_ids = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_can_filter_modify() {
this.msgid = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_can_filter_modify( int[] ids, short target_system, short target_component, short bus, short operation, short num_ids) {
this.msgid = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
this.ids = ids;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.operation = operation;
this.num_ids = num_ids;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_can_filter_modify( int[] ids, short target_system, short target_component, short bus, short operation, short num_ids, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.ids = ids;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.operation = operation;
this.num_ids = num_ids;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_can_filter_modify(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAN_FILTER_MODIFY;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAN_FILTER_MODIFY - sysid:"+sysid+" compid:"+compid+" ids:"+ids+" target_system:"+target_system+" target_component:"+target_component+" bus:"+bus+" operation:"+operation+" num_ids:"+num_ids+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAN_FILTER_MODIFY";
}
}

View File

@ -0,0 +1,192 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CAN_FRAME PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD.
*/
public class msg_can_frame extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CAN_FRAME = 386;
public static final int MAVLINK_MSG_LENGTH = 16;
private static final long serialVersionUID = MAVLINK_MSG_ID_CAN_FRAME;
/**
* Frame ID
*/
@Description("Frame ID")
@Units("")
public long id;
/**
* System ID.
*/
@Description("System ID.")
@Units("")
public short target_system;
/**
* Component ID.
*/
@Description("Component ID.")
@Units("")
public short target_component;
/**
* Bus number
*/
@Description("Bus number")
@Units("")
public short bus;
/**
* Frame length
*/
@Description("Frame length")
@Units("")
public short len;
/**
* Frame data
*/
@Description("Frame data")
@Units("")
public short data[] = new short[8];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CAN_FRAME;
packet.payload.putUnsignedInt(id);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(bus);
packet.payload.putUnsignedByte(len);
for (int i = 0; i < data.length; i++) {
packet.payload.putUnsignedByte(data[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a can_frame message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.id = payload.getUnsignedInt();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.bus = payload.getUnsignedByte();
this.len = payload.getUnsignedByte();
for (int i = 0; i < this.data.length; i++) {
this.data[i] = payload.getUnsignedByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_can_frame() {
this.msgid = MAVLINK_MSG_ID_CAN_FRAME;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_can_frame( long id, short target_system, short target_component, short bus, short len, short[] data) {
this.msgid = MAVLINK_MSG_ID_CAN_FRAME;
this.id = id;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.len = len;
this.data = data;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_can_frame( long id, short target_system, short target_component, short bus, short len, short[] data, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CAN_FRAME;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.id = id;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.len = len;
this.data = data;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_can_frame(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CAN_FRAME;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CAN_FRAME - sysid:"+sysid+" compid:"+compid+" id:"+id+" target_system:"+target_system+" target_component:"+target_component+" bus:"+bus+" len:"+len+" data:"+data+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CAN_FRAME";
}
}

View File

@ -0,0 +1,192 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CANFD_FRAME PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)
*/
public class msg_canfd_frame extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CANFD_FRAME = 387;
public static final int MAVLINK_MSG_LENGTH = 72;
private static final long serialVersionUID = MAVLINK_MSG_ID_CANFD_FRAME;
/**
* Frame ID
*/
@Description("Frame ID")
@Units("")
public long id;
/**
* System ID.
*/
@Description("System ID.")
@Units("")
public short target_system;
/**
* Component ID.
*/
@Description("Component ID.")
@Units("")
public short target_component;
/**
* bus number
*/
@Description("bus number")
@Units("")
public short bus;
/**
* Frame length
*/
@Description("Frame length")
@Units("")
public short len;
/**
* Frame data
*/
@Description("Frame data")
@Units("")
public short data[] = new short[64];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CANFD_FRAME;
packet.payload.putUnsignedInt(id);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(bus);
packet.payload.putUnsignedByte(len);
for (int i = 0; i < data.length; i++) {
packet.payload.putUnsignedByte(data[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a canfd_frame message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.id = payload.getUnsignedInt();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.bus = payload.getUnsignedByte();
this.len = payload.getUnsignedByte();
for (int i = 0; i < this.data.length; i++) {
this.data[i] = payload.getUnsignedByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_canfd_frame() {
this.msgid = MAVLINK_MSG_ID_CANFD_FRAME;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_canfd_frame( long id, short target_system, short target_component, short bus, short len, short[] data) {
this.msgid = MAVLINK_MSG_ID_CANFD_FRAME;
this.id = id;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.len = len;
this.data = data;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_canfd_frame( long id, short target_system, short target_component, short bus, short len, short[] data, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CANFD_FRAME;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.id = id;
this.target_system = target_system;
this.target_component = target_component;
this.bus = bus;
this.len = len;
this.data = data;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_canfd_frame(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CANFD_FRAME;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CANFD_FRAME - sysid:"+sysid+" compid:"+compid+" id:"+id+" target_system:"+target_system+" target_component:"+target_component+" bus:"+bus+" len:"+len+" data:"+data+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CANFD_FRAME";
}
}

View File

@ -0,0 +1,356 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CELLULAR_CONFIG PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Configure cellular modems.
This message is re-emitted as an acknowledgement by the modem.
The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE.
*/
public class msg_cellular_config extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CELLULAR_CONFIG = 336;
public static final int MAVLINK_MSG_LENGTH = 84;
private static final long serialVersionUID = MAVLINK_MSG_ID_CELLULAR_CONFIG;
/**
* Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
*/
@Description("Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.")
@Units("")
public short enable_lte;
/**
* Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
*/
@Description("Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.")
@Units("")
public short enable_pin;
/**
* PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.
*/
@Description("PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response.")
@Units("")
public byte pin[] = new byte[16];
/**
* New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.
*/
@Description("New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response.")
@Units("")
public byte new_pin[] = new byte[16];
/**
* Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.
*/
@Description("Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response.")
@Units("")
public byte apn[] = new byte[32];
/**
* Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.
*/
@Description("Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response.")
@Units("")
public byte puk[] = new byte[16];
/**
* Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.
*/
@Description("Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response.")
@Units("")
public short roaming;
/**
* Message acceptance response (sent back to GS).
*/
@Description("Message acceptance response (sent back to GS).")
@Units("")
public short response;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
packet.payload.putUnsignedByte(enable_lte);
packet.payload.putUnsignedByte(enable_pin);
for (int i = 0; i < pin.length; i++) {
packet.payload.putByte(pin[i]);
}
for (int i = 0; i < new_pin.length; i++) {
packet.payload.putByte(new_pin[i]);
}
for (int i = 0; i < apn.length; i++) {
packet.payload.putByte(apn[i]);
}
for (int i = 0; i < puk.length; i++) {
packet.payload.putByte(puk[i]);
}
packet.payload.putUnsignedByte(roaming);
packet.payload.putUnsignedByte(response);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a cellular_config message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.enable_lte = payload.getUnsignedByte();
this.enable_pin = payload.getUnsignedByte();
for (int i = 0; i < this.pin.length; i++) {
this.pin[i] = payload.getByte();
}
for (int i = 0; i < this.new_pin.length; i++) {
this.new_pin[i] = payload.getByte();
}
for (int i = 0; i < this.apn.length; i++) {
this.apn[i] = payload.getByte();
}
for (int i = 0; i < this.puk.length; i++) {
this.puk[i] = payload.getByte();
}
this.roaming = payload.getUnsignedByte();
this.response = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_cellular_config() {
this.msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_cellular_config( short enable_lte, short enable_pin, byte[] pin, byte[] new_pin, byte[] apn, byte[] puk, short roaming, short response) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
this.enable_lte = enable_lte;
this.enable_pin = enable_pin;
this.pin = pin;
this.new_pin = new_pin;
this.apn = apn;
this.puk = puk;
this.roaming = roaming;
this.response = response;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_cellular_config( short enable_lte, short enable_pin, byte[] pin, byte[] new_pin, byte[] apn, byte[] puk, short roaming, short response, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.enable_lte = enable_lte;
this.enable_pin = enable_pin;
this.pin = pin;
this.new_pin = new_pin;
this.apn = apn;
this.puk = puk;
this.roaming = roaming;
this.response = response;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_cellular_config(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_CONFIG;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setPin(String str) {
int len = Math.min(str.length(), 16);
for (int i=0; i<len; i++) {
pin[i] = (byte) str.charAt(i);
}
for (int i=len; i<16; i++) { // padding for the rest of the buffer
pin[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getPin() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 16; i++) {
if (pin[i] != 0)
buf.append((char) pin[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setNew_Pin(String str) {
int len = Math.min(str.length(), 16);
for (int i=0; i<len; i++) {
new_pin[i] = (byte) str.charAt(i);
}
for (int i=len; i<16; i++) { // padding for the rest of the buffer
new_pin[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getNew_Pin() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 16; i++) {
if (new_pin[i] != 0)
buf.append((char) new_pin[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setApn(String str) {
int len = Math.min(str.length(), 32);
for (int i=0; i<len; i++) {
apn[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
apn[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getApn() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (apn[i] != 0)
buf.append((char) apn[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setPuk(String str) {
int len = Math.min(str.length(), 16);
for (int i=0; i<len; i++) {
puk[i] = (byte) str.charAt(i);
}
for (int i=len; i<16; i++) { // padding for the rest of the buffer
puk[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getPuk() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 16; i++) {
if (puk[i] != 0)
buf.append((char) puk[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CELLULAR_CONFIG - sysid:"+sysid+" compid:"+compid+" enable_lte:"+enable_lte+" enable_pin:"+enable_pin+" pin:"+pin+" new_pin:"+new_pin+" apn:"+apn+" puk:"+puk+" roaming:"+roaming+" response:"+response+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CELLULAR_CONFIG";
}
}

View File

@ -0,0 +1,195 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CELLULAR_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Report current used cellular network status
*/
public class msg_cellular_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CELLULAR_STATUS = 334;
public static final int MAVLINK_MSG_LENGTH = 10;
private static final long serialVersionUID = MAVLINK_MSG_ID_CELLULAR_STATUS;
/**
* Mobile country code. If unknown, set to UINT16_MAX
*/
@Description("Mobile country code. If unknown, set to UINT16_MAX")
@Units("")
public int mcc;
/**
* Mobile network code. If unknown, set to UINT16_MAX
*/
@Description("Mobile network code. If unknown, set to UINT16_MAX")
@Units("")
public int mnc;
/**
* Location area code. If unknown, set to 0
*/
@Description("Location area code. If unknown, set to 0")
@Units("")
public int lac;
/**
* Cellular modem status
*/
@Description("Cellular modem status")
@Units("")
public short status;
/**
* Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED
*/
@Description("Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED")
@Units("")
public short failure_reason;
/**
* Cellular network radio type: gsm, cdma, lte...
*/
@Description("Cellular network radio type: gsm, cdma, lte...")
@Units("")
public short type;
/**
* Signal quality in percent. If unknown, set to UINT8_MAX
*/
@Description("Signal quality in percent. If unknown, set to UINT8_MAX")
@Units("")
public short quality;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CELLULAR_STATUS;
packet.payload.putUnsignedShort(mcc);
packet.payload.putUnsignedShort(mnc);
packet.payload.putUnsignedShort(lac);
packet.payload.putUnsignedByte(status);
packet.payload.putUnsignedByte(failure_reason);
packet.payload.putUnsignedByte(type);
packet.payload.putUnsignedByte(quality);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a cellular_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.mcc = payload.getUnsignedShort();
this.mnc = payload.getUnsignedShort();
this.lac = payload.getUnsignedShort();
this.status = payload.getUnsignedByte();
this.failure_reason = payload.getUnsignedByte();
this.type = payload.getUnsignedByte();
this.quality = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_cellular_status() {
this.msgid = MAVLINK_MSG_ID_CELLULAR_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_cellular_status( int mcc, int mnc, int lac, short status, short failure_reason, short type, short quality) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_STATUS;
this.mcc = mcc;
this.mnc = mnc;
this.lac = lac;
this.status = status;
this.failure_reason = failure_reason;
this.type = type;
this.quality = quality;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_cellular_status( int mcc, int mnc, int lac, short status, short failure_reason, short type, short quality, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.mcc = mcc;
this.mnc = mnc;
this.lac = lac;
this.status = status;
this.failure_reason = failure_reason;
this.type = type;
this.quality = quality;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_cellular_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CELLULAR_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CELLULAR_STATUS - sysid:"+sysid+" compid:"+compid+" mcc:"+mcc+" mnc:"+mnc+" lac:"+lac+" status:"+status+" failure_reason:"+failure_reason+" type:"+type+" quality:"+quality+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CELLULAR_STATUS";
}
}

View File

@ -0,0 +1,199 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CHANGE_OPERATOR_CONTROL PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
/**
* Request to control this MAV
*/
public class msg_change_operator_control extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL = 5;
public static final int MAVLINK_MSG_LENGTH = 28;
private static final long serialVersionUID = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
/**
* System the GCS requests control for
*/
@Description("System the GCS requests control for")
@Units("")
public short target_system;
/**
* 0: request control of this MAV, 1: Release control of this MAV
*/
@Description("0: request control of this MAV, 1: Release control of this MAV")
@Units("")
public short control_request;
/**
* 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
*/
@Description("0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.")
@Units("rad")
public short version;
/**
* Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and '!?,.-'
*/
@Description("Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and '!?,.-'")
@Units("")
public byte passkey[] = new byte[25];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(control_request);
packet.payload.putUnsignedByte(version);
for (int i = 0; i < passkey.length; i++) {
packet.payload.putByte(passkey[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a change_operator_control message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.target_system = payload.getUnsignedByte();
this.control_request = payload.getUnsignedByte();
this.version = payload.getUnsignedByte();
for (int i = 0; i < this.passkey.length; i++) {
this.passkey[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_change_operator_control() {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_change_operator_control( short target_system, short control_request, short version, byte[] passkey) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
this.target_system = target_system;
this.control_request = control_request;
this.version = version;
this.passkey = passkey;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_change_operator_control( short target_system, short control_request, short version, byte[] passkey, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.target_system = target_system;
this.control_request = control_request;
this.version = version;
this.passkey = passkey;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_change_operator_control(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setPasskey(String str) {
int len = Math.min(str.length(), 25);
for (int i=0; i<len; i++) {
passkey[i] = (byte) str.charAt(i);
}
for (int i=len; i<25; i++) { // padding for the rest of the buffer
passkey[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getPasskey() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 25; i++) {
if (passkey[i] != 0)
buf.append((char) passkey[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" control_request:"+control_request+" version:"+version+" passkey:"+passkey+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL";
}
}

View File

@ -0,0 +1,151 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CHANGE_OPERATOR_CONTROL_ACK PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
/**
* Accept / deny control of this MAV
*/
public class msg_change_operator_control_ack extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK = 6;
public static final int MAVLINK_MSG_LENGTH = 3;
private static final long serialVersionUID = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
/**
* ID of the GCS this message
*/
@Description("ID of the GCS this message ")
@Units("")
public short gcs_system_id;
/**
* 0: request control of this MAV, 1: Release control of this MAV
*/
@Description("0: request control of this MAV, 1: Release control of this MAV")
@Units("")
public short control_request;
/**
* 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
*/
@Description("0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control")
@Units("")
public short ack;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
packet.payload.putUnsignedByte(gcs_system_id);
packet.payload.putUnsignedByte(control_request);
packet.payload.putUnsignedByte(ack);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a change_operator_control_ack message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.gcs_system_id = payload.getUnsignedByte();
this.control_request = payload.getUnsignedByte();
this.ack = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_change_operator_control_ack() {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_change_operator_control_ack( short gcs_system_id, short control_request, short ack) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
this.gcs_system_id = gcs_system_id;
this.control_request = control_request;
this.ack = ack;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_change_operator_control_ack( short gcs_system_id, short control_request, short ack, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.gcs_system_id = gcs_system_id;
this.control_request = control_request;
this.ack = ack;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_change_operator_control_ack(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK - sysid:"+sysid+" compid:"+compid+" gcs_system_id:"+gcs_system_id+" control_request:"+control_request+" ack:"+ack+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK";
}
}

View File

@ -0,0 +1,195 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COLLISION PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Information about a potential collision
*/
public class msg_collision extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COLLISION = 247;
public static final int MAVLINK_MSG_LENGTH = 19;
private static final long serialVersionUID = MAVLINK_MSG_ID_COLLISION;
/**
* Unique identifier, domain based on src field
*/
@Description("Unique identifier, domain based on src field")
@Units("")
public long id;
/**
* Estimated time until collision occurs
*/
@Description("Estimated time until collision occurs")
@Units("s")
public float time_to_minimum_delta;
/**
* Closest vertical distance between vehicle and object
*/
@Description("Closest vertical distance between vehicle and object")
@Units("m")
public float altitude_minimum_delta;
/**
* Closest horizontal distance between vehicle and object
*/
@Description("Closest horizontal distance between vehicle and object")
@Units("m")
public float horizontal_minimum_delta;
/**
* Collision data source
*/
@Description("Collision data source")
@Units("")
public short src;
/**
* Action that is being taken to avoid this collision
*/
@Description("Action that is being taken to avoid this collision")
@Units("")
public short action;
/**
* How concerned the aircraft is about this collision
*/
@Description("How concerned the aircraft is about this collision")
@Units("")
public short threat_level;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COLLISION;
packet.payload.putUnsignedInt(id);
packet.payload.putFloat(time_to_minimum_delta);
packet.payload.putFloat(altitude_minimum_delta);
packet.payload.putFloat(horizontal_minimum_delta);
packet.payload.putUnsignedByte(src);
packet.payload.putUnsignedByte(action);
packet.payload.putUnsignedByte(threat_level);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a collision message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.id = payload.getUnsignedInt();
this.time_to_minimum_delta = payload.getFloat();
this.altitude_minimum_delta = payload.getFloat();
this.horizontal_minimum_delta = payload.getFloat();
this.src = payload.getUnsignedByte();
this.action = payload.getUnsignedByte();
this.threat_level = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_collision() {
this.msgid = MAVLINK_MSG_ID_COLLISION;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_collision( long id, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta, short src, short action, short threat_level) {
this.msgid = MAVLINK_MSG_ID_COLLISION;
this.id = id;
this.time_to_minimum_delta = time_to_minimum_delta;
this.altitude_minimum_delta = altitude_minimum_delta;
this.horizontal_minimum_delta = horizontal_minimum_delta;
this.src = src;
this.action = action;
this.threat_level = threat_level;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_collision( long id, float time_to_minimum_delta, float altitude_minimum_delta, float horizontal_minimum_delta, short src, short action, short threat_level, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COLLISION;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.id = id;
this.time_to_minimum_delta = time_to_minimum_delta;
this.altitude_minimum_delta = altitude_minimum_delta;
this.horizontal_minimum_delta = horizontal_minimum_delta;
this.src = src;
this.action = action;
this.threat_level = threat_level;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_collision(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COLLISION;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COLLISION - sysid:"+sysid+" compid:"+compid+" id:"+id+" time_to_minimum_delta:"+time_to_minimum_delta+" altitude_minimum_delta:"+altitude_minimum_delta+" horizontal_minimum_delta:"+horizontal_minimum_delta+" src:"+src+" action:"+action+" threat_level:"+threat_level+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COLLISION";
}
}

View File

@ -0,0 +1,184 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMMAND_ACK PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at https://mavlink.io/en/services/command.html
*/
public class msg_command_ack extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMMAND_ACK = 77;
public static final int MAVLINK_MSG_LENGTH = 10;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMMAND_ACK;
/**
* Command ID (of acknowledged command).
*/
@Description("Command ID (of acknowledged command).")
@Units("")
public int command;
/**
* Result of command.
*/
@Description("Result of command.")
@Units("")
public short result;
/**
* The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown.
*/
@Description("The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown.")
@Units("%")
public short progress;
/**
* Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate 'unused' or 'unknown').
*/
@Description("Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate 'unused' or 'unknown').")
@Units("")
public int result_param2;
/**
* System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.
*/
@Description("System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.")
@Units("")
public short target_system;
/**
* Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.
*/
@Description("Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement.")
@Units("")
public short target_component;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMMAND_ACK;
packet.payload.putUnsignedShort(command);
packet.payload.putUnsignedByte(result);
if (isMavlink2) {
packet.payload.putUnsignedByte(progress);
packet.payload.putInt(result_param2);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
}
return packet;
}
/**
* Decode a command_ack message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.command = payload.getUnsignedShort();
this.result = payload.getUnsignedByte();
if (isMavlink2) {
this.progress = payload.getUnsignedByte();
this.result_param2 = payload.getInt();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_command_ack() {
this.msgid = MAVLINK_MSG_ID_COMMAND_ACK;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_command_ack( int command, short result, short progress, int result_param2, short target_system, short target_component) {
this.msgid = MAVLINK_MSG_ID_COMMAND_ACK;
this.command = command;
this.result = result;
this.progress = progress;
this.result_param2 = result_param2;
this.target_system = target_system;
this.target_component = target_component;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_command_ack( int command, short result, short progress, int result_param2, short target_system, short target_component, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMMAND_ACK;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.command = command;
this.result = result;
this.progress = progress;
this.result_param2 = result_param2;
this.target_system = target_system;
this.target_component = target_component;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_command_ack(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMMAND_ACK;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMMAND_ACK - sysid:"+sysid+" compid:"+compid+" command:"+command+" result:"+result+" progress:"+progress+" result_param2:"+result_param2+" target_system:"+target_system+" target_component:"+target_component+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMMAND_ACK";
}
}

View File

@ -0,0 +1,151 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMMAND_CANCEL PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at https://mavlink.io/en/services/command.html
*/
public class msg_command_cancel extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMMAND_CANCEL = 80;
public static final int MAVLINK_MSG_LENGTH = 4;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMMAND_CANCEL;
/**
* Command ID (of command to cancel).
*/
@Description("Command ID (of command to cancel).")
@Units("")
public int command;
/**
* System executing long running command. Should not be broadcast (0).
*/
@Description("System executing long running command. Should not be broadcast (0).")
@Units("")
public short target_system;
/**
* Component executing long running command.
*/
@Description("Component executing long running command.")
@Units("")
public short target_component;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMMAND_CANCEL;
packet.payload.putUnsignedShort(command);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a command_cancel message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.command = payload.getUnsignedShort();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_command_cancel() {
this.msgid = MAVLINK_MSG_ID_COMMAND_CANCEL;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_command_cancel( int command, short target_system, short target_component) {
this.msgid = MAVLINK_MSG_ID_COMMAND_CANCEL;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_command_cancel( int command, short target_system, short target_component, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMMAND_CANCEL;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_command_cancel(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMMAND_CANCEL;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMMAND_CANCEL - sysid:"+sysid+" compid:"+compid+" command:"+command+" target_system:"+target_system+" target_component:"+target_component+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMMAND_CANCEL";
}
}

View File

@ -0,0 +1,261 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMMAND_INT PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at https://mavlink.io/en/services/command.html
*/
public class msg_command_int extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMMAND_INT = 75;
public static final int MAVLINK_MSG_LENGTH = 35;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMMAND_INT;
/**
* PARAM1, see MAV_CMD enum
*/
@Description("PARAM1, see MAV_CMD enum")
@Units("")
public float param1;
/**
* PARAM2, see MAV_CMD enum
*/
@Description("PARAM2, see MAV_CMD enum")
@Units("")
public float param2;
/**
* PARAM3, see MAV_CMD enum
*/
@Description("PARAM3, see MAV_CMD enum")
@Units("")
public float param3;
/**
* PARAM4, see MAV_CMD enum
*/
@Description("PARAM4, see MAV_CMD enum")
@Units("")
public float param4;
/**
* PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
*/
@Description("PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7")
@Units("")
public int x;
/**
* PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
*/
@Description("PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7")
@Units("")
public int y;
/**
* PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
*/
@Description("PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).")
@Units("")
public float z;
/**
* The scheduled action for the mission item.
*/
@Description("The scheduled action for the mission item.")
@Units("")
public int command;
/**
* System ID
*/
@Description("System ID")
@Units("")
public short target_system;
/**
* Component ID
*/
@Description("Component ID")
@Units("")
public short target_component;
/**
* The coordinate system of the COMMAND.
*/
@Description("The coordinate system of the COMMAND.")
@Units("")
public short frame;
/**
* Not used.
*/
@Description("Not used.")
@Units("")
public short current;
/**
* Not used (set 0).
*/
@Description("Not used (set 0).")
@Units("")
public short autocontinue;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMMAND_INT;
packet.payload.putFloat(param1);
packet.payload.putFloat(param2);
packet.payload.putFloat(param3);
packet.payload.putFloat(param4);
packet.payload.putInt(x);
packet.payload.putInt(y);
packet.payload.putFloat(z);
packet.payload.putUnsignedShort(command);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(frame);
packet.payload.putUnsignedByte(current);
packet.payload.putUnsignedByte(autocontinue);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a command_int message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.param1 = payload.getFloat();
this.param2 = payload.getFloat();
this.param3 = payload.getFloat();
this.param4 = payload.getFloat();
this.x = payload.getInt();
this.y = payload.getInt();
this.z = payload.getFloat();
this.command = payload.getUnsignedShort();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.frame = payload.getUnsignedByte();
this.current = payload.getUnsignedByte();
this.autocontinue = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_command_int() {
this.msgid = MAVLINK_MSG_ID_COMMAND_INT;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_command_int( float param1, float param2, float param3, float param4, int x, int y, float z, int command, short target_system, short target_component, short frame, short current, short autocontinue) {
this.msgid = MAVLINK_MSG_ID_COMMAND_INT;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.x = x;
this.y = y;
this.z = z;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
this.frame = frame;
this.current = current;
this.autocontinue = autocontinue;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_command_int( float param1, float param2, float param3, float param4, int x, int y, float z, int command, short target_system, short target_component, short frame, short current, short autocontinue, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMMAND_INT;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.x = x;
this.y = y;
this.z = z;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
this.frame = frame;
this.current = current;
this.autocontinue = autocontinue;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_command_int(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMMAND_INT;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMMAND_INT - sysid:"+sysid+" compid:"+compid+" param1:"+param1+" param2:"+param2+" param3:"+param3+" param4:"+param4+" x:"+x+" y:"+y+" z:"+z+" command:"+command+" target_system:"+target_system+" target_component:"+target_component+" frame:"+frame+" current:"+current+" autocontinue:"+autocontinue+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMMAND_INT";
}
}

View File

@ -0,0 +1,239 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMMAND_LONG PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at https://mavlink.io/en/services/command.html
*/
public class msg_command_long extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMMAND_LONG = 76;
public static final int MAVLINK_MSG_LENGTH = 33;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMMAND_LONG;
/**
* Parameter 1 (for the specific command).
*/
@Description("Parameter 1 (for the specific command).")
@Units("")
public float param1;
/**
* Parameter 2 (for the specific command).
*/
@Description("Parameter 2 (for the specific command).")
@Units("")
public float param2;
/**
* Parameter 3 (for the specific command).
*/
@Description("Parameter 3 (for the specific command).")
@Units("")
public float param3;
/**
* Parameter 4 (for the specific command).
*/
@Description("Parameter 4 (for the specific command).")
@Units("")
public float param4;
/**
* Parameter 5 (for the specific command).
*/
@Description("Parameter 5 (for the specific command).")
@Units("")
public float param5;
/**
* Parameter 6 (for the specific command).
*/
@Description("Parameter 6 (for the specific command).")
@Units("")
public float param6;
/**
* Parameter 7 (for the specific command).
*/
@Description("Parameter 7 (for the specific command).")
@Units("")
public float param7;
/**
* Command ID (of command to send).
*/
@Description("Command ID (of command to send).")
@Units("")
public int command;
/**
* System which should execute the command
*/
@Description("System which should execute the command")
@Units("")
public short target_system;
/**
* Component which should execute the command, 0 for all components
*/
@Description("Component which should execute the command, 0 for all components")
@Units("")
public short target_component;
/**
* 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
*/
@Description("0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)")
@Units("")
public short confirmation;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMMAND_LONG;
packet.payload.putFloat(param1);
packet.payload.putFloat(param2);
packet.payload.putFloat(param3);
packet.payload.putFloat(param4);
packet.payload.putFloat(param5);
packet.payload.putFloat(param6);
packet.payload.putFloat(param7);
packet.payload.putUnsignedShort(command);
packet.payload.putUnsignedByte(target_system);
packet.payload.putUnsignedByte(target_component);
packet.payload.putUnsignedByte(confirmation);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a command_long message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.param1 = payload.getFloat();
this.param2 = payload.getFloat();
this.param3 = payload.getFloat();
this.param4 = payload.getFloat();
this.param5 = payload.getFloat();
this.param6 = payload.getFloat();
this.param7 = payload.getFloat();
this.command = payload.getUnsignedShort();
this.target_system = payload.getUnsignedByte();
this.target_component = payload.getUnsignedByte();
this.confirmation = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_command_long() {
this.msgid = MAVLINK_MSG_ID_COMMAND_LONG;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_command_long( float param1, float param2, float param3, float param4, float param5, float param6, float param7, int command, short target_system, short target_component, short confirmation) {
this.msgid = MAVLINK_MSG_ID_COMMAND_LONG;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.param6 = param6;
this.param7 = param7;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
this.confirmation = confirmation;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_command_long( float param1, float param2, float param3, float param4, float param5, float param6, float param7, int command, short target_system, short target_component, short confirmation, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMMAND_LONG;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.param6 = param6;
this.param7 = param7;
this.command = command;
this.target_system = target_system;
this.target_component = target_component;
this.confirmation = confirmation;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_command_long(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMMAND_LONG;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMMAND_LONG - sysid:"+sysid+" compid:"+compid+" param1:"+param1+" param2:"+param2+" param3:"+param3+" param4:"+param4+" param5:"+param5+" param6:"+param6+" param7:"+param7+" command:"+command+" target_system:"+target_system+" target_component:"+target_component+" confirmation:"+confirmation+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMMAND_LONG";
}
}

View File

@ -0,0 +1,249 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMPONENT_INFORMATION PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
*
Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE.
*/
public class msg_component_information extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMPONENT_INFORMATION = 395;
public static final int MAVLINK_MSG_LENGTH = 212;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* CRC32 of the general metadata file (general_metadata_uri).
*/
@Description("CRC32 of the general metadata file (general_metadata_uri).")
@Units("")
public long general_metadata_file_crc;
/**
* CRC32 of peripherals metadata file (peripherals_metadata_uri).
*/
@Description("CRC32 of peripherals metadata file (peripherals_metadata_uri).")
@Units("")
public long peripherals_metadata_file_crc;
/**
* MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.
*/
@Description("MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.")
@Units("")
public byte general_metadata_uri[] = new byte[100];
/**
* (Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about 'attached components' such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated.
*/
@Description("(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about 'attached components' such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated.")
@Units("")
public byte peripherals_metadata_uri[] = new byte[100];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedInt(general_metadata_file_crc);
packet.payload.putUnsignedInt(peripherals_metadata_file_crc);
for (int i = 0; i < general_metadata_uri.length; i++) {
packet.payload.putByte(general_metadata_uri[i]);
}
for (int i = 0; i < peripherals_metadata_uri.length; i++) {
packet.payload.putByte(peripherals_metadata_uri[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a component_information message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.general_metadata_file_crc = payload.getUnsignedInt();
this.peripherals_metadata_file_crc = payload.getUnsignedInt();
for (int i = 0; i < this.general_metadata_uri.length; i++) {
this.general_metadata_uri[i] = payload.getByte();
}
for (int i = 0; i < this.peripherals_metadata_uri.length; i++) {
this.peripherals_metadata_uri[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_component_information() {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_component_information( long time_boot_ms, long general_metadata_file_crc, long peripherals_metadata_file_crc, byte[] general_metadata_uri, byte[] peripherals_metadata_uri) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
this.time_boot_ms = time_boot_ms;
this.general_metadata_file_crc = general_metadata_file_crc;
this.peripherals_metadata_file_crc = peripherals_metadata_file_crc;
this.general_metadata_uri = general_metadata_uri;
this.peripherals_metadata_uri = peripherals_metadata_uri;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_component_information( long time_boot_ms, long general_metadata_file_crc, long peripherals_metadata_file_crc, byte[] general_metadata_uri, byte[] peripherals_metadata_uri, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.general_metadata_file_crc = general_metadata_file_crc;
this.peripherals_metadata_file_crc = peripherals_metadata_file_crc;
this.general_metadata_uri = general_metadata_uri;
this.peripherals_metadata_uri = peripherals_metadata_uri;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_component_information(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setGeneral_Metadata_Uri(String str) {
int len = Math.min(str.length(), 100);
for (int i=0; i<len; i++) {
general_metadata_uri[i] = (byte) str.charAt(i);
}
for (int i=len; i<100; i++) { // padding for the rest of the buffer
general_metadata_uri[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getGeneral_Metadata_Uri() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 100; i++) {
if (general_metadata_uri[i] != 0)
buf.append((char) general_metadata_uri[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setPeripherals_Metadata_Uri(String str) {
int len = Math.min(str.length(), 100);
for (int i=0; i<len; i++) {
peripherals_metadata_uri[i] = (byte) str.charAt(i);
}
for (int i=len; i<100; i++) { // padding for the rest of the buffer
peripherals_metadata_uri[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getPeripherals_Metadata_Uri() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 100; i++) {
if (peripherals_metadata_uri[i] != 0)
buf.append((char) peripherals_metadata_uri[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMPONENT_INFORMATION - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" general_metadata_file_crc:"+general_metadata_file_crc+" peripherals_metadata_file_crc:"+peripherals_metadata_file_crc+" general_metadata_uri:"+general_metadata_uri+" peripherals_metadata_uri:"+peripherals_metadata_uri+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMPONENT_INFORMATION";
}
}

View File

@ -0,0 +1,391 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMPONENT_INFORMATION_BASIC PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required.
*/
public class msg_component_information_basic extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC = 396;
public static final int MAVLINK_MSG_LENGTH = 160;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
/**
* Component capability flags
*/
@Description("Component capability flags")
@Units("")
public long capabilities;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
*/
@Description("Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.")
@Units("s")
public long time_manufacture_s;
/**
* Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
*/
@Description("Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.")
@Units("")
public byte vendor_name[] = new byte[32];
/**
* Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
*/
@Description("Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.")
@Units("")
public byte model_name[] = new byte[32];
/**
* Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
*/
@Description("Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.")
@Units("")
public byte software_version[] = new byte[24];
/**
* Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
*/
@Description("Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.")
@Units("")
public byte hardware_version[] = new byte[24];
/**
* Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
*/
@Description("Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.")
@Units("")
public byte serial_number[] = new byte[32];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
packet.payload.putUnsignedLong(capabilities);
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedInt(time_manufacture_s);
for (int i = 0; i < vendor_name.length; i++) {
packet.payload.putByte(vendor_name[i]);
}
for (int i = 0; i < model_name.length; i++) {
packet.payload.putByte(model_name[i]);
}
for (int i = 0; i < software_version.length; i++) {
packet.payload.putByte(software_version[i]);
}
for (int i = 0; i < hardware_version.length; i++) {
packet.payload.putByte(hardware_version[i]);
}
for (int i = 0; i < serial_number.length; i++) {
packet.payload.putByte(serial_number[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a component_information_basic message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.capabilities = payload.getUnsignedLong();
this.time_boot_ms = payload.getUnsignedInt();
this.time_manufacture_s = payload.getUnsignedInt();
for (int i = 0; i < this.vendor_name.length; i++) {
this.vendor_name[i] = payload.getByte();
}
for (int i = 0; i < this.model_name.length; i++) {
this.model_name[i] = payload.getByte();
}
for (int i = 0; i < this.software_version.length; i++) {
this.software_version[i] = payload.getByte();
}
for (int i = 0; i < this.hardware_version.length; i++) {
this.hardware_version[i] = payload.getByte();
}
for (int i = 0; i < this.serial_number.length; i++) {
this.serial_number[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_component_information_basic() {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_component_information_basic( long capabilities, long time_boot_ms, long time_manufacture_s, byte[] vendor_name, byte[] model_name, byte[] software_version, byte[] hardware_version, byte[] serial_number) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
this.capabilities = capabilities;
this.time_boot_ms = time_boot_ms;
this.time_manufacture_s = time_manufacture_s;
this.vendor_name = vendor_name;
this.model_name = model_name;
this.software_version = software_version;
this.hardware_version = hardware_version;
this.serial_number = serial_number;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_component_information_basic( long capabilities, long time_boot_ms, long time_manufacture_s, byte[] vendor_name, byte[] model_name, byte[] software_version, byte[] hardware_version, byte[] serial_number, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.capabilities = capabilities;
this.time_boot_ms = time_boot_ms;
this.time_manufacture_s = time_manufacture_s;
this.vendor_name = vendor_name;
this.model_name = model_name;
this.software_version = software_version;
this.hardware_version = hardware_version;
this.serial_number = serial_number;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_component_information_basic(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setVendor_Name(String str) {
int len = Math.min(str.length(), 32);
for (int i=0; i<len; i++) {
vendor_name[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
vendor_name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getVendor_Name() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (vendor_name[i] != 0)
buf.append((char) vendor_name[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setModel_Name(String str) {
int len = Math.min(str.length(), 32);
for (int i=0; i<len; i++) {
model_name[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
model_name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getModel_Name() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (model_name[i] != 0)
buf.append((char) model_name[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setSoftware_Version(String str) {
int len = Math.min(str.length(), 24);
for (int i=0; i<len; i++) {
software_version[i] = (byte) str.charAt(i);
}
for (int i=len; i<24; i++) { // padding for the rest of the buffer
software_version[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getSoftware_Version() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 24; i++) {
if (software_version[i] != 0)
buf.append((char) software_version[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setHardware_Version(String str) {
int len = Math.min(str.length(), 24);
for (int i=0; i<len; i++) {
hardware_version[i] = (byte) str.charAt(i);
}
for (int i=len; i<24; i++) { // padding for the rest of the buffer
hardware_version[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getHardware_Version() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 24; i++) {
if (hardware_version[i] != 0)
buf.append((char) hardware_version[i]);
else
break;
}
return buf.toString();
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setSerial_Number(String str) {
int len = Math.min(str.length(), 32);
for (int i=0; i<len; i++) {
serial_number[i] = (byte) str.charAt(i);
}
for (int i=len; i<32; i++) { // padding for the rest of the buffer
serial_number[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getSerial_Number() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 32; i++) {
if (serial_number[i] != 0)
buf.append((char) serial_number[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC - sysid:"+sysid+" compid:"+compid+" capabilities:"+capabilities+" time_boot_ms:"+time_boot_ms+" time_manufacture_s:"+time_manufacture_s+" vendor_name:"+vendor_name+" model_name:"+model_name+" software_version:"+software_version+" hardware_version:"+hardware_version+" serial_number:"+serial_number+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC";
}
}

View File

@ -0,0 +1,199 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE COMPONENT_METADATA PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
*
Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE.
This contains the MAVLink FTP URI and CRC for the component's general metadata file.
The file must be hosted on the component, and may be xz compressed.
The file CRC can be used for file caching.
The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet.
For more information see: https://mavlink.io/en/services/component_information.html.
Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION.
*/
public class msg_component_metadata extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_COMPONENT_METADATA = 397;
public static final int MAVLINK_MSG_LENGTH = 108;
private static final long serialVersionUID = MAVLINK_MSG_ID_COMPONENT_METADATA;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* CRC32 of the general metadata file.
*/
@Description("CRC32 of the general metadata file.")
@Units("")
public long file_crc;
/**
* MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.
*/
@Description("MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated.")
@Units("")
public byte uri[] = new byte[100];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_COMPONENT_METADATA;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedInt(file_crc);
for (int i = 0; i < uri.length; i++) {
packet.payload.putByte(uri[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a component_metadata message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.file_crc = payload.getUnsignedInt();
for (int i = 0; i < this.uri.length; i++) {
this.uri[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_component_metadata() {
this.msgid = MAVLINK_MSG_ID_COMPONENT_METADATA;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_component_metadata( long time_boot_ms, long file_crc, byte[] uri) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_METADATA;
this.time_boot_ms = time_boot_ms;
this.file_crc = file_crc;
this.uri = uri;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_component_metadata( long time_boot_ms, long file_crc, byte[] uri, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_METADATA;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.file_crc = file_crc;
this.uri = uri;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_component_metadata(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_COMPONENT_METADATA;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setUri(String str) {
int len = Math.min(str.length(), 100);
for (int i=0; i<len; i++) {
uri[i] = (byte) str.charAt(i);
}
for (int i=len; i<100; i++) { // padding for the rest of the buffer
uri[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getUri() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 100; i++) {
if (uri[i] != 0)
buf.append((char) uri[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_COMPONENT_METADATA - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" file_crc:"+file_crc+" uri:"+uri+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_COMPONENT_METADATA";
}
}

View File

@ -0,0 +1,329 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CONTROL_SYSTEM_STATE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* The smoothed, monotonic system state used to feed the control loops of the system.
*/
public class msg_control_system_state extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE = 146;
public static final int MAVLINK_MSG_LENGTH = 100;
private static final long serialVersionUID = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* X acceleration in body frame
*/
@Description("X acceleration in body frame")
@Units("m/s/s")
public float x_acc;
/**
* Y acceleration in body frame
*/
@Description("Y acceleration in body frame")
@Units("m/s/s")
public float y_acc;
/**
* Z acceleration in body frame
*/
@Description("Z acceleration in body frame")
@Units("m/s/s")
public float z_acc;
/**
* X velocity in body frame
*/
@Description("X velocity in body frame")
@Units("m/s")
public float x_vel;
/**
* Y velocity in body frame
*/
@Description("Y velocity in body frame")
@Units("m/s")
public float y_vel;
/**
* Z velocity in body frame
*/
@Description("Z velocity in body frame")
@Units("m/s")
public float z_vel;
/**
* X position in local frame
*/
@Description("X position in local frame")
@Units("m")
public float x_pos;
/**
* Y position in local frame
*/
@Description("Y position in local frame")
@Units("m")
public float y_pos;
/**
* Z position in local frame
*/
@Description("Z position in local frame")
@Units("m")
public float z_pos;
/**
* Airspeed, set to -1 if unknown
*/
@Description("Airspeed, set to -1 if unknown")
@Units("m/s")
public float airspeed;
/**
* Variance of body velocity estimate
*/
@Description("Variance of body velocity estimate")
@Units("")
public float vel_variance[] = new float[3];
/**
* Variance in local position
*/
@Description("Variance in local position")
@Units("")
public float pos_variance[] = new float[3];
/**
* The attitude, represented as Quaternion
*/
@Description("The attitude, represented as Quaternion")
@Units("")
public float q[] = new float[4];
/**
* Angular rate in roll axis
*/
@Description("Angular rate in roll axis")
@Units("rad/s")
public float roll_rate;
/**
* Angular rate in pitch axis
*/
@Description("Angular rate in pitch axis")
@Units("rad/s")
public float pitch_rate;
/**
* Angular rate in yaw axis
*/
@Description("Angular rate in yaw axis")
@Units("rad/s")
public float yaw_rate;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putFloat(x_acc);
packet.payload.putFloat(y_acc);
packet.payload.putFloat(z_acc);
packet.payload.putFloat(x_vel);
packet.payload.putFloat(y_vel);
packet.payload.putFloat(z_vel);
packet.payload.putFloat(x_pos);
packet.payload.putFloat(y_pos);
packet.payload.putFloat(z_pos);
packet.payload.putFloat(airspeed);
for (int i = 0; i < vel_variance.length; i++) {
packet.payload.putFloat(vel_variance[i]);
}
for (int i = 0; i < pos_variance.length; i++) {
packet.payload.putFloat(pos_variance[i]);
}
for (int i = 0; i < q.length; i++) {
packet.payload.putFloat(q[i]);
}
packet.payload.putFloat(roll_rate);
packet.payload.putFloat(pitch_rate);
packet.payload.putFloat(yaw_rate);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a control_system_state message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.x_acc = payload.getFloat();
this.y_acc = payload.getFloat();
this.z_acc = payload.getFloat();
this.x_vel = payload.getFloat();
this.y_vel = payload.getFloat();
this.z_vel = payload.getFloat();
this.x_pos = payload.getFloat();
this.y_pos = payload.getFloat();
this.z_pos = payload.getFloat();
this.airspeed = payload.getFloat();
for (int i = 0; i < this.vel_variance.length; i++) {
this.vel_variance[i] = payload.getFloat();
}
for (int i = 0; i < this.pos_variance.length; i++) {
this.pos_variance[i] = payload.getFloat();
}
for (int i = 0; i < this.q.length; i++) {
this.q[i] = payload.getFloat();
}
this.roll_rate = payload.getFloat();
this.pitch_rate = payload.getFloat();
this.yaw_rate = payload.getFloat();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_control_system_state() {
this.msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_control_system_state( long time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, float[] vel_variance, float[] pos_variance, float[] q, float roll_rate, float pitch_rate, float yaw_rate) {
this.msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
this.time_usec = time_usec;
this.x_acc = x_acc;
this.y_acc = y_acc;
this.z_acc = z_acc;
this.x_vel = x_vel;
this.y_vel = y_vel;
this.z_vel = z_vel;
this.x_pos = x_pos;
this.y_pos = y_pos;
this.z_pos = z_pos;
this.airspeed = airspeed;
this.vel_variance = vel_variance;
this.pos_variance = pos_variance;
this.q = q;
this.roll_rate = roll_rate;
this.pitch_rate = pitch_rate;
this.yaw_rate = yaw_rate;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_control_system_state( long time_usec, float x_acc, float y_acc, float z_acc, float x_vel, float y_vel, float z_vel, float x_pos, float y_pos, float z_pos, float airspeed, float[] vel_variance, float[] pos_variance, float[] q, float roll_rate, float pitch_rate, float yaw_rate, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.x_acc = x_acc;
this.y_acc = y_acc;
this.z_acc = z_acc;
this.x_vel = x_vel;
this.y_vel = y_vel;
this.z_vel = z_vel;
this.x_pos = x_pos;
this.y_pos = y_pos;
this.z_pos = z_pos;
this.airspeed = airspeed;
this.vel_variance = vel_variance;
this.pos_variance = pos_variance;
this.q = q;
this.roll_rate = roll_rate;
this.pitch_rate = pitch_rate;
this.yaw_rate = yaw_rate;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_control_system_state(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" x_acc:"+x_acc+" y_acc:"+y_acc+" z_acc:"+z_acc+" x_vel:"+x_vel+" y_vel:"+y_vel+" z_vel:"+z_vel+" x_pos:"+x_pos+" y_pos:"+y_pos+" z_pos:"+z_pos+" airspeed:"+airspeed+" vel_variance:"+vel_variance+" pos_variance:"+pos_variance+" q:"+q+" roll_rate:"+roll_rate+" pitch_rate:"+pitch_rate+" yaw_rate:"+yaw_rate+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE";
}
}

View File

@ -0,0 +1,140 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CURRENT_EVENT_SEQUENCE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events.
*/
public class msg_current_event_sequence extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE = 411;
public static final int MAVLINK_MSG_LENGTH = 3;
private static final long serialVersionUID = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
/**
* Sequence number.
*/
@Description("Sequence number.")
@Units("")
public int sequence;
/**
* Flag bitset.
*/
@Description("Flag bitset.")
@Units("")
public short flags;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
packet.payload.putUnsignedShort(sequence);
packet.payload.putUnsignedByte(flags);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a current_event_sequence message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.sequence = payload.getUnsignedShort();
this.flags = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_current_event_sequence() {
this.msgid = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_current_event_sequence( int sequence, short flags) {
this.msgid = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
this.sequence = sequence;
this.flags = flags;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_current_event_sequence( int sequence, short flags, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.sequence = sequence;
this.flags = flags;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_current_event_sequence(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE - sysid:"+sysid+" compid:"+compid+" sequence:"+sequence+" flags:"+flags+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE";
}
}

View File

@ -0,0 +1,155 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE CURRENT_MODE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Get the current mode.
This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz).
It may be requested using MAV_CMD_REQUEST_MESSAGE.
See https://mavlink.io/en/services/standard_modes.html
*/
public class msg_current_mode extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_CURRENT_MODE = 436;
public static final int MAVLINK_MSG_LENGTH = 9;
private static final long serialVersionUID = MAVLINK_MSG_ID_CURRENT_MODE;
/**
* A bitfield for use for autopilot-specific flags
*/
@Description("A bitfield for use for autopilot-specific flags")
@Units("")
public long custom_mode;
/**
* The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied
*/
@Description("The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied")
@Units("")
public long intended_custom_mode;
/**
* Standard mode.
*/
@Description("Standard mode.")
@Units("")
public short standard_mode;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_CURRENT_MODE;
packet.payload.putUnsignedInt(custom_mode);
packet.payload.putUnsignedInt(intended_custom_mode);
packet.payload.putUnsignedByte(standard_mode);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a current_mode message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.custom_mode = payload.getUnsignedInt();
this.intended_custom_mode = payload.getUnsignedInt();
this.standard_mode = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_current_mode() {
this.msgid = MAVLINK_MSG_ID_CURRENT_MODE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_current_mode( long custom_mode, long intended_custom_mode, short standard_mode) {
this.msgid = MAVLINK_MSG_ID_CURRENT_MODE;
this.custom_mode = custom_mode;
this.intended_custom_mode = intended_custom_mode;
this.standard_mode = standard_mode;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_current_mode( long custom_mode, long intended_custom_mode, short standard_mode, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_CURRENT_MODE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.custom_mode = custom_mode;
this.intended_custom_mode = intended_custom_mode;
this.standard_mode = standard_mode;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_current_mode(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_CURRENT_MODE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_CURRENT_MODE - sysid:"+sysid+" compid:"+compid+" custom_mode:"+custom_mode+" intended_custom_mode:"+intended_custom_mode+" standard_mode:"+standard_mode+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_CURRENT_MODE";
}
}

View File

@ -0,0 +1,151 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DATA_STREAM PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Data stream status information.
*/
public class msg_data_stream extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DATA_STREAM = 67;
public static final int MAVLINK_MSG_LENGTH = 4;
private static final long serialVersionUID = MAVLINK_MSG_ID_DATA_STREAM;
/**
* The message rate
*/
@Description("The message rate")
@Units("Hz")
public int message_rate;
/**
* The ID of the requested data stream
*/
@Description("The ID of the requested data stream")
@Units("")
public short stream_id;
/**
* 1 stream is enabled, 0 stream is stopped.
*/
@Description("1 stream is enabled, 0 stream is stopped.")
@Units("")
public short on_off;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DATA_STREAM;
packet.payload.putUnsignedShort(message_rate);
packet.payload.putUnsignedByte(stream_id);
packet.payload.putUnsignedByte(on_off);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a data_stream message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.message_rate = payload.getUnsignedShort();
this.stream_id = payload.getUnsignedByte();
this.on_off = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_data_stream() {
this.msgid = MAVLINK_MSG_ID_DATA_STREAM;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_data_stream( int message_rate, short stream_id, short on_off) {
this.msgid = MAVLINK_MSG_ID_DATA_STREAM;
this.message_rate = message_rate;
this.stream_id = stream_id;
this.on_off = on_off;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_data_stream( int message_rate, short stream_id, short on_off, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DATA_STREAM;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.message_rate = message_rate;
this.stream_id = stream_id;
this.on_off = on_off;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_data_stream(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DATA_STREAM;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DATA_STREAM - sysid:"+sysid+" compid:"+compid+" message_rate:"+message_rate+" stream_id:"+stream_id+" on_off:"+on_off+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DATA_STREAM";
}
}

View File

@ -0,0 +1,195 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DATA_TRANSMISSION_HANDSHAKE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html.
*/
public class msg_data_transmission_handshake extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE = 130;
public static final int MAVLINK_MSG_LENGTH = 13;
private static final long serialVersionUID = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
/**
* total data size (set on ACK only).
*/
@Description("total data size (set on ACK only).")
@Units("bytes")
public long size;
/**
* Width of a matrix or image.
*/
@Description("Width of a matrix or image.")
@Units("")
public int width;
/**
* Height of a matrix or image.
*/
@Description("Height of a matrix or image.")
@Units("")
public int height;
/**
* Number of packets being sent (set on ACK only).
*/
@Description("Number of packets being sent (set on ACK only).")
@Units("")
public int packets;
/**
* Type of requested/acknowledged data.
*/
@Description("Type of requested/acknowledged data.")
@Units("")
public short type;
/**
* Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).
*/
@Description("Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only).")
@Units("bytes")
public short payload;
/**
* JPEG quality. Values: [1-100].
*/
@Description("JPEG quality. Values: [1-100].")
@Units("%")
public short jpg_quality;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
packet.payload.putUnsignedInt(size);
packet.payload.putUnsignedShort(width);
packet.payload.putUnsignedShort(height);
packet.payload.putUnsignedShort(packets);
packet.payload.putUnsignedByte(type);
packet.payload.putUnsignedByte(payload);
packet.payload.putUnsignedByte(jpg_quality);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a data_transmission_handshake message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.size = payload.getUnsignedInt();
this.width = payload.getUnsignedShort();
this.height = payload.getUnsignedShort();
this.packets = payload.getUnsignedShort();
this.type = payload.getUnsignedByte();
this.payload = payload.getUnsignedByte();
this.jpg_quality = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_data_transmission_handshake() {
this.msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_data_transmission_handshake( long size, int width, int height, int packets, short type, short payload, short jpg_quality) {
this.msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
this.size = size;
this.width = width;
this.height = height;
this.packets = packets;
this.type = type;
this.payload = payload;
this.jpg_quality = jpg_quality;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_data_transmission_handshake( long size, int width, int height, int packets, short type, short payload, short jpg_quality, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.size = size;
this.width = width;
this.height = height;
this.packets = packets;
this.type = type;
this.payload = payload;
this.jpg_quality = jpg_quality;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_data_transmission_handshake(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE - sysid:"+sysid+" compid:"+compid+" size:"+size+" width:"+width+" height:"+height+" packets:"+packets+" type:"+type+" payload:"+payload+" jpg_quality:"+jpg_quality+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE";
}
}

View File

@ -0,0 +1,151 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DEBUG PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N.
*/
public class msg_debug extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DEBUG = 254;
public static final int MAVLINK_MSG_LENGTH = 9;
private static final long serialVersionUID = MAVLINK_MSG_ID_DEBUG;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* DEBUG value
*/
@Description("DEBUG value")
@Units("")
public float value;
/**
* index of debug variable
*/
@Description("index of debug variable")
@Units("")
public short ind;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DEBUG;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putFloat(value);
packet.payload.putUnsignedByte(ind);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a debug message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.value = payload.getFloat();
this.ind = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_debug() {
this.msgid = MAVLINK_MSG_ID_DEBUG;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_debug( long time_boot_ms, float value, short ind) {
this.msgid = MAVLINK_MSG_ID_DEBUG;
this.time_boot_ms = time_boot_ms;
this.value = value;
this.ind = ind;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_debug( long time_boot_ms, float value, short ind, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DEBUG;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.value = value;
this.ind = ind;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_debug(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DEBUG;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DEBUG - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" value:"+value+" ind:"+ind+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DEBUG";
}
}

View File

@ -0,0 +1,207 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DEBUG_FLOAT_ARRAY PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code.
*/
public class msg_debug_float_array extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY = 350;
public static final int MAVLINK_MSG_LENGTH = 252;
private static final long serialVersionUID = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Unique ID used to discriminate between arrays
*/
@Description("Unique ID used to discriminate between arrays")
@Units("")
public int array_id;
/**
* Name, for human-friendly display in a Ground Control Station
*/
@Description("Name, for human-friendly display in a Ground Control Station")
@Units("")
public byte name[] = new byte[10];
/**
* data
*/
@Description("data")
@Units("")
public float data[] = new float[58];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putUnsignedShort(array_id);
for (int i = 0; i < name.length; i++) {
packet.payload.putByte(name[i]);
}
if (isMavlink2) {
for (int i = 0; i < data.length; i++) {
packet.payload.putFloat(data[i]);
}
}
return packet;
}
/**
* Decode a debug_float_array message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.array_id = payload.getUnsignedShort();
for (int i = 0; i < this.name.length; i++) {
this.name[i] = payload.getByte();
}
if (isMavlink2) {
for (int i = 0; i < this.data.length; i++) {
this.data[i] = payload.getFloat();
}
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_debug_float_array() {
this.msgid = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_debug_float_array( long time_usec, int array_id, byte[] name, float[] data) {
this.msgid = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
this.time_usec = time_usec;
this.array_id = array_id;
this.name = name;
this.data = data;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_debug_float_array( long time_usec, int array_id, byte[] name, float[] data, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.array_id = array_id;
this.name = name;
this.data = data;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_debug_float_array(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setName(String str) {
int len = Math.min(str.length(), 10);
for (int i=0; i<len; i++) {
name[i] = (byte) str.charAt(i);
}
for (int i=len; i<10; i++) { // padding for the rest of the buffer
name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getName() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 10; i++) {
if (name[i] != 0)
buf.append((char) name[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" array_id:"+array_id+" name:"+name+" data:"+data+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY";
}
}

View File

@ -0,0 +1,210 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DEBUG_VECT PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* To debug something using a named 3D vector.
*/
public class msg_debug_vect extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DEBUG_VECT = 250;
public static final int MAVLINK_MSG_LENGTH = 30;
private static final long serialVersionUID = MAVLINK_MSG_ID_DEBUG_VECT;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* x
*/
@Description("x")
@Units("")
public float x;
/**
* y
*/
@Description("y")
@Units("")
public float y;
/**
* z
*/
@Description("z")
@Units("")
public float z;
/**
* Name
*/
@Description("Name")
@Units("")
public byte name[] = new byte[10];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DEBUG_VECT;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putFloat(x);
packet.payload.putFloat(y);
packet.payload.putFloat(z);
for (int i = 0; i < name.length; i++) {
packet.payload.putByte(name[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a debug_vect message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.x = payload.getFloat();
this.y = payload.getFloat();
this.z = payload.getFloat();
for (int i = 0; i < this.name.length; i++) {
this.name[i] = payload.getByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_debug_vect() {
this.msgid = MAVLINK_MSG_ID_DEBUG_VECT;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_debug_vect( long time_usec, float x, float y, float z, byte[] name) {
this.msgid = MAVLINK_MSG_ID_DEBUG_VECT;
this.time_usec = time_usec;
this.x = x;
this.y = y;
this.z = z;
this.name = name;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_debug_vect( long time_usec, float x, float y, float z, byte[] name, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DEBUG_VECT;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.x = x;
this.y = y;
this.z = z;
this.name = name;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_debug_vect(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DEBUG_VECT;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Sets the buffer of this message with a string, adds the necessary padding
*/
public void setName(String str) {
int len = Math.min(str.length(), 10);
for (int i=0; i<len; i++) {
name[i] = (byte) str.charAt(i);
}
for (int i=len; i<10; i++) { // padding for the rest of the buffer
name[i] = 0;
}
}
/**
* Gets the message, formatted as a string
*/
public String getName() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 10; i++) {
if (name[i] != 0)
buf.append((char) name[i]);
else
break;
}
return buf.toString();
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DEBUG_VECT - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" x:"+x+" y:"+y+" z:"+z+" name:"+name+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DEBUG_VECT";
}
}

View File

@ -0,0 +1,258 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE DISTANCE_SENSOR PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Distance sensor information for an onboard rangefinder.
*/
public class msg_distance_sensor extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_DISTANCE_SENSOR = 132;
public static final int MAVLINK_MSG_LENGTH = 39;
private static final long serialVersionUID = MAVLINK_MSG_ID_DISTANCE_SENSOR;
/**
* Timestamp (time since system boot).
*/
@Description("Timestamp (time since system boot).")
@Units("ms")
public long time_boot_ms;
/**
* Minimum distance the sensor can measure
*/
@Description("Minimum distance the sensor can measure")
@Units("cm")
public int min_distance;
/**
* Maximum distance the sensor can measure
*/
@Description("Maximum distance the sensor can measure")
@Units("cm")
public int max_distance;
/**
* Current distance reading
*/
@Description("Current distance reading")
@Units("cm")
public int current_distance;
/**
* Type of distance sensor.
*/
@Description("Type of distance sensor.")
@Units("")
public short type;
/**
* Onboard ID of the sensor
*/
@Description("Onboard ID of the sensor")
@Units("")
public short id;
/**
* Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270
*/
@Description("Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270")
@Units("")
public short orientation;
/**
* Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown.
*/
@Description("Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown.")
@Units("cm^2")
public short covariance;
/**
* Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
*/
@Description("Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.")
@Units("rad")
public float horizontal_fov;
/**
* Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.
*/
@Description("Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0.")
@Units("rad")
public float vertical_fov;
/**
* Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.'
*/
@Description("Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.'")
@Units("")
public float quaternion[] = new float[4];
/**
* Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal.
*/
@Description("Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal.")
@Units("%")
public short signal_quality;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
packet.payload.putUnsignedInt(time_boot_ms);
packet.payload.putUnsignedShort(min_distance);
packet.payload.putUnsignedShort(max_distance);
packet.payload.putUnsignedShort(current_distance);
packet.payload.putUnsignedByte(type);
packet.payload.putUnsignedByte(id);
packet.payload.putUnsignedByte(orientation);
packet.payload.putUnsignedByte(covariance);
if (isMavlink2) {
packet.payload.putFloat(horizontal_fov);
packet.payload.putFloat(vertical_fov);
for (int i = 0; i < quaternion.length; i++) {
packet.payload.putFloat(quaternion[i]);
}
packet.payload.putUnsignedByte(signal_quality);
}
return packet;
}
/**
* Decode a distance_sensor message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_boot_ms = payload.getUnsignedInt();
this.min_distance = payload.getUnsignedShort();
this.max_distance = payload.getUnsignedShort();
this.current_distance = payload.getUnsignedShort();
this.type = payload.getUnsignedByte();
this.id = payload.getUnsignedByte();
this.orientation = payload.getUnsignedByte();
this.covariance = payload.getUnsignedByte();
if (isMavlink2) {
this.horizontal_fov = payload.getFloat();
this.vertical_fov = payload.getFloat();
for (int i = 0; i < this.quaternion.length; i++) {
this.quaternion[i] = payload.getFloat();
}
this.signal_quality = payload.getUnsignedByte();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_distance_sensor() {
this.msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_distance_sensor( long time_boot_ms, int min_distance, int max_distance, int current_distance, short type, short id, short orientation, short covariance, float horizontal_fov, float vertical_fov, float[] quaternion, short signal_quality) {
this.msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
this.time_boot_ms = time_boot_ms;
this.min_distance = min_distance;
this.max_distance = max_distance;
this.current_distance = current_distance;
this.type = type;
this.id = id;
this.orientation = orientation;
this.covariance = covariance;
this.horizontal_fov = horizontal_fov;
this.vertical_fov = vertical_fov;
this.quaternion = quaternion;
this.signal_quality = signal_quality;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_distance_sensor( long time_boot_ms, int min_distance, int max_distance, int current_distance, short type, short id, short orientation, short covariance, float horizontal_fov, float vertical_fov, float[] quaternion, short signal_quality, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_boot_ms = time_boot_ms;
this.min_distance = min_distance;
this.max_distance = max_distance;
this.current_distance = current_distance;
this.type = type;
this.id = id;
this.orientation = orientation;
this.covariance = covariance;
this.horizontal_fov = horizontal_fov;
this.vertical_fov = vertical_fov;
this.quaternion = quaternion;
this.signal_quality = signal_quality;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_distance_sensor(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_DISTANCE_SENSOR;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_DISTANCE_SENSOR - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" min_distance:"+min_distance+" max_distance:"+max_distance+" current_distance:"+current_distance+" type:"+type+" id:"+id+" orientation:"+orientation+" covariance:"+covariance+" horizontal_fov:"+horizontal_fov+" vertical_fov:"+vertical_fov+" quaternion:"+quaternion+" signal_quality:"+signal_quality+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_DISTANCE_SENSOR";
}
}

View File

@ -0,0 +1,327 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE EFI_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* EFI status output
*/
public class msg_efi_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_EFI_STATUS = 225;
public static final int MAVLINK_MSG_LENGTH = 73;
private static final long serialVersionUID = MAVLINK_MSG_ID_EFI_STATUS;
/**
* ECU index
*/
@Description("ECU index")
@Units("")
public float ecu_index;
/**
* RPM
*/
@Description("RPM")
@Units("")
public float rpm;
/**
* Fuel consumed
*/
@Description("Fuel consumed")
@Units("cm^3")
public float fuel_consumed;
/**
* Fuel flow rate
*/
@Description("Fuel flow rate")
@Units("cm^3/min")
public float fuel_flow;
/**
* Engine load
*/
@Description("Engine load")
@Units("%")
public float engine_load;
/**
* Throttle position
*/
@Description("Throttle position")
@Units("%")
public float throttle_position;
/**
* Spark dwell time
*/
@Description("Spark dwell time")
@Units("ms")
public float spark_dwell_time;
/**
* Barometric pressure
*/
@Description("Barometric pressure")
@Units("kPa")
public float barometric_pressure;
/**
* Intake manifold pressure(
*/
@Description("Intake manifold pressure(")
@Units("kPa")
public float intake_manifold_pressure;
/**
* Intake manifold temperature
*/
@Description("Intake manifold temperature")
@Units("degC")
public float intake_manifold_temperature;
/**
* Cylinder head temperature
*/
@Description("Cylinder head temperature")
@Units("degC")
public float cylinder_head_temperature;
/**
* Ignition timing (Crank angle degrees)
*/
@Description("Ignition timing (Crank angle degrees)")
@Units("deg")
public float ignition_timing;
/**
* Injection time
*/
@Description("Injection time")
@Units("ms")
public float injection_time;
/**
* Exhaust gas temperature
*/
@Description("Exhaust gas temperature")
@Units("degC")
public float exhaust_gas_temperature;
/**
* Output throttle
*/
@Description("Output throttle")
@Units("%")
public float throttle_out;
/**
* Pressure/temperature compensation
*/
@Description("Pressure/temperature compensation")
@Units("")
public float pt_compensation;
/**
* EFI health status
*/
@Description("EFI health status")
@Units("")
public short health;
/**
* Supply voltage to EFI sparking system. Zero in this value means 'unknown', so if the supply voltage really is zero volts use 0.0001 instead.
*/
@Description("Supply voltage to EFI sparking system. Zero in this value means 'unknown', so if the supply voltage really is zero volts use 0.0001 instead.")
@Units("V")
public float ignition_voltage;
/**
* Fuel pressure. Zero in this value means 'unknown', so if the fuel pressure really is zero kPa use 0.0001 instead.
*/
@Description("Fuel pressure. Zero in this value means 'unknown', so if the fuel pressure really is zero kPa use 0.0001 instead.")
@Units("kPa")
public float fuel_pressure;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_EFI_STATUS;
packet.payload.putFloat(ecu_index);
packet.payload.putFloat(rpm);
packet.payload.putFloat(fuel_consumed);
packet.payload.putFloat(fuel_flow);
packet.payload.putFloat(engine_load);
packet.payload.putFloat(throttle_position);
packet.payload.putFloat(spark_dwell_time);
packet.payload.putFloat(barometric_pressure);
packet.payload.putFloat(intake_manifold_pressure);
packet.payload.putFloat(intake_manifold_temperature);
packet.payload.putFloat(cylinder_head_temperature);
packet.payload.putFloat(ignition_timing);
packet.payload.putFloat(injection_time);
packet.payload.putFloat(exhaust_gas_temperature);
packet.payload.putFloat(throttle_out);
packet.payload.putFloat(pt_compensation);
packet.payload.putUnsignedByte(health);
if (isMavlink2) {
packet.payload.putFloat(ignition_voltage);
packet.payload.putFloat(fuel_pressure);
}
return packet;
}
/**
* Decode a efi_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.ecu_index = payload.getFloat();
this.rpm = payload.getFloat();
this.fuel_consumed = payload.getFloat();
this.fuel_flow = payload.getFloat();
this.engine_load = payload.getFloat();
this.throttle_position = payload.getFloat();
this.spark_dwell_time = payload.getFloat();
this.barometric_pressure = payload.getFloat();
this.intake_manifold_pressure = payload.getFloat();
this.intake_manifold_temperature = payload.getFloat();
this.cylinder_head_temperature = payload.getFloat();
this.ignition_timing = payload.getFloat();
this.injection_time = payload.getFloat();
this.exhaust_gas_temperature = payload.getFloat();
this.throttle_out = payload.getFloat();
this.pt_compensation = payload.getFloat();
this.health = payload.getUnsignedByte();
if (isMavlink2) {
this.ignition_voltage = payload.getFloat();
this.fuel_pressure = payload.getFloat();
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_efi_status() {
this.msgid = MAVLINK_MSG_ID_EFI_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_efi_status( float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, short health, float ignition_voltage, float fuel_pressure) {
this.msgid = MAVLINK_MSG_ID_EFI_STATUS;
this.ecu_index = ecu_index;
this.rpm = rpm;
this.fuel_consumed = fuel_consumed;
this.fuel_flow = fuel_flow;
this.engine_load = engine_load;
this.throttle_position = throttle_position;
this.spark_dwell_time = spark_dwell_time;
this.barometric_pressure = barometric_pressure;
this.intake_manifold_pressure = intake_manifold_pressure;
this.intake_manifold_temperature = intake_manifold_temperature;
this.cylinder_head_temperature = cylinder_head_temperature;
this.ignition_timing = ignition_timing;
this.injection_time = injection_time;
this.exhaust_gas_temperature = exhaust_gas_temperature;
this.throttle_out = throttle_out;
this.pt_compensation = pt_compensation;
this.health = health;
this.ignition_voltage = ignition_voltage;
this.fuel_pressure = fuel_pressure;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_efi_status( float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, short health, float ignition_voltage, float fuel_pressure, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_EFI_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.ecu_index = ecu_index;
this.rpm = rpm;
this.fuel_consumed = fuel_consumed;
this.fuel_flow = fuel_flow;
this.engine_load = engine_load;
this.throttle_position = throttle_position;
this.spark_dwell_time = spark_dwell_time;
this.barometric_pressure = barometric_pressure;
this.intake_manifold_pressure = intake_manifold_pressure;
this.intake_manifold_temperature = intake_manifold_temperature;
this.cylinder_head_temperature = cylinder_head_temperature;
this.ignition_timing = ignition_timing;
this.injection_time = injection_time;
this.exhaust_gas_temperature = exhaust_gas_temperature;
this.throttle_out = throttle_out;
this.pt_compensation = pt_compensation;
this.health = health;
this.ignition_voltage = ignition_voltage;
this.fuel_pressure = fuel_pressure;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_efi_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_EFI_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_EFI_STATUS - sysid:"+sysid+" compid:"+compid+" ecu_index:"+ecu_index+" rpm:"+rpm+" fuel_consumed:"+fuel_consumed+" fuel_flow:"+fuel_flow+" engine_load:"+engine_load+" throttle_position:"+throttle_position+" spark_dwell_time:"+spark_dwell_time+" barometric_pressure:"+barometric_pressure+" intake_manifold_pressure:"+intake_manifold_pressure+" intake_manifold_temperature:"+intake_manifold_temperature+" cylinder_head_temperature:"+cylinder_head_temperature+" ignition_timing:"+ignition_timing+" injection_time:"+injection_time+" exhaust_gas_temperature:"+exhaust_gas_temperature+" throttle_out:"+throttle_out+" pt_compensation:"+pt_compensation+" health:"+health+" ignition_voltage:"+ignition_voltage+" fuel_pressure:"+fuel_pressure+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_EFI_STATUS";
}
}

View File

@ -0,0 +1,148 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ENCAPSULATED_DATA PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Data packet for images sent using the Image Transmission Protocol: https://mavlink.io/en/services/image_transmission.html.
*/
public class msg_encapsulated_data extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ENCAPSULATED_DATA = 131;
public static final int MAVLINK_MSG_LENGTH = 255;
private static final long serialVersionUID = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
/**
* sequence number (starting with 0 on every transmission)
*/
@Description("sequence number (starting with 0 on every transmission)")
@Units("")
public int seqnr;
/**
* image data bytes
*/
@Description("image data bytes")
@Units("")
public short data[] = new short[253];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
packet.payload.putUnsignedShort(seqnr);
for (int i = 0; i < data.length; i++) {
packet.payload.putUnsignedByte(data[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a encapsulated_data message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.seqnr = payload.getUnsignedShort();
for (int i = 0; i < this.data.length; i++) {
this.data[i] = payload.getUnsignedByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_encapsulated_data() {
this.msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_encapsulated_data( int seqnr, short[] data) {
this.msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
this.seqnr = seqnr;
this.data = data;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_encapsulated_data( int seqnr, short[] data, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.seqnr = seqnr;
this.data = data;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_encapsulated_data(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ENCAPSULATED_DATA - sysid:"+sysid+" compid:"+compid+" seqnr:"+seqnr+" data:"+data+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ENCAPSULATED_DATA";
}
}

View File

@ -0,0 +1,241 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ESC_INFO PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data.
*/
public class msg_esc_info extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ESC_INFO = 290;
public static final int MAVLINK_MSG_LENGTH = 46;
private static final long serialVersionUID = MAVLINK_MSG_ID_ESC_INFO;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.")
@Units("us")
public long time_usec;
/**
* Number of reported errors by each ESC since boot.
*/
@Description("Number of reported errors by each ESC since boot.")
@Units("")
public long error_count[] = new long[4];
/**
* Counter of data packets received.
*/
@Description("Counter of data packets received.")
@Units("")
public int counter;
/**
* Bitmap of ESC failure flags.
*/
@Description("Bitmap of ESC failure flags.")
@Units("")
public int failure_flags[] = new int[4];
/**
* Temperature of each ESC. INT16_MAX: if data not supplied by ESC.
*/
@Description("Temperature of each ESC. INT16_MAX: if data not supplied by ESC.")
@Units("cdegC")
public short temperature[] = new short[4];
/**
* Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.
*/
@Description("Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.")
@Units("")
public short index;
/**
* Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data.
*/
@Description("Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data.")
@Units("")
public short count;
/**
* Connection type protocol for all ESC.
*/
@Description("Connection type protocol for all ESC.")
@Units("")
public short connection_type;
/**
* Information regarding online/offline status of each ESC.
*/
@Description("Information regarding online/offline status of each ESC.")
@Units("")
public short info;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ESC_INFO;
packet.payload.putUnsignedLong(time_usec);
for (int i = 0; i < error_count.length; i++) {
packet.payload.putUnsignedInt(error_count[i]);
}
packet.payload.putUnsignedShort(counter);
for (int i = 0; i < failure_flags.length; i++) {
packet.payload.putUnsignedShort(failure_flags[i]);
}
for (int i = 0; i < temperature.length; i++) {
packet.payload.putShort(temperature[i]);
}
packet.payload.putUnsignedByte(index);
packet.payload.putUnsignedByte(count);
packet.payload.putUnsignedByte(connection_type);
packet.payload.putUnsignedByte(info);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a esc_info message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
for (int i = 0; i < this.error_count.length; i++) {
this.error_count[i] = payload.getUnsignedInt();
}
this.counter = payload.getUnsignedShort();
for (int i = 0; i < this.failure_flags.length; i++) {
this.failure_flags[i] = payload.getUnsignedShort();
}
for (int i = 0; i < this.temperature.length; i++) {
this.temperature[i] = payload.getShort();
}
this.index = payload.getUnsignedByte();
this.count = payload.getUnsignedByte();
this.connection_type = payload.getUnsignedByte();
this.info = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_esc_info() {
this.msgid = MAVLINK_MSG_ID_ESC_INFO;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_esc_info( long time_usec, long[] error_count, int counter, int[] failure_flags, short[] temperature, short index, short count, short connection_type, short info) {
this.msgid = MAVLINK_MSG_ID_ESC_INFO;
this.time_usec = time_usec;
this.error_count = error_count;
this.counter = counter;
this.failure_flags = failure_flags;
this.temperature = temperature;
this.index = index;
this.count = count;
this.connection_type = connection_type;
this.info = info;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_esc_info( long time_usec, long[] error_count, int counter, int[] failure_flags, short[] temperature, short index, short count, short connection_type, short info, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ESC_INFO;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.error_count = error_count;
this.counter = counter;
this.failure_flags = failure_flags;
this.temperature = temperature;
this.index = index;
this.count = count;
this.connection_type = connection_type;
this.info = info;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_esc_info(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ESC_INFO;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ESC_INFO - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" error_count:"+error_count+" counter:"+counter+" failure_flags:"+failure_flags+" temperature:"+temperature+" index:"+index+" count:"+count+" connection_type:"+connection_type+" info:"+info+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ESC_INFO";
}
}

View File

@ -0,0 +1,197 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ESC_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer).
*/
public class msg_esc_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ESC_STATUS = 291;
public static final int MAVLINK_MSG_LENGTH = 57;
private static final long serialVersionUID = MAVLINK_MSG_ID_ESC_STATUS;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number.")
@Units("us")
public long time_usec;
/**
* Reported motor RPM from each ESC (negative for reverse rotation).
*/
@Description("Reported motor RPM from each ESC (negative for reverse rotation).")
@Units("rpm")
public int rpm[] = new int[4];
/**
* Voltage measured from each ESC.
*/
@Description("Voltage measured from each ESC.")
@Units("V")
public float voltage[] = new float[4];
/**
* Current measured from each ESC.
*/
@Description("Current measured from each ESC.")
@Units("A")
public float current[] = new float[4];
/**
* Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.
*/
@Description("Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4.")
@Units("")
public short index;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ESC_STATUS;
packet.payload.putUnsignedLong(time_usec);
for (int i = 0; i < rpm.length; i++) {
packet.payload.putInt(rpm[i]);
}
for (int i = 0; i < voltage.length; i++) {
packet.payload.putFloat(voltage[i]);
}
for (int i = 0; i < current.length; i++) {
packet.payload.putFloat(current[i]);
}
packet.payload.putUnsignedByte(index);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a esc_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
for (int i = 0; i < this.rpm.length; i++) {
this.rpm[i] = payload.getInt();
}
for (int i = 0; i < this.voltage.length; i++) {
this.voltage[i] = payload.getFloat();
}
for (int i = 0; i < this.current.length; i++) {
this.current[i] = payload.getFloat();
}
this.index = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_esc_status() {
this.msgid = MAVLINK_MSG_ID_ESC_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_esc_status( long time_usec, int[] rpm, float[] voltage, float[] current, short index) {
this.msgid = MAVLINK_MSG_ID_ESC_STATUS;
this.time_usec = time_usec;
this.rpm = rpm;
this.voltage = voltage;
this.current = current;
this.index = index;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_esc_status( long time_usec, int[] rpm, float[] voltage, float[] current, short index, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ESC_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.rpm = rpm;
this.voltage = voltage;
this.current = current;
this.index = index;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_esc_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ESC_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ESC_STATUS - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" rpm:"+rpm+" voltage:"+voltage+" current:"+current+" index:"+index+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ESC_STATUS";
}
}

View File

@ -0,0 +1,228 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE ESTIMATOR_STATUS PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user.
*/
public class msg_estimator_status extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_ESTIMATOR_STATUS = 230;
public static final int MAVLINK_MSG_LENGTH = 42;
private static final long serialVersionUID = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
/**
* Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
*/
@Description("Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.")
@Units("us")
public long time_usec;
/**
* Velocity innovation test ratio
*/
@Description("Velocity innovation test ratio")
@Units("")
public float vel_ratio;
/**
* Horizontal position innovation test ratio
*/
@Description("Horizontal position innovation test ratio")
@Units("")
public float pos_horiz_ratio;
/**
* Vertical position innovation test ratio
*/
@Description("Vertical position innovation test ratio")
@Units("")
public float pos_vert_ratio;
/**
* Magnetometer innovation test ratio
*/
@Description("Magnetometer innovation test ratio")
@Units("")
public float mag_ratio;
/**
* Height above terrain innovation test ratio
*/
@Description("Height above terrain innovation test ratio")
@Units("")
public float hagl_ratio;
/**
* True airspeed innovation test ratio
*/
@Description("True airspeed innovation test ratio")
@Units("")
public float tas_ratio;
/**
* Horizontal position 1-STD accuracy relative to the EKF local origin
*/
@Description("Horizontal position 1-STD accuracy relative to the EKF local origin")
@Units("m")
public float pos_horiz_accuracy;
/**
* Vertical position 1-STD accuracy relative to the EKF local origin
*/
@Description("Vertical position 1-STD accuracy relative to the EKF local origin")
@Units("m")
public float pos_vert_accuracy;
/**
* Bitmap indicating which EKF outputs are valid.
*/
@Description("Bitmap indicating which EKF outputs are valid.")
@Units("")
public int flags;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
packet.payload.putUnsignedLong(time_usec);
packet.payload.putFloat(vel_ratio);
packet.payload.putFloat(pos_horiz_ratio);
packet.payload.putFloat(pos_vert_ratio);
packet.payload.putFloat(mag_ratio);
packet.payload.putFloat(hagl_ratio);
packet.payload.putFloat(tas_ratio);
packet.payload.putFloat(pos_horiz_accuracy);
packet.payload.putFloat(pos_vert_accuracy);
packet.payload.putUnsignedShort(flags);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a estimator_status message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.time_usec = payload.getUnsignedLong();
this.vel_ratio = payload.getFloat();
this.pos_horiz_ratio = payload.getFloat();
this.pos_vert_ratio = payload.getFloat();
this.mag_ratio = payload.getFloat();
this.hagl_ratio = payload.getFloat();
this.tas_ratio = payload.getFloat();
this.pos_horiz_accuracy = payload.getFloat();
this.pos_vert_accuracy = payload.getFloat();
this.flags = payload.getUnsignedShort();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_estimator_status() {
this.msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_estimator_status( long time_usec, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy, int flags) {
this.msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
this.time_usec = time_usec;
this.vel_ratio = vel_ratio;
this.pos_horiz_ratio = pos_horiz_ratio;
this.pos_vert_ratio = pos_vert_ratio;
this.mag_ratio = mag_ratio;
this.hagl_ratio = hagl_ratio;
this.tas_ratio = tas_ratio;
this.pos_horiz_accuracy = pos_horiz_accuracy;
this.pos_vert_accuracy = pos_vert_accuracy;
this.flags = flags;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_estimator_status( long time_usec, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy, int flags, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.time_usec = time_usec;
this.vel_ratio = vel_ratio;
this.pos_horiz_ratio = pos_horiz_ratio;
this.pos_vert_ratio = pos_vert_ratio;
this.mag_ratio = mag_ratio;
this.hagl_ratio = hagl_ratio;
this.tas_ratio = tas_ratio;
this.pos_horiz_accuracy = pos_horiz_accuracy;
this.pos_vert_accuracy = pos_vert_accuracy;
this.flags = flags;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_estimator_status(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_ESTIMATOR_STATUS - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" vel_ratio:"+vel_ratio+" pos_horiz_ratio:"+pos_horiz_ratio+" pos_vert_ratio:"+pos_vert_ratio+" mag_ratio:"+mag_ratio+" hagl_ratio:"+hagl_ratio+" tas_ratio:"+tas_ratio+" pos_horiz_accuracy:"+pos_horiz_accuracy+" pos_vert_accuracy:"+pos_vert_accuracy+" flags:"+flags+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_ESTIMATOR_STATUS";
}
}

View File

@ -0,0 +1,203 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE EVENT PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component).
*/
public class msg_event extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_EVENT = 410;
public static final int MAVLINK_MSG_LENGTH = 53;
private static final long serialVersionUID = MAVLINK_MSG_ID_EVENT;
/**
* Event ID (as defined in the component metadata)
*/
@Description("Event ID (as defined in the component metadata)")
@Units("")
public long id;
/**
* Timestamp (time since system boot when the event happened).
*/
@Description("Timestamp (time since system boot when the event happened).")
@Units("ms")
public long event_time_boot_ms;
/**
* Sequence number.
*/
@Description("Sequence number.")
@Units("")
public int sequence;
/**
* Component ID
*/
@Description("Component ID")
@Units("")
public short destination_component;
/**
* System ID
*/
@Description("System ID")
@Units("")
public short destination_system;
/**
* Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9
*/
@Description("Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9")
@Units("")
public short log_levels;
/**
* Arguments (depend on event ID).
*/
@Description("Arguments (depend on event ID).")
@Units("")
public short arguments[] = new short[40];
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_EVENT;
packet.payload.putUnsignedInt(id);
packet.payload.putUnsignedInt(event_time_boot_ms);
packet.payload.putUnsignedShort(sequence);
packet.payload.putUnsignedByte(destination_component);
packet.payload.putUnsignedByte(destination_system);
packet.payload.putUnsignedByte(log_levels);
for (int i = 0; i < arguments.length; i++) {
packet.payload.putUnsignedByte(arguments[i]);
}
if (isMavlink2) {
}
return packet;
}
/**
* Decode a event message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.id = payload.getUnsignedInt();
this.event_time_boot_ms = payload.getUnsignedInt();
this.sequence = payload.getUnsignedShort();
this.destination_component = payload.getUnsignedByte();
this.destination_system = payload.getUnsignedByte();
this.log_levels = payload.getUnsignedByte();
for (int i = 0; i < this.arguments.length; i++) {
this.arguments[i] = payload.getUnsignedByte();
}
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_event() {
this.msgid = MAVLINK_MSG_ID_EVENT;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_event( long id, long event_time_boot_ms, int sequence, short destination_component, short destination_system, short log_levels, short[] arguments) {
this.msgid = MAVLINK_MSG_ID_EVENT;
this.id = id;
this.event_time_boot_ms = event_time_boot_ms;
this.sequence = sequence;
this.destination_component = destination_component;
this.destination_system = destination_system;
this.log_levels = log_levels;
this.arguments = arguments;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_event( long id, long event_time_boot_ms, int sequence, short destination_component, short destination_system, short log_levels, short[] arguments, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_EVENT;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.id = id;
this.event_time_boot_ms = event_time_boot_ms;
this.sequence = sequence;
this.destination_component = destination_component;
this.destination_system = destination_system;
this.log_levels = log_levels;
this.arguments = arguments;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_event(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_EVENT;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_EVENT - sysid:"+sysid+" compid:"+compid+" id:"+id+" event_time_boot_ms:"+event_time_boot_ms+" sequence:"+sequence+" destination_component:"+destination_component+" destination_system:"+destination_system+" log_levels:"+log_levels+" arguments:"+arguments+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_EVENT";
}
}

View File

@ -0,0 +1,140 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* java mavlink generator tool. It should not be modified by hand.
*/
// MESSAGE EXTENDED_SYS_STATE PACKING
package com.example.longyi_groundstation.MAVLink.common;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkMessage;
import com.example.longyi_groundstation.MAVLink.Messages.MAVLinkPayload;
import com.example.longyi_groundstation.MAVLink.Messages.Units;
import com.example.longyi_groundstation.MAVLink.Messages.Description;
/**
* Provides state for additional features
*/
public class msg_extended_sys_state extends MAVLinkMessage {
public static final int MAVLINK_MSG_ID_EXTENDED_SYS_STATE = 245;
public static final int MAVLINK_MSG_LENGTH = 2;
private static final long serialVersionUID = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
/**
* The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.
*/
@Description("The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration.")
@Units("")
public short vtol_state;
/**
* The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.
*/
@Description("The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown.")
@Units("")
public short landed_state;
/**
* Generates the payload for a mavlink message for a message of this type
* @return
*/
@Override
public MAVLinkPacket pack() {
MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH,isMavlink2);
packet.sysid = sysid;
packet.compid = compid;
packet.msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
packet.payload.putUnsignedByte(vtol_state);
packet.payload.putUnsignedByte(landed_state);
if (isMavlink2) {
}
return packet;
}
/**
* Decode a extended_sys_state message into this class fields
*
* @param payload The message to decode
*/
@Override
public void unpack(MAVLinkPayload payload) {
payload.resetIndex();
this.vtol_state = payload.getUnsignedByte();
this.landed_state = payload.getUnsignedByte();
if (isMavlink2) {
}
}
/**
* Constructor for a new message, just initializes the msgid
*/
public msg_extended_sys_state() {
this.msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
}
/**
* Constructor for a new message, initializes msgid and all payload variables
*/
public msg_extended_sys_state( short vtol_state, short landed_state) {
this.msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
this.vtol_state = vtol_state;
this.landed_state = landed_state;
}
/**
* Constructor for a new message, initializes everything
*/
public msg_extended_sys_state( short vtol_state, short landed_state, int sysid, int compid, boolean isMavlink2) {
this.msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
this.sysid = sysid;
this.compid = compid;
this.isMavlink2 = isMavlink2;
this.vtol_state = vtol_state;
this.landed_state = landed_state;
}
/**
* Constructor for a new message, initializes the message with the payload
* from a mavlink packet
*
*/
public msg_extended_sys_state(MAVLinkPacket mavLinkPacket) {
this.msgid = MAVLINK_MSG_ID_EXTENDED_SYS_STATE;
this.sysid = mavLinkPacket.sysid;
this.compid = mavLinkPacket.compid;
this.isMavlink2 = mavLinkPacket.isMavlink2;
unpack(mavLinkPacket.payload);
}
/**
* Returns a string with the MSG name and data
*/
@Override
public String toString() {
return "MAVLINK_MSG_ID_EXTENDED_SYS_STATE - sysid:"+sysid+" compid:"+compid+" vtol_state:"+vtol_state+" landed_state:"+landed_state+"";
}
/**
* Returns a human-readable string of the name of the message
*/
@Override
public String name() {
return "MAVLINK_MSG_ID_EXTENDED_SYS_STATE";
}
}

Some files were not shown because too many files have changed in this diff Show More