diff --git a/.idea/modules.xml b/.idea/modules.xml index d24fed5..32c1299 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,8 +2,8 @@ - - + + \ No newline at end of file diff --git a/README.md b/README.md index 21ec6fd..80febae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,16 @@ -# Rosetta Drone +# Rosetta Drone for **DJI Mavic 2** series +## Supports Android 8.0 and newer, with DJI SDK 4.11.1 and Androidx + +## The project now works on DJI Mavic 2 Pro/Zoom/Enterprise, and got live H.264 video stream out , tested on QGroundcontrol. + +## **Please do create issues or create PR on this fork.** + +![Image of Opening screen](images/popen.png) +Opening screen, requires DJI login first time... + + +This version has implemented the new video stream method in DJI SDK that require quite a few modifications. It also includes all the latest libraries, and Androidx. +In the unstable code there is also the DJI simulator, to enable testing in the lab. Android Studio is now updated to 3.6 Rosetta Drone is a Mavlink wrapper for the DJI SDK, which allows users to fly DJI drones using Mavlink-speaking ground control stations. In theory it should work with any Mavlink GCS, but all testing so far has been done with QGroundControl. @@ -6,12 +18,23 @@ Rosetta Drone is a Mavlink wrapper for the DJI SDK, which allows users to fly DJ The user assumes all responsibility for prevention of harm or damage. This is an evolving, experimental app. See "Known issues" below before use. +![Image of Opening screen](images/Screenshot.png) +Main screen, with live video... + + # Features * Report telemetry in QGC like position, attitude, relative altitude, heading, and battery remaining * Command Return-to-Launch from QGC -* View drone video feeds in QGC or forward RTP to an IP address of your choice (currently Mavic Pro only) +* View drone video feeds in QGC or forward RTP to an IP address of your choice (currently Mavic Pro 2 only) * Create and fly waypoint missions +* Fly by joystick and QGS +* Fly from Python in DroneKit +* Use Mavproxy to connect both QGC and DroneKit at the same time +* Use Gstreamer/OpenCV/FFMPEG and DroneKit to create complex AI functions + + + # Usage @@ -39,6 +62,29 @@ Note that if you are using QGroundControl on the same device as RosettaDrone, th 7. After flight, ensure the safety is enabled before approaching props. +8. Support is added for Pan and Tilt of camera gimbal by using RC channel 8 and 9. + +###Add this to you're Dronekit python script: + +def set_servo(servo,val): + msg = vehicle.message_factory.command_long_encode( + 0, # time_boot_ms (not used) + 0, # target system, target component + mavutil.mavlink.MAV_CMD_DO_SET_SERVO, + 0, + servo, # RC channel... + 1500+(val*5.5), # RC value + 0, 0, 0, 0, 0) + vehicle.send_mavlink(msg) + vehicle.flush() + + And then use: set_servo(8,-45.0) to set the gimbal.... + + +9. Support for **joystick** is added and tested with QGroundcontrol, using the now built in simulator. + +10. By taping on the drone icon 5 times, you enable test mode and can open the software with no drone connected. For GUI work. + # Building from source @@ -66,7 +112,7 @@ Anyone who speaks multiple languages knows that translations are rarely perfect. - DJI reports heading in True, which RosettaDrone passes along in vfr_hud.hdg. The mavlink protocol does not specify magnetic or true. -- DJI and Mavlink use different scales to characterize GPS accuracy. DJI also does not report hdop or vdop. +- DJI and Mavlink use different scales to characterise GPS accuracy. DJI also does not report hdop or vdop. - Radio signal strength is not yet implemented @@ -78,19 +124,25 @@ Anyone who speaks multiple languages knows that translations are rarely perfect. # Known Issues for Users -- Occassionally RosettaDrone will loop through repeated "Connecting to drone..." messages upon plugging in a drone. We believe this is a bug in the DJI SDK. Try restarting the drone, killing RosettaDrone, and restarting it. If that doesn't work, reinstalling the app clears caches and usually solves the problem. - If you change the UDP port while QGC is running, you may need to restart QGC +- If you change the video UDP port while QGC is running, you may need to restart Rosettadrone + +- Some times the Rosetta drone stopps and restarts, work are in progress to eliminate this. Seems to be related to the Mavlik layer. + +- If you takeoff using the QGC, and then sett a point and hit goto, the Rosettadrone enters an error state. Work are in progress. + # Known Issues for Developers -RosettaDrone uses MAVLink code generated by the MAVLink code generator, using the ArduPilot dialect. The Java code generator contains errors (see issues [#805](https://github.com/mavlink/mavlink/issues/805) and [#806](https://github.com/mavlink/mavlink/issues/806)), and the code required manual tweaking after generation. This means that simply dropping in updated auto-generated files will likely produce errors. +RosettaDrone uses MAVLink code generated by the MAVLink code generator, using the ArduPilot dialect. The Java code generator contains errors (see issues [#805](https://github.com/mavlink/mavlink/issues/805) and [#806](https://github.com/mavlink/mavlink/issues/806)), and the code required manual tweaking after generation. This means that simply dropping in updated auto-generated files will likely produce errors. At the moment this seems only to apply for setting and getting double that is missing. It is quite easy to copy the float function and modify it to double. The only usage for this is for ROV wheel distance, so someone should fix that in Mavlink. The use of an ArduPilot dialect over PX4 is not intended to be a statement of preference. The author believes strongly in the importance of maintaining maximum compatibility across both projects. # Acknowledgements Rosetta Drone was brought to you by developers from Rogue Squadron, a UAS/C-UAS red team at the Defense Innovation Unit Experimental. +The updated version was brought to you by eSmartSystems in cooperation with the Defense Drone depatment at 9Tek. ## Icons Icons made by Pixel Perfect & Freepik at flaticon @@ -103,3 +155,4 @@ Rosetta Drone uses a modified version of DJI's [Android Video Stream Decoding Sa Video RTP packing uses code modified from the [libstreamer](https://github.com/fyhertz/libstreaming) library, licensed under Apache 2. + diff --git a/app/build.gradle b/app/build.gradle index 612686e..7ff6a04 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,17 +1,21 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { applicationId "sq.rogue.rosettadrone" - minSdkVersion 23 - targetSdkVersion 27 + minSdkVersion 25 + targetSdkVersion 28 versionCode 1 - versionName "1.2.1" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + versionName "5.0.1" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } + dexOptions { + javaMaxHeapSize "4g" + } + buildTypes { release { minifyEnabled false @@ -28,6 +32,13 @@ android { } } + sourceSets { + main { + jni.srcDirs=[] + jniLibs.srcDirs=['../libs'] + } + } + packagingOptions { doNotStrip "*/*/libdjivideo.so" doNotStrip "*/*/libSDKRelativeJNI.so" @@ -38,6 +49,18 @@ android { doNotStrip "*/*/libFRCorkscrew.so" doNotStrip "*/*/libUpgradeVerify.so" doNotStrip "*/*/libFR.so" + + // Add the new so + doNotStrip "*/*/libDJIFlySafeCore.so" + doNotStrip "*/*/libdjifs_jni.so" + doNotStrip "*/*/libsfjni.so" + + doNotStrip "*/*/libDJICommonJNI.so" + doNotStrip "*/*/libDJICSDKCommon.so" + doNotStrip "*/*/libDJIUpgradeCore.so" + doNotStrip "*/*/libDJIUpgradeJNI.so" + + exclude 'META-INF/rxjava.properties' } externalNativeBuild { cmake { @@ -46,27 +69,54 @@ android { } defaultConfig { ndk { - abiFilters 'armeabi-v7a' // more could be added + abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a' } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + } dependencies { // debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' // releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' + + + + // classpath 'com.android.tools.build:gradle:6.2.1' + implementation fileTree(include: ['*.jar'], dir: 'libs') - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:preference-v7:27.1.1' - implementation 'com.android.support:preference-v14:27.1.1' - implementation 'com.android.support.constraint:constraint-layout:1.1.2' - implementation 'com.android.support:design:27.1.1' - testImplementation 'junit:junit:4.12' + implementation 'com.squareup:otto:1.3.8' + implementation('com.dji:dji-sdk:4.11.1', { + /** + * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom. + * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp + * is called. + * Both will greatly reducing the size of the APK. + */ + exclude module: 'library-anti-distortion' + //exclude module: 'fly-safe-database' + }) + compileOnly 'com.dji:dji-sdk-provided:4.11.1' + + implementation 'androidx.annotation:annotation:1.1.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.preference:preference:1.1.0' + implementation 'androidx.legacy:legacy-preference-v14:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'com.google.android.material:material:1.1.0' + testImplementation 'junit:junit:4.13' testImplementation 'org.mockito:mockito-core:2.7.22' testImplementation 'org.mockito:mockito-android:2.7.22' - implementation 'com.dji:dji-sdk:4.6' - compileOnly 'com.dji:dji-sdk-provided:4.6' - implementation 'com.android.support:multidex:1.0.3' + implementation 'androidx.multidex:multidex:2.0.1' + + implementation 'androidx.core:core:1.2.0' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' + } diff --git a/app/src/androidTest/java/sq/rogue/rosettadrone/ExampleInstrumentedTest.java b/app/src/androidTest/java/sq/rogue/rosettadrone/ExampleInstrumentedTest.java index 0025769..9812fec 100644 --- a/app/src/androidTest/java/sq/rogue/rosettadrone/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/sq/rogue/rosettadrone/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package sq.rogue.rosettadrone; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dd8b249..feb29a6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,19 +3,23 @@ package="sq.rogue.rosettadrone"> - - - + + + + + + + - + + + - - + + android:resource="@xml/accessory_filter"/> + + + + + + + + + + + + + + + + + + + + - - - + - \ No newline at end of file + diff --git a/app/src/main/assets/test.py b/app/src/main/assets/test.py new file mode 100644 index 0000000..052ddda --- /dev/null +++ b/app/src/main/assets/test.py @@ -0,0 +1,234 @@ +##########DEPENDENCIES############# + +from dronekit import connect, VehicleMode,LocationGlobalRelative,APIException +import time +import socket +import exception +import math +import argparse +from pymavlink import mavutil +#########FUNCTIONS################# + +def connectMyCopter(): + parser = argparse.ArgumentParser(description='commands') + parser.add_argument('--connect') + args = parser.parse_args() + connection_string = args.connect + if not connection_string: + import dronekit_sitl + sitl = dronekit_sitl.start_default() + connection_string = sitl.connection_string() + + vehicle = connect(connection_string,wait_ready=True) + return vehicle + +def arm_and_takeoff(targetHeight): + timeout = 0 + while vehicle.is_armable!=True and timeout < 5: + print("Waiting for vehicle to become armable.") + timeout = timeout +1 + time.sleep(1) + + print("Vehicle is now armable") + vehicle.mode = VehicleMode("GUIDED") + while vehicle.mode!='GUIDED': + print("Waiting for drone to enter GUIDED flight mode") + time.sleep(1) + + print("Vehicle now in GUIDED MODE. Have fun!!") + vehicle.armed = True + timeout = 0 + while vehicle.armed==False and timeout < 5: + print("Waiting for vehicle to become armed.") + timeout = timeout +1 + time.sleep(1) + + print("Look out! Virtual props are spinning!!") + time.sleep(5) + vehicle.simple_takeoff(targetHeight) ##meters + while True: + print("Current Altitude: %f"%vehicle.location.global_relative_frame.alt) + if vehicle.location.global_relative_frame.alt>=.95: #*targetHeight: + break + time.sleep(1) + + while vehicle.location.global_relative_frame.alt <= targetHeight*.95: + send_local_ned_velocity(0,0,-2) + time.sleep(1) + print("Current Altitude: %f"%vehicle.location.global_relative_frame.alt) + + send_local_ned_velocity(0,0,0) + print("Target altitude reached!!") + return None + +##Send a velocity command with +x being the heading of the drone. +def send_local_ned_velocity(vx, vy, vz): + msg = vehicle.message_factory.set_position_target_local_ned_encode( + 0, + 0, 0, + mavutil.mavlink.MAV_FRAME_BODY_OFFSET_NED, + 0b0000111111000111, + 0, 0, 0, + vx, vy, vz, + 0, 0, 0, + 0, 0) + vehicle.send_mavlink(msg) + vehicle.flush() + +##Send a velocity command with +x being the heading of the drone. +def send_global_ned_velocity(vx, vy, vz): + msg = vehicle.message_factory.set_position_target_local_ned_encode( + 0, # time_boot_ms (not used) + 0, 0, # target system, target component + mavutil.mavlink.MAV_FRAME_LOCAL_NED, #frame + 0b0000111111000111, #type_mask (only speeds enabled) + 0, 0, 0, # x, y, z positions (not used) + vx, vy, vz, # x, y, z velocity in m/s + 0, 0, 0, #x, y, z acceleration (not supported yet, ignored in GCS_Mavlink) + 0, 0) #yaw, yaw_rate (not supported yet, ignored in GCS_Mavlink) + vehicle.send_mavlink(msg) + vehicle.flush() + +# Set servo output, values are in degrees +def set_servo(servo,val): + msg = vehicle.message_factory.command_long_encode( + 0, # time_boot_ms (not used) + 0, # target system, target component + mavutil.mavlink.MAV_CMD_DO_SET_SERVO, + 0, + servo, # RC channel... + 1500+(val*5.5), # RC value + 0, 0, 0, 0, 0) + vehicle.send_mavlink(msg) + vehicle.flush() + +##########MAIN EXECUTABLE########### + +vehicle = connectMyCopter() +arm_and_takeoff(10) + +#------------------------------------------------------ +# Do gimbal test... + +set_servo(9,0.0) +set_servo(8,0.0) +time.sleep(2) +set_servo(8,-45.0) +time.sleep(5) +set_servo(8,45.0) +time.sleep(5) +set_servo(8,0.0) +time.sleep(5) +set_servo(9,-45.0) +time.sleep(5) +set_servo(9,-90.0) +time.sleep(6) +set_servo(9,20.0) +time.sleep(5) +set_servo(9,0.0) + + +counter=0 +while counter<5: + send_local_ned_velocity(2,0,0) + time.sleep(1) + print("Moving NORTH relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_local_ned_velocity(0,-2,0) + time.sleep(1) + print("Moving WEST relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_local_ned_velocity(-2,0,0) + time.sleep(1) + print("Moving NORTH relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_local_ned_velocity(0,2,0) + time.sleep(1) + print("Moving WEST relative to front of drone") + counter=counter+1 + +#------------------------------------------------------ +time.sleep(2) + +counter=0 +while counter<5: + send_global_ned_velocity(2,0,0) + time.sleep(1) + print("Moving TRUE NORTH relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_global_ned_velocity(0,-2,0) + time.sleep(1) + print("Moving TRUE WEST relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_global_ned_velocity(-2,0,0) + time.sleep(1) + print("Moving TRUE SOUTH relative to front of drone") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_global_ned_velocity(0,2,0) + time.sleep(1) + print("Moving TRUE EAST relative to front of drone") + counter=counter+1 + +#------------------------------------------------------ +#########UP AND DOWN############ +time.sleep(2) + +counter=0 +while counter<5: + send_local_ned_velocity(0,0,-2) + time.sleep(1) + print("Moving UP") + counter=counter+1 + +time.sleep(2) + +counter=0 +while counter<5: + send_local_ned_velocity(0,0,2) + time.sleep(1) + print("Moving DOWN") + counter=counter+1 + + +# Hover for 10 seconds +time.sleep(5) + +print("Now let's land") +vehicle.mode = VehicleMode("LAND") +time.sleep(5) + +print("Waiting for landing") +while vehicle.mode=='LAND': + print("Waiting for vehicle to land.") + print("Current Altitude: %f"%vehicle.location.global_relative_frame.alt) + time.sleep(1) diff --git a/app/src/main/cpp/lib/arm64-v8a/libgstreamer_android.so b/app/src/main/cpp/lib/arm64-v8a/libgstreamer_android.so index 883db7d..76467d9 100755 Binary files a/app/src/main/cpp/lib/arm64-v8a/libgstreamer_android.so and b/app/src/main/cpp/lib/arm64-v8a/libgstreamer_android.so differ diff --git a/app/src/main/cpp/lib/armeabi-v7a/libgstreamer_android.so b/app/src/main/cpp/lib/armeabi-v7a/libgstreamer_android.so index 16aa533..f400a17 100755 Binary files a/app/src/main/cpp/lib/armeabi-v7a/libgstreamer_android.so and b/app/src/main/cpp/lib/armeabi-v7a/libgstreamer_android.so differ diff --git a/app/src/main/cpp/lib/x86/libgstreamer_android.so b/app/src/main/cpp/lib/x86/libgstreamer_android.so index 958ce9b..73aaf7f 100755 Binary files a/app/src/main/cpp/lib/x86/libgstreamer_android.so and b/app/src/main/cpp/lib/x86/libgstreamer_android.so differ diff --git a/app/src/main/java/.DS_Store b/app/src/main/java/.DS_Store new file mode 100644 index 0000000..35a54bf Binary files /dev/null and b/app/src/main/java/.DS_Store differ diff --git a/app/src/main/java/com/.DS_Store b/app/src/main/java/com/.DS_Store new file mode 100644 index 0000000..995c5df Binary files /dev/null and b/app/src/main/java/com/.DS_Store differ diff --git a/app/src/main/java/com/MAVLink/.DS_Store b/app/src/main/java/com/MAVLink/.DS_Store new file mode 100644 index 0000000..2da6a49 Binary files /dev/null and b/app/src/main/java/com/MAVLink/.DS_Store differ diff --git a/app/src/main/java/com/MAVLink/MAVLinkPacket.java b/app/src/main/java/com/MAVLink/MAVLinkPacket.java index b2fd706..14deabd 100644 --- a/app/src/main/java/com/MAVLink/MAVLinkPacket.java +++ b/app/src/main/java/com/MAVLink/MAVLinkPacket.java @@ -3,159 +3,108 @@ * This class was automatically generated by the * java mavlink generator tool. It should not be modified by hand. */ - + package com.MAVLink; -import com.MAVLink.Messages.MAVLinkMessage; +import java.io.Serializable; import com.MAVLink.Messages.MAVLinkPayload; +import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.ardupilotmega.CRC; -import com.MAVLink.ardupilotmega.msg_adap_tuning; -import com.MAVLink.ardupilotmega.msg_ahrs; -import com.MAVLink.ardupilotmega.msg_ahrs2; -import com.MAVLink.ardupilotmega.msg_ahrs3; -import com.MAVLink.ardupilotmega.msg_airspeed_autocal; -import com.MAVLink.ardupilotmega.msg_ap_adc; -import com.MAVLink.ardupilotmega.msg_autopilot_version_request; -import com.MAVLink.ardupilotmega.msg_battery2; -import com.MAVLink.ardupilotmega.msg_camera_feedback; -import com.MAVLink.ardupilotmega.msg_camera_status; -import com.MAVLink.ardupilotmega.msg_compassmot_status; -import com.MAVLink.ardupilotmega.msg_data16; -import com.MAVLink.ardupilotmega.msg_data32; -import com.MAVLink.ardupilotmega.msg_data64; -import com.MAVLink.ardupilotmega.msg_data96; -import com.MAVLink.ardupilotmega.msg_device_op_read; -import com.MAVLink.ardupilotmega.msg_device_op_read_reply; -import com.MAVLink.ardupilotmega.msg_device_op_write; -import com.MAVLink.ardupilotmega.msg_device_op_write_reply; -import com.MAVLink.ardupilotmega.msg_digicam_configure; -import com.MAVLink.ardupilotmega.msg_digicam_control; -import com.MAVLink.ardupilotmega.msg_ekf_status_report; -import com.MAVLink.ardupilotmega.msg_fence_fetch_point; -import com.MAVLink.ardupilotmega.msg_fence_point; -import com.MAVLink.ardupilotmega.msg_fence_status; -import com.MAVLink.ardupilotmega.msg_gimbal_control; -import com.MAVLink.ardupilotmega.msg_gimbal_report; -import com.MAVLink.ardupilotmega.msg_gimbal_torque_cmd_report; -import com.MAVLink.ardupilotmega.msg_gopro_get_request; -import com.MAVLink.ardupilotmega.msg_gopro_get_response; -import com.MAVLink.ardupilotmega.msg_gopro_heartbeat; -import com.MAVLink.ardupilotmega.msg_gopro_set_request; -import com.MAVLink.ardupilotmega.msg_gopro_set_response; -import com.MAVLink.ardupilotmega.msg_hwstatus; -import com.MAVLink.ardupilotmega.msg_led_control; -import com.MAVLink.ardupilotmega.msg_limits_status; -import com.MAVLink.ardupilotmega.msg_mag_cal_progress; -import com.MAVLink.ardupilotmega.msg_mag_cal_report; -import com.MAVLink.ardupilotmega.msg_meminfo; -import com.MAVLink.ardupilotmega.msg_mount_configure; -import com.MAVLink.ardupilotmega.msg_mount_control; -import com.MAVLink.ardupilotmega.msg_mount_status; -import com.MAVLink.ardupilotmega.msg_pid_tuning; -import com.MAVLink.ardupilotmega.msg_radio; -import com.MAVLink.ardupilotmega.msg_rally_fetch_point; -import com.MAVLink.ardupilotmega.msg_rally_point; -import com.MAVLink.ardupilotmega.msg_rangefinder; -import com.MAVLink.ardupilotmega.msg_remote_log_block_status; -import com.MAVLink.ardupilotmega.msg_remote_log_data_block; -import com.MAVLink.ardupilotmega.msg_rpm; -import com.MAVLink.ardupilotmega.msg_sensor_offsets; -import com.MAVLink.ardupilotmega.msg_set_mag_offsets; -import com.MAVLink.ardupilotmega.msg_simstate; -import com.MAVLink.ardupilotmega.msg_vision_position_delta; -import com.MAVLink.ardupilotmega.msg_wind; -import com.MAVLink.common.*; -import com.MAVLink.uAvionix.msg_uavionix_adsb_out_cfg; -import com.MAVLink.uAvionix.msg_uavionix_adsb_out_dynamic; -import com.MAVLink.uAvionix.msg_uavionix_adsb_transceiver_health_report; -import java.io.Serializable; +import com.MAVLink.ardupilotmega.*; +import com.MAVLink.common.*; +import com.MAVLink.uAvionix.*; +import com.MAVLink.icarous.*; /** - * Common interface for all MAVLink Messages - * Packet Anatomy - * This is the anatomy of one packet. It is inspired by the CAN and SAE AS-4 standards. - *

- * Byte Index Content Value Explanation - * 0 Packet start sign v1.0: 0xFE Indicates the start of a new packet. (v0.9: 0x55) - * 1 Payload length 0 - 255 Indicates length of the following payload. - * 2 Packet sequence 0 - 255 Each component counts up his send sequence. Allows to detect packet loss - * 3 System ID 1 - 255 ID of the SENDING system. Allows to differentiate different MAVs on the same network. - * 4 Component ID 0 - 255 ID of the SENDING component. Allows to differentiate different components of the same system, e.g. the IMU and the autopilot. - * 5 Message ID 0 - 255 ID of the message - the id defines what the payload means and how it should be correctly decoded. - * 6 to (n+6) Payload 0 - 255 Data of the message, depends on the message id. - * (n+7)to(n+8) Checksum (low byte, high byte) ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from message fields. Protects the packet from decoding a different version of the same packet but with different variables). - *

- * The checksum is the same as used in ITU X.25 and SAE AS-4 standards (CRC-16-CCITT), documented in SAE AS5669A. Please see the MAVLink source code for a documented C-implementation of it. LINK TO CHECKSUM - * The minimum packet length is 8 bytes for acknowledgement packets without payload - * The maximum packet length is 263 bytes for full payload - */ +* Common interface for all MAVLink Messages +* Packet Anatomy +* This is the anatomy of one packet. It is inspired by the CAN and SAE AS-4 standards. + +* Byte Index Content Value Explanation +* 0 Packet start sign v1.0: 0xFE Indicates the start of a new packet. (v0.9: 0x55) +* 1 Payload length 0 - 255 Indicates length of the following payload. +* 2 Packet sequence 0 - 255 Each component counts up his send sequence. Allows to detect packet loss +* 3 System ID 1 - 255 ID of the SENDING system. Allows to differentiate different MAVs on the same network. +* 4 Component ID 0 - 255 ID of the SENDING component. Allows to differentiate different components of the same system, e.g. the IMU and the autopilot. +* 5 Message ID 0 - 255 ID of the message - the id defines what the payload means and how it should be correctly decoded. +* 6 to (n+6) Payload 0 - 255 Data of the message, depends on the message id. +* (n+7)to(n+8) Checksum (low byte, high byte) ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from message fields. Protects the packet from decoding a different version of the same packet but with different variables). + +* The checksum is the same as used in ITU X.25 and SAE AS-4 standards (CRC-16-CCITT), documented in SAE AS5669A. Please see the MAVLink source code for a documented C-implementation of it. LINK TO CHECKSUM +* The minimum packet length is 8 bytes for acknowledgement packets without payload +* The maximum packet length is 263 bytes for full payload +* +*/ public class MAVLinkPacket implements Serializable { - public static final int MAVLINK_STX = 254; private static final long serialVersionUID = 2095947771227815314L; + + public static final int MAVLINK_STX = 254; + /** - * Message length. NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 - */ + * Message length. NOT counting STX, LENGTH, SEQ, SYSID, COMPID, MSGID, CRC1 and CRC2 + */ public final int len; /** - * Message sequence - */ + * Message sequence + */ public int seq; /** - * ID of the SENDING system. Allows to differentiate different MAVs on the - * same network. - */ + * 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. - */ + * 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. - */ + * 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. - */ + * Data of the message, depends on the message id. + */ public MAVLinkPayload payload; /** - * ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) - * Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from - * message fields. Protects the packet from decoding a different version of - * the same packet but with different variables). - */ + * ITU X.25/SAE AS-4 hash, excluding packet start sign, so bytes 1..(n+6) + * Note: The checksum also includes MAVLINK_CRC_EXTRA (Number computed from + * message fields. Protects the packet from decoding a different version of + * the same packet but with different variables). + */ public CRC crc; - public MAVLinkPacket(int payloadLength) { + public MAVLinkPacket(int payloadLength){ len = payloadLength; payload = new MAVLinkPayload(payloadLength); } /** - * Check if the size of the Payload is equal to the "len" byte - */ + * 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. - */ - public void generateCRC() { - if (crc == null) { + * Update CRC for this packet. + */ + public void generateCRC(){ + if(crc == null){ crc = new CRC(); - } else { + } + else{ crc.start_checksum(); } - + crc.update_checksum(len); crc.update_checksum(seq); crc.update_checksum(sysid); @@ -172,13 +121,13 @@ public void generateCRC() { } /** - * Encode this packet for transmission. - * - * @return Array with bytes to be transmitted - */ + * Encode this packet for transmission. + * + * @return Array with bytes to be transmitted + */ public byte[] encodePacket() { byte[] buffer = new byte[6 + len + 2]; - + int i = 0; buffer[i++] = (byte) MAVLINK_STX; buffer[i++] = (byte) len; @@ -199,670 +148,785 @@ public byte[] encodePacket() { } /** - * Unpack the data in this packet and return a MAVLink message - * - * @return MAVLink message decoded from this packet - */ + * Unpack the data in this packet and return a MAVLink message + * + * @return MAVLink message decoded from this packet + */ public MAVLinkMessage unpack() { switch (msgid) { - + case msg_sensor_offsets.MAVLINK_MSG_ID_SENSOR_OFFSETS: - return new msg_sensor_offsets(this); - + return new msg_sensor_offsets(this); + case msg_set_mag_offsets.MAVLINK_MSG_ID_SET_MAG_OFFSETS: - return new msg_set_mag_offsets(this); - + return new msg_set_mag_offsets(this); + case msg_meminfo.MAVLINK_MSG_ID_MEMINFO: - return new msg_meminfo(this); - + return new msg_meminfo(this); + case msg_ap_adc.MAVLINK_MSG_ID_AP_ADC: - return new msg_ap_adc(this); - + return new msg_ap_adc(this); + case msg_digicam_configure.MAVLINK_MSG_ID_DIGICAM_CONFIGURE: - return new msg_digicam_configure(this); - + return new msg_digicam_configure(this); + case msg_digicam_control.MAVLINK_MSG_ID_DIGICAM_CONTROL: - return new msg_digicam_control(this); - + return new msg_digicam_control(this); + case msg_mount_configure.MAVLINK_MSG_ID_MOUNT_CONFIGURE: - return new msg_mount_configure(this); - + return new msg_mount_configure(this); + case msg_mount_control.MAVLINK_MSG_ID_MOUNT_CONTROL: - return new msg_mount_control(this); - + return new msg_mount_control(this); + case msg_mount_status.MAVLINK_MSG_ID_MOUNT_STATUS: - return new msg_mount_status(this); - + return new msg_mount_status(this); + case msg_fence_point.MAVLINK_MSG_ID_FENCE_POINT: - return new msg_fence_point(this); - + return new msg_fence_point(this); + case msg_fence_fetch_point.MAVLINK_MSG_ID_FENCE_FETCH_POINT: - return new msg_fence_fetch_point(this); - - case msg_fence_status.MAVLINK_MSG_ID_FENCE_STATUS: - return new msg_fence_status(this); - + return new msg_fence_fetch_point(this); + case msg_ahrs.MAVLINK_MSG_ID_AHRS: - return new msg_ahrs(this); - + return new msg_ahrs(this); + case msg_simstate.MAVLINK_MSG_ID_SIMSTATE: - return new msg_simstate(this); - + return new msg_simstate(this); + case msg_hwstatus.MAVLINK_MSG_ID_HWSTATUS: - return new msg_hwstatus(this); - + return new msg_hwstatus(this); + case msg_radio.MAVLINK_MSG_ID_RADIO: - return new msg_radio(this); - + return new msg_radio(this); + case msg_limits_status.MAVLINK_MSG_ID_LIMITS_STATUS: - return new msg_limits_status(this); - + return new msg_limits_status(this); + case msg_wind.MAVLINK_MSG_ID_WIND: - return new msg_wind(this); - + return new msg_wind(this); + case msg_data16.MAVLINK_MSG_ID_DATA16: - return new msg_data16(this); - + return new msg_data16(this); + case msg_data32.MAVLINK_MSG_ID_DATA32: - return new msg_data32(this); - + return new msg_data32(this); + case msg_data64.MAVLINK_MSG_ID_DATA64: - return new msg_data64(this); - + return new msg_data64(this); + case msg_data96.MAVLINK_MSG_ID_DATA96: - return new msg_data96(this); - + return new msg_data96(this); + case msg_rangefinder.MAVLINK_MSG_ID_RANGEFINDER: - return new msg_rangefinder(this); - + return new msg_rangefinder(this); + case msg_airspeed_autocal.MAVLINK_MSG_ID_AIRSPEED_AUTOCAL: - return new msg_airspeed_autocal(this); - + return new msg_airspeed_autocal(this); + case msg_rally_point.MAVLINK_MSG_ID_RALLY_POINT: - return new msg_rally_point(this); - + return new msg_rally_point(this); + case msg_rally_fetch_point.MAVLINK_MSG_ID_RALLY_FETCH_POINT: - return new msg_rally_fetch_point(this); - + return new msg_rally_fetch_point(this); + case msg_compassmot_status.MAVLINK_MSG_ID_COMPASSMOT_STATUS: - return new msg_compassmot_status(this); - + return new msg_compassmot_status(this); + case msg_ahrs2.MAVLINK_MSG_ID_AHRS2: - return new msg_ahrs2(this); - + return new msg_ahrs2(this); + case msg_camera_status.MAVLINK_MSG_ID_CAMERA_STATUS: - return new msg_camera_status(this); - + return new msg_camera_status(this); + case msg_camera_feedback.MAVLINK_MSG_ID_CAMERA_FEEDBACK: - return new msg_camera_feedback(this); - + return new msg_camera_feedback(this); + case msg_battery2.MAVLINK_MSG_ID_BATTERY2: - return new msg_battery2(this); - + return new msg_battery2(this); + case msg_ahrs3.MAVLINK_MSG_ID_AHRS3: - return new msg_ahrs3(this); - + return new msg_ahrs3(this); + case msg_autopilot_version_request.MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST: - return new msg_autopilot_version_request(this); - + return new msg_autopilot_version_request(this); + case msg_remote_log_data_block.MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK: - return new msg_remote_log_data_block(this); - + return new msg_remote_log_data_block(this); + case msg_remote_log_block_status.MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS: - return new msg_remote_log_block_status(this); - + return new msg_remote_log_block_status(this); + case msg_led_control.MAVLINK_MSG_ID_LED_CONTROL: - return new msg_led_control(this); - + return new msg_led_control(this); + case msg_mag_cal_progress.MAVLINK_MSG_ID_MAG_CAL_PROGRESS: - return new msg_mag_cal_progress(this); - + return new msg_mag_cal_progress(this); + case msg_mag_cal_report.MAVLINK_MSG_ID_MAG_CAL_REPORT: - return new msg_mag_cal_report(this); - + return new msg_mag_cal_report(this); + case msg_ekf_status_report.MAVLINK_MSG_ID_EKF_STATUS_REPORT: - return new msg_ekf_status_report(this); - + return new msg_ekf_status_report(this); + case msg_pid_tuning.MAVLINK_MSG_ID_PID_TUNING: - return new msg_pid_tuning(this); - + return new msg_pid_tuning(this); + + case msg_deepstall.MAVLINK_MSG_ID_DEEPSTALL: + return new msg_deepstall(this); + case msg_gimbal_report.MAVLINK_MSG_ID_GIMBAL_REPORT: - return new msg_gimbal_report(this); - + return new msg_gimbal_report(this); + case msg_gimbal_control.MAVLINK_MSG_ID_GIMBAL_CONTROL: - return new msg_gimbal_control(this); - + return new msg_gimbal_control(this); + case msg_gimbal_torque_cmd_report.MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT: - return new msg_gimbal_torque_cmd_report(this); - + return new msg_gimbal_torque_cmd_report(this); + case msg_gopro_heartbeat.MAVLINK_MSG_ID_GOPRO_HEARTBEAT: - return new msg_gopro_heartbeat(this); - + return new msg_gopro_heartbeat(this); + case msg_gopro_get_request.MAVLINK_MSG_ID_GOPRO_GET_REQUEST: - return new msg_gopro_get_request(this); - + return new msg_gopro_get_request(this); + case msg_gopro_get_response.MAVLINK_MSG_ID_GOPRO_GET_RESPONSE: - return new msg_gopro_get_response(this); - + return new msg_gopro_get_response(this); + case msg_gopro_set_request.MAVLINK_MSG_ID_GOPRO_SET_REQUEST: - return new msg_gopro_set_request(this); - + return new msg_gopro_set_request(this); + case msg_gopro_set_response.MAVLINK_MSG_ID_GOPRO_SET_RESPONSE: - return new msg_gopro_set_response(this); - + return new msg_gopro_set_response(this); + + case msg_efi_status.MAVLINK_MSG_ID_EFI_STATUS: + return new msg_efi_status(this); + case msg_rpm.MAVLINK_MSG_ID_RPM: - return new msg_rpm(this); - + return new msg_rpm(this); + case msg_device_op_read.MAVLINK_MSG_ID_DEVICE_OP_READ: - return new msg_device_op_read(this); - + return new msg_device_op_read(this); + case msg_device_op_read_reply.MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY: - return new msg_device_op_read_reply(this); - + return new msg_device_op_read_reply(this); + case msg_device_op_write.MAVLINK_MSG_ID_DEVICE_OP_WRITE: - return new msg_device_op_write(this); - + return new msg_device_op_write(this); + case msg_device_op_write_reply.MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY: - return new msg_device_op_write_reply(this); - + return new msg_device_op_write_reply(this); + case msg_adap_tuning.MAVLINK_MSG_ID_ADAP_TUNING: - return new msg_adap_tuning(this); - + return new msg_adap_tuning(this); + case msg_vision_position_delta.MAVLINK_MSG_ID_VISION_POSITION_DELTA: - return new msg_vision_position_delta(this); - - + return new msg_vision_position_delta(this); + + case msg_aoa_ssa.MAVLINK_MSG_ID_AOA_SSA: + return new msg_aoa_ssa(this); + + case msg_esc_telemetry_1_to_4.MAVLINK_MSG_ID_ESC_TELEMETRY_1_TO_4: + return new msg_esc_telemetry_1_to_4(this); + + case msg_esc_telemetry_5_to_8.MAVLINK_MSG_ID_ESC_TELEMETRY_5_TO_8: + return new msg_esc_telemetry_5_to_8(this); + + case msg_esc_telemetry_9_to_12.MAVLINK_MSG_ID_ESC_TELEMETRY_9_TO_12: + return new msg_esc_telemetry_9_to_12(this); + + case msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT: - return new msg_heartbeat(this); - + return new msg_heartbeat(this); + case msg_sys_status.MAVLINK_MSG_ID_SYS_STATUS: - return new msg_sys_status(this); - + return new msg_sys_status(this); + case msg_system_time.MAVLINK_MSG_ID_SYSTEM_TIME: - return new msg_system_time(this); - + return new msg_system_time(this); + case msg_ping.MAVLINK_MSG_ID_PING: - return new msg_ping(this); - + return new msg_ping(this); + case msg_change_operator_control.MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL: - return new msg_change_operator_control(this); - + 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); - + return new msg_change_operator_control_ack(this); + case msg_auth_key.MAVLINK_MSG_ID_AUTH_KEY: - return new msg_auth_key(this); - + 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); - + return new msg_set_mode(this); + case msg_param_request_read.MAVLINK_MSG_ID_PARAM_REQUEST_READ: - return new msg_param_request_read(this); - + 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); - + return new msg_param_request_list(this); + case msg_param_value.MAVLINK_MSG_ID_PARAM_VALUE: - return new msg_param_value(this); - + return new msg_param_value(this); + case msg_param_set.MAVLINK_MSG_ID_PARAM_SET: - return new msg_param_set(this); - + return new msg_param_set(this); + case msg_gps_raw_int.MAVLINK_MSG_ID_GPS_RAW_INT: - return new msg_gps_raw_int(this); - + return new msg_gps_raw_int(this); + case msg_gps_status.MAVLINK_MSG_ID_GPS_STATUS: - return new msg_gps_status(this); - + return new msg_gps_status(this); + case msg_scaled_imu.MAVLINK_MSG_ID_SCALED_IMU: - return new msg_scaled_imu(this); - + return new msg_scaled_imu(this); + case msg_raw_imu.MAVLINK_MSG_ID_RAW_IMU: - return new msg_raw_imu(this); - + return new msg_raw_imu(this); + case msg_raw_pressure.MAVLINK_MSG_ID_RAW_PRESSURE: - return new msg_raw_pressure(this); - + return new msg_raw_pressure(this); + case msg_scaled_pressure.MAVLINK_MSG_ID_SCALED_PRESSURE: - return new msg_scaled_pressure(this); - + return new msg_scaled_pressure(this); + case msg_attitude.MAVLINK_MSG_ID_ATTITUDE: - return new msg_attitude(this); - + return new msg_attitude(this); + case msg_attitude_quaternion.MAVLINK_MSG_ID_ATTITUDE_QUATERNION: - return new msg_attitude_quaternion(this); - + return new msg_attitude_quaternion(this); + case msg_local_position_ned.MAVLINK_MSG_ID_LOCAL_POSITION_NED: - return new msg_local_position_ned(this); - + 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); - + 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); - + 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); - + return new msg_rc_channels_raw(this); + case msg_servo_output_raw.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW: - return new msg_servo_output_raw(this); - + 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); - + 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); - + return new msg_mission_write_partial_list(this); + case msg_mission_item.MAVLINK_MSG_ID_MISSION_ITEM: - return new msg_mission_item(this); - + return new msg_mission_item(this); + case msg_mission_request.MAVLINK_MSG_ID_MISSION_REQUEST: - return new msg_mission_request(this); - + return new msg_mission_request(this); + case msg_mission_set_current.MAVLINK_MSG_ID_MISSION_SET_CURRENT: - return new msg_mission_set_current(this); - + return new msg_mission_set_current(this); + case msg_mission_current.MAVLINK_MSG_ID_MISSION_CURRENT: - return new msg_mission_current(this); - + return new msg_mission_current(this); + case msg_mission_request_list.MAVLINK_MSG_ID_MISSION_REQUEST_LIST: - return new msg_mission_request_list(this); - + return new msg_mission_request_list(this); + case msg_mission_count.MAVLINK_MSG_ID_MISSION_COUNT: - return new msg_mission_count(this); - + return new msg_mission_count(this); + case msg_mission_clear_all.MAVLINK_MSG_ID_MISSION_CLEAR_ALL: - return new msg_mission_clear_all(this); - + return new msg_mission_clear_all(this); + case msg_mission_item_reached.MAVLINK_MSG_ID_MISSION_ITEM_REACHED: - return new msg_mission_item_reached(this); - + return new msg_mission_item_reached(this); + case msg_mission_ack.MAVLINK_MSG_ID_MISSION_ACK: - return new msg_mission_ack(this); - + 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); - + 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); - + 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); - + 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); - + return new msg_mission_request_int(this); + + case msg_mission_changed.MAVLINK_MSG_ID_MISSION_CHANGED: + return new msg_mission_changed(this); + case msg_safety_set_allowed_area.MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA: - return new msg_safety_set_allowed_area(this); - + 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); - + 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); - + 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); - + 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); - + 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); - + return new msg_local_position_ned_cov(this); + case msg_rc_channels.MAVLINK_MSG_ID_RC_CHANNELS: - return new msg_rc_channels(this); - + return new msg_rc_channels(this); + case msg_request_data_stream.MAVLINK_MSG_ID_REQUEST_DATA_STREAM: - return new msg_request_data_stream(this); - + return new msg_request_data_stream(this); + case msg_data_stream.MAVLINK_MSG_ID_DATA_STREAM: - return new msg_data_stream(this); - + return new msg_data_stream(this); + case msg_manual_control.MAVLINK_MSG_ID_MANUAL_CONTROL: - return new msg_manual_control(this); - + return new msg_manual_control(this); + case msg_rc_channels_override.MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE: - return new msg_rc_channels_override(this); - + 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); - + return new msg_mission_item_int(this); + case msg_vfr_hud.MAVLINK_MSG_ID_VFR_HUD: - return new msg_vfr_hud(this); - + return new msg_vfr_hud(this); + case msg_command_int.MAVLINK_MSG_ID_COMMAND_INT: - return new msg_command_int(this); - + return new msg_command_int(this); + case msg_command_long.MAVLINK_MSG_ID_COMMAND_LONG: - return new msg_command_long(this); - + return new msg_command_long(this); + case msg_command_ack.MAVLINK_MSG_ID_COMMAND_ACK: - return new msg_command_ack(this); - + return new msg_command_ack(this); + case msg_manual_setpoint.MAVLINK_MSG_ID_MANUAL_SETPOINT: - return new msg_manual_setpoint(this); - + return new msg_manual_setpoint(this); + case msg_set_attitude_target.MAVLINK_MSG_ID_SET_ATTITUDE_TARGET: - return new msg_set_attitude_target(this); - + return new msg_set_attitude_target(this); + case msg_attitude_target.MAVLINK_MSG_ID_ATTITUDE_TARGET: - return new msg_attitude_target(this); - + 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); - + 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); - + 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); - + 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); - + 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); - + 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); - + return new msg_hil_state(this); + case msg_hil_controls.MAVLINK_MSG_ID_HIL_CONTROLS: - return new msg_hil_controls(this); - + 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); - + 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); - + return new msg_hil_actuator_controls(this); + case msg_optical_flow.MAVLINK_MSG_ID_OPTICAL_FLOW: - return new msg_optical_flow(this); - + 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); - + 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); - + 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); - + 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); - + return new msg_vicon_position_estimate(this); + case msg_highres_imu.MAVLINK_MSG_ID_HIGHRES_IMU: - return new msg_highres_imu(this); - + return new msg_highres_imu(this); + case msg_optical_flow_rad.MAVLINK_MSG_ID_OPTICAL_FLOW_RAD: - return new msg_optical_flow_rad(this); - + return new msg_optical_flow_rad(this); + case msg_hil_sensor.MAVLINK_MSG_ID_HIL_SENSOR: - return new msg_hil_sensor(this); - + return new msg_hil_sensor(this); + case msg_sim_state.MAVLINK_MSG_ID_SIM_STATE: - return new msg_sim_state(this); - + return new msg_sim_state(this); + case msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS: - return new msg_radio_status(this); - + return new msg_radio_status(this); + case msg_file_transfer_protocol.MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL: - return new msg_file_transfer_protocol(this); - + return new msg_file_transfer_protocol(this); + case msg_timesync.MAVLINK_MSG_ID_TIMESYNC: - return new msg_timesync(this); - + return new msg_timesync(this); + case msg_camera_trigger.MAVLINK_MSG_ID_CAMERA_TRIGGER: - return new msg_camera_trigger(this); - + return new msg_camera_trigger(this); + case msg_hil_gps.MAVLINK_MSG_ID_HIL_GPS: - return new msg_hil_gps(this); - + return new msg_hil_gps(this); + case msg_hil_optical_flow.MAVLINK_MSG_ID_HIL_OPTICAL_FLOW: - return new msg_hil_optical_flow(this); - + 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); - + return new msg_hil_state_quaternion(this); + case msg_scaled_imu2.MAVLINK_MSG_ID_SCALED_IMU2: - return new msg_scaled_imu2(this); - + return new msg_scaled_imu2(this); + case msg_log_request_list.MAVLINK_MSG_ID_LOG_REQUEST_LIST: - return new msg_log_request_list(this); - + return new msg_log_request_list(this); + case msg_log_entry.MAVLINK_MSG_ID_LOG_ENTRY: - return new msg_log_entry(this); - + return new msg_log_entry(this); + case msg_log_request_data.MAVLINK_MSG_ID_LOG_REQUEST_DATA: - return new msg_log_request_data(this); - + return new msg_log_request_data(this); + case msg_log_data.MAVLINK_MSG_ID_LOG_DATA: - return new msg_log_data(this); - + return new msg_log_data(this); + case msg_log_erase.MAVLINK_MSG_ID_LOG_ERASE: - return new msg_log_erase(this); - + return new msg_log_erase(this); + case msg_log_request_end.MAVLINK_MSG_ID_LOG_REQUEST_END: - return new msg_log_request_end(this); - + 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); - + return new msg_gps_inject_data(this); + case msg_gps2_raw.MAVLINK_MSG_ID_GPS2_RAW: - return new msg_gps2_raw(this); - + return new msg_gps2_raw(this); + case msg_power_status.MAVLINK_MSG_ID_POWER_STATUS: - return new msg_power_status(this); - + return new msg_power_status(this); + case msg_serial_control.MAVLINK_MSG_ID_SERIAL_CONTROL: - return new msg_serial_control(this); - + return new msg_serial_control(this); + case msg_gps_rtk.MAVLINK_MSG_ID_GPS_RTK: - return new msg_gps_rtk(this); - + return new msg_gps_rtk(this); + case msg_gps2_rtk.MAVLINK_MSG_ID_GPS2_RTK: - return new msg_gps2_rtk(this); - + return new msg_gps2_rtk(this); + case msg_scaled_imu3.MAVLINK_MSG_ID_SCALED_IMU3: - return new msg_scaled_imu3(this); - + return new msg_scaled_imu3(this); + case msg_data_transmission_handshake.MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE: - return new msg_data_transmission_handshake(this); - + return new msg_data_transmission_handshake(this); + case msg_encapsulated_data.MAVLINK_MSG_ID_ENCAPSULATED_DATA: - return new msg_encapsulated_data(this); - + return new msg_encapsulated_data(this); + case msg_distance_sensor.MAVLINK_MSG_ID_DISTANCE_SENSOR: - return new msg_distance_sensor(this); - + return new msg_distance_sensor(this); + case msg_terrain_request.MAVLINK_MSG_ID_TERRAIN_REQUEST: - return new msg_terrain_request(this); - + return new msg_terrain_request(this); + case msg_terrain_data.MAVLINK_MSG_ID_TERRAIN_DATA: - return new msg_terrain_data(this); - + return new msg_terrain_data(this); + case msg_terrain_check.MAVLINK_MSG_ID_TERRAIN_CHECK: - return new msg_terrain_check(this); - + return new msg_terrain_check(this); + case msg_terrain_report.MAVLINK_MSG_ID_TERRAIN_REPORT: - return new msg_terrain_report(this); - + return new msg_terrain_report(this); + case msg_scaled_pressure2.MAVLINK_MSG_ID_SCALED_PRESSURE2: - return new msg_scaled_pressure2(this); - + return new msg_scaled_pressure2(this); + case msg_att_pos_mocap.MAVLINK_MSG_ID_ATT_POS_MOCAP: - return new msg_att_pos_mocap(this); - + 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); - + 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); - + return new msg_actuator_control_target(this); + case msg_altitude.MAVLINK_MSG_ID_ALTITUDE: - return new msg_altitude(this); - + return new msg_altitude(this); + case msg_resource_request.MAVLINK_MSG_ID_RESOURCE_REQUEST: - return new msg_resource_request(this); - + return new msg_resource_request(this); + case msg_scaled_pressure3.MAVLINK_MSG_ID_SCALED_PRESSURE3: - return new msg_scaled_pressure3(this); - + return new msg_scaled_pressure3(this); + case msg_follow_target.MAVLINK_MSG_ID_FOLLOW_TARGET: - return new msg_follow_target(this); - + return new msg_follow_target(this); + case msg_control_system_state.MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE: - return new msg_control_system_state(this); - + return new msg_control_system_state(this); + case msg_battery_status.MAVLINK_MSG_ID_BATTERY_STATUS: - return new msg_battery_status(this); - + return new msg_battery_status(this); + case msg_autopilot_version.MAVLINK_MSG_ID_AUTOPILOT_VERSION: - return new msg_autopilot_version(this); - + return new msg_autopilot_version(this); + case msg_landing_target.MAVLINK_MSG_ID_LANDING_TARGET: - return new msg_landing_target(this); - + return new msg_landing_target(this); + + case msg_fence_status.MAVLINK_MSG_ID_FENCE_STATUS: + return new msg_fence_status(this); + case msg_estimator_status.MAVLINK_MSG_ID_ESTIMATOR_STATUS: - return new msg_estimator_status(this); - + return new msg_estimator_status(this); + case msg_wind_cov.MAVLINK_MSG_ID_WIND_COV: - return new msg_wind_cov(this); - + return new msg_wind_cov(this); + case msg_gps_input.MAVLINK_MSG_ID_GPS_INPUT: - return new msg_gps_input(this); - + return new msg_gps_input(this); + case msg_gps_rtcm_data.MAVLINK_MSG_ID_GPS_RTCM_DATA: - return new msg_gps_rtcm_data(this); - + return new msg_gps_rtcm_data(this); + case msg_high_latency.MAVLINK_MSG_ID_HIGH_LATENCY: - return new msg_high_latency(this); - + 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); - + return new msg_vibration(this); + case msg_home_position.MAVLINK_MSG_ID_HOME_POSITION: - return new msg_home_position(this); - + return new msg_home_position(this); + case msg_set_home_position.MAVLINK_MSG_ID_SET_HOME_POSITION: - return new msg_set_home_position(this); - + return new msg_set_home_position(this); + case msg_message_interval.MAVLINK_MSG_ID_MESSAGE_INTERVAL: - return new msg_message_interval(this); - + return new msg_message_interval(this); + case msg_extended_sys_state.MAVLINK_MSG_ID_EXTENDED_SYS_STATE: - return new msg_extended_sys_state(this); - + return new msg_extended_sys_state(this); + case msg_adsb_vehicle.MAVLINK_MSG_ID_ADSB_VEHICLE: - return new msg_adsb_vehicle(this); - + return new msg_adsb_vehicle(this); + case msg_collision.MAVLINK_MSG_ID_COLLISION: - return new msg_collision(this); - + return new msg_collision(this); + case msg_v2_extension.MAVLINK_MSG_ID_V2_EXTENSION: - return new msg_v2_extension(this); - + return new msg_v2_extension(this); + case msg_memory_vect.MAVLINK_MSG_ID_MEMORY_VECT: - return new msg_memory_vect(this); - + return new msg_memory_vect(this); + case msg_debug_vect.MAVLINK_MSG_ID_DEBUG_VECT: - return new msg_debug_vect(this); - + return new msg_debug_vect(this); + case msg_named_value_float.MAVLINK_MSG_ID_NAMED_VALUE_FLOAT: - return new msg_named_value_float(this); - + 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); - + return new msg_named_value_int(this); + case msg_statustext.MAVLINK_MSG_ID_STATUSTEXT: - return new msg_statustext(this); - + return new msg_statustext(this); + case msg_debug.MAVLINK_MSG_ID_DEBUG: - return new msg_debug(this); - + return new msg_debug(this); + case msg_setup_signing.MAVLINK_MSG_ID_SETUP_SIGNING: - return new msg_setup_signing(this); - + return new msg_setup_signing(this); + case msg_button_change.MAVLINK_MSG_ID_BUTTON_CHANGE: - return new msg_button_change(this); - + return new msg_button_change(this); + case msg_play_tune.MAVLINK_MSG_ID_PLAY_TUNE: - return new msg_play_tune(this); - + return new msg_play_tune(this); + case msg_camera_information.MAVLINK_MSG_ID_CAMERA_INFORMATION: - return new msg_camera_information(this); - + return new msg_camera_information(this); + case msg_camera_settings.MAVLINK_MSG_ID_CAMERA_SETTINGS: - return new msg_camera_settings(this); - + return new msg_camera_settings(this); + case msg_storage_information.MAVLINK_MSG_ID_STORAGE_INFORMATION: - return new msg_storage_information(this); - + return new msg_storage_information(this); + case msg_camera_capture_status.MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS: - return new msg_camera_capture_status(this); - + 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); - + return new msg_camera_image_captured(this); + case msg_flight_information.MAVLINK_MSG_ID_FLIGHT_INFORMATION: - return new msg_flight_information(this); - + return new msg_flight_information(this); + case msg_mount_orientation.MAVLINK_MSG_ID_MOUNT_ORIENTATION: - return new msg_mount_orientation(this); - + return new msg_mount_orientation(this); + case msg_logging_data.MAVLINK_MSG_ID_LOGGING_DATA: - return new msg_logging_data(this); - + return new msg_logging_data(this); + case msg_logging_data_acked.MAVLINK_MSG_ID_LOGGING_DATA_ACKED: - return new msg_logging_data_acked(this); - + return new msg_logging_data_acked(this); + case msg_logging_ack.MAVLINK_MSG_ID_LOGGING_ACK: - return new msg_logging_ack(this); - + 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_set_video_stream_settings.MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS: - return new msg_set_video_stream_settings(this); - + 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_wifi_config_ap.MAVLINK_MSG_ID_WIFI_CONFIG_AP: - return new msg_wifi_config_ap(this); - + return new msg_wifi_config_ap(this); + case msg_protocol_version.MAVLINK_MSG_ID_PROTOCOL_VERSION: - return new msg_protocol_version(this); - + 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); - + 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); - + 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); - + 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); - + 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); - + 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); - + 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); - - + 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_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_smart_battery_status.MAVLINK_MSG_ID_SMART_BATTERY_STATUS: + return new msg_smart_battery_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_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_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_wheel_distance.MAVLINK_MSG_ID_WHEEL_DISTANCE: + return new msg_wheel_distance(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_uavionix_adsb_out_cfg.MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG: - return new msg_uavionix_adsb_out_cfg(this); - + return new msg_uavionix_adsb_out_cfg(this); + case msg_uavionix_adsb_out_dynamic.MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_DYNAMIC: - return new msg_uavionix_adsb_out_dynamic(this); - + return new msg_uavionix_adsb_out_dynamic(this); + case msg_uavionix_adsb_transceiver_health_report.MAVLINK_MSG_ID_UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT: - return new msg_uavionix_adsb_transceiver_health_report(this); - - + return new msg_uavionix_adsb_transceiver_health_report(this); + + + case msg_icarous_heartbeat.MAVLINK_MSG_ID_ICAROUS_HEARTBEAT: + return new msg_icarous_heartbeat(this); + + case msg_icarous_kinematic_bands.MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS: + return new msg_icarous_kinematic_bands(this); + + default: return null; } diff --git a/app/src/main/java/com/MAVLink/Messages/MAVLinkMessage.java b/app/src/main/java/com/MAVLink/Messages/MAVLinkMessage.java index d71eef1..768befd 100644 --- a/app/src/main/java/com/MAVLink/Messages/MAVLinkMessage.java +++ b/app/src/main/java/com/MAVLink/Messages/MAVLinkMessage.java @@ -6,24 +6,22 @@ package com.MAVLink.Messages; -import com.MAVLink.MAVLinkPacket; - import java.io.Serializable; +import com.MAVLink.MAVLinkPacket; + public abstract class MAVLinkMessage implements Serializable { private static final long serialVersionUID = -7754622750478538539L; // The MAVLink message classes have been changed to implement Serializable, // this way is possible to pass a mavlink message trought the Service-Acctivity interface - + /** - * Simply a common interface for all MAVLink Messages + * Simply a common interface for all MAVLink Messages */ - + public int sysid; public int compid; public int msgid; - public abstract MAVLinkPacket pack(); - public abstract void unpack(MAVLinkPayload payload); } diff --git a/app/src/main/java/com/MAVLink/Messages/MAVLinkPayload.java b/app/src/main/java/com/MAVLink/Messages/MAVLinkPayload.java index 426453f..a6743ea 100644 --- a/app/src/main/java/com/MAVLink/Messages/MAVLinkPayload.java +++ b/app/src/main/java/com/MAVLink/Messages/MAVLinkPayload.java @@ -10,19 +10,24 @@ public class MAVLinkPayload { - public static final int MAX_PAYLOAD_SIZE = 255; 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(int payloadSize) { - if (payloadSize > MAX_PAYLOAD_SIZE) { + if(payloadSize > MAX_PAYLOAD_SIZE) { payload = ByteBuffer.allocate(MAX_PAYLOAD_SIZE); } else { payload = ByteBuffer.allocate(payloadSize); @@ -51,12 +56,16 @@ public byte getByte() { index += 1; return result; } - - public short getUnsignedByte() { +// TERJE BUGG.... + public short getUnsignedByte(){ short result = 0; - result |= payload.get(index + 0) & 0xFF; - index += 1; - return result; + if( payload.array().length > index) { + result |= payload.get(index + 0) & 0xFF; + index += 1; + }else{ + // ERROR:::: + } + return result; } public short getShort() { @@ -67,7 +76,7 @@ public short getShort() { return result; } - public int getUnsignedShort() { + public int getUnsignedShort(){ int result = 0; result |= (payload.get(index + 1) & 0xFF) << 8; result |= (payload.get(index + 0) & 0xFF); @@ -85,7 +94,7 @@ public int getInt() { return result; } - public long getUnsignedInt() { + public long getUnsignedInt(){ long result = 0; result |= (payload.get(index + 3) & 0xFFL) << 24; result |= (payload.get(index + 2) & 0xFFL) << 16; @@ -109,10 +118,10 @@ public long getLong() { return result; } - public long getUnsignedLong() { + public long getUnsignedLong(){ return getLong(); } - + public long getLongReverse() { long result = 0; result |= (payload.get(index + 0) & 0xFFL) << 56; @@ -131,12 +140,14 @@ 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) { + 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); } @@ -148,8 +159,8 @@ public void putShort(short data) { add((byte) (data >> 8)); } - public void putUnsignedShort(int data) { - if (data < UNSIGNED_SHORT_MIN_VALUE || data > UNSIGNED_SHORT_MAX_VALUE) { + 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); } @@ -163,8 +174,8 @@ public void putInt(int data) { add((byte) (data >> 24)); } - public void putUnsignedInt(long data) { - if (data < UNSIGNED_INT_MIN_VALUE || data > UNSIGNED_INT_MAX_VALUE) { + 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); } @@ -182,8 +193,8 @@ public void putLong(long data) { add((byte) (data >> 56)); } - public void putUnsignedLong(long data) { - if (data < UNSIGNED_LONG_MIN_VALUE) { + 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); } @@ -194,4 +205,6 @@ public void putFloat(float data) { putInt(Float.floatToIntBits(data)); } + public void putDouble(double data) { putLong(Double.doubleToLongBits(data)); } + } diff --git a/app/src/main/java/com/MAVLink/Messages/MAVLinkStats.java b/app/src/main/java/com/MAVLink/Messages/MAVLinkStats.java index b84aa62..7f9c76f 100644 --- a/app/src/main/java/com/MAVLink/Messages/MAVLinkStats.java +++ b/app/src/main/java/com/MAVLink/Messages/MAVLinkStats.java @@ -11,8 +11,9 @@ /** * Storage for MAVLink Packet and Error statistics + * */ -public class MAVLinkStats /* implements Serializable */ { +public class MAVLinkStats /* implements Serializable */{ public int receivedPacketCount; // total recieved packet count for all sources @@ -37,8 +38,9 @@ public MAVLinkStats(boolean ignoreRadioPackets) { /** * Check the new received packet to see if has lost someone between this and * the last packet - * - * @param packet Packet that should be checked + * + * @param packet + * Packet that should be checked */ public void newPacket(MAVLinkPacket packet) { if (ignoreRadioPackets && packet.msgid == msg_radio_status.MAVLINK_MSG_ID_RADIO_STATUS) { @@ -142,7 +144,7 @@ private void advanceLastPacketSequence(int lastSeq) { } private boolean hasLostPackets(MAVLinkPacket packet) { - return lastPacketSeq >= 0 && packet.seq != lastPacketSeq; + return lastPacketSeq >= 0 && packet.seq != lastPacketSeq; } } diff --git a/app/src/main/java/com/MAVLink/Parser.java b/app/src/main/java/com/MAVLink/Parser.java index d79e3bb..0b295b5 100644 --- a/app/src/main/java/com/MAVLink/Parser.java +++ b/app/src/main/java/com/MAVLink/Parser.java @@ -6,13 +6,23 @@ package com.MAVLink; +import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkStats; public class Parser { - public MAVLinkStats stats; + /** + * 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_SEQ, MAVLINK_PARSE_STATE_GOT_SYSID, MAVLINK_PARSE_STATE_GOT_COMPID, MAVLINK_PARSE_STATE_GOT_MSGID, MAVLINK_PARSE_STATE_GOT_CRC1, MAVLINK_PARSE_STATE_GOT_PAYLOAD + } + MAV_states state = MAV_states.MAVLINK_PARSE_STATE_UNINIT; + + public MAVLinkStats stats; private MAVLinkPacket m; + public Parser() { this(false); } @@ -26,96 +36,90 @@ public Parser(boolean ignoreRadioPacketStats) { * 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 + * + * @param c + * The char to parse */ public MAVLinkPacket mavlink_parse_char(int c) { switch (state) { - case MAVLINK_PARSE_STATE_UNINIT: - case MAVLINK_PARSE_STATE_IDLE: - + case MAVLINK_PARSE_STATE_UNINIT: + case MAVLINK_PARSE_STATE_IDLE: + + if (c == MAVLinkPacket.MAVLINK_STX) { + state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX; + } + break; + + case MAVLINK_PARSE_STATE_GOT_STX: + m = new MAVLinkPacket(c); + state = MAV_states.MAVLINK_PARSE_STATE_GOT_LENGTH; + break; + + case MAVLINK_PARSE_STATE_GOT_LENGTH: + m.seq = c; + state = MAV_states.MAVLINK_PARSE_STATE_GOT_SEQ; + break; + + case MAVLINK_PARSE_STATE_GOT_SEQ: + m.sysid = c; + state = MAV_states.MAVLINK_PARSE_STATE_GOT_SYSID; + break; + + case MAVLINK_PARSE_STATE_GOT_SYSID: + m.compid = c; + state = MAV_states.MAVLINK_PARSE_STATE_GOT_COMPID; + break; + + case MAVLINK_PARSE_STATE_GOT_COMPID: + m.msgid = c; + if (m.len == 0) { + state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD; + } else { + state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID; + } + break; + + case MAVLINK_PARSE_STATE_GOT_MSGID: + m.payload.add((byte) c); + if (m.payloadIsFilled()) { + state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD; + } + break; + + case MAVLINK_PARSE_STATE_GOT_PAYLOAD: + m.generateCRC(); + // Check first checksum byte + if (c != m.crc.getLSB()) { + state = MAV_states.MAVLINK_PARSE_STATE_IDLE; if (c == MAVLinkPacket.MAVLINK_STX) { state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX; + m.crc.start_checksum(); } - break; - - case MAVLINK_PARSE_STATE_GOT_STX: - m = new MAVLinkPacket(c); - state = MAV_states.MAVLINK_PARSE_STATE_GOT_LENGTH; - break; - - case MAVLINK_PARSE_STATE_GOT_LENGTH: - m.seq = c; - state = MAV_states.MAVLINK_PARSE_STATE_GOT_SEQ; - break; - - case MAVLINK_PARSE_STATE_GOT_SEQ: - m.sysid = c; - state = MAV_states.MAVLINK_PARSE_STATE_GOT_SYSID; - break; - - case MAVLINK_PARSE_STATE_GOT_SYSID: - m.compid = c; - state = MAV_states.MAVLINK_PARSE_STATE_GOT_COMPID; - break; - - case MAVLINK_PARSE_STATE_GOT_COMPID: - m.msgid = c; - if (m.len == 0) { - state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD; - } else { - state = MAV_states.MAVLINK_PARSE_STATE_GOT_MSGID; - } - break; - - case MAVLINK_PARSE_STATE_GOT_MSGID: - m.payload.add((byte) c); - if (m.payloadIsFilled()) { - state = MAV_states.MAVLINK_PARSE_STATE_GOT_PAYLOAD; - } - break; - - case MAVLINK_PARSE_STATE_GOT_PAYLOAD: - m.generateCRC(); - // Check first checksum byte - if (c != m.crc.getLSB()) { - state = MAV_states.MAVLINK_PARSE_STATE_IDLE; - if (c == MAVLinkPacket.MAVLINK_STX) { - state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX; - m.crc.start_checksum(); - } - 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; - if (c == MAVLinkPacket.MAVLINK_STX) { - state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX; - m.crc.start_checksum(); - } - stats.crcError(); - } else { // Successfully received the message - stats.newPacket(m); - state = MAV_states.MAVLINK_PARSE_STATE_IDLE; - return m; + 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; + if (c == MAVLinkPacket.MAVLINK_STX) { + state = MAV_states.MAVLINK_PARSE_STATE_GOT_STX; + m.crc.start_checksum(); } + stats.crcError(); + } else { // Successfully received the message + stats.newPacket(m); + state = MAV_states.MAVLINK_PARSE_STATE_IDLE; + return m; + } - break; + break; } return null; } - - /** - * 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_SEQ, MAVLINK_PARSE_STATE_GOT_SYSID, MAVLINK_PARSE_STATE_GOT_COMPID, MAVLINK_PARSE_STATE_GOT_MSGID, MAVLINK_PARSE_STATE_GOT_CRC1, MAVLINK_PARSE_STATE_GOT_PAYLOAD - } } diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/CRC.java b/app/src/main/java/com/MAVLink/ardupilotmega/CRC.java index 4a1794b..061e7fb 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/CRC.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/CRC.java @@ -7,28 +7,26 @@ package com.MAVLink.ardupilotmega; /** - * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, - * updated with witch field of the message, and then finished with the message - * id. - */ +* X.25 CRC calculation for MAVlink messages. The checksum must be initialized, +* updated with witch field of the message, and then finished with the message +* id. +* +*/ public class CRC { - private static final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 159, 186, 72, 0, 0, 0, 0, 92, 36, 71, 98, 0, 0, 0, 0, 0, 134, 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 101, 50, 202, 17, 162, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 163, 105, 151, 35, 150, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0}; + private static final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 117, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 132, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 159, 186, 72, 0, 0, 0, 0, 92, 36, 71, 98, 120, 0, 0, 0, 0, 134, 205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 101, 50, 202, 17, 162, 0, 0, 0, 0, 0, 142, 207, 0, 0, 0, 163, 105, 151, 35, 150, 179, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0}; private static final int CRC_INIT_VALUE = 0xffff; private int crcValue; - public CRC() { - start_checksum(); - } - /** - * Accumulate the X.25 CRC by adding one char at a time. - *

- * The checksum function adds the hash of one char at a time to the 16 bit - * checksum (uint16_t). - * - * @param data new char to hash - **/ - public void update_checksum(int data) { + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + **/ + 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; @@ -36,18 +34,20 @@ public void update_checksum(int data) { } /** - * Finish the CRC calculation of a message, by running the CRC with the - * Magic Byte. This Magic byte has been defined in MAVlink v1.0. - * - * @param msgid The message id number - */ + * Finish the CRC calculation of a message, by running the CRC with the + * Magic Byte. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ public void finish_checksum(int msgid) { update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); } /** - * Initialize the buffer for the X.25 CRC - */ + * Initialize the buffer for the X.25 CRC + * + */ public void start_checksum() { crcValue = CRC_INIT_VALUE; } @@ -60,5 +60,9 @@ public int getLSB() { return (crcValue & 0xff); } + public CRC() { + start_checksum(); + } + } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_adap_tuning.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_adap_tuning.java index caa6e33..8924f51 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_adap_tuning.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_adap_tuning.java @@ -6,186 +6,187 @@ // MESSAGE ADAP_TUNING PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Adaptive Controller tuning information - */ -public class msg_adap_tuning extends MAVLinkMessage { +* Adaptive Controller tuning information. +*/ +public class msg_adap_tuning extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_ADAP_TUNING = 11010; public static final int MAVLINK_MSG_LENGTH = 49; private static final long serialVersionUID = MAVLINK_MSG_ID_ADAP_TUNING; + /** - * desired rate (degrees/s) - */ + * Desired rate. + */ public float desired; - + /** - * achieved rate (degrees/s) - */ + * Achieved rate. + */ public float achieved; - + /** - * error between model and vehicle - */ + * Error between model and vehicle. + */ public float error; - + /** - * theta estimated state predictor - */ + * Theta estimated state predictor. + */ public float theta; - + /** - * omega estimated state predictor - */ + * Omega estimated state predictor. + */ public float omega; - + /** - * sigma estimated state predictor - */ + * Sigma estimated state predictor. + */ public float sigma; - + /** - * theta derivative - */ + * Theta derivative. + */ public float theta_dot; - + /** - * omega derivative - */ + * Omega derivative. + */ public float omega_dot; - + /** - * sigma derivative - */ + * Sigma derivative. + */ public float sigma_dot; - + /** - * projection operator value - */ + * Projection operator value. + */ public float f; - + /** - * projection operator derivative - */ + * Projection operator derivative. + */ public float f_dot; - + /** - * u adaptive controlled output command - */ + * u adaptive controlled output command. + */ public float u; - + /** - * axis - */ + * Axis. + */ public short axis; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_adap_tuning() { - msgid = MAVLINK_MSG_ID_ADAP_TUNING; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_adap_tuning(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ADAP_TUNING; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_ADAP_TUNING; - + packet.payload.putFloat(desired); - + packet.payload.putFloat(achieved); - + packet.payload.putFloat(error); - + packet.payload.putFloat(theta); - + packet.payload.putFloat(omega); - + packet.payload.putFloat(sigma); - + packet.payload.putFloat(theta_dot); - + packet.payload.putFloat(omega_dot); - + packet.payload.putFloat(sigma_dot); - + packet.payload.putFloat(f); - + packet.payload.putFloat(f_dot); - + packet.payload.putFloat(u); - + packet.payload.putUnsignedByte(axis); - + return packet; } /** - * Decode a adap_tuning message into this class fields - * - * @param payload The message to decode - */ + * Decode a adap_tuning message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.desired = payload.getFloat(); - + this.achieved = payload.getFloat(); - + this.error = payload.getFloat(); - + this.theta = payload.getFloat(); - + this.omega = payload.getFloat(); - + this.sigma = payload.getFloat(); - + this.theta_dot = payload.getFloat(); - + this.omega_dot = payload.getFloat(); - + this.sigma_dot = payload.getFloat(); - + this.f = payload.getFloat(); - + this.f_dot = payload.getFloat(); - + this.u = payload.getFloat(); - + this.axis = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_adap_tuning(){ + msgid = MAVLINK_MSG_ID_ADAP_TUNING; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_adap_tuning(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ADAP_TUNING; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_ADAP_TUNING - sysid:" + sysid + " compid:" + compid + " desired:" + desired + " achieved:" + achieved + " error:" + error + " theta:" + theta + " omega:" + omega + " sigma:" + sigma + " theta_dot:" + theta_dot + " omega_dot:" + omega_dot + " sigma_dot:" + sigma_dot + " f:" + f + " f_dot:" + f_dot + " u:" + u + " axis:" + axis + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ADAP_TUNING - sysid:"+sysid+" compid:"+compid+" desired:"+desired+" achieved:"+achieved+" error:"+error+" theta:"+theta+" omega:"+omega+" sigma:"+sigma+" theta_dot:"+theta_dot+" omega_dot:"+omega_dot+" sigma_dot:"+sigma_dot+" f:"+f+" f_dot:"+f_dot+" u:"+u+" axis:"+axis+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs.java index d453c41..4a3b360 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs.java @@ -6,132 +6,133 @@ // MESSAGE AHRS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of DCM attitude estimator - */ -public class msg_ahrs extends MAVLinkMessage { +* Status of DCM attitude estimator. +*/ +public class msg_ahrs extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AHRS = 163; public static final int MAVLINK_MSG_LENGTH = 28; private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS; + /** - * X gyro drift estimate rad/s - */ + * X gyro drift estimate. + */ public float omegaIx; - + /** - * Y gyro drift estimate rad/s - */ + * Y gyro drift estimate. + */ public float omegaIy; - + /** - * Z gyro drift estimate rad/s - */ + * Z gyro drift estimate. + */ public float omegaIz; - + /** - * average accel_weight - */ + * Average accel_weight. + */ public float accel_weight; - + /** - * average renormalisation value - */ + * Average renormalisation value. + */ public float renorm_val; - + /** - * average error_roll_pitch value - */ + * Average error_roll_pitch value. + */ public float error_rp; - + /** - * average error_yaw value - */ + * Average error_yaw value. + */ public float error_yaw; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ahrs() { - msgid = MAVLINK_MSG_ID_AHRS; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_ahrs(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AHRS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AHRS; - + packet.payload.putFloat(omegaIx); - + packet.payload.putFloat(omegaIy); - + packet.payload.putFloat(omegaIz); - + packet.payload.putFloat(accel_weight); - + packet.payload.putFloat(renorm_val); - + packet.payload.putFloat(error_rp); - + packet.payload.putFloat(error_yaw); - + return packet; } /** - * Decode a ahrs message into this class fields - * - * @param payload The message to decode - */ + * Decode a ahrs message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.omegaIx = payload.getFloat(); - + this.omegaIy = payload.getFloat(); - + this.omegaIz = payload.getFloat(); - + this.accel_weight = payload.getFloat(); - + this.renorm_val = payload.getFloat(); - + this.error_rp = payload.getFloat(); - + this.error_yaw = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ahrs(){ + msgid = MAVLINK_MSG_ID_AHRS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ahrs(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AHRS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AHRS - sysid:" + sysid + " compid:" + compid + " omegaIx:" + omegaIx + " omegaIy:" + omegaIy + " omegaIz:" + omegaIz + " accel_weight:" + accel_weight + " renorm_val:" + renorm_val + " error_rp:" + error_rp + " error_yaw:" + error_yaw + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AHRS - sysid:"+sysid+" compid:"+compid+" omegaIx:"+omegaIx+" omegaIy:"+omegaIy+" omegaIz:"+omegaIz+" accel_weight:"+accel_weight+" renorm_val:"+renorm_val+" error_rp:"+error_rp+" error_yaw:"+error_yaw+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs2.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs2.java index c8e4452..6c4722a 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs2.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs2.java @@ -6,123 +6,124 @@ // MESSAGE AHRS2 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of secondary AHRS filter if available - */ -public class msg_ahrs2 extends MAVLinkMessage { +* Status of secondary AHRS filter if available. +*/ +public class msg_ahrs2 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AHRS2 = 178; public static final int MAVLINK_MSG_LENGTH = 24; private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS2; + /** - * Roll angle (rad) - */ + * Roll angle. + */ public float roll; - + /** - * Pitch angle (rad) - */ + * Pitch angle. + */ public float pitch; - + /** - * Yaw angle (rad) - */ + * Yaw angle. + */ public float yaw; - + /** - * Altitude (MSL) - */ + * Altitude (MSL). + */ public float altitude; - + /** - * Latitude in degrees * 1E7 - */ + * Latitude. + */ public int lat; - + /** - * Longitude in degrees * 1E7 - */ + * Longitude. + */ public int lng; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ahrs2() { - msgid = MAVLINK_MSG_ID_AHRS2; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_ahrs2(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AHRS2; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AHRS2; - + packet.payload.putFloat(roll); - + packet.payload.putFloat(pitch); - + packet.payload.putFloat(yaw); - + packet.payload.putFloat(altitude); - + packet.payload.putInt(lat); - + packet.payload.putInt(lng); - + return packet; } /** - * Decode a ahrs2 message into this class fields - * - * @param payload The message to decode - */ + * Decode a ahrs2 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.roll = payload.getFloat(); - + this.pitch = payload.getFloat(); - + this.yaw = payload.getFloat(); - + this.altitude = payload.getFloat(); - + this.lat = payload.getInt(); - + this.lng = payload.getInt(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ahrs2(){ + msgid = MAVLINK_MSG_ID_AHRS2; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ahrs2(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AHRS2; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AHRS2 - sysid:" + sysid + " compid:" + compid + " roll:" + roll + " pitch:" + pitch + " yaw:" + yaw + " altitude:" + altitude + " lat:" + lat + " lng:" + lng + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AHRS2 - sysid:"+sysid+" compid:"+compid+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" altitude:"+altitude+" lat:"+lat+" lng:"+lng+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs3.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs3.java index 5db6fae..ed27265 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs3.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ahrs3.java @@ -6,159 +6,160 @@ // MESSAGE AHRS3 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of third AHRS filter if available. This is for ANU research group (Ali and Sean) - */ -public class msg_ahrs3 extends MAVLinkMessage { +* Status of third AHRS filter if available. This is for ANU research group (Ali and Sean). +*/ +public class msg_ahrs3 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AHRS3 = 182; public static final int MAVLINK_MSG_LENGTH = 40; private static final long serialVersionUID = MAVLINK_MSG_ID_AHRS3; + /** - * Roll angle (rad) - */ + * Roll angle. + */ public float roll; - + /** - * Pitch angle (rad) - */ + * Pitch angle. + */ public float pitch; - + /** - * Yaw angle (rad) - */ + * Yaw angle. + */ public float yaw; - + /** - * Altitude (MSL) - */ + * Altitude (MSL). + */ public float altitude; - + /** - * Latitude in degrees * 1E7 - */ + * Latitude. + */ public int lat; - + /** - * Longitude in degrees * 1E7 - */ + * Longitude. + */ public int lng; - + /** - * test variable1 - */ + * Test variable1. + */ public float v1; - + /** - * test variable2 - */ + * Test variable2. + */ public float v2; - + /** - * test variable3 - */ + * Test variable3. + */ public float v3; - + /** - * test variable4 - */ + * Test variable4. + */ public float v4; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ahrs3() { - msgid = MAVLINK_MSG_ID_AHRS3; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_ahrs3(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AHRS3; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AHRS3; - + packet.payload.putFloat(roll); - + packet.payload.putFloat(pitch); - + packet.payload.putFloat(yaw); - + packet.payload.putFloat(altitude); - + packet.payload.putInt(lat); - + packet.payload.putInt(lng); - + packet.payload.putFloat(v1); - + packet.payload.putFloat(v2); - + packet.payload.putFloat(v3); - + packet.payload.putFloat(v4); - + return packet; } /** - * Decode a ahrs3 message into this class fields - * - * @param payload The message to decode - */ + * Decode a ahrs3 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.roll = payload.getFloat(); - + this.pitch = payload.getFloat(); - + this.yaw = payload.getFloat(); - + this.altitude = payload.getFloat(); - + this.lat = payload.getInt(); - + this.lng = payload.getInt(); - + this.v1 = payload.getFloat(); - + this.v2 = payload.getFloat(); - + this.v3 = payload.getFloat(); - + this.v4 = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ahrs3(){ + msgid = MAVLINK_MSG_ID_AHRS3; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ahrs3(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AHRS3; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AHRS3 - sysid:" + sysid + " compid:" + compid + " roll:" + roll + " pitch:" + pitch + " yaw:" + yaw + " altitude:" + altitude + " lat:" + lat + " lng:" + lng + " v1:" + v1 + " v2:" + v2 + " v3:" + v3 + " v4:" + v4 + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AHRS3 - sysid:"+sysid+" compid:"+compid+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" altitude:"+altitude+" lat:"+lat+" lng:"+lng+" v1:"+v1+" v2:"+v2+" v3:"+v3+" v4:"+v4+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java index 194b31f..bc17374 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_airspeed_autocal.java @@ -6,177 +6,178 @@ // MESSAGE AIRSPEED_AUTOCAL PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Airspeed auto-calibration - */ -public class msg_airspeed_autocal extends MAVLinkMessage { +* Airspeed auto-calibration. +*/ +public class msg_airspeed_autocal extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AIRSPEED_AUTOCAL = 174; public static final int MAVLINK_MSG_LENGTH = 48; private static final long serialVersionUID = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + /** - * GPS velocity north m/s - */ + * GPS velocity north. + */ public float vx; - + /** - * GPS velocity east m/s - */ + * GPS velocity east. + */ public float vy; - + /** - * GPS velocity down m/s - */ + * GPS velocity down. + */ public float vz; - + /** - * Differential pressure pascals - */ + * Differential pressure. + */ public float diff_pressure; - + /** - * Estimated to true airspeed ratio - */ + * Estimated to true airspeed ratio. + */ public float EAS2TAS; - + /** - * Airspeed ratio - */ + * Airspeed ratio. + */ public float ratio; - + /** - * EKF state x - */ + * EKF state x. + */ public float state_x; - + /** - * EKF state y - */ + * EKF state y. + */ public float state_y; - + /** - * EKF state z - */ + * EKF state z. + */ public float state_z; - + /** - * EKF Pax - */ + * EKF Pax. + */ public float Pax; - + /** - * EKF Pby - */ + * EKF Pby. + */ public float Pby; - + /** - * EKF Pcz - */ + * EKF Pcz. + */ public float Pcz; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_airspeed_autocal() { - msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_airspeed_autocal(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; - + packet.payload.putFloat(vx); - + packet.payload.putFloat(vy); - + packet.payload.putFloat(vz); - + packet.payload.putFloat(diff_pressure); - + packet.payload.putFloat(EAS2TAS); - + packet.payload.putFloat(ratio); - + packet.payload.putFloat(state_x); - + packet.payload.putFloat(state_y); - + packet.payload.putFloat(state_z); - + packet.payload.putFloat(Pax); - + packet.payload.putFloat(Pby); - + packet.payload.putFloat(Pcz); - + return packet; } /** - * Decode a airspeed_autocal message into this class fields - * - * @param payload The message to decode - */ + * Decode a airspeed_autocal message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.vx = payload.getFloat(); - + this.vy = payload.getFloat(); - + this.vz = payload.getFloat(); - + this.diff_pressure = payload.getFloat(); - + this.EAS2TAS = payload.getFloat(); - + this.ratio = payload.getFloat(); - + this.state_x = payload.getFloat(); - + this.state_y = payload.getFloat(); - + this.state_z = payload.getFloat(); - + this.Pax = payload.getFloat(); - + this.Pby = payload.getFloat(); - + this.Pcz = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_airspeed_autocal(){ + msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_airspeed_autocal(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AIRSPEED_AUTOCAL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AIRSPEED_AUTOCAL - sysid:" + sysid + " compid:" + compid + " vx:" + vx + " vy:" + vy + " vz:" + vz + " diff_pressure:" + diff_pressure + " EAS2TAS:" + EAS2TAS + " ratio:" + ratio + " state_x:" + state_x + " state_y:" + state_y + " state_z:" + state_z + " Pax:" + Pax + " Pby:" + Pby + " Pcz:" + Pcz + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AIRSPEED_AUTOCAL - sysid:"+sysid+" compid:"+compid+" vx:"+vx+" vy:"+vy+" vz:"+vz+" diff_pressure:"+diff_pressure+" EAS2TAS:"+EAS2TAS+" ratio:"+ratio+" state_x:"+state_x+" state_y:"+state_y+" state_z:"+state_z+" Pax:"+Pax+" Pby:"+Pby+" Pcz:"+Pcz+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_aoa_ssa.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_aoa_ssa.java new file mode 100644 index 0000000..87652fd --- /dev/null +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_aoa_ssa.java @@ -0,0 +1,102 @@ +/* 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 AOA_SSA PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* Angle of Attack and Side Slip Angle. +*/ +public class msg_aoa_ssa extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_AOA_SSA = 11020; + public static final int MAVLINK_MSG_LENGTH = 16; + private static final long serialVersionUID = MAVLINK_MSG_ID_AOA_SSA; + + + + /** + * Timestamp (since boot or Unix epoch). + */ + public long time_usec; + + /** + * Angle of Attack. + */ + public float AOA; + + /** + * Side Slip Angle. + */ + public float SSA; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_AOA_SSA; + + packet.payload.putUnsignedLong(time_usec); + + packet.payload.putFloat(AOA); + + packet.payload.putFloat(SSA); + + return packet; + } + + /** + * Decode a aoa_ssa message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + + this.time_usec = payload.getUnsignedLong(); + + this.AOA = payload.getFloat(); + + this.SSA = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_aoa_ssa(){ + msgid = MAVLINK_MSG_ID_AOA_SSA; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_aoa_ssa(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AOA_SSA; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AOA_SSA - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" AOA:"+AOA+" SSA:"+SSA+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ap_adc.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ap_adc.java index 10dc675..1530848 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_ap_adc.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_ap_adc.java @@ -6,123 +6,124 @@ // MESSAGE AP_ADC PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * raw ADC output - */ -public class msg_ap_adc extends MAVLinkMessage { +* Raw ADC output. +*/ +public class msg_ap_adc extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AP_ADC = 153; public static final int MAVLINK_MSG_LENGTH = 12; private static final long serialVersionUID = MAVLINK_MSG_ID_AP_ADC; + /** - * ADC output 1 - */ + * ADC output 1. + */ public int adc1; - + /** - * ADC output 2 - */ + * ADC output 2. + */ public int adc2; - + /** - * ADC output 3 - */ + * ADC output 3. + */ public int adc3; - + /** - * ADC output 4 - */ + * ADC output 4. + */ public int adc4; - + /** - * ADC output 5 - */ + * ADC output 5. + */ public int adc5; - + /** - * ADC output 6 - */ + * ADC output 6. + */ public int adc6; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_ap_adc() { - msgid = MAVLINK_MSG_ID_AP_ADC; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_ap_adc(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AP_ADC; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AP_ADC; - + packet.payload.putUnsignedShort(adc1); - + packet.payload.putUnsignedShort(adc2); - + packet.payload.putUnsignedShort(adc3); - + packet.payload.putUnsignedShort(adc4); - + packet.payload.putUnsignedShort(adc5); - + packet.payload.putUnsignedShort(adc6); - + return packet; } /** - * Decode a ap_adc message into this class fields - * - * @param payload The message to decode - */ + * Decode a ap_adc message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.adc1 = payload.getUnsignedShort(); - + this.adc2 = payload.getUnsignedShort(); - + this.adc3 = payload.getUnsignedShort(); - + this.adc4 = payload.getUnsignedShort(); - + this.adc5 = payload.getUnsignedShort(); - + this.adc6 = payload.getUnsignedShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_ap_adc(){ + msgid = MAVLINK_MSG_ID_AP_ADC; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_ap_adc(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AP_ADC; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AP_ADC - sysid:" + sysid + " compid:" + compid + " adc1:" + adc1 + " adc2:" + adc2 + " adc3:" + adc3 + " adc4:" + adc4 + " adc5:" + adc5 + " adc6:" + adc6 + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AP_ADC - sysid:"+sysid+" compid:"+compid+" adc1:"+adc1+" adc2:"+adc2+" adc3:"+adc3+" adc4:"+adc4+" adc5:"+adc5+" adc6:"+adc6+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_autopilot_version_request.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_autopilot_version_request.java index 31909c1..96d7b94 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_autopilot_version_request.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_autopilot_version_request.java @@ -6,87 +6,88 @@ // MESSAGE AUTOPILOT_VERSION_REQUEST PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request the autopilot version from the system/component. - */ -public class msg_autopilot_version_request extends MAVLinkMessage { +* Request the autopilot version from the system/component. +*/ +public class msg_autopilot_version_request extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST = 183; public static final int MAVLINK_MSG_LENGTH = 2; private static final long serialVersionUID = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_autopilot_version_request() { - msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_autopilot_version_request(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a autopilot_version_request message into this class fields - * - * @param payload The message to decode - */ + * Decode a autopilot_version_request message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_autopilot_version_request(){ + msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_autopilot_version_request(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_battery2.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_battery2.java index 833993f..918371a 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_battery2.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_battery2.java @@ -6,87 +6,88 @@ // MESSAGE BATTERY2 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * 2nd Battery status - */ -public class msg_battery2 extends MAVLinkMessage { +* 2nd Battery status +*/ +public class msg_battery2 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_BATTERY2 = 181; public static final int MAVLINK_MSG_LENGTH = 4; private static final long serialVersionUID = MAVLINK_MSG_ID_BATTERY2; + /** - * voltage in millivolts - */ + * Voltage. + */ public int voltage; - + /** - * Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current - */ + * Battery current, -1: autopilot does not measure the current. + */ public short current_battery; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_battery2() { - msgid = MAVLINK_MSG_ID_BATTERY2; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_battery2(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_BATTERY2; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_BATTERY2; - + packet.payload.putUnsignedShort(voltage); - + packet.payload.putShort(current_battery); - + return packet; } /** - * Decode a battery2 message into this class fields - * - * @param payload The message to decode - */ + * Decode a battery2 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.voltage = payload.getUnsignedShort(); - + this.current_battery = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_battery2(){ + msgid = MAVLINK_MSG_ID_BATTERY2; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_battery2(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_BATTERY2; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_BATTERY2 - sysid:" + sysid + " compid:" + compid + " voltage:" + voltage + " current_battery:" + current_battery + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_BATTERY2 - sysid:"+sysid+" compid:"+compid+" voltage:"+voltage+" current_battery:"+current_battery+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_feedback.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_feedback.java index 9d94cfb..f0adc75 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_feedback.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_feedback.java @@ -6,186 +6,196 @@ // MESSAGE CAMERA_FEEDBACK PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Camera Capture Feedback - */ -public class msg_camera_feedback extends MAVLinkMessage { +* Camera Capture Feedback. +*/ +public class msg_camera_feedback extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_CAMERA_FEEDBACK = 180; - public static final int MAVLINK_MSG_LENGTH = 45; + public static final int MAVLINK_MSG_LENGTH = 47; private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + /** - * Image timestamp (microseconds since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB) - */ + * Image timestamp (since UNIX epoch), as passed in by CAMERA_STATUS message (or autopilot if no CCB). + */ public long time_usec; - + /** - * Latitude in (deg * 1E7) - */ + * Latitude. + */ public int lat; - + /** - * Longitude in (deg * 1E7) - */ + * Longitude. + */ public int lng; - + /** - * Altitude Absolute (meters AMSL) - */ + * Altitude (MSL). + */ public float alt_msl; - + /** - * Altitude Relative (meters above HOME location) - */ + * Altitude (Relative to HOME location). + */ public float alt_rel; - + /** - * Camera Roll angle (earth frame, degrees, +-180) - */ + * Camera Roll angle (earth frame, +-180). + */ public float roll; - + /** - * Camera Pitch angle (earth frame, degrees, +-180) - */ + * Camera Pitch angle (earth frame, +-180). + */ public float pitch; - + /** - * Camera Yaw (earth frame, degrees, 0-360, true) - */ + * Camera Yaw (earth frame, 0-360, true). + */ public float yaw; - + /** - * Focal Length (mm) - */ + * Focal Length. + */ public float foc_len; - + /** - * Image index - */ + * Image index. + */ public int img_idx; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Camera ID - */ + * Camera ID. + */ public short cam_idx; - + /** - * See CAMERA_FEEDBACK_FLAGS enum for definition of the bitmask - */ + * Feedback flags. + */ public short flags; - - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_camera_feedback() { - msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; - } + * Completed image captures. + */ + public int completed_captures; + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_camera_feedback(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; - + packet.payload.putUnsignedLong(time_usec); - + packet.payload.putInt(lat); - + packet.payload.putInt(lng); - + packet.payload.putFloat(alt_msl); - + packet.payload.putFloat(alt_rel); - + packet.payload.putFloat(roll); - + packet.payload.putFloat(pitch); - + packet.payload.putFloat(yaw); - + packet.payload.putFloat(foc_len); - + packet.payload.putUnsignedShort(img_idx); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(cam_idx); - + packet.payload.putUnsignedByte(flags); - + + packet.payload.putUnsignedShort(completed_captures); + return packet; } /** - * Decode a camera_feedback message into this class fields - * - * @param payload The message to decode - */ + * Decode a camera_feedback message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.time_usec = payload.getUnsignedLong(); - + this.lat = payload.getInt(); - + this.lng = payload.getInt(); - + this.alt_msl = payload.getFloat(); - + this.alt_rel = payload.getFloat(); - + this.roll = payload.getFloat(); - + this.pitch = payload.getFloat(); - + this.yaw = payload.getFloat(); - + this.foc_len = payload.getFloat(); - + this.img_idx = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.cam_idx = payload.getUnsignedByte(); - + this.flags = payload.getUnsignedByte(); + + this.completed_captures = payload.getUnsignedShort(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_camera_feedback(){ + msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_camera_feedback(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_CAMERA_FEEDBACK; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_CAMERA_FEEDBACK - sysid:" + sysid + " compid:" + compid + " time_usec:" + time_usec + " lat:" + lat + " lng:" + lng + " alt_msl:" + alt_msl + " alt_rel:" + alt_rel + " roll:" + roll + " pitch:" + pitch + " yaw:" + yaw + " foc_len:" + foc_len + " img_idx:" + img_idx + " target_system:" + target_system + " cam_idx:" + cam_idx + " flags:" + flags + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_CAMERA_FEEDBACK - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" lat:"+lat+" lng:"+lng+" alt_msl:"+alt_msl+" alt_rel:"+alt_rel+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" foc_len:"+foc_len+" img_idx:"+img_idx+" target_system:"+target_system+" cam_idx:"+cam_idx+" flags:"+flags+" completed_captures:"+completed_captures+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_status.java index 0860015..91b612b 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_status.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_camera_status.java @@ -6,150 +6,151 @@ // MESSAGE CAMERA_STATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Camera Event - */ -public class msg_camera_status extends MAVLinkMessage { +* Camera Event. +*/ +public class msg_camera_status extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_CAMERA_STATUS = 179; public static final int MAVLINK_MSG_LENGTH = 29; private static final long serialVersionUID = MAVLINK_MSG_ID_CAMERA_STATUS; + /** - * Image timestamp (microseconds since UNIX epoch, according to camera clock) - */ + * Image timestamp (since UNIX epoch, according to camera clock). + */ public long time_usec; - + /** - * Parameter 1 (meaning depends on event, see CAMERA_STATUS_TYPES enum) - */ + * Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + */ public float p1; - + /** - * Parameter 2 (meaning depends on event, see CAMERA_STATUS_TYPES enum) - */ + * Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + */ public float p2; - + /** - * Parameter 3 (meaning depends on event, see CAMERA_STATUS_TYPES enum) - */ + * Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + */ public float p3; - + /** - * Parameter 4 (meaning depends on event, see CAMERA_STATUS_TYPES enum) - */ + * Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum). + */ public float p4; - + /** - * Image index - */ + * Image index. + */ public int img_idx; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Camera ID - */ + * Camera ID. + */ public short cam_idx; - + /** - * See CAMERA_STATUS_TYPES enum for definition of the bitmask - */ + * Event type. + */ public short event_id; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_camera_status() { - msgid = MAVLINK_MSG_ID_CAMERA_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_camera_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_CAMERA_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_CAMERA_STATUS; - + packet.payload.putUnsignedLong(time_usec); - + packet.payload.putFloat(p1); - + packet.payload.putFloat(p2); - + packet.payload.putFloat(p3); - + packet.payload.putFloat(p4); - + packet.payload.putUnsignedShort(img_idx); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(cam_idx); - + packet.payload.putUnsignedByte(event_id); - + return packet; } /** - * Decode a camera_status message into this class fields - * - * @param payload The message to decode - */ + * Decode a camera_status message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.time_usec = payload.getUnsignedLong(); - + this.p1 = payload.getFloat(); - + this.p2 = payload.getFloat(); - + this.p3 = payload.getFloat(); - + this.p4 = payload.getFloat(); - + this.img_idx = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.cam_idx = payload.getUnsignedByte(); - + this.event_id = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_camera_status(){ + msgid = MAVLINK_MSG_ID_CAMERA_STATUS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_camera_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_CAMERA_STATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_CAMERA_STATUS - sysid:" + sysid + " compid:" + compid + " time_usec:" + time_usec + " p1:" + p1 + " p2:" + p2 + " p3:" + p3 + " p4:" + p4 + " img_idx:" + img_idx + " target_system:" + target_system + " cam_idx:" + cam_idx + " event_id:" + event_id + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_CAMERA_STATUS - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" p1:"+p1+" p2:"+p2+" p3:"+p3+" p4:"+p4+" img_idx:"+img_idx+" target_system:"+target_system+" cam_idx:"+cam_idx+" event_id:"+event_id+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_compassmot_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_compassmot_status.java index 00ae176..04e611c 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_compassmot_status.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_compassmot_status.java @@ -6,123 +6,124 @@ // MESSAGE COMPASSMOT_STATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of compassmot calibration - */ -public class msg_compassmot_status extends MAVLinkMessage { +* Status of compassmot calibration. +*/ +public class msg_compassmot_status extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_COMPASSMOT_STATUS = 177; public static final int MAVLINK_MSG_LENGTH = 20; private static final long serialVersionUID = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + /** - * current (Ampere) - */ + * Current. + */ public float current; - + /** - * Motor Compensation X - */ + * Motor Compensation X. + */ public float CompensationX; - + /** - * Motor Compensation Y - */ + * Motor Compensation Y. + */ public float CompensationY; - + /** - * Motor Compensation Z - */ + * Motor Compensation Z. + */ public float CompensationZ; - + /** - * throttle (percent*10) - */ + * Throttle. + */ public int throttle; - + /** - * interference (percent) - */ + * Interference. + */ public int interference; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_compassmot_status() { - msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_compassmot_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; - + packet.payload.putFloat(current); - + packet.payload.putFloat(CompensationX); - + packet.payload.putFloat(CompensationY); - + packet.payload.putFloat(CompensationZ); - + packet.payload.putUnsignedShort(throttle); - + packet.payload.putUnsignedShort(interference); - + return packet; } /** - * Decode a compassmot_status message into this class fields - * - * @param payload The message to decode - */ + * Decode a compassmot_status message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.current = payload.getFloat(); - + this.CompensationX = payload.getFloat(); - + this.CompensationY = payload.getFloat(); - + this.CompensationZ = payload.getFloat(); - + this.throttle = payload.getUnsignedShort(); - + this.interference = payload.getUnsignedShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_compassmot_status(){ + msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_compassmot_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_COMPASSMOT_STATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_COMPASSMOT_STATUS - sysid:" + sysid + " compid:" + compid + " current:" + current + " CompensationX:" + CompensationX + " CompensationY:" + CompensationY + " CompensationZ:" + CompensationZ + " throttle:" + throttle + " interference:" + interference + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_COMPASSMOT_STATUS - sysid:"+sysid+" compid:"+compid+" current:"+current+" CompensationX:"+CompensationX+" CompensationY:"+CompensationY+" CompensationZ:"+CompensationZ+" throttle:"+throttle+" interference:"+interference+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data16.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data16.java index e9ebc83..3bc801b 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data16.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data16.java @@ -6,104 +6,105 @@ // MESSAGE DATA16 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Data packet, size 16 - */ -public class msg_data16 extends MAVLinkMessage { +* Data packet, size 16. +*/ +public class msg_data16 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_DATA16 = 169; public static final int MAVLINK_MSG_LENGTH = 18; private static final long serialVersionUID = MAVLINK_MSG_ID_DATA16; + /** - * data type - */ + * Data type. + */ public short type; - + /** - * data length - */ + * Data length. + */ public short len; - + /** - * raw data - */ + * Raw data. + */ public short data[] = new short[16]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_data16() { - msgid = MAVLINK_MSG_ID_DATA16; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_data16(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_DATA16; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_DATA16; - + packet.payload.putUnsignedByte(type); - + packet.payload.putUnsignedByte(len); - - + + for (int i = 0; i < data.length; i++) { packet.payload.putUnsignedByte(data[i]); } - - + + return packet; } /** - * Decode a data16 message into this class fields - * - * @param payload The message to decode - */ + * Decode a data16 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.type = payload.getUnsignedByte(); - + this.len = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.data.length; i++) { this.data[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data16(){ + msgid = MAVLINK_MSG_ID_DATA16; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data16(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA16; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_DATA16 - sysid:" + sysid + " compid:" + compid + " type:" + type + " len:" + len + " data:" + data + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA16 - sysid:"+sysid+" compid:"+compid+" type:"+type+" len:"+len+" data:"+data+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data32.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data32.java index 06985b3..e1e3852 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data32.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data32.java @@ -6,104 +6,105 @@ // MESSAGE DATA32 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Data packet, size 32 - */ -public class msg_data32 extends MAVLinkMessage { +* Data packet, size 32. +*/ +public class msg_data32 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_DATA32 = 170; public static final int MAVLINK_MSG_LENGTH = 34; private static final long serialVersionUID = MAVLINK_MSG_ID_DATA32; + /** - * data type - */ + * Data type. + */ public short type; - + /** - * data length - */ + * Data length. + */ public short len; - + /** - * raw data - */ + * Raw data. + */ public short data[] = new short[32]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_data32() { - msgid = MAVLINK_MSG_ID_DATA32; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_data32(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_DATA32; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_DATA32; - + packet.payload.putUnsignedByte(type); - + packet.payload.putUnsignedByte(len); - - + + for (int i = 0; i < data.length; i++) { packet.payload.putUnsignedByte(data[i]); } - - + + return packet; } /** - * Decode a data32 message into this class fields - * - * @param payload The message to decode - */ + * Decode a data32 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.type = payload.getUnsignedByte(); - + this.len = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.data.length; i++) { this.data[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data32(){ + msgid = MAVLINK_MSG_ID_DATA32; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data32(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA32; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_DATA32 - sysid:" + sysid + " compid:" + compid + " type:" + type + " len:" + len + " data:" + data + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA32 - sysid:"+sysid+" compid:"+compid+" type:"+type+" len:"+len+" data:"+data+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data64.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data64.java index 8629612..19da039 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data64.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data64.java @@ -6,104 +6,105 @@ // MESSAGE DATA64 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Data packet, size 64 - */ -public class msg_data64 extends MAVLinkMessage { +* Data packet, size 64. +*/ +public class msg_data64 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_DATA64 = 171; public static final int MAVLINK_MSG_LENGTH = 66; private static final long serialVersionUID = MAVLINK_MSG_ID_DATA64; + /** - * data type - */ + * Data type. + */ public short type; - + /** - * data length - */ + * Data length. + */ public short len; - + /** - * raw data - */ + * Raw data. + */ public short data[] = new short[64]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_data64() { - msgid = MAVLINK_MSG_ID_DATA64; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_data64(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_DATA64; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_DATA64; - + packet.payload.putUnsignedByte(type); - + packet.payload.putUnsignedByte(len); - - + + for (int i = 0; i < data.length; i++) { packet.payload.putUnsignedByte(data[i]); } - - + + return packet; } /** - * Decode a data64 message into this class fields - * - * @param payload The message to decode - */ + * Decode a data64 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.type = payload.getUnsignedByte(); - + this.len = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.data.length; i++) { this.data[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data64(){ + msgid = MAVLINK_MSG_ID_DATA64; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data64(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA64; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_DATA64 - sysid:" + sysid + " compid:" + compid + " type:" + type + " len:" + len + " data:" + data + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA64 - sysid:"+sysid+" compid:"+compid+" type:"+type+" len:"+len+" data:"+data+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data96.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data96.java index f2135e1..7203904 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_data96.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_data96.java @@ -6,104 +6,105 @@ // MESSAGE DATA96 PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Data packet, size 96 - */ -public class msg_data96 extends MAVLinkMessage { +* Data packet, size 96. +*/ +public class msg_data96 extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_DATA96 = 172; public static final int MAVLINK_MSG_LENGTH = 98; private static final long serialVersionUID = MAVLINK_MSG_ID_DATA96; + /** - * data type - */ + * Data type. + */ public short type; - + /** - * data length - */ + * Data length. + */ public short len; - + /** - * raw data - */ + * Raw data. + */ public short data[] = new short[96]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_data96() { - msgid = MAVLINK_MSG_ID_DATA96; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_data96(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_DATA96; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_DATA96; - + packet.payload.putUnsignedByte(type); - + packet.payload.putUnsignedByte(len); - - + + for (int i = 0; i < data.length; i++) { packet.payload.putUnsignedByte(data[i]); } - - + + return packet; } /** - * Decode a data96 message into this class fields - * - * @param payload The message to decode - */ + * Decode a data96 message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.type = payload.getUnsignedByte(); - + this.len = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.data.length; i++) { this.data[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_data96(){ + msgid = MAVLINK_MSG_ID_DATA96; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_data96(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DATA96; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_DATA96 - sysid:" + sysid + " compid:" + compid + " type:" + type + " len:" + len + " data:" + data + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DATA96 - sysid:"+sysid+" compid:"+compid+" type:"+type+" len:"+len+" data:"+data+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_deepstall.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_deepstall.java new file mode 100644 index 0000000..d3b7c74 --- /dev/null +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_deepstall.java @@ -0,0 +1,165 @@ +/* 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 DEEPSTALL PACKING +package com.MAVLink.ardupilotmega; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* Deepstall path planning. +*/ +public class msg_deepstall extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_DEEPSTALL = 195; + public static final int MAVLINK_MSG_LENGTH = 37; + private static final long serialVersionUID = MAVLINK_MSG_ID_DEEPSTALL; + + + + /** + * Landing latitude. + */ + public int landing_lat; + + /** + * Landing longitude. + */ + public int landing_lon; + + /** + * Final heading start point, latitude. + */ + public int path_lat; + + /** + * Final heading start point, longitude. + */ + public int path_lon; + + /** + * Arc entry point, latitude. + */ + public int arc_entry_lat; + + /** + * Arc entry point, longitude. + */ + public int arc_entry_lon; + + /** + * Altitude. + */ + public float altitude; + + /** + * Distance the aircraft expects to travel during the deepstall. + */ + public float expected_travel_distance; + + /** + * Deepstall cross track error (only valid when in DEEPSTALL_STAGE_LAND). + */ + public float cross_track_error; + + /** + * Deepstall stage. + */ + public short stage; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_DEEPSTALL; + + packet.payload.putInt(landing_lat); + + packet.payload.putInt(landing_lon); + + packet.payload.putInt(path_lat); + + packet.payload.putInt(path_lon); + + packet.payload.putInt(arc_entry_lat); + + packet.payload.putInt(arc_entry_lon); + + packet.payload.putFloat(altitude); + + packet.payload.putFloat(expected_travel_distance); + + packet.payload.putFloat(cross_track_error); + + packet.payload.putUnsignedByte(stage); + + return packet; + } + + /** + * Decode a deepstall message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + + this.landing_lat = payload.getInt(); + + this.landing_lon = payload.getInt(); + + this.path_lat = payload.getInt(); + + this.path_lon = payload.getInt(); + + this.arc_entry_lat = payload.getInt(); + + this.arc_entry_lon = payload.getInt(); + + this.altitude = payload.getFloat(); + + this.expected_travel_distance = payload.getFloat(); + + this.cross_track_error = payload.getFloat(); + + this.stage = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_deepstall(){ + msgid = MAVLINK_MSG_ID_DEEPSTALL; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_deepstall(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DEEPSTALL; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_DEEPSTALL - sysid:"+sysid+" compid:"+compid+" landing_lat:"+landing_lat+" landing_lon:"+landing_lon+" path_lat:"+path_lat+" path_lon:"+path_lon+" arc_entry_lat:"+arc_entry_lat+" arc_entry_lon:"+arc_entry_lon+" altitude:"+altitude+" expected_travel_distance:"+expected_travel_distance+" cross_track_error:"+cross_track_error+" stage:"+stage+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_device_op_read.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_device_op_read.java index 8aadb34..34b63e8 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_device_op_read.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_device_op_read.java @@ -6,187 +6,188 @@ // MESSAGE DEVICE_OP_READ PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Read registers for a device - */ -public class msg_device_op_read extends MAVLinkMessage { +* Read registers for a device. +*/ +public class msg_device_op_read extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_DEVICE_OP_READ = 11000; public static final int MAVLINK_MSG_LENGTH = 51; private static final long serialVersionUID = MAVLINK_MSG_ID_DEVICE_OP_READ; + /** - * request ID - copied to reply - */ + * Request ID - copied to reply. + */ public long request_id; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * The bus type - */ + * The bus type. + */ public short bustype; - + /** - * Bus number - */ + * Bus number. + */ public short bus; - + /** - * Bus address - */ + * Bus address. + */ public short address; - + /** - * Name of device on bus (for SPI) - */ + * Name of device on bus (for SPI). + */ public byte busname[] = new byte[40]; - + /** - * First register to read - */ + * First register to read. + */ public short regstart; - + /** - * count of registers to read - */ + * Count of registers to read. + */ public short count; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_device_op_read() { - msgid = MAVLINK_MSG_ID_DEVICE_OP_READ; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_device_op_read(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_DEVICE_OP_READ; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_DEVICE_OP_READ; - + packet.payload.putUnsignedInt(request_id); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(bustype); - + packet.payload.putUnsignedByte(bus); - + packet.payload.putUnsignedByte(address); - - + + for (int i = 0; i < busname.length; i++) { packet.payload.putByte(busname[i]); } - - + + packet.payload.putUnsignedByte(regstart); - + packet.payload.putUnsignedByte(count); - + return packet; } /** - * Decode a device_op_read message into this class fields - * - * @param payload The message to decode - */ + * Decode a device_op_read message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.request_id = payload.getUnsignedInt(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.bustype = payload.getUnsignedByte(); - + this.bus = payload.getUnsignedByte(); - + this.address = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.busname.length; i++) { this.busname[i] = payload.getByte(); } - - + + this.regstart = payload.getUnsignedByte(); - + this.count = payload.getUnsignedByte(); - + } /** - * Gets the message, formated as a string - */ - public String getBusname() { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < 40; i++) { - if (busname[i] != 0) - buf.append((char) busname[i]); - else - break; - } - return buf.toString(); + * Constructor for a new message, just initializes the msgid + */ + public msg_device_op_read(){ + msgid = MAVLINK_MSG_ID_DEVICE_OP_READ; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_device_op_read(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_DEVICE_OP_READ; + unpack(mavLinkPacket.payload); } + /** - * Sets the buffer of this message with a string, adds the necessary padding - */ + * Sets the buffer of this message with a string, adds the necessary padding + */ public void setBusname(String str) { int len = Math.min(str.length(), 40); - for (int i = 0; i < len; i++) { + for (int i=0; i MAV. Also used to return a point from MAV -> GCS - */ -public class msg_fence_point extends MAVLinkMessage { +* A fence point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS. +*/ +public class msg_fence_point extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_FENCE_POINT = 160; public static final int MAVLINK_MSG_LENGTH = 12; private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_POINT; + /** - * Latitude of point - */ + * Latitude of point. + */ public float lat; - + /** - * Longitude of point - */ + * Longitude of point. + */ public float lng; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * point index (first point is 1, 0 is for return point) - */ + * Point index (first point is 1, 0 is for return point). + */ public short idx; - + /** - * total number of points (for sanity checking) - */ + * Total number of points (for sanity checking). + */ public short count; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_fence_point() { - msgid = MAVLINK_MSG_ID_FENCE_POINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_fence_point(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_FENCE_POINT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_FENCE_POINT; - + packet.payload.putFloat(lat); - + packet.payload.putFloat(lng); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(idx); - + packet.payload.putUnsignedByte(count); - + return packet; } /** - * Decode a fence_point message into this class fields - * - * @param payload The message to decode - */ + * Decode a fence_point message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.lat = payload.getFloat(); - + this.lng = payload.getFloat(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.idx = payload.getUnsignedByte(); - + this.count = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_fence_point(){ + msgid = MAVLINK_MSG_ID_FENCE_POINT; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_fence_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_FENCE_POINT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_FENCE_POINT - sysid:" + sysid + " compid:" + compid + " lat:" + lat + " lng:" + lng + " target_system:" + target_system + " target_component:" + target_component + " idx:" + idx + " count:" + count + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_FENCE_POINT - sysid:"+sysid+" compid:"+compid+" lat:"+lat+" lng:"+lng+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_fence_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_fence_status.java deleted file mode 100644 index 1d1c04f..0000000 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_fence_status.java +++ /dev/null @@ -1,110 +0,0 @@ -/* 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 FENCE_STATUS PACKING -package com.MAVLink.ardupilotmega; - -import com.MAVLink.MAVLinkPacket; -import com.MAVLink.Messages.MAVLinkMessage; -import com.MAVLink.Messages.MAVLinkPayload; - -/** - * Status of geo-fencing. Sent in extended status stream when fencing enabled - */ -public class msg_fence_status extends MAVLinkMessage { - - public static final int MAVLINK_MSG_ID_FENCE_STATUS = 162; - public static final int MAVLINK_MSG_LENGTH = 8; - private static final long serialVersionUID = MAVLINK_MSG_ID_FENCE_STATUS; - - - /** - * time of last breach in milliseconds since boot - */ - public long breach_time; - - /** - * number of fence breaches - */ - public int breach_count; - - /** - * 0 if currently inside fence, 1 if outside - */ - public short breach_status; - - /** - * last breach type (see FENCE_BREACH_* enum) - */ - public short breach_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_fence_status() { - msgid = MAVLINK_MSG_ID_FENCE_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_fence_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_FENCE_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { - MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); - packet.sysid = 255; - packet.compid = 190; - packet.msgid = MAVLINK_MSG_ID_FENCE_STATUS; - - packet.payload.putUnsignedInt(breach_time); - - packet.payload.putUnsignedShort(breach_count); - - packet.payload.putUnsignedByte(breach_status); - - packet.payload.putUnsignedByte(breach_type); - - return packet; - } - - /** - * Decode a fence_status message into this class fields - * - * @param payload The message to decode - */ - public void unpack(MAVLinkPayload payload) { - payload.resetIndex(); - - this.breach_time = payload.getUnsignedInt(); - - this.breach_count = payload.getUnsignedShort(); - - this.breach_status = payload.getUnsignedByte(); - - this.breach_type = payload.getUnsignedByte(); - - } - - /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_FENCE_STATUS - sysid:" + sysid + " compid:" + compid + " breach_time:" + breach_time + " breach_count:" + breach_count + " breach_status:" + breach_status + " breach_type:" + breach_type + ""; - } -} - \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_control.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_control.java index 443a654..784ad62 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_control.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_control.java @@ -6,114 +6,115 @@ // MESSAGE GIMBAL_CONTROL PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Control message for rate gimbal - */ -public class msg_gimbal_control extends MAVLinkMessage { +* Control message for rate gimbal. +*/ +public class msg_gimbal_control extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GIMBAL_CONTROL = 201; public static final int MAVLINK_MSG_LENGTH = 14; private static final long serialVersionUID = MAVLINK_MSG_ID_GIMBAL_CONTROL; + /** - * Demanded angular rate X (rad/s) - */ + * Demanded angular rate X. + */ public float demanded_rate_x; - + /** - * Demanded angular rate Y (rad/s) - */ + * Demanded angular rate Y. + */ public float demanded_rate_y; - + /** - * Demanded angular rate Z (rad/s) - */ + * Demanded angular rate Z. + */ public float demanded_rate_z; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gimbal_control() { - msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gimbal_control(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL; - + packet.payload.putFloat(demanded_rate_x); - + packet.payload.putFloat(demanded_rate_y); - + packet.payload.putFloat(demanded_rate_z); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a gimbal_control message into this class fields - * - * @param payload The message to decode - */ + * Decode a gimbal_control message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.demanded_rate_x = payload.getFloat(); - + this.demanded_rate_y = payload.getFloat(); - + this.demanded_rate_z = payload.getFloat(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gimbal_control(){ + msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gimbal_control(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GIMBAL_CONTROL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GIMBAL_CONTROL - sysid:" + sysid + " compid:" + compid + " demanded_rate_x:" + demanded_rate_x + " demanded_rate_y:" + demanded_rate_y + " demanded_rate_z:" + demanded_rate_z + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GIMBAL_CONTROL - sysid:"+sysid+" compid:"+compid+" demanded_rate_x:"+demanded_rate_x+" demanded_rate_y:"+demanded_rate_y+" demanded_rate_z:"+demanded_rate_z+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_report.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_report.java index 2eb8b44..0c336eb 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_report.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_report.java @@ -6,177 +6,178 @@ // MESSAGE GIMBAL_REPORT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * 3 axis gimbal mesuraments - */ -public class msg_gimbal_report extends MAVLinkMessage { +* 3 axis gimbal measurements. +*/ +public class msg_gimbal_report extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GIMBAL_REPORT = 200; public static final int MAVLINK_MSG_LENGTH = 42; private static final long serialVersionUID = MAVLINK_MSG_ID_GIMBAL_REPORT; + /** - * Time since last update (seconds) - */ + * Time since last update. + */ public float delta_time; - + /** - * Delta angle X (radians) - */ + * Delta angle X. + */ public float delta_angle_x; - + /** - * Delta angle Y (radians) - */ + * Delta angle Y. + */ public float delta_angle_y; - + /** - * Delta angle X (radians) - */ + * Delta angle X. + */ public float delta_angle_z; - + /** - * Delta velocity X (m/s) - */ + * Delta velocity X. + */ public float delta_velocity_x; - + /** - * Delta velocity Y (m/s) - */ + * Delta velocity Y. + */ public float delta_velocity_y; - + /** - * Delta velocity Z (m/s) - */ + * Delta velocity Z. + */ public float delta_velocity_z; - + /** - * Joint ROLL (radians) - */ + * Joint ROLL. + */ public float joint_roll; - + /** - * Joint EL (radians) - */ + * Joint EL. + */ public float joint_el; - + /** - * Joint AZ (radians) - */ + * Joint AZ. + */ public float joint_az; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gimbal_report() { - msgid = MAVLINK_MSG_ID_GIMBAL_REPORT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gimbal_report(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GIMBAL_REPORT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GIMBAL_REPORT; - + packet.payload.putFloat(delta_time); - + packet.payload.putFloat(delta_angle_x); - + packet.payload.putFloat(delta_angle_y); - + packet.payload.putFloat(delta_angle_z); - + packet.payload.putFloat(delta_velocity_x); - + packet.payload.putFloat(delta_velocity_y); - + packet.payload.putFloat(delta_velocity_z); - + packet.payload.putFloat(joint_roll); - + packet.payload.putFloat(joint_el); - + packet.payload.putFloat(joint_az); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a gimbal_report message into this class fields - * - * @param payload The message to decode - */ + * Decode a gimbal_report message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.delta_time = payload.getFloat(); - + this.delta_angle_x = payload.getFloat(); - + this.delta_angle_y = payload.getFloat(); - + this.delta_angle_z = payload.getFloat(); - + this.delta_velocity_x = payload.getFloat(); - + this.delta_velocity_y = payload.getFloat(); - + this.delta_velocity_z = payload.getFloat(); - + this.joint_roll = payload.getFloat(); - + this.joint_el = payload.getFloat(); - + this.joint_az = payload.getFloat(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gimbal_report(){ + msgid = MAVLINK_MSG_ID_GIMBAL_REPORT; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gimbal_report(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GIMBAL_REPORT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GIMBAL_REPORT - sysid:" + sysid + " compid:" + compid + " delta_time:" + delta_time + " delta_angle_x:" + delta_angle_x + " delta_angle_y:" + delta_angle_y + " delta_angle_z:" + delta_angle_z + " delta_velocity_x:" + delta_velocity_x + " delta_velocity_y:" + delta_velocity_y + " delta_velocity_z:" + delta_velocity_z + " joint_roll:" + joint_roll + " joint_el:" + joint_el + " joint_az:" + joint_az + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GIMBAL_REPORT - sysid:"+sysid+" compid:"+compid+" delta_time:"+delta_time+" delta_angle_x:"+delta_angle_x+" delta_angle_y:"+delta_angle_y+" delta_angle_z:"+delta_angle_z+" delta_velocity_x:"+delta_velocity_x+" delta_velocity_y:"+delta_velocity_y+" delta_velocity_z:"+delta_velocity_z+" joint_roll:"+joint_roll+" joint_el:"+joint_el+" joint_az:"+joint_az+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_torque_cmd_report.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_torque_cmd_report.java index b0b88cb..2cf1603 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_torque_cmd_report.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gimbal_torque_cmd_report.java @@ -6,114 +6,115 @@ // MESSAGE GIMBAL_TORQUE_CMD_REPORT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * 100 Hz gimbal torque command telemetry - */ -public class msg_gimbal_torque_cmd_report extends MAVLinkMessage { +* 100 Hz gimbal torque command telemetry. +*/ +public class msg_gimbal_torque_cmd_report extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT = 214; public static final int MAVLINK_MSG_LENGTH = 8; private static final long serialVersionUID = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; + /** - * Roll Torque Command - */ + * Roll Torque Command. + */ public short rl_torque_cmd; - + /** - * Elevation Torque Command - */ + * Elevation Torque Command. + */ public short el_torque_cmd; - + /** - * Azimuth Torque Command - */ + * Azimuth Torque Command. + */ public short az_torque_cmd; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gimbal_torque_cmd_report() { - msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gimbal_torque_cmd_report(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; - + packet.payload.putShort(rl_torque_cmd); - + packet.payload.putShort(el_torque_cmd); - + packet.payload.putShort(az_torque_cmd); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a gimbal_torque_cmd_report message into this class fields - * - * @param payload The message to decode - */ + * Decode a gimbal_torque_cmd_report message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.rl_torque_cmd = payload.getShort(); - + this.el_torque_cmd = payload.getShort(); - + this.az_torque_cmd = payload.getShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gimbal_torque_cmd_report(){ + msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gimbal_torque_cmd_report(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT - sysid:" + sysid + " compid:" + compid + " rl_torque_cmd:" + rl_torque_cmd + " el_torque_cmd:" + el_torque_cmd + " az_torque_cmd:" + az_torque_cmd + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT - sysid:"+sysid+" compid:"+compid+" rl_torque_cmd:"+rl_torque_cmd+" el_torque_cmd:"+el_torque_cmd+" az_torque_cmd:"+az_torque_cmd+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_request.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_request.java index 23be6b5..9839adc 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_request.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_request.java @@ -6,96 +6,97 @@ // MESSAGE GOPRO_GET_REQUEST PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request a GOPRO_COMMAND response from the GoPro - */ -public class msg_gopro_get_request extends MAVLinkMessage { +* Request a GOPRO_COMMAND response from the GoPro. +*/ +public class msg_gopro_get_request extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GOPRO_GET_REQUEST = 216; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Command ID - */ + * Command ID. + */ public short cmd_id; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gopro_get_request() { - msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gopro_get_request(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(cmd_id); - + return packet; } /** - * Decode a gopro_get_request message into this class fields - * - * @param payload The message to decode - */ + * Decode a gopro_get_request message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.cmd_id = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gopro_get_request(){ + msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gopro_get_request(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GOPRO_GET_REQUEST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GOPRO_GET_REQUEST - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " cmd_id:" + cmd_id + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GOPRO_GET_REQUEST - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" cmd_id:"+cmd_id+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_response.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_response.java index bf5cd38..3665f18 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_response.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_get_response.java @@ -6,104 +6,105 @@ // MESSAGE GOPRO_GET_RESPONSE PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Response from a GOPRO_COMMAND get request - */ -public class msg_gopro_get_response extends MAVLinkMessage { +* Response from a GOPRO_COMMAND get request. +*/ +public class msg_gopro_get_response extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GOPRO_GET_RESPONSE = 217; public static final int MAVLINK_MSG_LENGTH = 6; private static final long serialVersionUID = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; + /** - * Command ID - */ + * Command ID. + */ public short cmd_id; - + /** - * Status - */ + * Status. + */ public short status; - + /** - * Value - */ + * Value. + */ public short value[] = new short[4]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gopro_get_response() { - msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gopro_get_response(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; - + packet.payload.putUnsignedByte(cmd_id); - + packet.payload.putUnsignedByte(status); - - + + for (int i = 0; i < value.length; i++) { packet.payload.putUnsignedByte(value[i]); } - - + + return packet; } /** - * Decode a gopro_get_response message into this class fields - * - * @param payload The message to decode - */ + * Decode a gopro_get_response message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.cmd_id = payload.getUnsignedByte(); - + this.status = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.value.length; i++) { this.value[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gopro_get_response(){ + msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gopro_get_response(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GOPRO_GET_RESPONSE; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GOPRO_GET_RESPONSE - sysid:" + sysid + " compid:" + compid + " cmd_id:" + cmd_id + " status:" + status + " value:" + value + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GOPRO_GET_RESPONSE - sysid:"+sysid+" compid:"+compid+" cmd_id:"+cmd_id+" status:"+status+" value:"+value+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_heartbeat.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_heartbeat.java index 8517e83..6b9650c 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_heartbeat.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_heartbeat.java @@ -6,96 +6,97 @@ // MESSAGE GOPRO_HEARTBEAT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Heartbeat from a HeroBus attached GoPro - */ -public class msg_gopro_heartbeat extends MAVLinkMessage { +* Heartbeat from a HeroBus attached GoPro. +*/ +public class msg_gopro_heartbeat extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GOPRO_HEARTBEAT = 215; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; + /** - * Status - */ + * Status. + */ public short status; - + /** - * Current capture mode - */ + * Current capture mode. + */ public short capture_mode; - + /** - * additional status bits - */ + * Additional status bits. + */ public short flags; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gopro_heartbeat() { - msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gopro_heartbeat(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; - + packet.payload.putUnsignedByte(status); - + packet.payload.putUnsignedByte(capture_mode); - + packet.payload.putUnsignedByte(flags); - + return packet; } /** - * Decode a gopro_heartbeat message into this class fields - * - * @param payload The message to decode - */ + * Decode a gopro_heartbeat message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.status = payload.getUnsignedByte(); - + this.capture_mode = payload.getUnsignedByte(); - + this.flags = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gopro_heartbeat(){ + msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gopro_heartbeat(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GOPRO_HEARTBEAT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GOPRO_HEARTBEAT - sysid:" + sysid + " compid:" + compid + " status:" + status + " capture_mode:" + capture_mode + " flags:" + flags + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GOPRO_HEARTBEAT - sysid:"+sysid+" compid:"+compid+" status:"+status+" capture_mode:"+capture_mode+" flags:"+flags+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_request.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_request.java index 7637826..9e4b281 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_request.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_request.java @@ -6,113 +6,114 @@ // MESSAGE GOPRO_SET_REQUEST PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request to set a GOPRO_COMMAND with a desired - */ -public class msg_gopro_set_request extends MAVLinkMessage { +* Request to set a GOPRO_COMMAND with a desired. +*/ +public class msg_gopro_set_request extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GOPRO_SET_REQUEST = 218; public static final int MAVLINK_MSG_LENGTH = 7; private static final long serialVersionUID = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Command ID - */ + * Command ID. + */ public short cmd_id; - + /** - * Value - */ + * Value. + */ public short value[] = new short[4]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gopro_set_request() { - msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gopro_set_request(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(cmd_id); - - + + for (int i = 0; i < value.length; i++) { packet.payload.putUnsignedByte(value[i]); } - - + + return packet; } /** - * Decode a gopro_set_request message into this class fields - * - * @param payload The message to decode - */ + * Decode a gopro_set_request message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.cmd_id = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.value.length; i++) { this.value[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gopro_set_request(){ + msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gopro_set_request(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GOPRO_SET_REQUEST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GOPRO_SET_REQUEST - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " cmd_id:" + cmd_id + " value:" + value + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GOPRO_SET_REQUEST - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" cmd_id:"+cmd_id+" value:"+value+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_response.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_response.java index 7325b50..0fb73e3 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_response.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_gopro_set_response.java @@ -6,87 +6,88 @@ // MESSAGE GOPRO_SET_RESPONSE PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Response from a GOPRO_COMMAND set request - */ -public class msg_gopro_set_response extends MAVLinkMessage { +* Response from a GOPRO_COMMAND set request. +*/ +public class msg_gopro_set_response extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_GOPRO_SET_RESPONSE = 219; public static final int MAVLINK_MSG_LENGTH = 2; private static final long serialVersionUID = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; + /** - * Command ID - */ + * Command ID. + */ public short cmd_id; - + /** - * Status - */ + * Status. + */ public short status; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_gopro_set_response() { - msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_gopro_set_response(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; - + packet.payload.putUnsignedByte(cmd_id); - + packet.payload.putUnsignedByte(status); - + return packet; } /** - * Decode a gopro_set_response message into this class fields - * - * @param payload The message to decode - */ + * Decode a gopro_set_response message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.cmd_id = payload.getUnsignedByte(); - + this.status = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_gopro_set_response(){ + msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_gopro_set_response(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_GOPRO_SET_RESPONSE; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_GOPRO_SET_RESPONSE - sysid:" + sysid + " compid:" + compid + " cmd_id:" + cmd_id + " status:" + status + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_GOPRO_SET_RESPONSE - sysid:"+sysid+" compid:"+compid+" cmd_id:"+cmd_id+" status:"+status+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_hwstatus.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_hwstatus.java index a8cb6de..b331c89 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_hwstatus.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_hwstatus.java @@ -6,87 +6,88 @@ // MESSAGE HWSTATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of key hardware - */ -public class msg_hwstatus extends MAVLinkMessage { +* Status of key hardware. +*/ +public class msg_hwstatus extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_HWSTATUS = 165; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_HWSTATUS; + /** - * board voltage (mV) - */ + * Board voltage. + */ public int Vcc; - + /** - * I2C error count - */ + * I2C error count. + */ public short I2Cerr; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_hwstatus() { - msgid = MAVLINK_MSG_ID_HWSTATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_hwstatus(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_HWSTATUS; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_HWSTATUS; - + packet.payload.putUnsignedShort(Vcc); - + packet.payload.putUnsignedByte(I2Cerr); - + return packet; } /** - * Decode a hwstatus message into this class fields - * - * @param payload The message to decode - */ + * Decode a hwstatus message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.Vcc = payload.getUnsignedShort(); - + this.I2Cerr = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_hwstatus(){ + msgid = MAVLINK_MSG_ID_HWSTATUS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_hwstatus(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_HWSTATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_HWSTATUS - sysid:" + sysid + " compid:" + compid + " Vcc:" + Vcc + " I2Cerr:" + I2Cerr + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_HWSTATUS - sysid:"+sysid+" compid:"+compid+" Vcc:"+Vcc+" I2Cerr:"+I2Cerr+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_led_control.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_led_control.java index d5ddfed..8bcb732 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_led_control.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_led_control.java @@ -6,131 +6,132 @@ // MESSAGE LED_CONTROL PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Control vehicle LEDs - */ -public class msg_led_control extends MAVLinkMessage { +* Control vehicle LEDs. +*/ +public class msg_led_control extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_LED_CONTROL = 186; public static final int MAVLINK_MSG_LENGTH = 29; private static final long serialVersionUID = MAVLINK_MSG_ID_LED_CONTROL; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Instance (LED instance to control or 255 for all LEDs) - */ + * Instance (LED instance to control or 255 for all LEDs). + */ public short instance; - + /** - * Pattern (see LED_PATTERN_ENUM) - */ + * Pattern (see LED_PATTERN_ENUM). + */ public short pattern; - + /** - * Custom Byte Length - */ + * Custom Byte Length. + */ public short custom_len; - + /** - * Custom Bytes - */ + * Custom Bytes. + */ public short custom_bytes[] = new short[24]; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_led_control() { - msgid = MAVLINK_MSG_ID_LED_CONTROL; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_led_control(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_LED_CONTROL; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_LED_CONTROL; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(instance); - + packet.payload.putUnsignedByte(pattern); - + packet.payload.putUnsignedByte(custom_len); - - + + for (int i = 0; i < custom_bytes.length; i++) { packet.payload.putUnsignedByte(custom_bytes[i]); } - - + + return packet; } /** - * Decode a led_control message into this class fields - * - * @param payload The message to decode - */ + * Decode a led_control message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.instance = payload.getUnsignedByte(); - + this.pattern = payload.getUnsignedByte(); - + this.custom_len = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.custom_bytes.length; i++) { this.custom_bytes[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_led_control(){ + msgid = MAVLINK_MSG_ID_LED_CONTROL; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_led_control(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_LED_CONTROL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_LED_CONTROL - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " instance:" + instance + " pattern:" + pattern + " custom_len:" + custom_len + " custom_bytes:" + custom_bytes + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_LED_CONTROL - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" instance:"+instance+" pattern:"+pattern+" custom_len:"+custom_len+" custom_bytes:"+custom_bytes+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_limits_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_limits_status.java index 3ad548b..3735204 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_limits_status.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_limits_status.java @@ -6,150 +6,151 @@ // MESSAGE LIMITS_STATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of AP_Limits. Sent in extended status stream when AP_Limits is enabled - */ -public class msg_limits_status extends MAVLinkMessage { +* Status of AP_Limits. Sent in extended status stream when AP_Limits is enabled. +*/ +public class msg_limits_status extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_LIMITS_STATUS = 167; public static final int MAVLINK_MSG_LENGTH = 22; private static final long serialVersionUID = MAVLINK_MSG_ID_LIMITS_STATUS; + /** - * time of last breach in milliseconds since boot - */ + * Time (since boot) of last breach. + */ public long last_trigger; - + /** - * time of last recovery action in milliseconds since boot - */ + * Time (since boot) of last recovery action. + */ public long last_action; - + /** - * time of last successful recovery in milliseconds since boot - */ + * Time (since boot) of last successful recovery. + */ public long last_recovery; - + /** - * time of last all-clear in milliseconds since boot - */ + * Time (since boot) of last all-clear. + */ public long last_clear; - + /** - * number of fence breaches - */ + * Number of fence breaches. + */ public int breach_count; - + /** - * state of AP_Limits, (see enum LimitState, LIMITS_STATE) - */ + * State of AP_Limits. + */ public short limits_state; - + /** - * AP_Limit_Module bitfield of enabled modules, (see enum moduleid or LIMIT_MODULE) - */ + * AP_Limit_Module bitfield of enabled modules. + */ public short mods_enabled; - + /** - * AP_Limit_Module bitfield of required modules, (see enum moduleid or LIMIT_MODULE) - */ + * AP_Limit_Module bitfield of required modules. + */ public short mods_required; - + /** - * AP_Limit_Module bitfield of triggered modules, (see enum moduleid or LIMIT_MODULE) - */ + * AP_Limit_Module bitfield of triggered modules. + */ public short mods_triggered; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_limits_status() { - msgid = MAVLINK_MSG_ID_LIMITS_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_limits_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_LIMITS_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_LIMITS_STATUS; - + packet.payload.putUnsignedInt(last_trigger); - + packet.payload.putUnsignedInt(last_action); - + packet.payload.putUnsignedInt(last_recovery); - + packet.payload.putUnsignedInt(last_clear); - + packet.payload.putUnsignedShort(breach_count); - + packet.payload.putUnsignedByte(limits_state); - + packet.payload.putUnsignedByte(mods_enabled); - + packet.payload.putUnsignedByte(mods_required); - + packet.payload.putUnsignedByte(mods_triggered); - + return packet; } /** - * Decode a limits_status message into this class fields - * - * @param payload The message to decode - */ + * Decode a limits_status message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.last_trigger = payload.getUnsignedInt(); - + this.last_action = payload.getUnsignedInt(); - + this.last_recovery = payload.getUnsignedInt(); - + this.last_clear = payload.getUnsignedInt(); - + this.breach_count = payload.getUnsignedShort(); - + this.limits_state = payload.getUnsignedByte(); - + this.mods_enabled = payload.getUnsignedByte(); - + this.mods_required = payload.getUnsignedByte(); - + this.mods_triggered = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_limits_status(){ + msgid = MAVLINK_MSG_ID_LIMITS_STATUS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_limits_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_LIMITS_STATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_LIMITS_STATUS - sysid:" + sysid + " compid:" + compid + " last_trigger:" + last_trigger + " last_action:" + last_action + " last_recovery:" + last_recovery + " last_clear:" + last_clear + " breach_count:" + breach_count + " limits_state:" + limits_state + " mods_enabled:" + mods_enabled + " mods_required:" + mods_required + " mods_triggered:" + mods_triggered + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_LIMITS_STATUS - sysid:"+sysid+" compid:"+compid+" last_trigger:"+last_trigger+" last_action:"+last_action+" last_recovery:"+last_recovery+" last_clear:"+last_clear+" breach_count:"+breach_count+" limits_state:"+limits_state+" mods_enabled:"+mods_enabled+" mods_required:"+mods_required+" mods_triggered:"+mods_triggered+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_progress.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_progress.java index 9cfaa51..34444ab 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_progress.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_progress.java @@ -6,158 +6,159 @@ // MESSAGE MAG_CAL_PROGRESS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Reports progress of compass calibration. - */ -public class msg_mag_cal_progress extends MAVLinkMessage { +* Reports progress of compass calibration. +*/ +public class msg_mag_cal_progress extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MAG_CAL_PROGRESS = 191; public static final int MAVLINK_MSG_LENGTH = 27; private static final long serialVersionUID = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; + /** - * Body frame direction vector for display - */ + * Body frame direction vector for display. + */ public float direction_x; - + /** - * Body frame direction vector for display - */ + * Body frame direction vector for display. + */ public float direction_y; - + /** - * Body frame direction vector for display - */ + * Body frame direction vector for display. + */ public float direction_z; - + /** - * Compass being calibrated - */ + * Compass being calibrated. + */ public short compass_id; - + /** - * Bitmask of compasses being calibrated - */ + * Bitmask of compasses being calibrated. + */ public short cal_mask; - + /** - * Status (see MAG_CAL_STATUS enum) - */ + * Calibration Status. + */ public short cal_status; - + /** - * Attempt number - */ + * Attempt number. + */ public short attempt; - + /** - * Completion percentage - */ + * Completion percentage. + */ public short completion_pct; - + /** - * Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid) - */ + * Bitmask of sphere sections (see http://en.wikipedia.org/wiki/Geodesic_grid). + */ public short completion_mask[] = new short[10]; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mag_cal_progress() { - msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mag_cal_progress(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; - + packet.payload.putFloat(direction_x); - + packet.payload.putFloat(direction_y); - + packet.payload.putFloat(direction_z); - + packet.payload.putUnsignedByte(compass_id); - + packet.payload.putUnsignedByte(cal_mask); - + packet.payload.putUnsignedByte(cal_status); - + packet.payload.putUnsignedByte(attempt); - + packet.payload.putUnsignedByte(completion_pct); - - + + for (int i = 0; i < completion_mask.length; i++) { packet.payload.putUnsignedByte(completion_mask[i]); } - - + + return packet; } /** - * Decode a mag_cal_progress message into this class fields - * - * @param payload The message to decode - */ + * Decode a mag_cal_progress message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.direction_x = payload.getFloat(); - + this.direction_y = payload.getFloat(); - + this.direction_z = payload.getFloat(); - + this.compass_id = payload.getUnsignedByte(); - + this.cal_mask = payload.getUnsignedByte(); - + this.cal_status = payload.getUnsignedByte(); - + this.attempt = payload.getUnsignedByte(); - + this.completion_pct = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.completion_mask.length; i++) { this.completion_mask[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mag_cal_progress(){ + msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mag_cal_progress(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MAG_CAL_PROGRESS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MAG_CAL_PROGRESS - sysid:" + sysid + " compid:" + compid + " direction_x:" + direction_x + " direction_y:" + direction_y + " direction_z:" + direction_z + " compass_id:" + compass_id + " cal_mask:" + cal_mask + " cal_status:" + cal_status + " attempt:" + attempt + " completion_pct:" + completion_pct + " completion_mask:" + completion_mask + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MAG_CAL_PROGRESS - sysid:"+sysid+" compid:"+compid+" direction_x:"+direction_x+" direction_y:"+direction_y+" direction_z:"+direction_z+" compass_id:"+compass_id+" cal_mask:"+cal_mask+" cal_status:"+cal_status+" attempt:"+attempt+" completion_pct:"+completion_pct+" completion_mask:"+completion_mask+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_report.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_report.java index 95d5e01..e840047 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_report.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mag_cal_report.java @@ -6,195 +6,232 @@ // MESSAGE MAG_CAL_REPORT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Reports results of completed compass calibration. Sent until MAG_CAL_ACK received. - */ -public class msg_mag_cal_report extends MAVLinkMessage { +* Reports results of completed compass calibration. Sent until MAG_CAL_ACK received. +*/ +public class msg_mag_cal_report extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MAG_CAL_REPORT = 192; - public static final int MAVLINK_MSG_LENGTH = 44; + public static final int MAVLINK_MSG_LENGTH = 54; private static final long serialVersionUID = MAVLINK_MSG_ID_MAG_CAL_REPORT; + /** - * RMS milligauss residuals - */ + * RMS milligauss residuals. + */ public float fitness; - + /** - * X offset - */ + * X offset. + */ public float ofs_x; - + /** - * Y offset - */ + * Y offset. + */ public float ofs_y; - + /** - * Z offset - */ + * Z offset. + */ public float ofs_z; - + /** - * X diagonal (matrix 11) - */ + * X diagonal (matrix 11). + */ public float diag_x; - + /** - * Y diagonal (matrix 22) - */ + * Y diagonal (matrix 22). + */ public float diag_y; - + /** - * Z diagonal (matrix 33) - */ + * Z diagonal (matrix 33). + */ public float diag_z; - + /** - * X off-diagonal (matrix 12 and 21) - */ + * X off-diagonal (matrix 12 and 21). + */ public float offdiag_x; - + /** - * Y off-diagonal (matrix 13 and 31) - */ + * Y off-diagonal (matrix 13 and 31). + */ public float offdiag_y; - + /** - * Z off-diagonal (matrix 32 and 23) - */ + * Z off-diagonal (matrix 32 and 23). + */ public float offdiag_z; - + /** - * Compass being calibrated - */ + * Compass being calibrated. + */ public short compass_id; - + /** - * Bitmask of compasses being calibrated - */ + * Bitmask of compasses being calibrated. + */ public short cal_mask; - + /** - * Status (see MAG_CAL_STATUS enum) - */ + * Calibration Status. + */ public short cal_status; - + /** - * 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters - */ + * 0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters. + */ public short autosaved; - - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mag_cal_report() { - msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT; - } - + * Confidence in orientation (higher is better). + */ + public float orientation_confidence; + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mag_cal_report(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT; - unpack(mavLinkPacket.payload); - } + * orientation before calibration. + */ + public short old_orientation; + + /** + * orientation after calibration. + */ + public short new_orientation; + + /** + * field radius correction factor + */ + public float scale_factor; + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT; - + packet.payload.putFloat(fitness); - + packet.payload.putFloat(ofs_x); - + packet.payload.putFloat(ofs_y); - + packet.payload.putFloat(ofs_z); - + packet.payload.putFloat(diag_x); - + packet.payload.putFloat(diag_y); - + packet.payload.putFloat(diag_z); - + packet.payload.putFloat(offdiag_x); - + packet.payload.putFloat(offdiag_y); - + packet.payload.putFloat(offdiag_z); - + packet.payload.putUnsignedByte(compass_id); - + packet.payload.putUnsignedByte(cal_mask); - + packet.payload.putUnsignedByte(cal_status); - + packet.payload.putUnsignedByte(autosaved); - + + packet.payload.putFloat(orientation_confidence); + + packet.payload.putUnsignedByte(old_orientation); + + packet.payload.putUnsignedByte(new_orientation); + + packet.payload.putFloat(scale_factor); + return packet; } /** - * Decode a mag_cal_report message into this class fields - * - * @param payload The message to decode - */ + * Decode a mag_cal_report message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.fitness = payload.getFloat(); - + this.ofs_x = payload.getFloat(); - + this.ofs_y = payload.getFloat(); - + this.ofs_z = payload.getFloat(); - + this.diag_x = payload.getFloat(); - + this.diag_y = payload.getFloat(); - + this.diag_z = payload.getFloat(); - + this.offdiag_x = payload.getFloat(); - + this.offdiag_y = payload.getFloat(); - + this.offdiag_z = payload.getFloat(); - + this.compass_id = payload.getUnsignedByte(); - + this.cal_mask = payload.getUnsignedByte(); - + this.cal_status = payload.getUnsignedByte(); - + this.autosaved = payload.getUnsignedByte(); + + this.orientation_confidence = payload.getFloat(); + + this.old_orientation = payload.getUnsignedByte(); + + this.new_orientation = payload.getUnsignedByte(); + + this.scale_factor = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mag_cal_report(){ + msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mag_cal_report(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MAG_CAL_REPORT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MAG_CAL_REPORT - sysid:" + sysid + " compid:" + compid + " fitness:" + fitness + " ofs_x:" + ofs_x + " ofs_y:" + ofs_y + " ofs_z:" + ofs_z + " diag_x:" + diag_x + " diag_y:" + diag_y + " diag_z:" + diag_z + " offdiag_x:" + offdiag_x + " offdiag_y:" + offdiag_y + " offdiag_z:" + offdiag_z + " compass_id:" + compass_id + " cal_mask:" + cal_mask + " cal_status:" + cal_status + " autosaved:" + autosaved + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MAG_CAL_REPORT - sysid:"+sysid+" compid:"+compid+" fitness:"+fitness+" ofs_x:"+ofs_x+" ofs_y:"+ofs_y+" ofs_z:"+ofs_z+" diag_x:"+diag_x+" diag_y:"+diag_y+" diag_z:"+diag_z+" offdiag_x:"+offdiag_x+" offdiag_y:"+offdiag_y+" offdiag_z:"+offdiag_z+" compass_id:"+compass_id+" cal_mask:"+cal_mask+" cal_status:"+cal_status+" autosaved:"+autosaved+" orientation_confidence:"+orientation_confidence+" old_orientation:"+old_orientation+" new_orientation:"+new_orientation+" scale_factor:"+scale_factor+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_meminfo.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_meminfo.java index 0c62fb9..ff641d4 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_meminfo.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_meminfo.java @@ -6,96 +6,97 @@ // MESSAGE MEMINFO PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * state of APM memory - */ -public class msg_meminfo extends MAVLinkMessage { +* State of APM memory. +*/ +public class msg_meminfo extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MEMINFO = 152; public static final int MAVLINK_MSG_LENGTH = 8; private static final long serialVersionUID = MAVLINK_MSG_ID_MEMINFO; + /** - * heap top - */ + * Heap top. + */ public int brkval; - + /** - * free memory - */ + * Free memory. + */ public int freemem; - + /** - * free memory (32 bit) - */ + * Free memory (32 bit). + */ public long freemem32; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_meminfo() { - msgid = MAVLINK_MSG_ID_MEMINFO; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_meminfo(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MEMINFO; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MEMINFO; - + packet.payload.putUnsignedShort(brkval); - + packet.payload.putUnsignedShort(freemem); - + packet.payload.putUnsignedInt(freemem32); - + return packet; } /** - * Decode a meminfo message into this class fields - * - * @param payload The message to decode - */ + * Decode a meminfo message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.brkval = payload.getUnsignedShort(); - + this.freemem = payload.getUnsignedShort(); - + this.freemem32 = payload.getUnsignedInt(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_meminfo(){ + msgid = MAVLINK_MSG_ID_MEMINFO; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_meminfo(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MEMINFO; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MEMINFO - sysid:" + sysid + " compid:" + compid + " brkval:" + brkval + " freemem:" + freemem + " freemem32:" + freemem32 + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MEMINFO - sysid:"+sysid+" compid:"+compid+" brkval:"+brkval+" freemem:"+freemem+" freemem32:"+freemem32+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_configure.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_configure.java index bceb453..a25a9ab 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_configure.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_configure.java @@ -6,123 +6,124 @@ // MESSAGE MOUNT_CONFIGURE PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Message to configure a camera mount, directional antenna, etc. - */ -public class msg_mount_configure extends MAVLinkMessage { +* Message to configure a camera mount, directional antenna, etc. +*/ +public class msg_mount_configure extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MOUNT_CONFIGURE = 156; public static final int MAVLINK_MSG_LENGTH = 6; private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * mount operating mode (see MAV_MOUNT_MODE enum) - */ + * Mount operating mode. + */ public short mount_mode; - + /** - * (1 = yes, 0 = no) - */ + * (1 = yes, 0 = no). + */ public short stab_roll; - + /** - * (1 = yes, 0 = no) - */ + * (1 = yes, 0 = no). + */ public short stab_pitch; - + /** - * (1 = yes, 0 = no) - */ + * (1 = yes, 0 = no). + */ public short stab_yaw; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mount_configure() { - msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mount_configure(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mount_mode); - + packet.payload.putUnsignedByte(stab_roll); - + packet.payload.putUnsignedByte(stab_pitch); - + packet.payload.putUnsignedByte(stab_yaw); - + return packet; } /** - * Decode a mount_configure message into this class fields - * - * @param payload The message to decode - */ + * Decode a mount_configure message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mount_mode = payload.getUnsignedByte(); - + this.stab_roll = payload.getUnsignedByte(); - + this.stab_pitch = payload.getUnsignedByte(); - + this.stab_yaw = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_configure(){ + msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_configure(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MOUNT_CONFIGURE - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " mount_mode:" + mount_mode + " stab_roll:" + stab_roll + " stab_pitch:" + stab_pitch + " stab_yaw:" + stab_yaw + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_CONFIGURE - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" mount_mode:"+mount_mode+" stab_roll:"+stab_roll+" stab_pitch:"+stab_pitch+" stab_yaw:"+stab_yaw+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_control.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_control.java index f902cfd..fb41f38 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_control.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_control.java @@ -6,123 +6,124 @@ // MESSAGE MOUNT_CONTROL PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Message to control a camera mount, directional antenna, etc. - */ -public class msg_mount_control extends MAVLinkMessage { +* Message to control a camera mount, directional antenna, etc. +*/ +public class msg_mount_control extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MOUNT_CONTROL = 157; public static final int MAVLINK_MSG_LENGTH = 15; private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_CONTROL; + /** - * pitch(deg*100) or lat, depending on mount mode - */ + * Pitch (centi-degrees) or lat (degE7), depending on mount mode. + */ public int input_a; - + /** - * roll(deg*100) or lon depending on mount mode - */ + * Roll (centi-degrees) or lon (degE7) depending on mount mode. + */ public int input_b; - + /** - * yaw(deg*100) or alt (in cm) depending on mount mode - */ + * Yaw (centi-degrees) or alt (cm) depending on mount mode. + */ public int input_c; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) - */ + * If "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING). + */ public short save_position; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mount_control() { - msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mount_control(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; - + packet.payload.putInt(input_a); - + packet.payload.putInt(input_b); - + packet.payload.putInt(input_c); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(save_position); - + return packet; } /** - * Decode a mount_control message into this class fields - * - * @param payload The message to decode - */ + * Decode a mount_control message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.input_a = payload.getInt(); - + this.input_b = payload.getInt(); - + this.input_c = payload.getInt(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.save_position = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_control(){ + msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_control(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MOUNT_CONTROL - sysid:" + sysid + " compid:" + compid + " input_a:" + input_a + " input_b:" + input_b + " input_c:" + input_c + " target_system:" + target_system + " target_component:" + target_component + " save_position:" + save_position + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_CONTROL - sysid:"+sysid+" compid:"+compid+" input_a:"+input_a+" input_b:"+input_b+" input_c:"+input_c+" target_system:"+target_system+" target_component:"+target_component+" save_position:"+save_position+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_status.java index 51e6a20..fbfc9af 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_status.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_mount_status.java @@ -6,114 +6,115 @@ // MESSAGE MOUNT_STATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Message with some status from APM to GCS about camera or antenna mount - */ -public class msg_mount_status extends MAVLinkMessage { +* Message with some status from APM to GCS about camera or antenna mount. +*/ +public class msg_mount_status extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MOUNT_STATUS = 158; public static final int MAVLINK_MSG_LENGTH = 14; private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_STATUS; + /** - * pitch(deg*100) - */ + * Pitch. + */ public int pointing_a; - + /** - * roll(deg*100) - */ + * Roll. + */ public int pointing_b; - + /** - * yaw(deg*100) - */ + * Yaw. + */ public int pointing_c; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mount_status() { - msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mount_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MOUNT_STATUS; - + packet.payload.putInt(pointing_a); - + packet.payload.putInt(pointing_b); - + packet.payload.putInt(pointing_c); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a mount_status message into this class fields - * - * @param payload The message to decode - */ + * Decode a mount_status message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.pointing_a = payload.getInt(); - + this.pointing_b = payload.getInt(); - + this.pointing_c = payload.getInt(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_status(){ + msgid = MAVLINK_MSG_ID_MOUNT_STATUS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_STATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MOUNT_STATUS - sysid:" + sysid + " compid:" + compid + " pointing_a:" + pointing_a + " pointing_b:" + pointing_b + " pointing_c:" + pointing_c + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_STATUS - sysid:"+sysid+" compid:"+compid+" pointing_a:"+pointing_a+" pointing_b:"+pointing_b+" pointing_c:"+pointing_c+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_pid_tuning.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_pid_tuning.java index 5681e74..c6d4f52 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_pid_tuning.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_pid_tuning.java @@ -6,132 +6,133 @@ // MESSAGE PID_TUNING PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * PID tuning information - */ -public class msg_pid_tuning extends MAVLinkMessage { +* PID tuning information. +*/ +public class msg_pid_tuning extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_PID_TUNING = 194; public static final int MAVLINK_MSG_LENGTH = 25; private static final long serialVersionUID = MAVLINK_MSG_ID_PID_TUNING; + /** - * desired rate (degrees/s) - */ + * Desired rate. + */ public float desired; - + /** - * achieved rate (degrees/s) - */ + * Achieved rate. + */ public float achieved; - + /** - * FF component - */ + * FF component. + */ public float FF; - + /** - * P component - */ + * P component. + */ public float P; - + /** - * I component - */ + * I component. + */ public float I; - + /** - * D component - */ + * D component. + */ public float D; - + /** - * axis - */ + * Axis. + */ public short axis; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_pid_tuning() { - msgid = MAVLINK_MSG_ID_PID_TUNING; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_pid_tuning(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_PID_TUNING; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_PID_TUNING; - + packet.payload.putFloat(desired); - + packet.payload.putFloat(achieved); - + packet.payload.putFloat(FF); - + packet.payload.putFloat(P); - + packet.payload.putFloat(I); - + packet.payload.putFloat(D); - + packet.payload.putUnsignedByte(axis); - + return packet; } /** - * Decode a pid_tuning message into this class fields - * - * @param payload The message to decode - */ + * Decode a pid_tuning message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.desired = payload.getFloat(); - + this.achieved = payload.getFloat(); - + this.FF = payload.getFloat(); - + this.P = payload.getFloat(); - + this.I = payload.getFloat(); - + this.D = payload.getFloat(); - + this.axis = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_pid_tuning(){ + msgid = MAVLINK_MSG_ID_PID_TUNING; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_pid_tuning(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_PID_TUNING; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_PID_TUNING - sysid:" + sysid + " compid:" + compid + " desired:" + desired + " achieved:" + achieved + " FF:" + FF + " P:" + P + " I:" + I + " D:" + D + " axis:" + axis + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_PID_TUNING - sysid:"+sysid+" compid:"+compid+" desired:"+desired+" achieved:"+achieved+" FF:"+FF+" P:"+P+" I:"+I+" D:"+D+" axis:"+axis+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_radio.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_radio.java index 781e30c..d9cba65 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_radio.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_radio.java @@ -6,132 +6,133 @@ // MESSAGE RADIO PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status generated by radio - */ -public class msg_radio extends MAVLinkMessage { +* Status generated by radio. +*/ +public class msg_radio extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_RADIO = 166; public static final int MAVLINK_MSG_LENGTH = 9; private static final long serialVersionUID = MAVLINK_MSG_ID_RADIO; + /** - * receive errors - */ + * Receive errors. + */ public int rxerrors; - + /** - * count of error corrected packets - */ + * Count of error corrected packets. + */ public int fixed; - + /** - * local signal strength - */ + * Local signal strength. + */ public short rssi; - + /** - * remote signal strength - */ + * Remote signal strength. + */ public short remrssi; - + /** - * how full the tx buffer is as a percentage - */ + * How full the tx buffer is. + */ public short txbuf; - + /** - * background noise level - */ + * Background noise level. + */ public short noise; - + /** - * remote background noise level - */ + * Remote background noise level. + */ public short remnoise; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_radio() { - msgid = MAVLINK_MSG_ID_RADIO; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_radio(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RADIO; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_RADIO; - + packet.payload.putUnsignedShort(rxerrors); - + packet.payload.putUnsignedShort(fixed); - + packet.payload.putUnsignedByte(rssi); - + packet.payload.putUnsignedByte(remrssi); - + packet.payload.putUnsignedByte(txbuf); - + packet.payload.putUnsignedByte(noise); - + packet.payload.putUnsignedByte(remnoise); - + return packet; } /** - * Decode a radio message into this class fields - * - * @param payload The message to decode - */ + * Decode a radio message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.rxerrors = payload.getUnsignedShort(); - + this.fixed = payload.getUnsignedShort(); - + this.rssi = payload.getUnsignedByte(); - + this.remrssi = payload.getUnsignedByte(); - + this.txbuf = payload.getUnsignedByte(); - + this.noise = payload.getUnsignedByte(); - + this.remnoise = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_radio(){ + msgid = MAVLINK_MSG_ID_RADIO; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_radio(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RADIO; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_RADIO - sysid:" + sysid + " compid:" + compid + " rxerrors:" + rxerrors + " fixed:" + fixed + " rssi:" + rssi + " remrssi:" + remrssi + " txbuf:" + txbuf + " noise:" + noise + " remnoise:" + remnoise + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RADIO - sysid:"+sysid+" compid:"+compid+" rxerrors:"+rxerrors+" fixed:"+fixed+" rssi:"+rssi+" remrssi:"+remrssi+" txbuf:"+txbuf+" noise:"+noise+" remnoise:"+remnoise+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java index 26bd44f..5a00562 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_fetch_point.java @@ -6,96 +6,97 @@ // MESSAGE RALLY_FETCH_POINT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid. - */ -public class msg_rally_fetch_point extends MAVLinkMessage { +* Request a current rally point from MAV. MAV should respond with a RALLY_POINT message. MAV should not respond if the request is invalid. +*/ +public class msg_rally_fetch_point extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_RALLY_FETCH_POINT = 176; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * point index (first point is 0) - */ + * Point index (first point is 0). + */ public short idx; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rally_fetch_point() { - msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_rally_fetch_point(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(idx); - + return packet; } /** - * Decode a rally_fetch_point message into this class fields - * - * @param payload The message to decode - */ + * Decode a rally_fetch_point message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.idx = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rally_fetch_point(){ + msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rally_fetch_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RALLY_FETCH_POINT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_RALLY_FETCH_POINT - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " idx:" + idx + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RALLY_FETCH_POINT - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_point.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_point.java index aa8be6b..3611b6c 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_point.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rally_point.java @@ -6,159 +6,160 @@ // MESSAGE RALLY_POINT PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * A rally point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS - */ -public class msg_rally_point extends MAVLinkMessage { +* A rally point. Used to set a point when from GCS -> MAV. Also used to return a point from MAV -> GCS. +*/ +public class msg_rally_point extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_RALLY_POINT = 175; public static final int MAVLINK_MSG_LENGTH = 19; private static final long serialVersionUID = MAVLINK_MSG_ID_RALLY_POINT; + /** - * Latitude of point in degrees * 1E7 - */ + * Latitude of point. + */ public int lat; - + /** - * Longitude of point in degrees * 1E7 - */ + * Longitude of point. + */ public int lng; - + /** - * Transit / loiter altitude in meters relative to home - */ + * Transit / loiter altitude relative to home. + */ public short alt; - + /** - * Break altitude in meters relative to home - */ + * Break altitude relative to home. + */ public short break_alt; - + /** - * Heading to aim for when landing. In centi-degrees. - */ + * Heading to aim for when landing. + */ public int land_dir; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * point index (first point is 0) - */ + * Point index (first point is 0). + */ public short idx; - + /** - * total number of points (for sanity checking) - */ + * Total number of points (for sanity checking). + */ public short count; - + /** - * See RALLY_FLAGS enum for definition of the bitmask. - */ + * Configuration flags. + */ public short flags; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rally_point() { - msgid = MAVLINK_MSG_ID_RALLY_POINT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_rally_point(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RALLY_POINT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_RALLY_POINT; - + packet.payload.putInt(lat); - + packet.payload.putInt(lng); - + packet.payload.putShort(alt); - + packet.payload.putShort(break_alt); - + packet.payload.putUnsignedShort(land_dir); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(idx); - + packet.payload.putUnsignedByte(count); - + packet.payload.putUnsignedByte(flags); - + return packet; } /** - * Decode a rally_point message into this class fields - * - * @param payload The message to decode - */ + * Decode a rally_point message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.lat = payload.getInt(); - + this.lng = payload.getInt(); - + this.alt = payload.getShort(); - + this.break_alt = payload.getShort(); - + this.land_dir = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.idx = payload.getUnsignedByte(); - + this.count = payload.getUnsignedByte(); - + this.flags = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rally_point(){ + msgid = MAVLINK_MSG_ID_RALLY_POINT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rally_point(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RALLY_POINT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_RALLY_POINT - sysid:" + sysid + " compid:" + compid + " lat:" + lat + " lng:" + lng + " alt:" + alt + " break_alt:" + break_alt + " land_dir:" + land_dir + " target_system:" + target_system + " target_component:" + target_component + " idx:" + idx + " count:" + count + " flags:" + flags + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RALLY_POINT - sysid:"+sysid+" compid:"+compid+" lat:"+lat+" lng:"+lng+" alt:"+alt+" break_alt:"+break_alt+" land_dir:"+land_dir+" target_system:"+target_system+" target_component:"+target_component+" idx:"+idx+" count:"+count+" flags:"+flags+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rangefinder.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rangefinder.java index 9ddfc09..d6d061c 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rangefinder.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rangefinder.java @@ -6,87 +6,88 @@ // MESSAGE RANGEFINDER PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Rangefinder reporting - */ -public class msg_rangefinder extends MAVLinkMessage { +* Rangefinder reporting. +*/ +public class msg_rangefinder extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_RANGEFINDER = 173; public static final int MAVLINK_MSG_LENGTH = 8; private static final long serialVersionUID = MAVLINK_MSG_ID_RANGEFINDER; + /** - * distance in meters - */ + * Distance. + */ public float distance; - + /** - * raw voltage if available, zero otherwise - */ + * Raw voltage if available, zero otherwise. + */ public float voltage; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rangefinder() { - msgid = MAVLINK_MSG_ID_RANGEFINDER; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_rangefinder(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RANGEFINDER; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_RANGEFINDER; - + packet.payload.putFloat(distance); - + packet.payload.putFloat(voltage); - + return packet; } /** - * Decode a rangefinder message into this class fields - * - * @param payload The message to decode - */ + * Decode a rangefinder message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.distance = payload.getFloat(); - + this.voltage = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rangefinder(){ + msgid = MAVLINK_MSG_ID_RANGEFINDER; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rangefinder(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RANGEFINDER; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_RANGEFINDER - sysid:" + sysid + " compid:" + compid + " distance:" + distance + " voltage:" + voltage + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RANGEFINDER - sysid:"+sysid+" compid:"+compid+" distance:"+distance+" voltage:"+voltage+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_block_status.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_block_status.java index b8fa2ae..169f2d1 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_block_status.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_block_status.java @@ -6,105 +6,106 @@ // MESSAGE REMOTE_LOG_BLOCK_STATUS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Send Status of each log block that autopilot board might have sent - */ -public class msg_remote_log_block_status extends MAVLinkMessage { +* Send Status of each log block that autopilot board might have sent. +*/ +public class msg_remote_log_block_status extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS = 185; public static final int MAVLINK_MSG_LENGTH = 7; private static final long serialVersionUID = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; + /** - * log data block sequence number - */ + * Log data block sequence number. + */ public long seqno; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * log data block status - */ + * Log data block status. + */ public short status; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_remote_log_block_status() { - msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_remote_log_block_status(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; - + packet.payload.putUnsignedInt(seqno); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(status); - + return packet; } /** - * Decode a remote_log_block_status message into this class fields - * - * @param payload The message to decode - */ + * Decode a remote_log_block_status message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seqno = payload.getUnsignedInt(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.status = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_remote_log_block_status(){ + msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_remote_log_block_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS - sysid:" + sysid + " compid:" + compid + " seqno:" + seqno + " target_system:" + target_system + " target_component:" + target_component + " status:" + status + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS - sysid:"+sysid+" compid:"+compid+" seqno:"+seqno+" target_system:"+target_system+" target_component:"+target_component+" status:"+status+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_data_block.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_data_block.java index 657e577..1b38347 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_data_block.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_remote_log_data_block.java @@ -6,113 +6,114 @@ // MESSAGE REMOTE_LOG_DATA_BLOCK PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Send a block of log data to remote location - */ -public class msg_remote_log_data_block extends MAVLinkMessage { +* Send a block of log data to remote location. +*/ +public class msg_remote_log_data_block extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK = 184; public static final int MAVLINK_MSG_LENGTH = 206; private static final long serialVersionUID = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; + /** - * log data block sequence number - */ + * Log data block sequence number. + */ public long seqno; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * log data block - */ + * Log data block. + */ public short data[] = new short[200]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_remote_log_data_block() { - msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_remote_log_data_block(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; - + packet.payload.putUnsignedInt(seqno); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - - + + for (int i = 0; i < data.length; i++) { packet.payload.putUnsignedByte(data[i]); } - - + + return packet; } /** - * Decode a remote_log_data_block message into this class fields - * - * @param payload The message to decode - */ + * Decode a remote_log_data_block message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seqno = payload.getUnsignedInt(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.data.length; i++) { this.data[i] = payload.getUnsignedByte(); } + + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_remote_log_data_block(){ + msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_remote_log_data_block(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK - sysid:" + sysid + " compid:" + compid + " seqno:" + seqno + " target_system:" + target_system + " target_component:" + target_component + " data:" + data + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK - sysid:"+sysid+" compid:"+compid+" seqno:"+seqno+" target_system:"+target_system+" target_component:"+target_component+" data:"+data+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rpm.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rpm.java index 2251463..c6e5259 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_rpm.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_rpm.java @@ -6,87 +6,88 @@ // MESSAGE RPM PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * RPM sensor output - */ -public class msg_rpm extends MAVLinkMessage { +* RPM sensor output. +*/ +public class msg_rpm extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_RPM = 226; public static final int MAVLINK_MSG_LENGTH = 8; private static final long serialVersionUID = MAVLINK_MSG_ID_RPM; + /** - * RPM Sensor1 - */ + * RPM Sensor1. + */ public float rpm1; - + /** - * RPM Sensor2 - */ + * RPM Sensor2. + */ public float rpm2; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_rpm() { - msgid = MAVLINK_MSG_ID_RPM; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_rpm(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_RPM; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_RPM; - + packet.payload.putFloat(rpm1); - + packet.payload.putFloat(rpm2); - + return packet; } /** - * Decode a rpm message into this class fields - * - * @param payload The message to decode - */ + * Decode a rpm message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.rpm1 = payload.getFloat(); - + this.rpm2 = payload.getFloat(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_rpm(){ + msgid = MAVLINK_MSG_ID_RPM; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_rpm(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_RPM; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_RPM - sysid:" + sysid + " compid:" + compid + " rpm1:" + rpm1 + " rpm2:" + rpm2 + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_RPM - sysid:"+sysid+" compid:"+compid+" rpm1:"+rpm1+" rpm2:"+rpm2+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_sensor_offsets.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_sensor_offsets.java index efd7e0d..065e64a 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_sensor_offsets.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_sensor_offsets.java @@ -6,177 +6,178 @@ // MESSAGE SENSOR_OFFSETS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Offsets and calibrations values for hardware sensors. This makes it easier to debug the calibration process. - */ -public class msg_sensor_offsets extends MAVLinkMessage { +* Offsets and calibrations values for hardware sensors. This makes it easier to debug the calibration process. +*/ +public class msg_sensor_offsets extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_SENSOR_OFFSETS = 150; public static final int MAVLINK_MSG_LENGTH = 42; private static final long serialVersionUID = MAVLINK_MSG_ID_SENSOR_OFFSETS; + /** - * magnetic declination (radians) - */ + * Magnetic declination. + */ public float mag_declination; - + /** - * raw pressure from barometer - */ + * Raw pressure from barometer. + */ public int raw_press; - + /** - * raw temperature from barometer - */ + * Raw temperature from barometer. + */ public int raw_temp; - + /** - * gyro X calibration - */ + * Gyro X calibration. + */ public float gyro_cal_x; - + /** - * gyro Y calibration - */ + * Gyro Y calibration. + */ public float gyro_cal_y; - + /** - * gyro Z calibration - */ + * Gyro Z calibration. + */ public float gyro_cal_z; - + /** - * accel X calibration - */ + * Accel X calibration. + */ public float accel_cal_x; - + /** - * accel Y calibration - */ + * Accel Y calibration. + */ public float accel_cal_y; - + /** - * accel Z calibration - */ + * Accel Z calibration. + */ public float accel_cal_z; - + /** - * magnetometer X offset - */ + * Magnetometer X offset. + */ public short mag_ofs_x; - + /** - * magnetometer Y offset - */ + * Magnetometer Y offset. + */ public short mag_ofs_y; - + /** - * magnetometer Z offset - */ + * Magnetometer Z offset. + */ public short mag_ofs_z; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_sensor_offsets() { - msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_sensor_offsets(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; - + packet.payload.putFloat(mag_declination); - + packet.payload.putInt(raw_press); - + packet.payload.putInt(raw_temp); - + packet.payload.putFloat(gyro_cal_x); - + packet.payload.putFloat(gyro_cal_y); - + packet.payload.putFloat(gyro_cal_z); - + packet.payload.putFloat(accel_cal_x); - + packet.payload.putFloat(accel_cal_y); - + packet.payload.putFloat(accel_cal_z); - + packet.payload.putShort(mag_ofs_x); - + packet.payload.putShort(mag_ofs_y); - + packet.payload.putShort(mag_ofs_z); - + return packet; } /** - * Decode a sensor_offsets message into this class fields - * - * @param payload The message to decode - */ + * Decode a sensor_offsets message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.mag_declination = payload.getFloat(); - + this.raw_press = payload.getInt(); - + this.raw_temp = payload.getInt(); - + this.gyro_cal_x = payload.getFloat(); - + this.gyro_cal_y = payload.getFloat(); - + this.gyro_cal_z = payload.getFloat(); - + this.accel_cal_x = payload.getFloat(); - + this.accel_cal_y = payload.getFloat(); - + this.accel_cal_z = payload.getFloat(); - + this.mag_ofs_x = payload.getShort(); - + this.mag_ofs_y = payload.getShort(); - + this.mag_ofs_z = payload.getShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_sensor_offsets(){ + msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_sensor_offsets(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_SENSOR_OFFSETS - sysid:" + sysid + " compid:" + compid + " mag_declination:" + mag_declination + " raw_press:" + raw_press + " raw_temp:" + raw_temp + " gyro_cal_x:" + gyro_cal_x + " gyro_cal_y:" + gyro_cal_y + " gyro_cal_z:" + gyro_cal_z + " accel_cal_x:" + accel_cal_x + " accel_cal_y:" + accel_cal_y + " accel_cal_z:" + accel_cal_z + " mag_ofs_x:" + mag_ofs_x + " mag_ofs_y:" + mag_ofs_y + " mag_ofs_z:" + mag_ofs_z + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SENSOR_OFFSETS - sysid:"+sysid+" compid:"+compid+" mag_declination:"+mag_declination+" raw_press:"+raw_press+" raw_temp:"+raw_temp+" gyro_cal_x:"+gyro_cal_x+" gyro_cal_y:"+gyro_cal_y+" gyro_cal_z:"+gyro_cal_z+" accel_cal_x:"+accel_cal_x+" accel_cal_y:"+accel_cal_y+" accel_cal_z:"+accel_cal_z+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java index d3826b3..98bd5fd 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_set_mag_offsets.java @@ -6,114 +6,115 @@ // MESSAGE SET_MAG_OFFSETS PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Deprecated. Use MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS instead. Set the magnetometer offsets - */ -public class msg_set_mag_offsets extends MAVLinkMessage { +* Set the magnetometer offsets +*/ +public class msg_set_mag_offsets extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_SET_MAG_OFFSETS = 151; public static final int MAVLINK_MSG_LENGTH = 8; private static final long serialVersionUID = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + /** - * magnetometer X offset - */ + * Magnetometer X offset. + */ public short mag_ofs_x; - + /** - * magnetometer Y offset - */ + * Magnetometer Y offset. + */ public short mag_ofs_y; - + /** - * magnetometer Z offset - */ + * Magnetometer Z offset. + */ public short mag_ofs_z; - + /** - * System ID - */ + * System ID. + */ public short target_system; - + /** - * Component ID - */ + * Component ID. + */ public short target_component; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_set_mag_offsets() { - msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_set_mag_offsets(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; - + packet.payload.putShort(mag_ofs_x); - + packet.payload.putShort(mag_ofs_y); - + packet.payload.putShort(mag_ofs_z); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a set_mag_offsets message into this class fields - * - * @param payload The message to decode - */ + * Decode a set_mag_offsets message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.mag_ofs_x = payload.getShort(); - + this.mag_ofs_y = payload.getShort(); - + this.mag_ofs_z = payload.getShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_set_mag_offsets(){ + msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_set_mag_offsets(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_SET_MAG_OFFSETS - sysid:" + sysid + " compid:" + compid + " mag_ofs_x:" + mag_ofs_x + " mag_ofs_y:" + mag_ofs_y + " mag_ofs_z:" + mag_ofs_z + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SET_MAG_OFFSETS - sysid:"+sysid+" compid:"+compid+" mag_ofs_x:"+mag_ofs_x+" mag_ofs_y:"+mag_ofs_y+" mag_ofs_z:"+mag_ofs_z+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_simstate.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_simstate.java index be0444f..53d0789 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_simstate.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_simstate.java @@ -6,168 +6,169 @@ // MESSAGE SIMSTATE PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Status of simulation environment, if used - */ -public class msg_simstate extends MAVLinkMessage { +* Status of simulation environment, if used. +*/ +public class msg_simstate extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_SIMSTATE = 164; public static final int MAVLINK_MSG_LENGTH = 44; private static final long serialVersionUID = MAVLINK_MSG_ID_SIMSTATE; + /** - * Roll angle (rad) - */ + * Roll angle. + */ public float roll; - + /** - * Pitch angle (rad) - */ + * Pitch angle. + */ public float pitch; - + /** - * Yaw angle (rad) - */ + * Yaw angle. + */ public float yaw; - + /** - * X acceleration m/s/s - */ + * X acceleration. + */ public float xacc; - + /** - * Y acceleration m/s/s - */ + * Y acceleration. + */ public float yacc; - + /** - * Z acceleration m/s/s - */ + * Z acceleration. + */ public float zacc; - + /** - * Angular speed around X axis rad/s - */ + * Angular speed around X axis. + */ public float xgyro; - + /** - * Angular speed around Y axis rad/s - */ + * Angular speed around Y axis. + */ public float ygyro; - + /** - * Angular speed around Z axis rad/s - */ + * Angular speed around Z axis. + */ public float zgyro; - + /** - * Latitude in degrees * 1E7 - */ + * Latitude. + */ public int lat; - + /** - * Longitude in degrees * 1E7 - */ + * Longitude. + */ public int lng; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_simstate() { - msgid = MAVLINK_MSG_ID_SIMSTATE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_simstate(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_SIMSTATE; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_SIMSTATE; - + packet.payload.putFloat(roll); - + packet.payload.putFloat(pitch); - + packet.payload.putFloat(yaw); - + packet.payload.putFloat(xacc); - + packet.payload.putFloat(yacc); - + packet.payload.putFloat(zacc); - + packet.payload.putFloat(xgyro); - + packet.payload.putFloat(ygyro); - + packet.payload.putFloat(zgyro); - + packet.payload.putInt(lat); - + packet.payload.putInt(lng); - + return packet; } /** - * Decode a simstate message into this class fields - * - * @param payload The message to decode - */ + * Decode a simstate message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.roll = payload.getFloat(); - + this.pitch = payload.getFloat(); - + this.yaw = payload.getFloat(); - + this.xacc = payload.getFloat(); - + this.yacc = payload.getFloat(); - + this.zacc = payload.getFloat(); - + this.xgyro = payload.getFloat(); - + this.ygyro = payload.getFloat(); - + this.zgyro = payload.getFloat(); - + this.lat = payload.getInt(); - + this.lng = payload.getInt(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_simstate(){ + msgid = MAVLINK_MSG_ID_SIMSTATE; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_simstate(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_SIMSTATE; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_SIMSTATE - sysid:" + sysid + " compid:" + compid + " roll:" + roll + " pitch:" + pitch + " yaw:" + yaw + " xacc:" + xacc + " yacc:" + yacc + " zacc:" + zacc + " xgyro:" + xgyro + " ygyro:" + ygyro + " zgyro:" + zgyro + " lat:" + lat + " lng:" + lng + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_SIMSTATE - sysid:"+sysid+" compid:"+compid+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" xacc:"+xacc+" yacc:"+yacc+" zacc:"+zacc+" xgyro:"+xgyro+" ygyro:"+ygyro+" zgyro:"+zgyro+" lat:"+lat+" lng:"+lng+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_vision_position_delta.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_vision_position_delta.java index 1155083..584e4ad 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_vision_position_delta.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_vision_position_delta.java @@ -6,128 +6,131 @@ // MESSAGE VISION_POSITION_DELTA PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * camera vision based attitude and position deltas - */ -public class msg_vision_position_delta extends MAVLinkMessage { +* Camera vision based attitude and position deltas. +*/ +public class msg_vision_position_delta extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_VISION_POSITION_DELTA = 11011; public static final int MAVLINK_MSG_LENGTH = 44; private static final long serialVersionUID = MAVLINK_MSG_ID_VISION_POSITION_DELTA; + /** - * Timestamp (microseconds, synced to UNIX time or since system boot) - */ + * Timestamp (synced to UNIX time or since system boot). + */ public long time_usec; - + /** - * Time in microseconds since the last reported camera frame - */ + * Time since the last reported camera frame. + */ public long time_delta_usec; - + /** - * Defines a rotation vector in body frame that rotates the vehicle from the previous to the current orientation - */ + * Defines a rotation vector in body frame that rotates the vehicle from the previous to the current orientation. + */ public float angle_delta[] = new float[3]; - + /** - * Change in position in meters from previous to current frame rotated into body frame (0=forward, 1=right, 2=down) - */ + * Change in position from previous to current frame rotated into body frame (0=forward, 1=right, 2=down). + */ public float position_delta[] = new float[3]; - + /** - * normalised confidence value from 0 to 100 - */ + * Normalised confidence value from 0 to 100. + */ public float confidence; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_vision_position_delta() { - msgid = MAVLINK_MSG_ID_VISION_POSITION_DELTA; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_vision_position_delta(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_VISION_POSITION_DELTA; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_VISION_POSITION_DELTA; - + packet.payload.putUnsignedLong(time_usec); - + packet.payload.putUnsignedLong(time_delta_usec); - - + + for (int i = 0; i < angle_delta.length; i++) { packet.payload.putFloat(angle_delta[i]); } - - + + + for (int i = 0; i < position_delta.length; i++) { packet.payload.putFloat(position_delta[i]); } - - + + packet.payload.putFloat(confidence); - + return packet; } /** - * Decode a vision_position_delta message into this class fields - * - * @param payload The message to decode - */ + * Decode a vision_position_delta message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.time_usec = payload.getUnsignedLong(); - + this.time_delta_usec = payload.getUnsignedLong(); - - + + for (int i = 0; i < this.angle_delta.length; i++) { this.angle_delta[i] = payload.getFloat(); } - - + + + for (int i = 0; i < this.position_delta.length; i++) { this.position_delta[i] = payload.getFloat(); } - - + + this.confidence = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_vision_position_delta(){ + msgid = MAVLINK_MSG_ID_VISION_POSITION_DELTA; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_vision_position_delta(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_VISION_POSITION_DELTA; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_VISION_POSITION_DELTA - sysid:" + sysid + " compid:" + compid + " time_usec:" + time_usec + " time_delta_usec:" + time_delta_usec + " angle_delta:" + angle_delta + " position_delta:" + position_delta + " confidence:" + confidence + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_VISION_POSITION_DELTA - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" time_delta_usec:"+time_delta_usec+" angle_delta:"+angle_delta+" position_delta:"+position_delta+" confidence:"+confidence+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/ardupilotmega/msg_wind.java b/app/src/main/java/com/MAVLink/ardupilotmega/msg_wind.java index c31a778..175f4f1 100644 --- a/app/src/main/java/com/MAVLink/ardupilotmega/msg_wind.java +++ b/app/src/main/java/com/MAVLink/ardupilotmega/msg_wind.java @@ -6,96 +6,97 @@ // MESSAGE WIND PACKING package com.MAVLink.ardupilotmega; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Wind estimation - */ -public class msg_wind extends MAVLinkMessage { +* Wind estimation. +*/ +public class msg_wind extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_WIND = 168; public static final int MAVLINK_MSG_LENGTH = 12; private static final long serialVersionUID = MAVLINK_MSG_ID_WIND; + /** - * wind direction that wind is coming from (degrees) - */ + * Wind direction (that wind is coming from). + */ public float direction; - + /** - * wind speed in ground plane (m/s) - */ + * Wind speed in ground plane. + */ public float speed; - + /** - * vertical wind speed (m/s) - */ + * Vertical wind speed. + */ public float speed_z; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_wind() { - msgid = MAVLINK_MSG_ID_WIND; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_wind(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_WIND; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_WIND; - + packet.payload.putFloat(direction); - + packet.payload.putFloat(speed); - + packet.payload.putFloat(speed_z); - + return packet; } /** - * Decode a wind message into this class fields - * - * @param payload The message to decode - */ + * Decode a wind message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.direction = payload.getFloat(); - + this.speed = payload.getFloat(); - + this.speed_z = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_wind(){ + msgid = MAVLINK_MSG_ID_WIND; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_wind(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_WIND; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_WIND - sysid:" + sysid + " compid:" + compid + " direction:" + direction + " speed:" + speed + " speed_z:" + speed_z + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_WIND - sysid:"+sysid+" compid:"+compid+" direction:"+direction+" speed:"+speed+" speed_z:"+speed_z+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/CRC.java b/app/src/main/java/com/MAVLink/common/CRC.java index 0104454..b6f2ab2 100644 --- a/app/src/main/java/com/MAVLink/common/CRC.java +++ b/app/src/main/java/com/MAVLink/common/CRC.java @@ -7,28 +7,26 @@ package com.MAVLink.common; /** - * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, - * updated with witch field of the message, and then finished with the message - * id. - */ +* X.25 CRC calculation for MAVlink messages. The checksum must be initialized, +* updated with witch field of the message, and then finished with the message +* id. +* +*/ public class CRC { - private static final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 0, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 151, 35, 150, 0, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0}; + private static final int[] MAVLINK_MESSAGE_CRCS = {50, 124, 137, 0, 237, 217, 104, 119, 117, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 196, 132, 0, 15, 3, 0, 0, 0, 0, 0, 167, 183, 119, 191, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 47, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 174, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 47, 72, 131, 127, 0, 103, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 105, 151, 35, 150, 179, 0, 0, 0, 0, 0, 90, 104, 85, 95, 130, 184, 81, 8, 204, 49, 170, 44, 83, 46, 0}; private static final int CRC_INIT_VALUE = 0xffff; private int crcValue; - public CRC() { - start_checksum(); - } - /** - * Accumulate the X.25 CRC by adding one char at a time. - *

- * The checksum function adds the hash of one char at a time to the 16 bit - * checksum (uint16_t). - * - * @param data new char to hash - **/ - public void update_checksum(int data) { + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + **/ + 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; @@ -36,18 +34,20 @@ public void update_checksum(int data) { } /** - * Finish the CRC calculation of a message, by running the CRC with the - * Magic Byte. This Magic byte has been defined in MAVlink v1.0. - * - * @param msgid The message id number - */ + * Finish the CRC calculation of a message, by running the CRC with the + * Magic Byte. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ public void finish_checksum(int msgid) { update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); } /** - * Initialize the buffer for the X.25 CRC - */ + * Initialize the buffer for the X.25 CRC + * + */ public void start_checksum() { crcValue = CRC_INIT_VALUE; } @@ -60,5 +60,9 @@ public int getLSB() { return (crcValue & 0xff); } + public CRC() { + start_checksum(); + } + } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_actuator_control_target.java b/app/src/main/java/com/MAVLink/common/msg_actuator_control_target.java index 07e54ef..57ff8e2 100644 --- a/app/src/main/java/com/MAVLink/common/msg_actuator_control_target.java +++ b/app/src/main/java/com/MAVLink/common/msg_actuator_control_target.java @@ -6,104 +6,105 @@ // MESSAGE ACTUATOR_CONTROL_TARGET PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Set the vehicle attitude and body angular rates. - */ -public class msg_actuator_control_target extends MAVLinkMessage { +* 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 (micros since boot or Unix epoch) - */ + * 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. + */ 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. - */ + * 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. + */ 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. - */ + * Actuator group. The "_mlx" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances. + */ public short group_mlx; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_actuator_control_target() { - msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_actuator_control_target(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_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); - + return packet; } /** - * Decode a actuator_control_target message into this class fields - * - * @param payload The message to decode - */ + * Decode a actuator_control_target message into this class fields + * + * @param payload The message to decode + */ 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(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_actuator_control_target(){ + msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_actuator_control_target(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET - sysid:" + sysid + " compid:" + compid + " time_usec:" + time_usec + " controls:" + controls + " group_mlx:" + group_mlx + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" controls:"+controls+" group_mlx:"+group_mlx+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_actuator_output_status.java b/app/src/main/java/com/MAVLink/common/msg_actuator_output_status.java new file mode 100644 index 0000000..8c6a861 --- /dev/null +++ b/app/src/main/java/com/MAVLink/common/msg_actuator_output_status.java @@ -0,0 +1,110 @@ +/* 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.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* 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). + */ + public long time_usec; + + /** + * Active outputs + */ + public long active; + + /** + * Servo / motor output array values. Zero values indicate unused channels. + */ + public float actuator[] = new float[32]; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_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]); + } + + + return packet; + } + + /** + * Decode a actuator_output_status message into this class fields + * + * @param payload The message to decode + */ + 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(); + } + + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_actuator_output_status(){ + msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_actuator_output_status(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS - sysid:"+sysid+" compid:"+compid+" time_usec:"+time_usec+" active:"+active+" actuator:"+actuator+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_adsb_vehicle.java b/app/src/main/java/com/MAVLink/common/msg_adsb_vehicle.java index 372fe87..353a106 100644 --- a/app/src/main/java/com/MAVLink/common/msg_adsb_vehicle.java +++ b/app/src/main/java/com/MAVLink/common/msg_adsb_vehicle.java @@ -6,223 +6,224 @@ // MESSAGE ADSB_VEHICLE PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * The location and information of an ADSB vehicle - */ -public class msg_adsb_vehicle extends MAVLinkMessage { +* 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 - */ + * ICAO address + */ public long ICAO_address; - + /** - * Latitude, expressed as degrees * 1E7 - */ + * Latitude + */ public int lat; - + /** - * Longitude, expressed as degrees * 1E7 - */ + * Longitude + */ public int lon; - + /** - * Altitude(ASL) in millimeters - */ + * Altitude(ASL) + */ public int altitude; - + /** - * Course over ground in centidegrees - */ + * Course over ground + */ public int heading; - + /** - * The horizontal velocity in centimeters/second - */ + * The horizontal velocity + */ public int hor_velocity; - + /** - * The vertical velocity in centimeters/second, positive is up - */ + * The vertical velocity. Positive is up + */ public short ver_velocity; - + /** - * Flags to indicate various statuses including valid data fields - */ + * Bitmap to indicate various statuses including valid data fields + */ public int flags; - + /** - * Squawk code - */ + * Squawk code + */ public int squawk; - + /** - * Type from ADSB_ALTITUDE_TYPE enum - */ + * ADSB altitude type. + */ public short altitude_type; - + /** - * The callsign, 8+null - */ + * The callsign, 8+null + */ public byte callsign[] = new byte[9]; - + /** - * Type from ADSB_EMITTER_TYPE enum - */ + * ADSB emitter type. + */ public short emitter_type; - + /** - * Time since last communication in seconds - */ + * Time since last communication in seconds + */ public short tslc; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_adsb_vehicle() { - msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_adsb_vehicle(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_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); - + return packet; } /** - * Decode a adsb_vehicle message into this class fields - * - * @param payload The message to decode - */ + * Decode a adsb_vehicle message into this class fields + * + * @param payload The message to decode + */ 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(); - + } /** - * Gets the message, formated 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(); + * Constructor for a new message, just initializes the msgid + */ + public msg_adsb_vehicle(){ + msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_adsb_vehicle(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ADSB_VEHICLE; + unpack(mavLinkPacket.payload); } + /** - * Sets the buffer of this message with a string, adds the necessary padding - */ + * 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++) { + for (int i=0; i 0 indicates the interval at which it is sent. - */ + * The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent. + */ public int interval_us; - + /** - * The ID of the requested MAVLink message. v1.0 is limited to 254 messages. - */ + * The ID of the requested MAVLink message. v1.0 is limited to 254 messages. + */ public int message_id; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_message_interval() { - msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_message_interval(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; - + packet.payload.putInt(interval_us); - + packet.payload.putUnsignedShort(message_id); - + return packet; } /** - * Decode a message_interval message into this class fields - * - * @param payload The message to decode - */ + * Decode a message_interval message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.interval_us = payload.getInt(); - + this.message_id = payload.getUnsignedShort(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_message_interval(){ + msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_message_interval(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MESSAGE_INTERVAL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MESSAGE_INTERVAL - sysid:" + sysid + " compid:" + compid + " interval_us:" + interval_us + " message_id:" + message_id + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MESSAGE_INTERVAL - sysid:"+sysid+" compid:"+compid+" interval_us:"+interval_us+" message_id:"+message_id+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_ack.java b/app/src/main/java/com/MAVLink/common/msg_mission_ack.java index dd64967..9dad49c 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_ack.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_ack.java @@ -6,107 +6,106 @@ // MESSAGE MISSION_ACK PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; -import com.MAVLink.enums.MAV_MISSION_TYPE; - + /** - * Ack message during MISSION handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). - */ -public class msg_mission_ack extends MAVLinkMessage { +* Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero). +*/ +public class msg_mission_ack extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_ACK = 47; public static final int MAVLINK_MSG_LENGTH = 4; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_ACK; + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * See MAV_MISSION_RESULT enum - */ + * Mission result. + */ public short type; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_ack() { - msgid = MAVLINK_MSG_ID_MISSION_ACK; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_ack(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_ACK; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_ACK; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(type); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_ack message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_ack message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.type = payload.getUnsignedByte(); + + this.mission_type = payload.getUnsignedByte(); + + } - //this.mission_type = payload.getUnsignedByte(); - this.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION; + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_ack(){ + msgid = MAVLINK_MSG_ID_MISSION_ACK; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_ack(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_ACK; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_ACK - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " type:" + type + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_ACK - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" type:"+type+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_changed.java b/app/src/main/java/com/MAVLink/common/msg_mission_changed.java new file mode 100644 index 0000000..50ec906 --- /dev/null +++ b/app/src/main/java/com/MAVLink/common/msg_mission_changed.java @@ -0,0 +1,120 @@ +/* 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 MISSION_CHANGED PACKING +package com.MAVLink.common; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* A broadcast message to notify any ground station or SDK if a mission, geofence or safe points have changed on the vehicle. +*/ +public class msg_mission_changed extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_MISSION_CHANGED = 52; + public static final int MAVLINK_MSG_LENGTH = 7; + private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_CHANGED; + + + + /** + * Start index for partial mission change (-1 for all items). + */ + public short start_index; + + /** + * End index of a partial mission change. -1 is a synonym for the last mission item (i.e. selects all items from start_index). Ignore field if start_index=-1. + */ + public short end_index; + + /** + * System ID of the author of the new mission. + */ + public short origin_sysid; + + /** + * Compnent ID of the author of the new mission. + */ + public short origin_compid; + + /** + * Mission type. + */ + public short mission_type; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_MISSION_CHANGED; + + packet.payload.putShort(start_index); + + packet.payload.putShort(end_index); + + packet.payload.putUnsignedByte(origin_sysid); + + packet.payload.putUnsignedByte(origin_compid); + + packet.payload.putUnsignedByte(mission_type); + + return packet; + } + + /** + * Decode a mission_changed message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + + this.start_index = payload.getShort(); + + this.end_index = payload.getShort(); + + this.origin_sysid = payload.getUnsignedByte(); + + this.origin_compid = payload.getUnsignedByte(); + + this.mission_type = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_changed(){ + msgid = MAVLINK_MSG_ID_MISSION_CHANGED; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_changed(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_CHANGED; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_CHANGED - sysid:"+sysid+" compid:"+compid+" start_index:"+start_index+" end_index:"+end_index+" origin_sysid:"+origin_sysid+" origin_compid:"+origin_compid+" mission_type:"+mission_type+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_clear_all.java b/app/src/main/java/com/MAVLink/common/msg_mission_clear_all.java index d510052..eb1ad8e 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_clear_all.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_clear_all.java @@ -6,96 +6,97 @@ // MESSAGE MISSION_CLEAR_ALL PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Delete all mission items at once. - */ -public class msg_mission_clear_all extends MAVLinkMessage { +* Delete all mission items at once. +*/ +public class msg_mission_clear_all extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_CLEAR_ALL = 45; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_clear_all() { - msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_clear_all(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_clear_all message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_clear_all message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mission_type = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_clear_all(){ + msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_clear_all(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_CLEAR_ALL - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_CLEAR_ALL - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_count.java b/app/src/main/java/com/MAVLink/common/msg_mission_count.java index b7278ae..0793334 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_count.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_count.java @@ -6,106 +6,106 @@ // MESSAGE MISSION_COUNT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; -import com.MAVLink.enums.MAV_MISSION_TYPE; - + /** - * This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of MISSIONs. - */ -public class msg_mission_count extends MAVLinkMessage { +* This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints. +*/ +public class msg_mission_count extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_COUNT = 44; public static final int MAVLINK_MSG_LENGTH = 5; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_COUNT; + /** - * Number of mission items in the sequence - */ + * Number of mission items in the sequence + */ public int count; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_count() { - msgid = MAVLINK_MSG_ID_MISSION_COUNT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_count(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_COUNT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_COUNT; - + packet.payload.putUnsignedShort(count); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_count message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_count message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.count = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + this.mission_type = payload.getUnsignedByte(); + + } - //this.mission_type = payload.getUnsignedByte(); - this.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION; + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_count(){ + msgid = MAVLINK_MSG_ID_MISSION_COUNT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_count(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_COUNT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_COUNT - sysid:" + sysid + " compid:" + compid + " count:" + count + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_COUNT - sysid:"+sysid+" compid:"+compid+" count:"+count+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_current.java b/app/src/main/java/com/MAVLink/common/msg_mission_current.java index 4ba8fa6..632e324 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_current.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_current.java @@ -6,78 +6,79 @@ // MESSAGE MISSION_CURRENT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. - */ -public class msg_mission_current extends MAVLinkMessage { +* Message that announces the sequence number of the current active mission item. The MAV will fly towards this mission item. +*/ +public class msg_mission_current extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_CURRENT = 42; public static final int MAVLINK_MSG_LENGTH = 2; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_CURRENT; + /** - * Sequence - */ + * Sequence + */ public int seq; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_current() { - msgid = MAVLINK_MSG_ID_MISSION_CURRENT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_current(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_CURRENT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_CURRENT; - + packet.payload.putUnsignedShort(seq); - + return packet; } /** - * Decode a mission_current message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_current message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seq = payload.getUnsignedShort(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_current(){ + msgid = MAVLINK_MSG_ID_MISSION_CURRENT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_current(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_CURRENT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_CURRENT - sysid:" + sysid + " compid:" + compid + " seq:" + seq + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_CURRENT - sysid:"+sysid+" compid:"+compid+" seq:"+seq+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_item.java b/app/src/main/java/com/MAVLink/common/msg_mission_item.java index 90a93eb..ee476b8 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_item.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_item.java @@ -6,207 +6,206 @@ // MESSAGE MISSION_ITEM PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; -import com.MAVLink.enums.MAV_MISSION_TYPE; - + /** - * Message encoding a mission item. This message is emitted to announce - * the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also http://qgroundcontrol.org/mavlink/waypoint_protocol. - */ -public class msg_mission_item extends MAVLinkMessage { +* Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also https://mavlink.io/en/services/mission.html. +*/ +public class msg_mission_item extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_ITEM = 39; public static final int MAVLINK_MSG_LENGTH = 38; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_ITEM; + /** - * PARAM1, see MAV_CMD enum - */ + * PARAM1, see MAV_CMD enum + */ public float param1; - + /** - * PARAM2, see MAV_CMD enum - */ + * PARAM2, see MAV_CMD enum + */ public float param2; - + /** - * PARAM3, see MAV_CMD enum - */ + * PARAM3, see MAV_CMD enum + */ public float param3; - + /** - * PARAM4, see MAV_CMD enum - */ + * PARAM4, see MAV_CMD enum + */ public float param4; - + /** - * PARAM5 / local: x position, global: latitude - */ + * PARAM5 / local: X coordinate, global: latitude + */ public float x; - + /** - * PARAM6 / y position: global: longitude - */ + * PARAM6 / local: Y coordinate, global: longitude + */ public float y; - + /** - * PARAM7 / z position: global: altitude (relative or absolute, depending on frame. - */ + * PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame). + */ public float z; - + /** - * Sequence - */ + * Sequence + */ public int seq; - + /** - * The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - */ + * The scheduled action for the waypoint. + */ public int command; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - */ + * The coordinate system of the waypoint. + */ public short frame; - + /** - * false:0, true:1 - */ + * false:0, true:1 + */ public short current; - + /** - * autocontinue to next wp - */ + * Autocontinue to next waypoint + */ public short autocontinue; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_item() { - msgid = MAVLINK_MSG_ID_MISSION_ITEM; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_item(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_ITEM; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_ITEM; - + packet.payload.putFloat(param1); - + packet.payload.putFloat(param2); - + packet.payload.putFloat(param3); - + packet.payload.putFloat(param4); - + packet.payload.putFloat(x); - + packet.payload.putFloat(y); - + packet.payload.putFloat(z); - + packet.payload.putUnsignedShort(seq); - + 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); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_item message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_item message into this class fields + * + * @param payload The message to decode + */ 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.getFloat(); - + this.y = payload.getFloat(); - + this.z = payload.getFloat(); - + this.seq = payload.getUnsignedShort(); - + 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(); + + this.mission_type = payload.getUnsignedByte(); + + } - //this.mission_type = payload.getUnsignedByte(); - this.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION; + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_item(){ + msgid = MAVLINK_MSG_ID_MISSION_ITEM; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_item(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_ITEM; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_ITEM - sysid:" + sysid + " compid:" + compid + " param1:" + param1 + " param2:" + param2 + " param3:" + param3 + " param4:" + param4 + " x:" + x + " y:" + y + " z:" + z + " seq:" + seq + " command:" + command + " target_system:" + target_system + " target_component:" + target_component + " frame:" + frame + " current:" + current + " autocontinue:" + autocontinue + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_ITEM - sysid:"+sysid+" compid:"+compid+" param1:"+param1+" param2:"+param2+" param3:"+param3+" param4:"+param4+" x:"+x+" y:"+y+" z:"+z+" seq:"+seq+" command:"+command+" target_system:"+target_system+" target_component:"+target_component+" frame:"+frame+" current:"+current+" autocontinue:"+autocontinue+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_item_int.java b/app/src/main/java/com/MAVLink/common/msg_mission_item_int.java index b8f5688..bd883c9 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_item_int.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_item_int.java @@ -6,205 +6,206 @@ // MESSAGE MISSION_ITEM_INT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Message encoding a mission item. This message is emitted to announce - * the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See alsohttp://qgroundcontrol.org/mavlink/waypoint_protocol. - */ -public class msg_mission_item_int extends MAVLinkMessage { +* Message encoding a mission item. This message is emitted to announce + the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). See also https://mavlink.io/en/services/mission.html. +*/ +public class msg_mission_item_int extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_ITEM_INT = 73; public static final int MAVLINK_MSG_LENGTH = 38; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_ITEM_INT; + /** - * PARAM1, see MAV_CMD enum - */ + * PARAM1, see MAV_CMD enum + */ public float param1; - + /** - * PARAM2, see MAV_CMD enum - */ + * PARAM2, see MAV_CMD enum + */ public float param2; - + /** - * PARAM3, see MAV_CMD enum - */ + * PARAM3, see MAV_CMD enum + */ public float param3; - + /** - * PARAM4, see MAV_CMD enum - */ + * PARAM4, see MAV_CMD enum + */ public float param4; - + /** - * PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 - */ + * PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7 + */ public int x; - + /** - * PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 - */ + * PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7 + */ public int y; - + /** - * PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. - */ + * PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame. + */ public float z; - + /** - * Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). - */ + * Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4). + */ public int seq; - + /** - * The scheduled action for the MISSION. see MAV_CMD in common.xml MAVLink specs - */ + * The scheduled action for the waypoint. + */ public int command; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * The coordinate system of the MISSION. see MAV_FRAME in mavlink_types.h - */ + * The coordinate system of the waypoint. + */ public short frame; - + /** - * false:0, true:1 - */ + * false:0, true:1 + */ public short current; - + /** - * autocontinue to next wp - */ + * Autocontinue to next waypoint + */ public short autocontinue; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_item_int() { - msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_item_int(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_ITEM_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(seq); - + 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); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_item_int message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_item_int message into this class fields + * + * @param payload The message to decode + */ 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.seq = payload.getUnsignedShort(); - + 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(); - + this.mission_type = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_item_int(){ + msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_item_int(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_ITEM_INT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_ITEM_INT - sysid:" + sysid + " compid:" + compid + " param1:" + param1 + " param2:" + param2 + " param3:" + param3 + " param4:" + param4 + " x:" + x + " y:" + y + " z:" + z + " seq:" + seq + " command:" + command + " target_system:" + target_system + " target_component:" + target_component + " frame:" + frame + " current:" + current + " autocontinue:" + autocontinue + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_ITEM_INT - sysid:"+sysid+" compid:"+compid+" param1:"+param1+" param2:"+param2+" param3:"+param3+" param4:"+param4+" x:"+x+" y:"+y+" z:"+z+" seq:"+seq+" command:"+command+" target_system:"+target_system+" target_component:"+target_component+" frame:"+frame+" current:"+current+" autocontinue:"+autocontinue+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_item_reached.java b/app/src/main/java/com/MAVLink/common/msg_mission_item_reached.java index 7908a7e..7392d48 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_item_reached.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_item_reached.java @@ -6,78 +6,79 @@ // MESSAGE MISSION_ITEM_REACHED PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next MISSION. - */ -public class msg_mission_item_reached extends MAVLinkMessage { +* A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint. +*/ +public class msg_mission_item_reached extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_ITEM_REACHED = 46; public static final int MAVLINK_MSG_LENGTH = 2; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; + /** - * Sequence - */ + * Sequence + */ public int seq; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_item_reached() { - msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_item_reached(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; - + packet.payload.putUnsignedShort(seq); - + return packet; } /** - * Decode a mission_item_reached message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_item_reached message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seq = payload.getUnsignedShort(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_item_reached(){ + msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_item_reached(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_ITEM_REACHED - sysid:" + sysid + " compid:" + compid + " seq:" + seq + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_ITEM_REACHED - sysid:"+sysid+" compid:"+compid+" seq:"+seq+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_request.java b/app/src/main/java/com/MAVLink/common/msg_mission_request.java index 09a83ad..e97a608 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_request.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_request.java @@ -6,105 +6,106 @@ // MESSAGE MISSION_REQUEST PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol - */ -public class msg_mission_request extends MAVLinkMessage { +* Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. https://mavlink.io/en/services/mission.html +*/ +public class msg_mission_request extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_REQUEST = 40; public static final int MAVLINK_MSG_LENGTH = 5; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_REQUEST; + /** - * Sequence - */ + * Sequence + */ public int seq; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_request() { - msgid = MAVLINK_MSG_ID_MISSION_REQUEST; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_request(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_REQUEST; - + packet.payload.putUnsignedShort(seq); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_request message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_request message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seq = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mission_type = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_request(){ + msgid = MAVLINK_MSG_ID_MISSION_REQUEST; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_request(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_REQUEST - sysid:" + sysid + " compid:" + compid + " seq:" + seq + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_REQUEST - sysid:"+sysid+" compid:"+compid+" seq:"+seq+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_request_int.java b/app/src/main/java/com/MAVLink/common/msg_mission_request_int.java index 64669ba..580e4f3 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_request_int.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_request_int.java @@ -6,105 +6,106 @@ // MESSAGE MISSION_REQUEST_INT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. http://qgroundcontrol.org/mavlink/waypoint_protocol - */ -public class msg_mission_request_int extends MAVLinkMessage { +* Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. https://mavlink.io/en/services/mission.html +*/ +public class msg_mission_request_int extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_REQUEST_INT = 51; public static final int MAVLINK_MSG_LENGTH = 5; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_REQUEST_INT; + /** - * Sequence - */ + * Sequence + */ public int seq; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_request_int() { - msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; - } + /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_request_int(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; - + packet.payload.putUnsignedShort(seq); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_request_int message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_request_int message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seq = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mission_type = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_request_int(){ + msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_request_int(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_INT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_REQUEST_INT - sysid:" + sysid + " compid:" + compid + " seq:" + seq + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_REQUEST_INT - sysid:"+sysid+" compid:"+compid+" seq:"+seq+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_request_list.java b/app/src/main/java/com/MAVLink/common/msg_mission_request_list.java index b7a6961..74b2722 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_request_list.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_request_list.java @@ -6,98 +6,97 @@ // MESSAGE MISSION_REQUEST_LIST PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; -import com.MAVLink.enums.MAV_MISSION_TYPE; - + /** - * Request the overall list of mission items from the system/component. - */ -public class msg_mission_request_list extends MAVLinkMessage { +* Request the overall list of mission items from the system/component. +*/ +public class msg_mission_request_list extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_REQUEST_LIST = 43; public static final int MAVLINK_MSG_LENGTH = 3; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_request_list() { - msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_request_list(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_request_list message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_request_list message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + this.mission_type = payload.getUnsignedByte(); + + } - //this.mission_type = payload.getUnsignedByte(); - this.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION; + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_request_list(){ + msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_request_list(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_REQUEST_LIST - sysid:" + sysid + " compid:" + compid + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_REQUEST_LIST - sysid:"+sysid+" compid:"+compid+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_request_partial_list.java b/app/src/main/java/com/MAVLink/common/msg_mission_request_partial_list.java index 0b992e9..ec915e8 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_request_partial_list.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_request_partial_list.java @@ -6,114 +6,115 @@ // MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Request a partial list of mission items from the system/component. http://qgroundcontrol.org/mavlink/waypoint_protocol. If start and end index are the same, just send one waypoint. - */ -public class msg_mission_request_partial_list extends MAVLinkMessage { +* Request a partial list of mission items from the system/component. https://mavlink.io/en/services/mission.html. If start and end index are the same, just send one waypoint. +*/ +public class msg_mission_request_partial_list extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST = 37; public static final int MAVLINK_MSG_LENGTH = 7; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; + /** - * Start index, 0 by default - */ + * Start index + */ public short start_index; - + /** - * End index, -1 by default (-1: send list to end). Else a valid index of the list - */ + * End index, -1 by default (-1: send list to end). Else a valid index of the list + */ public short end_index; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_request_partial_list() { - msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_request_partial_list(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; - + packet.payload.putShort(start_index); - + packet.payload.putShort(end_index); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_request_partial_list message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_request_partial_list message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.start_index = payload.getShort(); - + this.end_index = payload.getShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mission_type = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_request_partial_list(){ + msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_request_partial_list(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST - sysid:" + sysid + " compid:" + compid + " start_index:" + start_index + " end_index:" + end_index + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST - sysid:"+sysid+" compid:"+compid+" start_index:"+start_index+" end_index:"+end_index+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_set_current.java b/app/src/main/java/com/MAVLink/common/msg_mission_set_current.java index c7b35af..d1e88b4 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_set_current.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_set_current.java @@ -6,96 +6,97 @@ // MESSAGE MISSION_SET_CURRENT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). - */ -public class msg_mission_set_current extends MAVLinkMessage { +* Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). +*/ +public class msg_mission_set_current extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_SET_CURRENT = 41; public static final int MAVLINK_MSG_LENGTH = 4; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_SET_CURRENT; + /** - * Sequence - */ + * Sequence + */ public int seq; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_set_current() { - msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_set_current(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; - + packet.payload.putUnsignedShort(seq); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + return packet; } /** - * Decode a mission_set_current message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_set_current message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.seq = payload.getUnsignedShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_set_current(){ + msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_set_current(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_SET_CURRENT - sysid:" + sysid + " compid:" + compid + " seq:" + seq + " target_system:" + target_system + " target_component:" + target_component + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_SET_CURRENT - sysid:"+sysid+" compid:"+compid+" seq:"+seq+" target_system:"+target_system+" target_component:"+target_component+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mission_write_partial_list.java b/app/src/main/java/com/MAVLink/common/msg_mission_write_partial_list.java index c642e74..041c6b5 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mission_write_partial_list.java +++ b/app/src/main/java/com/MAVLink/common/msg_mission_write_partial_list.java @@ -6,114 +6,115 @@ // MESSAGE MISSION_WRITE_PARTIAL_LIST PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! - */ -public class msg_mission_write_partial_list extends MAVLinkMessage { +* This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED! +*/ +public class msg_mission_write_partial_list extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST = 38; public static final int MAVLINK_MSG_LENGTH = 7; private static final long serialVersionUID = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; + /** - * Start index, 0 by default and smaller / equal to the largest index of the current onboard list. - */ + * Start index. Must be smaller / equal to the largest index of the current onboard list. + */ public short start_index; - + /** - * End index, equal or greater than start index. - */ + * End index, equal or greater than start index. + */ public short end_index; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Mission type, see MAV_MISSION_TYPE - */ + * Mission type. + */ public short mission_type; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mission_write_partial_list() { - msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mission_write_partial_list(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; - + packet.payload.putShort(start_index); - + packet.payload.putShort(end_index); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - + packet.payload.putUnsignedByte(mission_type); - + return packet; } /** - * Decode a mission_write_partial_list message into this class fields - * - * @param payload The message to decode - */ + * Decode a mission_write_partial_list message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.start_index = payload.getShort(); - + this.end_index = payload.getShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - + this.mission_type = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mission_write_partial_list(){ + msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mission_write_partial_list(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST - sysid:" + sysid + " compid:" + compid + " start_index:" + start_index + " end_index:" + end_index + " target_system:" + target_system + " target_component:" + target_component + " mission_type:" + mission_type + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST - sysid:"+sysid+" compid:"+compid+" start_index:"+start_index+" end_index:"+end_index+" target_system:"+target_system+" target_component:"+target_component+" mission_type:"+mission_type+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_mount_orientation.java b/app/src/main/java/com/MAVLink/common/msg_mount_orientation.java index 501f6a0..feb1848 100644 --- a/app/src/main/java/com/MAVLink/common/msg_mount_orientation.java +++ b/app/src/main/java/com/MAVLink/common/msg_mount_orientation.java @@ -6,105 +6,115 @@ // MESSAGE MOUNT_ORIENTATION PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * WIP: Orientation of a mount - */ -public class msg_mount_orientation extends MAVLinkMessage { +* Orientation of a mount +*/ +public class msg_mount_orientation extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_MOUNT_ORIENTATION = 265; - public static final int MAVLINK_MSG_LENGTH = 16; + public static final int MAVLINK_MSG_LENGTH = 20; private static final long serialVersionUID = MAVLINK_MSG_ID_MOUNT_ORIENTATION; + /** - * Timestamp (milliseconds since system boot) - */ + * Timestamp (time since system boot). + */ public long time_boot_ms; - + /** - * Roll in degrees - */ + * Roll in global frame (set to NaN for invalid). + */ public float roll; - + /** - * Pitch in degrees - */ + * Pitch in global frame (set to NaN for invalid). + */ public float pitch; - + /** - * Yaw in degrees - */ + * Yaw relative to vehicle (set to NaN for invalid). + */ public float yaw; - - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_mount_orientation() { - msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_mount_orientation(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION; - unpack(mavLinkPacket.payload); - } + * Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid). + */ + public float yaw_absolute; + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION; - + packet.payload.putUnsignedInt(time_boot_ms); - + packet.payload.putFloat(roll); - + packet.payload.putFloat(pitch); - + packet.payload.putFloat(yaw); - + + packet.payload.putFloat(yaw_absolute); + return packet; } /** - * Decode a mount_orientation message into this class fields - * - * @param payload The message to decode - */ + * Decode a mount_orientation message into this class fields + * + * @param payload The message to decode + */ 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.yaw_absolute = payload.getFloat(); + + } + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_mount_orientation(){ + msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_mount_orientation(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_MOUNT_ORIENTATION; + unpack(mavLinkPacket.payload); } + /** - * Returns a string with the MSG name and data - */ - public String toString() { - return "MAVLINK_MSG_ID_MOUNT_ORIENTATION - sysid:" + sysid + " compid:" + compid + " time_boot_ms:" + time_boot_ms + " roll:" + roll + " pitch:" + pitch + " yaw:" + yaw + ""; + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_MOUNT_ORIENTATION - sysid:"+sysid+" compid:"+compid+" time_boot_ms:"+time_boot_ms+" roll:"+roll+" pitch:"+pitch+" yaw:"+yaw+" yaw_absolute:"+yaw_absolute+""; } } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/common/msg_named_value_float.java b/app/src/main/java/com/MAVLink/common/msg_named_value_float.java index 9a948e0..a4ef351 100644 --- a/app/src/main/java/com/MAVLink/common/msg_named_value_float.java +++ b/app/src/main/java/com/MAVLink/common/msg_named_value_float.java @@ -6,133 +6,134 @@ // MESSAGE NAMED_VALUE_FLOAT PACKING package com.MAVLink.common; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. - */ -public class msg_named_value_float extends MAVLinkMessage { +* Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output. +*/ +public class msg_named_value_float extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_NAMED_VALUE_FLOAT = 251; public static final int MAVLINK_MSG_LENGTH = 18; private static final long serialVersionUID = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; + /** - * Timestamp (milliseconds since system boot) - */ + * Timestamp (time since system boot). + */ public long time_boot_ms; - + /** - * Floating point value - */ + * Floating point value + */ public float value; - + /** - * Name of the debug variable - */ + * Name of the debug variable + */ public byte name[] = new byte[10]; - - - /** - * Constructor for a new message, just initializes the msgid - */ - public msg_named_value_float() { - msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_named_value_float(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - unpack(mavLinkPacket.payload); - } + /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; - + packet.payload.putUnsignedInt(time_boot_ms); - + packet.payload.putFloat(value); - - + + for (int i = 0; i < name.length; i++) { packet.payload.putByte(name[i]); } - - + + return packet; } /** - * Decode a named_value_float message into this class fields - * - * @param payload The message to decode - */ + * Decode a named_value_float message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.time_boot_ms = payload.getUnsignedInt(); - + this.value = payload.getFloat(); - - + + for (int i = 0; i < this.name.length; i++) { this.name[i] = payload.getByte(); } - - + + } /** - * Gets the message, formated 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(); + * Constructor for a new message, just initializes the msgid + */ + public msg_named_value_float(){ + msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_named_value_float(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; + unpack(mavLinkPacket.payload); } + /** - * Sets the buffer of this message with a string, adds the necessary padding - */ + * 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++) { + for (int i=0; i value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also http://qgroundcontrol.org/parameter_interface for a full documentation of QGroundControl and IMU code. - */ -public class msg_param_request_read extends MAVLinkMessage { +* Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] -> value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also https://mavlink.io/en/services/parameter.html for a full documentation of QGroundControl and IMU code. +*/ +public class msg_param_request_read extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_PARAM_REQUEST_READ = 20; public static final int MAVLINK_MSG_LENGTH = 20; private static final long serialVersionUID = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + /** - * Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) - */ + * Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored) + */ public short param_index; - + /** - * System ID - */ + * System ID + */ public short target_system; - + /** - * Component ID - */ + * Component ID + */ public short target_component; - + /** - * Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string - */ + * Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string + */ public byte param_id[] = new byte[16]; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_param_request_read() { - msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_param_request_read(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; - + packet.payload.putShort(param_index); - + packet.payload.putUnsignedByte(target_system); - + packet.payload.putUnsignedByte(target_component); - - + + for (int i = 0; i < param_id.length; i++) { packet.payload.putByte(param_id[i]); } - - + + return packet; } /** - * Decode a param_request_read message into this class fields - * - * @param payload The message to decode - */ + * Decode a param_request_read message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.param_index = payload.getShort(); - + this.target_system = payload.getUnsignedByte(); - + this.target_component = payload.getUnsignedByte(); - - + + for (int i = 0; i < this.param_id.length; i++) { this.param_id[i] = payload.getByte(); } - - + + } /** - * Gets the message, formated as a string - */ - public String getParam_Id() { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < 16; i++) { - if (param_id[i] != 0) - buf.append((char) param_id[i]); - else - break; - } - return buf.toString(); + * Constructor for a new message, just initializes the msgid + */ + public msg_param_request_read(){ + msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_param_request_read(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_PARAM_REQUEST_READ; + unpack(mavLinkPacket.payload); } + /** - * Sets the buffer of this message with a string, adds the necessary padding - */ + * Sets the buffer of this message with a string, adds the necessary padding + */ public void setParam_Id(String str) { int len = Math.min(str.length(), 16); - for (int i = 0; i < len; i++) { + for (int i=0; i 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing). NaN for unchanged.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_UNLIM = 17; /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_TURNS = 18; /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LOITER_TIME = 19; /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_RETURN_TO_LAUNCH = 20; /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_LAND = 21; /* Land at location |Abort Alt| Empty| Empty| Desired yaw angle. NaN for unchanged.| Latitude| Longitude| Altitude (ground level)| */ - public static final int MAV_CMD_NAV_TAKEOFF = 22; /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer. NaN for unchanged.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_LAND_LOCAL = 23; /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position [m] - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate [ms^-1]| Desired yaw angle [rad]| Y-axis position [m]| X-axis position [m]| Z-axis / ground level position [m]| */ - public static final int MAV_CMD_NAV_TAKEOFF_LOCAL = 24; /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor [rad]| Empty| Takeoff ascend rate [ms^-1]| Yaw angle [rad] (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position [m]| X-axis position [m]| Z-axis position [m]| */ - public static final int MAV_CMD_NAV_FOLLOW = 25; /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30; /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude. | Empty| Empty| Empty| Empty| Empty| Desired altitude in meters| */ - public static final int MAV_CMD_NAV_LOITER_TO_ALT = 31; /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius in meters. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_DO_FOLLOW = 32; /* Being following a target |System ID (the system ID of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode| RESERVED| RESERVED| altitude flag: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home| altitude| RESERVED| TTL in seconds in which the MAV should go to the default position hold mode after a message rx timeout| */ - public static final int MAV_CMD_DO_FOLLOW_REPOSITION = 33; /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target (m)| X offset from target (m)| Y offset from target (m)| */ - public static final int MAV_CMD_NAV_ROI = 80; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - public static final int MAV_CMD_NAV_PATHPLANNING = 81; /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - public static final int MAV_CMD_NAV_SPLINE_WAYPOINT = 82; /* Navigate to MISSION using a spline path. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ - public static final int MAV_CMD_NAV_ALTITUDE_WAIT = 83; /* Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up. |altitude (m)| descent speed (m/s)| Wiggle Time (s)| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_VTOL_TAKEOFF = 84; /* Takeoff from ground using VTOL mode |Empty| Front transition heading, see VTOL_TRANSITION_HEADING enum.| Empty| Yaw angle in degrees. NaN for unchanged.| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_VTOL_LAND = 85; /* Land using VTOL mode |Empty| Empty| Approach altitude (with the same reference as the Altitude field). NaN if unspecified.| Yaw angle in degrees. NaN for unchanged.| Latitude| Longitude| Altitude (ground level)| */ - public static final int MAV_CMD_NAV_GUIDED_ENABLE = 92; /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_DELAY = 93; /* Delay the next navigation command a number of seconds or until a specified time |Delay in seconds (decimal, -1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_PAYLOAD_PLACE = 94; /* Descend and place payload. Vehicle descends until it detects a hanging payload has reached the ground, the gripper is opened to release the payload |Maximum distance to descend (meters)| Empty| Empty| Empty| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)| */ - public static final int MAV_CMD_NAV_LAST = 95; /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_DELAY = 112; /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_CHANGE_ALT = 113; /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ - public static final int MAV_CMD_CONDITION_DISTANCE = 114; /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_YAW = 115; /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ - public static final int MAV_CMD_CONDITION_LAST = 159; /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_MODE = 176; /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_JUMP = 177; /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CHANGE_SPEED = 178; /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| absolute or relative [0,1]| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_HOME = 179; /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_DO_SET_PARAMETER = 180; /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_RELAY = 181; /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_REPEAT_RELAY = 182; /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_SERVO = 183; /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_REPEAT_SERVO = 184; /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_FLIGHTTERMINATION = 185; /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CHANGE_ALTITUDE = 186; /* Change altitude set point. |Altitude in meters| Mav frame of new altitude (see MAV_FRAME)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_LAND_START = 189; /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ - public static final int MAV_CMD_DO_RALLY_LAND = 190; /* Mission command to perform a landing from a rally point. |Break altitude (meters)| Landing speed (m/s)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GO_AROUND = 191; /* Mission command to safely abort an autonmous landing. |Altitude (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_REPOSITION = 192; /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags, see the MAV_DO_REPOSITION_FLAGS enum.| Reserved| Yaw heading, NaN for unchanged. For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude (deg * 1E7)| Longitude (deg * 1E7)| Altitude (meters)| */ - public static final int MAV_CMD_DO_PAUSE_CONTINUE = 193; /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - public static final int MAV_CMD_DO_SET_REVERSE = 194; /* Set moving direction to forward or reverse. |Direction (0=Forward, 1=Reverse)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CONTROL_VIDEO = 200; /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_ROI = 201; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ - public static final int MAV_CMD_DO_DIGICAM_CONFIGURE = 202; /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ - public static final int MAV_CMD_DO_DIGICAM_CONTROL = 203; /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count.| */ - public static final int MAV_CMD_DO_MOUNT_CONFIGURE = 204; /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| roll input (0 = angle, 1 = angular rate)| pitch input (0 = angle, 1 = angular rate)| yaw input (0 = angle, 1 = angular rate)| */ - public static final int MAV_CMD_DO_MOUNT_CONTROL = 205; /* Mission command to control a camera or antenna mount |pitch depending on mount mode (degrees or degrees/second depending on pitch input).| roll depending on mount mode (degrees or degrees/second depending on roll input).| yaw depending on mount mode (degrees or degrees/second depending on yaw input).| alt in meters depending on mount mode.| latitude in degrees * 1E7, set if appropriate mount mode.| longitude in degrees * 1E7, set if appropriate mount mode.| MAV_MOUNT_MODE enum value| */ - public static final int MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206; /* Mission command to set camera trigger distance for this flight. The camera is trigerred each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera. |Camera trigger distance (meters). 0 to stop triggering.| Camera shutter integration time (milliseconds). -1 or 0 to ignore| Trigger camera once immediately. (0 = no trigger, 1 = trigger)| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_FENCE_ENABLE = 207; /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_PARACHUTE = 208; /* Mission command to trigger a parachute |action (0=disable, 1=enable, 2=release, for some systems see PARACHUTE_ACTION enum, not in general message set.)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_MOTOR_TEST = 209; /* Mission command to perform motor test |motor sequence number (a number from 1 to max number of motors on the vehicle)| throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum)| throttle| timeout (in seconds)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_INVERTED_FLIGHT = 210; /* Change to/from inverted flight |inverted (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GRIPPER = 211; /* Mission command to operate EPM gripper |gripper number (a number from 1 to max number of grippers on the vehicle)| gripper action (0=release, 1=grab. See GRIPPER_ACTIONS enum)| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_AUTOTUNE_ENABLE = 212; /* Enable/disable autotune |enable (1: enable, 0:disable)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_NAV_SET_YAW_SPEED = 213; /* Sets a desired vehicle turn angle and speed change |yaw angle to adjust steering by in centidegress| speed - normalized to 0 .. 1| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214; /* Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera. |Camera trigger cycle time (milliseconds). -1 or 0 to ignore.| Camera shutter integration time (milliseconds). Should be less than trigger cycle time. -1 or 0 to ignore.| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220; /* Mission command to control a camera or antenna mount, using a quaternion as reference. |q1 - quaternion param #1, w (1 in null-rotation)| q2 - quaternion param #2, x (0 in null-rotation)| q3 - quaternion param #3, y (0 in null-rotation)| q4 - quaternion param #4, z (0 in null-rotation)| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GUIDED_MASTER = 221; /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_GUIDED_LIMITS = 222; /* set limits for external control |timeout - maximum time (in seconds) that external controller will be allowed to control vehicle. 0 means no timeout| absolute altitude min (in meters, AMSL) - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit| absolute altitude max (in meters)- if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit| horizontal move limit (in meters, AMSL) - if vehicle moves more than this distance from it's location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal altitude limit| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_ENGINE_CONTROL = 223; /* Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines |0: Stop engine, 1:Start Engine| 0: Warm start, 1:Cold start. Controls use of choke where applicable| Height delay (meters). This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_LAST = 240; /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_PREFLIGHT_CALIBRATION = 241; /* Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero. |1: gyro calibration, 3: gyro temperature calibration| 1: magnetometer calibration| 1: ground pressure calibration| 1: radio RC calibration, 2: RC trim calibration| 1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration| 1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration| 1: ESC calibration, 3: barometer temperature calibration| */ - public static final int MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242; /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ - public static final int MAV_CMD_PREFLIGHT_UAVCAN = 243; /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - public static final int MAV_CMD_PREFLIGHT_STORAGE = 245; /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: start logging with rate of param 3 in Hz (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ - public static final int MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246; /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| WIP: 0: Do nothing for camera, 1: Reboot onboard camera, 2: Shutdown onboard camera, 3: Reboot onboard camera and keep it in the bootloader until upgraded| WIP: 0: Do nothing for mount (e.g. gimbal), 1: Reboot mount, 2: Shutdown mount, 3: Reboot mount and keep it in the bootloader until upgraded| Reserved, send 0| Reserved, send 0| WIP: ID (e.g. camera ID -1 for all IDs)| */ - public static final int MAV_CMD_OVERRIDE_GOTO = 252; /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ - public static final int MAV_CMD_MISSION_START = 300; /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ - public static final int MAV_CMD_COMPONENT_ARM_DISARM = 400; /* Arms / Disarms a component |1 to arm, 0 to disarm| */ - public static final int MAV_CMD_GET_HOME_POSITION = 410; /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - public static final int MAV_CMD_START_RX_PAIR = 500; /* Starts receiver pairing |0:Spektrum| 0:Spektrum DSM2, 1:Spektrum DSMX| */ - public static final int MAV_CMD_GET_MESSAGE_INTERVAL = 510; /* Request the interval between messages for a particular MAVLink message ID |The MAVLink message ID| */ - public static final int MAV_CMD_SET_MESSAGE_INTERVAL = 511; /* Request the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM |The MAVLink message ID| The interval between two messages, in microseconds. Set to -1 to disable and 0 to request default rate.| */ - public static final int MAV_CMD_REQUEST_PROTOCOL_VERSION = 519; /* Request MAVLink protocol version compatibility |1: Request supported protocol versions by all nodes on the network| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520; /* Request autopilot capabilities |1: Request autopilot version| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_CAMERA_INFORMATION = 521; /* WIP: Request camera information (CAMERA_INFORMATION). |0: No action 1: Request camera capabilities| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_CAMERA_SETTINGS = 522; /* WIP: Request camera settings (CAMERA_SETTINGS). |0: No Action 1: Request camera settings| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_STORAGE_INFORMATION = 525; /* WIP: Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage. |Storage ID (0 for all, 1 for first, 2 for second, etc.)| 0: No Action 1: Request storage information| Reserved (all remaining params)| */ - public static final int MAV_CMD_STORAGE_FORMAT = 526; /* WIP: Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage. |Storage ID (1 for first, 2 for second, etc.)| 0: No action 1: Format storage| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527; /* WIP: Request camera capture status (CAMERA_CAPTURE_STATUS) |0: No Action 1: Request camera capture status| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528; /* WIP: Request flight information (FLIGHT_INFORMATION) |1: Request flight information| Reserved (all remaining params)| */ - public static final int MAV_CMD_RESET_CAMERA_SETTINGS = 529; /* WIP: Reset all camera settings to Factory Default |0: No Action 1: Reset all settings| Reserved (all remaining params)| */ - public static final int MAV_CMD_SET_CAMERA_MODE = 530; /* Set camera running mode. Use NAN for reserved values. |Reserved (Set to 0)| Camera mode (see CAMERA_MODE enum)| Reserved (all remaining params)| */ - public static final int MAV_CMD_IMAGE_START_CAPTURE = 2000; /* Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. Use NAN for reserved values. |Reserved (Set to 0)| Duration between two consecutive pictures (in seconds)| Number of images to capture total - 0 for unlimited capture| Reserved (all remaining params)| */ - public static final int MAV_CMD_IMAGE_STOP_CAPTURE = 2001; /* Stop image capture sequence Use NAN for reserved values. |Reserved (Set to 0)| Reserved (all remaining params)| */ - public static final int MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002; /* WIP: Re-request a CAMERA_IMAGE_CAPTURE packet. Use NAN for reserved values. |Sequence number for missing CAMERA_IMAGE_CAPTURE packet| Reserved (all remaining params)| */ - public static final int MAV_CMD_DO_TRIGGER_CONTROL = 2003; /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start), -1 to ignore| 1 to reset the trigger sequence, -1 or 0 to ignore| 1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore| */ - public static final int MAV_CMD_VIDEO_START_CAPTURE = 2500; /* Starts video capture (recording). Use NAN for reserved values. |Reserved (Set to 0)| Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency in Hz)| Reserved (all remaining params)| */ - public static final int MAV_CMD_VIDEO_STOP_CAPTURE = 2501; /* Stop the current video capture (recording). Use NAN for reserved values. |Reserved (Set to 0)| Reserved (all remaining params)| */ - public static final int MAV_CMD_VIDEO_START_STREAMING = 2502; /* WIP: Start video streaming |Camera ID (0 for all cameras, 1 for first, 2 for second, etc.)| Reserved| */ - public static final int MAV_CMD_VIDEO_STOP_STREAMING = 2503; /* WIP: Stop the current video streaming |Camera ID (0 for all cameras, 1 for first, 2 for second, etc.)| Reserved| */ - public static final int MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504; /* WIP: Request video stream information (VIDEO_STREAM_INFORMATION) |Camera ID (0 for all cameras, 1 for first, 2 for second, etc.)| 0: No Action 1: Request video stream information| Reserved (all remaining params)| */ - public static final int MAV_CMD_LOGGING_START = 2510; /* Request to start streaming logging data over MAVLink (see also LOGGING_DATA message) |Format: 0: ULog| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ - public static final int MAV_CMD_LOGGING_STOP = 2511; /* Request to stop streaming log data over MAVLink |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ - public static final int MAV_CMD_AIRFRAME_CONFIGURATION = 2520; /* |Landing gear ID (default: 0, -1 for all)| Landing gear position (Down: 0, Up: 1, NAN for no change)| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| Reserved, set to NAN| */ - public static final int MAV_CMD_PANORAMA_CREATE = 2800; /* Create a panorama at the current position |Viewing angle horizontal of the panorama (in degrees, +- 0.5 the total angle)| Viewing angle vertical of panorama (in degrees)| Speed of the horizontal rotation (in degrees per second)| Speed of the vertical rotation (in degrees per second)| */ - public static final int MAV_CMD_DO_VTOL_TRANSITION = 3000; /* Request VTOL transition |The target VTOL state, as defined by ENUM MAV_VTOL_STATE. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| */ - public static final int MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001; /* Request authorization to arm the vehicle to a external entity, the arm authorizer is resposible to request all data that is needs from the vehicle before authorize or deny the request. If approved the progress of command_ack message should be set with period of time that this authorization is valid in seconds or in case it was denied it should be set with one of the reasons in ARM_AUTH_DENIED_REASON. - |Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle| */ - public static final int MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000; /* This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocites along all three axes. - | */ - public static final int MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001; /* This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position. - |Radius of desired circle in CIRCLE_MODE| User defined| User defined| User defined| Unscaled target latitude of center of circle in CIRCLE_MODE| Unscaled target longitude of center of circle in CIRCLE_MODE| */ - public static final int MAV_CMD_CONDITION_GATE = 4501; /* WIP: Delay mission state machine until gate has been reached. |Geometry: 0: orthogonal to path between previous and next waypoint.| Altitude: 0: ignore altitude| Empty| Empty| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_FENCE_RETURN_POINT = 5000; /* Fence return point. There can only be one fence return point. + public static final int MAV_CMD_NAV_WAYPOINT = 16; /* Navigate to waypoint. |Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| Acceptance radius (if the sphere with this radius is hit, the waypoint counts as reached)| 0 to pass through the WP, if > 0 radius to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at waypoint (rotary wing). NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_UNLIM = 17; /* Loiter around this waypoint an unlimited amount of time |Empty| Empty| Radius around waypoint. If positive loiter clockwise, else counter-clockwise| Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_TURNS = 18; /* Loiter around this waypoint for X turns |Number of turns.| Empty| Radius around waypoint. If positive loiter clockwise, else counter-clockwise| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LOITER_TIME = 19; /* Loiter around this waypoint for X seconds |Loiter time.| Empty| Radius around waypoint. If positive loiter clockwise, else counter-clockwise.| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location. Else, this is desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_RETURN_TO_LAUNCH = 20; /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_NAV_LAND = 21; /* Land at location. |Minimum target altitude if landing is aborted (0 = undefined/use system default).| Precision land mode.| Empty.| Desired yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude.| Longitude.| Landing altitude (ground level in current frame).| */ + public static final int MAV_CMD_NAV_TAKEOFF = 22; /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LAND_LOCAL = 23; /* Land at local position (local frame only) |Landing target number (if available)| Maximum accepted offset from desired landing position - computed magnitude from spherical coordinates: d = sqrt(x^2 + y^2 + z^2), which gives the maximum accepted distance between the desired landing position and the position where the vehicle is about to land| Landing descend rate| Desired yaw angle| Y-axis position| X-axis position| Z-axis / ground level position| */ + public static final int MAV_CMD_NAV_TAKEOFF_LOCAL = 24; /* Takeoff from local position (local frame only) |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Takeoff ascend rate| Yaw angle (if magnetometer or another yaw estimation source present), ignored without one of these| Y-axis position| X-axis position| Z-axis position| */ + public static final int MAV_CMD_NAV_FOLLOW = 25; /* Vehicle following, i.e. this waypoint represents the position of a moving vehicle |Following logic to use (e.g. loitering or sinusoidal following) - depends on specific autopilot implementation| Ground speed of vehicle to be followed| Radius around waypoint. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30; /* Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached. |Climb or Descend (0 = Neutral, command completes when within 5m of this command's altitude, 1 = Climbing, command completes when at or above this command's altitude, 2 = Descending, command completes when at or below this command's altitude.| Empty| Empty| Empty| Empty| Empty| Desired altitude| */ + public static final int MAV_CMD_NAV_LOITER_TO_ALT = 31; /* Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint. |Heading Required (0 = False)| Radius. If positive loiter clockwise, negative counter-clockwise, 0 means no change to standard loiter.| Empty| Forward moving aircraft this sets exit xtrack location: 0 for center of loiter wp, 1 for exit location| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_DO_FOLLOW = 32; /* Begin following a target |System ID (of the FOLLOW_TARGET beacon). Send 0 to disable follow-me and return to the default position hold mode.| RESERVED| RESERVED| Altitude mode: 0: Keep current altitude, 1: keep altitude difference to target, 2: go to a fixed altitude above home.| Altitude above home. (used if mode=2)| RESERVED| Time to land in which the MAV should go to the default position hold mode after a message RX timeout.| */ + public static final int MAV_CMD_DO_FOLLOW_REPOSITION = 33; /* Reposition the MAV after a follow target command has been sent |Camera q1 (where 0 is on the ray from the camera to the tracking device)| Camera q2| Camera q3| Camera q4| altitude offset from target| X offset from target| Y offset from target| */ + public static final int MAV_CMD_DO_ORBIT = 34; /* Start orbiting on the circumference of a circle defined by the parameters. Setting any value NaN results in using defaults. |Radius of the circle. positive: Orbit clockwise. negative: Orbit counter-clockwise.| Tangential Velocity. NaN: Vehicle configuration default.| Yaw behavior of the vehicle.| Reserved (e.g. for dynamic center beacon options)| Center point latitude (if no MAV_FRAME specified) / X coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| Center point longitude (if no MAV_FRAME specified) / Y coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| Center point altitude (MSL) (if no MAV_FRAME specified) / Z coordinate according to MAV_FRAME. NaN: Use current vehicle position or current center if already orbiting.| */ + public static final int MAV_CMD_NAV_ROI = 80; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of interest mode.| Waypoint index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ + public static final int MAV_CMD_NAV_PATHPLANNING = 81; /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + public static final int MAV_CMD_NAV_SPLINE_WAYPOINT = 82; /* Navigate to waypoint using a spline path. |Hold time. (ignored by fixed wing, time to stay at waypoint for rotary wing)| Empty| Empty| Empty| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ + public static final int MAV_CMD_NAV_ALTITUDE_WAIT = 83; /* Mission command to wait for an altitude or downwards vertical speed. This is meant for high altitude balloon launches, allowing the aircraft to be idle until either an altitude is reached or a negative vertical speed is reached (indicating early balloon burst). The wiggle time is how often to wiggle the control surfaces to prevent them seizing up. |Altitude (m).| Descent speed (m/s).| Wiggle Time (s).| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_NAV_VTOL_TAKEOFF = 84; /* Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. |Empty| Front transition heading.| Empty| Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_VTOL_LAND = 85; /* Land using VTOL mode |Empty| Empty| Approach altitude (with the same reference as the Altitude field). NaN if unspecified.| Yaw angle. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.).| Latitude| Longitude| Altitude (ground level)| */ + public static final int MAV_CMD_NAV_GUIDED_ENABLE = 92; /* hand control over to an external controller |On / Off (> 0.5f on)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_NAV_DELAY = 93; /* Delay the next navigation command a number of seconds or until a specified time |Delay (-1 to enable time-of-day fields)| hour (24h format, UTC, -1 to ignore)| minute (24h format, UTC, -1 to ignore)| second (24h format, UTC)| Empty| Empty| Empty| */ + public static final int MAV_CMD_NAV_PAYLOAD_PLACE = 94; /* Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload. |Maximum distance to descend.| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_LAST = 95; /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_DELAY = 112; /* Delay mission state machine. |Delay| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_CHANGE_ALT = 113; /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate.| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ + public static final int MAV_CMD_CONDITION_DISTANCE = 114; /* Delay mission state machine until within desired distance of next NAV point. |Distance.| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_YAW = 115; /* Reach a certain target angle. |target angle, 0 is north| angular speed| direction: -1: counter clockwise, 1: clockwise| 0: absolute angle, 1: relative offset| Empty| Empty| Empty| */ + public static final int MAV_CMD_CONDITION_LAST = 159; /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_MODE = 176; /* Set system mode. |Mode| Custom mode - this is system specific, please refer to the individual autopilot specifications for details.| Custom sub mode - this is system specific, please refer to the individual autopilot specifications for details.| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_JUMP = 177; /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_CHANGE_SPEED = 178; /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed, 2=Climb Speed, 3=Descent Speed)| Speed (-1 indicates no change)| Throttle (-1 indicates no change)| 0: absolute, 1: relative| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_HOME = 179; /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_DO_SET_PARAMETER = 180; /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_RELAY = 181; /* Set a relay to a condition. |Relay instance number.| Setting. (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_REPEAT_RELAY = 182; /* Cycle a relay on and off for a desired number of cycles with a desired period. |Relay instance number.| Cycle count.| Cycle time.| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_SERVO = 183; /* Set a servo to a desired PWM value. |Servo instance number.| Pulse Width Modulation.| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_REPEAT_SERVO = 184; /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo instance number.| Pulse Width Modulation.| Cycle count.| Cycle time.| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_FLIGHTTERMINATION = 185; /* Terminate flight immediately |Flight termination activated if > 0.5| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_CHANGE_ALTITUDE = 186; /* Change altitude set point. |Altitude.| Frame of new altitude.| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_LAND_START = 189; /* Mission command to perform a landing. This is used as a marker in a mission to tell the autopilot where a sequence of mission items that represents a landing starts. It may also be sent via a COMMAND_LONG to trigger a landing, in which case the nearest (geographically) landing sequence in the mission will be used. The Latitude/Longitude is optional, and may be set to 0 if not needed. If specified then it will be used to help find the closest landing sequence. |Empty| Empty| Empty| Empty| Latitude| Longitude| Empty| */ + public static final int MAV_CMD_DO_RALLY_LAND = 190; /* Mission command to perform a landing from a rally point. |Break altitude| Landing speed| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GO_AROUND = 191; /* Mission command to safely abort an autonomous landing. |Altitude| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_REPOSITION = 192; /* Reposition the vehicle to a specific WGS84 global position. |Ground speed, less than 0 (-1) for default| Bitmask of option flags.| Reserved| Yaw heading. NaN to use the current system yaw heading mode (e.g. yaw towards next waypoint, yaw to home, etc.). For planes indicates loiter direction (0: clockwise, 1: counter clockwise)| Latitude| Longitude| Altitude (meters)| */ + public static final int MAV_CMD_DO_PAUSE_CONTINUE = 193; /* If in a GPS controlled position mode, hold the current position or continue. |0: Pause current mission or reposition command, hold current position. 1: Continue mission. A VTOL capable vehicle should enter hover mode (multicopter and VTOL planes). A plane should loiter with the default loiter radius.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + public static final int MAV_CMD_DO_SET_REVERSE = 194; /* Set moving direction to forward or reverse. |Direction (0=Forward, 1=Reverse)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_ROI_LOCATION = 195; /* Sets the region of interest (ROI) to a location. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Empty| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196; /* Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Empty| Empty| Empty| Empty| pitch offset from next waypoint| roll offset from next waypoint| yaw offset from next waypoint| */ + public static final int MAV_CMD_DO_SET_ROI_NONE = 197; /* Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_ROI_SYSID = 198; /* Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. |sysid| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_DO_CONTROL_VIDEO = 200; /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_ROI = 201; /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of interest mode.| Waypoint index/ target ID (depends on param 1).| Region of interest index. (allows a vehicle to manage multiple ROI's)| Empty| MAV_ROI_WPNEXT: pitch offset from next waypoint, MAV_ROI_LOCATION: latitude| MAV_ROI_WPNEXT: roll offset from next waypoint, MAV_ROI_LOCATION: longitude| MAV_ROI_WPNEXT: yaw offset from next waypoint, MAV_ROI_LOCATION: altitude| */ + public static final int MAV_CMD_DO_DIGICAM_CONFIGURE = 202; /* Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). |Modes: P, TV, AV, M, Etc.| Shutter speed: Divisor number for one second.| Aperture: F stop number.| ISO number e.g. 80, 100, 200, Etc.| Exposure type enumerator.| Command Identity.| Main engine cut-off time before camera trigger. (0 means no cut-off)| */ + public static final int MAV_CMD_DO_DIGICAM_CONTROL = 203; /* Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see https://mavlink.io/en/services/camera_def.html ). |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Test shot identifier. If set to 1, image will only be captured, but not counted towards internal frame count.| */ + public static final int MAV_CMD_DO_MOUNT_CONFIGURE = 204; /* Mission command to configure a camera or antenna mount |Mount operation mode| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| roll input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| pitch input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| yaw input (0 = angle body frame, 1 = angular rate, 2 = angle absolute frame)| */ + public static final int MAV_CMD_DO_MOUNT_CONTROL = 205; /* Mission command to control a camera or antenna mount |pitch depending on mount mode (degrees or degrees/second depending on pitch input).| roll depending on mount mode (degrees or degrees/second depending on roll input).| yaw depending on mount mode (degrees or degrees/second depending on yaw input).| altitude depending on mount mode.| latitude, set if appropriate mount mode.| longitude, set if appropriate mount mode.| Mount mode.| */ + public static final int MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206; /* Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera. |Camera trigger distance. 0 to stop triggering.| Camera shutter integration time. -1 or 0 to ignore| Trigger camera once immediately. (0 = no trigger, 1 = trigger)| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_FENCE_ENABLE = 207; /* Mission command to enable the geofence |enable? (0=disable, 1=enable, 2=disable_floor_only)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_PARACHUTE = 208; /* Mission command to trigger a parachute |action| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_MOTOR_TEST = 209; /* Mission command to perform motor test. |Motor instance number. (from 1 to max number of motors on the vehicle)| Throttle type.| Throttle.| Timeout.| Motor count. (number of motors to test to test in sequence, waiting for the timeout above between them; 0=1 motor, 1=1 motor, 2=2 motors...)| Motor test order.| Empty| */ + public static final int MAV_CMD_DO_INVERTED_FLIGHT = 210; /* Change to/from inverted flight. |Inverted flight. (0=normal, 1=inverted)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GRIPPER = 211; /* Mission command to operate EPM gripper. |Gripper number (a number from 1 to max number of grippers on the vehicle).| Gripper action (0=release, 1=grab. See GRIPPER_ACTIONS enum).| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_DO_AUTOTUNE_ENABLE = 212; /* Enable/disable autotune. |Enable (1: enable, 0:disable).| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_NAV_SET_YAW_SPEED = 213; /* Sets a desired vehicle turn angle and speed change. |Yaw angle to adjust steering by.| Speed.| Final angle. (0=absolute, 1=relative)| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214; /* Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera. |Camera trigger cycle time. -1 or 0 to ignore.| Camera shutter integration time. Should be less than trigger cycle time. -1 or 0 to ignore.| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220; /* Mission command to control a camera or antenna mount, using a quaternion as reference. |quaternion param q1, w (1 in null-rotation)| quaternion param q2, x (0 in null-rotation)| quaternion param q3, y (0 in null-rotation)| quaternion param q4, z (0 in null-rotation)| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GUIDED_MASTER = 221; /* set id of master controller |System ID| Component ID| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_GUIDED_LIMITS = 222; /* Set limits for external control |Timeout - maximum time that external controller will be allowed to control vehicle. 0 means no timeout.| Altitude (MSL) min - if vehicle moves below this alt, the command will be aborted and the mission will continue. 0 means no lower altitude limit.| Altitude (MSL) max - if vehicle moves above this alt, the command will be aborted and the mission will continue. 0 means no upper altitude limit.| Horizontal move limit - if vehicle moves more than this distance from its location at the moment the command was executed, the command will be aborted and the mission will continue. 0 means no horizontal move limit.| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_ENGINE_CONTROL = 223; /* Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines |0: Stop engine, 1:Start Engine| 0: Warm start, 1:Cold start. Controls use of choke where applicable| Height delay. This is for commanding engine start only after the vehicle has gained the specified height. Used in VTOL vehicles during takeoff to start engine after the aircraft is off the ground. Zero for no delay.| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_SET_MISSION_CURRENT = 224; /* Set the mission item with sequence number seq as current item. This means that the MAV will continue to this mission item on the shortest path (not following the mission items in-between). |Mission sequence value to set| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_DO_LAST = 240; /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_PREFLIGHT_CALIBRATION = 241; /* Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero. |1: gyro calibration, 3: gyro temperature calibration| 1: magnetometer calibration| 1: ground pressure calibration| 1: radio RC calibration, 2: RC trim calibration| 1: accelerometer calibration, 2: board level calibration, 3: accelerometer temperature calibration, 4: simple accelerometer calibration| 1: APM: compass/motor interference calibration (PX4: airspeed calibration, deprecated), 2: airspeed calibration| 1: ESC calibration, 3: barometer temperature calibration| */ + public static final int MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242; /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow, 5: second magnetometer, 6: third magnetometer| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ + public static final int MAV_CMD_PREFLIGHT_UAVCAN = 243; /* Trigger UAVCAN config. This command will be only accepted if in pre-flight mode. |1: Trigger actuator ID assignment and direction mapping.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + public static final int MAV_CMD_PREFLIGHT_STORAGE = 245; /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM, 2: Reset to defaults| Onboard logging: 0: Ignore, 1: Start default rate logging, -1: Stop logging, > 1: logging rate (e.g. set to 1000 for 1000 Hz logging)| Reserved| Empty| Empty| Empty| */ + public static final int MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246; /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot, 3: Reboot autopilot and keep it in the bootloader until upgraded.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer, 3: Reboot onboard computer and keep it in the bootloader until upgraded.| WIP: 0: Do nothing for camera, 1: Reboot onboard camera, 2: Shutdown onboard camera, 3: Reboot onboard camera and keep it in the bootloader until upgraded| WIP: 0: Do nothing for mount (e.g. gimbal), 1: Reboot mount, 2: Shutdown mount, 3: Reboot mount and keep it in the bootloader until upgraded| Reserved, send 0| Reserved, send 0| WIP: ID (e.g. camera ID -1 for all IDs)| */ + public static final int MAV_CMD_OVERRIDE_GOTO = 252; /* Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position. |MAV_GOTO_DO_HOLD: pause mission and either hold or move to specified position (depending on param2), MAV_GOTO_DO_CONTINUE: resume mission.| MAV_GOTO_HOLD_AT_CURRENT_POSITION: hold at current position, MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position.| Coordinate frame of hold point.| Desired yaw angle.| Latitude / X position.| Longitude / Y position.| Altitude / Z position.| */ + public static final int MAV_CMD_MISSION_START = 300; /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_COMPONENT_ARM_DISARM = 400; /* Arms / Disarms a component |0: disarm, 1: arm| 0: arm-disarm unless prevented by safety checks (i.e. when landed), 21196: force arming/disarming (e.g. allow arming to override preflight checks and disarming in flight)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ILLUMINATOR_ON_OFF = 405; /* Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light). |0: Illuminators OFF, 1: Illuminators ON| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_GET_HOME_POSITION = 410; /* Request the home position from the vehicle. |Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + public static final int MAV_CMD_START_RX_PAIR = 500; /* Starts receiver pairing. |0:Spektrum.| RC type.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_GET_MESSAGE_INTERVAL = 510; /* Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message. |The MAVLink message ID| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_MESSAGE_INTERVAL = 511; /* Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM. |The MAVLink message ID| The interval between two messages. Set to -1 to disable and 0 to request default rate.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Target address of message stream (if message has target address fields). 0: Flight-stack default (recommended), 1: address of requestor, 2: broadcast.| */ + public static final int MAV_CMD_REQUEST_MESSAGE = 512; /* Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL). |The MAVLink message ID of the requested message.| Index id (if appropriate). The use of this parameter (if any), must be defined in the requested message.| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| The use of this parameter (if any), must be defined in the requested message. By default assumed not used (0).| Target address for requested message (if message has target address fields). 0: Flight-stack default, 1: address of requestor, 2: broadcast.| */ + public static final int MAV_CMD_REQUEST_PROTOCOL_VERSION = 519; /* Request MAVLink protocol version compatibility |1: Request supported protocol versions by all nodes on the network| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520; /* Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message |1: Request autopilot version| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_CAMERA_INFORMATION = 521; /* Request camera information (CAMERA_INFORMATION). |0: No action 1: Request camera capabilities| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_CAMERA_SETTINGS = 522; /* Request camera settings (CAMERA_SETTINGS). |0: No Action 1: Request camera settings| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_STORAGE_INFORMATION = 525; /* Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage. |Storage ID (0 for all, 1 for first, 2 for second, etc.)| 0: No Action 1: Request storage information| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_STORAGE_FORMAT = 526; /* Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage. |Storage ID (1 for first, 2 for second, etc.)| 0: No action 1: Format storage| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527; /* Request camera capture status (CAMERA_CAPTURE_STATUS) |0: No Action 1: Request camera capture status| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528; /* Request flight information (FLIGHT_INFORMATION) |1: Request flight information| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_RESET_CAMERA_SETTINGS = 529; /* Reset all camera settings to Factory Default |0: No Action 1: Reset all settings| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_CAMERA_MODE = 530; /* Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming. |Reserved (Set to 0)| Camera mode| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_CAMERA_ZOOM = 531; /* Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success). Use NaN for reserved values. |Zoom type| Zoom value. The range of valid values depend on the zoom type.| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_CAMERA_FOCUS = 532; /* Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success). Use NaN for reserved values. |Focus type| Focus value| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_JUMP_TAG = 600; /* Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG. |Tag.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_DO_JUMP_TAG = 601; /* Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number. |Target tag to jump to.| Repeat count.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_IMAGE_START_CAPTURE = 2000; /* Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture. Use NaN for reserved values. |Reserved (Set to 0)| Desired elapsed time between two consecutive pictures (in seconds). Minimum values depend on hardware (typically greater than 2 seconds).| Total number of images to capture. 0 to capture forever/until MAV_CMD_IMAGE_STOP_CAPTURE.| Capture sequence number starting from 1. This is only valid for single-capture (param3 == 1). Increment the capture ID for each capture command to prevent double captures when a command is re-transmitted. Use 0 to ignore it.| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_IMAGE_STOP_CAPTURE = 2001; /* Stop image capture sequence Use NaN for reserved values. |Reserved (Set to 0)| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002; /* Re-request a CAMERA_IMAGE_CAPTURE message. Use NaN for reserved values. |Sequence number for missing CAMERA_IMAGE_CAPTURE message| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_DO_TRIGGER_CONTROL = 2003; /* Enable or disable on-board camera triggering system. |Trigger enable/disable (0 for disable, 1 for start), -1 to ignore| 1 to reset the trigger sequence, -1 or 0 to ignore| 1 to pause triggering, but without switching the camera off or retracting it. -1 to ignore| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_VIDEO_START_CAPTURE = 2500; /* Starts video capture (recording). Use NaN for reserved values. |Video Stream ID (0 for all streams)| Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency)| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_VIDEO_STOP_CAPTURE = 2501; /* Stop the current video capture (recording). Use NaN for reserved values. |Video Stream ID (0 for all streams)| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_VIDEO_START_STREAMING = 2502; /* Start video streaming |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_VIDEO_STOP_STREAMING = 2503; /* Stop the given video stream |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504; /* Request video stream information (VIDEO_STREAM_INFORMATION) |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505; /* Request video stream status (VIDEO_STREAM_STATUS) |Video Stream ID (0 for all streams, 1 for first, 2 for second, etc.)| Reserved (all remaining params)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_LOGGING_START = 2510; /* Request to start streaming logging data over MAVLink (see also LOGGING_DATA message) |Format: 0: ULog| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ + public static final int MAV_CMD_LOGGING_STOP = 2511; /* Request to stop streaming log data over MAVLink |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ + public static final int MAV_CMD_AIRFRAME_CONFIGURATION = 2520; /* |Landing gear ID (default: 0, -1 for all)| Landing gear position (Down: 0, Up: 1, NaN for no change)| Reserved, set to NaN| Reserved, set to NaN| Reserved, set to NaN| Reserved, set to NaN| Reserved, set to NaN| */ + public static final int MAV_CMD_CONTROL_HIGH_LATENCY = 2600; /* Request to start/stop transmitting over the high latency telemetry |Control transmission over high latency telemetry (0: stop, 1: start)| Empty| Empty| Empty| Empty| Empty| Empty| */ + public static final int MAV_CMD_PANORAMA_CREATE = 2800; /* Create a panorama at the current position |Viewing angle horizontal of the panorama (+- 0.5 the total angle)| Viewing angle vertical of panorama.| Speed of the horizontal rotation.| Speed of the vertical rotation.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_DO_VTOL_TRANSITION = 3000; /* Request VTOL transition |The target VTOL state. Only MAV_VTOL_STATE_MC and MAV_VTOL_STATE_FW can be used.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001; /* Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. If approved the progress of command_ack message should be set with period of time that this authorization is valid in seconds or in case it was denied it should be set with one of the reasons in ARM_AUTH_DENIED_REASON. + |Vehicle system id, this way ground station can request arm authorization on behalf of any vehicle| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000; /* This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes. + |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001; /* This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position. + |Radius of desired circle in CIRCLE_MODE| User defined| User defined| User defined| Unscaled target latitude of center of circle in CIRCLE_MODE| Unscaled target longitude of center of circle in CIRCLE_MODE| Reserved (default:0)| */ + public static final int MAV_CMD_CONDITION_GATE = 4501; /* Delay mission state machine until gate has been reached. |Geometry: 0: orthogonal to path between previous and next waypoint.| Altitude: 0: ignore altitude| Empty| Empty| Latitude| Longitude| Altitude| */ + public static final int MAV_CMD_NAV_FENCE_RETURN_POINT = 5000; /* Fence return point. There can only be one fence return point. |Reserved| Reserved| Reserved| Reserved| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001; /* Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. + public static final int MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001; /* Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. |Polygon vertex count| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ - public static final int MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002; /* Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. + public static final int MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002; /* Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. |Polygon vertex count| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ - public static final int MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003; /* Circular fence area. The vehicle must stay inside this area. - |radius in meters| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ - public static final int MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004; /* Circular fence area. The vehicle must stay outside this area. - |radius in meters| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ - public static final int MAV_CMD_NAV_RALLY_POINT = 5100; /* Rally point. You can have multiple rally points defined. + public static final int MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003; /* Circular fence area. The vehicle must stay inside this area. + |Radius.| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ + public static final int MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004; /* Circular fence area. The vehicle must stay outside this area. + |Radius.| Reserved| Reserved| Reserved| Latitude| Longitude| Reserved| */ + public static final int MAV_CMD_NAV_RALLY_POINT = 5100; /* Rally point. You can have multiple rally points defined. |Reserved| Reserved| Reserved| Reserved| Latitude| Longitude| Altitude| */ - public static final int MAV_CMD_UAVCAN_GET_NODE_INFO = 5200; /* Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages. |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ - public static final int MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001; /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in degrees compass heading (0..360). A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overriden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position in meters. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude, in meters AMSL| */ - public static final int MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002; /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deploment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ - public static final int MAV_CMD_WAYPOINT_USER_1 = 31000; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_WAYPOINT_USER_2 = 31001; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_WAYPOINT_USER_3 = 31002; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_WAYPOINT_USER_4 = 31003; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_WAYPOINT_USER_5 = 31004; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_SPATIAL_USER_1 = 31005; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_SPATIAL_USER_2 = 31006; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_SPATIAL_USER_3 = 31007; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_SPATIAL_USER_4 = 31008; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_SPATIAL_USER_5 = 31009; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude, in meters AMSL| */ - public static final int MAV_CMD_USER_1 = 31010; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - public static final int MAV_CMD_USER_2 = 31011; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - public static final int MAV_CMD_USER_3 = 31012; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - public static final int MAV_CMD_USER_4 = 31013; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - public static final int MAV_CMD_USER_5 = 31014; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ - public static final int MAV_CMD_POWER_OFF_INITIATED = 42000; /* A system wide power-off event has been initiated. |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_SOLO_BTN_FLY_CLICK = 42001; /* FLY button has been clicked. |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_SOLO_BTN_FLY_HOLD = 42002; /* FLY button has been held for 1.5 seconds. |Takeoff altitude| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_SOLO_BTN_PAUSE_CLICK = 42003; /* PAUSE button has been clicked. |1 if Solo is in a shot mode, 0 otherwise| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_START_MAG_CAL = 42424; /* Initiate a magnetometer calibration |uint8_t bitmask of magnetometers (0 means all)| Automatically retry on failure (0=no retry, 1=retry).| Save without user input (0=require input, 1=autosave).| Delay (seconds)| Autoreboot (0=user reboot, 1=autoreboot)| Empty| Empty| */ - public static final int MAV_CMD_DO_ACCEPT_MAG_CAL = 42425; /* Initiate a magnetometer calibration |uint8_t bitmask of magnetometers (0 means all)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_CANCEL_MAG_CAL = 42426; /* Cancel a running magnetometer calibration |uint8_t bitmask of magnetometers (0 means all)| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_SET_FACTORY_TEST_MODE = 42427; /* Command autopilot to get into factory test/diagnostic mode |0 means get out of test mode, 1 means get into test mode| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_DO_SEND_BANNER = 42428; /* Reply with the version banner |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_ACCELCAL_VEHICLE_POS = 42429; /* Used when doing accelerometer calibration. When sent to the GCS tells it what position to put the vehicle in. When sent to the vehicle says what position the vehicle is in. |Position, one of the ACCELCAL_VEHICLE_POS enum values| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_GIMBAL_RESET = 42501; /* Causes the gimbal to reset and boot as if it was just powered on |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_GIMBAL_AXIS_CALIBRATION_STATUS = 42502; /* Reports progress and success or failure of gimbal axis calibration procedure |Gimbal axis we're reporting calibration progress for| Current calibration progress for this axis, 0x64=100%| Status of the calibration| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_GIMBAL_REQUEST_AXIS_CALIBRATION = 42503; /* Starts commutation calibration on the gimbal |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ - public static final int MAV_CMD_GIMBAL_FULL_RESET = 42505; /* Erases gimbal application and parameters |Magic number| Magic number| Magic number| Magic number| Magic number| Magic number| Magic number| */ - public static final int MAV_CMD_ENUM_END = 42506; /* | */ + public static final int MAV_CMD_UAVCAN_GET_NODE_INFO = 5200; /* Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages. |Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| Reserved (set to 0)| */ + public static final int MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001; /* Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity. |Operation mode. 0: prepare single payload deploy (overwriting previous requests), but do not execute it. 1: execute payload deploy immediately (rejecting further deploy commands during execution, but allowing abort). 2: add payload deploy to existing deployment list.| Desired approach vector in compass heading. A negative value indicates the system can define the approach vector at will.| Desired ground speed at release time. This can be overridden by the airframe in case it needs to meet minimum airspeed. A negative value indicates the system can define the ground speed at will.| Minimum altitude clearance to the release position. A negative value indicates the system can define the clearance at will.| Latitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Longitude unscaled for MISSION_ITEM or in 1e7 degrees for MISSION_ITEM_INT| Altitude (MSL), in meters| */ + public static final int MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002; /* Control the payload deployment. |Operation mode. 0: Abort deployment, continue normal mission. 1: switch to payload deployment mode. 100: delete first payload deployment request. 101: delete all payload deployment requests.| Reserved| Reserved| Reserved| Reserved| Reserved| Reserved| */ + public static final int MAV_CMD_WAYPOINT_USER_1 = 31000; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_WAYPOINT_USER_2 = 31001; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_WAYPOINT_USER_3 = 31002; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_WAYPOINT_USER_4 = 31003; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_WAYPOINT_USER_5 = 31004; /* User defined waypoint item. Ground Station will show the Vehicle as flying through this item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_SPATIAL_USER_1 = 31005; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_SPATIAL_USER_2 = 31006; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_SPATIAL_USER_3 = 31007; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_SPATIAL_USER_4 = 31008; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_SPATIAL_USER_5 = 31009; /* User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item. |User defined| User defined| User defined| User defined| Latitude unscaled| Longitude unscaled| Altitude (MSL), in meters| */ + public static final int MAV_CMD_USER_1 = 31010; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + public static final int MAV_CMD_USER_2 = 31011; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + public static final int MAV_CMD_USER_3 = 31012; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + public static final int MAV_CMD_USER_4 = 31013; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + public static final int MAV_CMD_USER_5 = 31014; /* User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item. |User defined| User defined| User defined| User defined| User defined| User defined| User defined| */ + public static final int MAV_CMD_POWER_OFF_INITIATED = 42000; /* A system wide power-off event has been initiated. |Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_SOLO_BTN_FLY_CLICK = 42001; /* FLY button has been clicked. |Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_SOLO_BTN_FLY_HOLD = 42002; /* FLY button has been held for 1.5 seconds. |Takeoff altitude.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_SOLO_BTN_PAUSE_CLICK = 42003; /* PAUSE button has been clicked. |1 if Solo is in a shot mode, 0 otherwise.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_FIXED_MAG_CAL = 42004; /* Magnetometer calibration based on fixed position + in earth field given by inclination, declination and intensity. |MagDeclinationDegrees.| MagInclinationDegrees.| MagIntensityMilliGauss.| YawDegrees.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_FIXED_MAG_CAL_FIELD = 42005; /* Magnetometer calibration based on fixed expected field values in milliGauss. |FieldX.| FieldY.| FieldZ.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_FIXED_MAG_CAL_YAW = 42006; /* Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location. |Yaw of vehicle in earth frame.| CompassMask, 0 for all.| Latitude.| Longitude.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_DO_START_MAG_CAL = 42424; /* Initiate a magnetometer calibration. |uint8_t bitmask of magnetometers (0 means all).| Automatically retry on failure (0=no retry, 1=retry).| Save without user input (0=require input, 1=autosave).| Delay (seconds).| Autoreboot (0=user reboot, 1=autoreboot).| Empty.| Empty.| */ + public static final int MAV_CMD_DO_ACCEPT_MAG_CAL = 42425; /* Initiate a magnetometer calibration. |uint8_t bitmask of magnetometers (0 means all).| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_DO_CANCEL_MAG_CAL = 42426; /* Cancel a running magnetometer calibration. |uint8_t bitmask of magnetometers (0 means all).| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_SET_FACTORY_TEST_MODE = 42427; /* Command autopilot to get into factory test/diagnostic mode. |0 means get out of test mode, 1 means get into test mode.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_DO_SEND_BANNER = 42428; /* Reply with the version banner. |Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_ACCELCAL_VEHICLE_POS = 42429; /* Used when doing accelerometer calibration. When sent to the GCS tells it what position to put the vehicle in. When sent to the vehicle says what position the vehicle is in. |Position, one of the ACCELCAL_VEHICLE_POS enum values.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_GIMBAL_RESET = 42501; /* Causes the gimbal to reset and boot as if it was just powered on. |Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_GIMBAL_AXIS_CALIBRATION_STATUS = 42502; /* Reports progress and success or failure of gimbal axis calibration procedure. |Gimbal axis we're reporting calibration progress for.| Current calibration progress for this axis, 0x64=100%.| Status of the calibration.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_GIMBAL_REQUEST_AXIS_CALIBRATION = 42503; /* Starts commutation calibration on the gimbal. |Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_GIMBAL_FULL_RESET = 42505; /* Erases gimbal application and parameters. |Magic number.| Magic number.| Magic number.| Magic number.| Magic number.| Magic number.| Magic number.| */ + public static final int MAV_CMD_DO_WINCH = 42600; /* Command to operate winch. |Winch number (0 for the default winch, otherwise a number from 1 to max number of winches on the vehicle).| Action (0=relax, 1=relative length control, 2=rate control. See WINCH_ACTIONS enum.).| Release length (cable distance to unwind in meters, negative numbers to wind in cable).| Release rate (meters/second).| Empty.| Empty.| Empty.| */ + public static final int MAV_CMD_FLASH_BOOTLOADER = 42650; /* Update the bootloader |Empty| Empty| Empty| Empty| Magic number - set to 290876 to actually flash| Empty| Empty| */ + public static final int MAV_CMD_BATTERY_RESET = 42651; /* Reset battery capacity for batteries that accumulate consumed battery via integration. |Bitmask of batteries to reset. Least significant bit is for the first battery.| Battery percentage remaining to set.| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ENUM_END = 42652; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_CMD_ACK.java b/app/src/main/java/com/MAVLink/enums/MAV_CMD_ACK.java index a083c77..40f3383 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_CMD_ACK.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_CMD_ACK.java @@ -6,19 +6,19 @@ package com.MAVLink.enums; -/** - * ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. - */ +/** +* ACK / NACK / ERROR values as a result of MAV_CMDs and for mission item transmission. +*/ public class MAV_CMD_ACK { - public static final int MAV_CMD_ACK_OK = 1; /* Command / mission item is ok. | */ - public static final int MAV_CMD_ACK_ERR_FAIL = 2; /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. | */ - public static final int MAV_CMD_ACK_ERR_ACCESS_DENIED = 3; /* The system is refusing to accept this command from this source / communication partner. | */ - public static final int MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4; /* Command or mission item is not supported, other commands would be accepted. | */ - public static final int MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5; /* The coordinate frame of this command / mission item is not supported. | */ - public static final int MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6; /* The coordinate frame of this command is ok, but he coordinate values exceed the safety_layout limits of this system. This is a generic error, please use the more specific error messages below if possible. | */ - public static final int MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7; /* The X or latitude value is out of range. | */ - public static final int MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8; /* The Y or longitude value is out of range. | */ - public static final int MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9; /* The Z or altitude value is out of range. | */ - public static final int MAV_CMD_ACK_ENUM_END = 10; /* | */ + public static final int MAV_CMD_ACK_OK = 1; /* Command / mission item is ok. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_FAIL = 2; /* Generic error message if none of the other reasons fails or if no detailed error reporting is implemented. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_ACCESS_DENIED = 3; /* The system is refusing to accept this command from this source / communication partner. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_NOT_SUPPORTED = 4; /* Command or mission item is not supported, other commands would be accepted. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_COORDINATE_FRAME_NOT_SUPPORTED = 5; /* The coordinate frame of this command / mission item is not supported. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_COORDINATES_OUT_OF_RANGE = 6; /* The coordinate frame of this command is ok, but he coordinate values exceed the safety limits of this system. This is a generic error, please use the more specific error messages below if possible. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_X_LAT_OUT_OF_RANGE = 7; /* The X or latitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_Y_LON_OUT_OF_RANGE = 8; /* The Y or longitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ERR_Z_ALT_OUT_OF_RANGE = 9; /* The Z or altitude value is out of range. |Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| Reserved (default:0)| */ + public static final int MAV_CMD_ACK_ENUM_END = 10; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_ACTION.java b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_ACTION.java index 3bbfcbe..988daf3 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_ACTION.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_ACTION.java @@ -6,17 +6,17 @@ package com.MAVLink.enums; -/** - * Possible actions an aircraft can take to avoid a collision. - */ +/** +* Possible actions an aircraft can take to avoid a collision. +*/ public class MAV_COLLISION_ACTION { - public static final int MAV_COLLISION_ACTION_NONE = 0; /* Ignore any potential collisions | */ - public static final int MAV_COLLISION_ACTION_REPORT = 1; /* Report potential collision | */ - public static final int MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2; /* Ascend or Descend to avoid threat | */ - public static final int MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3; /* Move horizontally to avoid threat | */ - public static final int MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4; /* Aircraft to move perpendicular to the collision's velocity vector | */ - public static final int MAV_COLLISION_ACTION_RTL = 5; /* Aircraft to fly directly back to its launch point | */ - public static final int MAV_COLLISION_ACTION_HOVER = 6; /* Aircraft to stop in place | */ - public static final int MAV_COLLISION_ACTION_ENUM_END = 7; /* | */ + public static final int MAV_COLLISION_ACTION_NONE = 0; /* Ignore any potential collisions | */ + public static final int MAV_COLLISION_ACTION_REPORT = 1; /* Report potential collision | */ + public static final int MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2; /* Ascend or Descend to avoid threat | */ + public static final int MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3; /* Move horizontally to avoid threat | */ + public static final int MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4; /* Aircraft to move perpendicular to the collision's velocity vector | */ + public static final int MAV_COLLISION_ACTION_RTL = 5; /* Aircraft to fly directly back to its launch point | */ + public static final int MAV_COLLISION_ACTION_HOVER = 6; /* Aircraft to stop in place | */ + public static final int MAV_COLLISION_ACTION_ENUM_END = 7; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_SRC.java b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_SRC.java index 16fb78c..b2fd278 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_SRC.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_SRC.java @@ -6,12 +6,12 @@ package com.MAVLink.enums; -/** - * Source of information about this collision. - */ +/** +* Source of information about this collision. +*/ public class MAV_COLLISION_SRC { - public static final int MAV_COLLISION_SRC_ADSB = 0; /* ID field references ADSB_VEHICLE packets | */ - public static final int MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1; /* ID field references MAVLink SRC ID | */ - public static final int MAV_COLLISION_SRC_ENUM_END = 2; /* | */ + public static final int MAV_COLLISION_SRC_ADSB = 0; /* ID field references ADSB_VEHICLE packets | */ + public static final int MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1; /* ID field references MAVLink SRC ID | */ + public static final int MAV_COLLISION_SRC_ENUM_END = 2; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_THREAT_LEVEL.java b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_THREAT_LEVEL.java index 1ea6428..ba4a984 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_THREAT_LEVEL.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_COLLISION_THREAT_LEVEL.java @@ -6,13 +6,13 @@ package com.MAVLink.enums; -/** - * Aircraft-rated danger from this threat. - */ +/** +* Aircraft-rated danger from this threat. +*/ public class MAV_COLLISION_THREAT_LEVEL { - public static final int MAV_COLLISION_THREAT_LEVEL_NONE = 0; /* Not a threat | */ - public static final int MAV_COLLISION_THREAT_LEVEL_LOW = 1; /* Craft is mildly concerned about this threat | */ - public static final int MAV_COLLISION_THREAT_LEVEL_HIGH = 2; /* Craft is panicing, and may take actions to avoid threat | */ - public static final int MAV_COLLISION_THREAT_LEVEL_ENUM_END = 3; /* | */ + public static final int MAV_COLLISION_THREAT_LEVEL_NONE = 0; /* Not a threat | */ + public static final int MAV_COLLISION_THREAT_LEVEL_LOW = 1; /* Craft is mildly concerned about this threat | */ + public static final int MAV_COLLISION_THREAT_LEVEL_HIGH = 2; /* Craft is panicking, and may take actions to avoid threat | */ + public static final int MAV_COLLISION_THREAT_LEVEL_ENUM_END = 3; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_COMPONENT.java b/app/src/main/java/com/MAVLink/enums/MAV_COMPONENT.java index 776c113..2e38d40 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_COMPONENT.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_COMPONENT.java @@ -6,49 +6,135 @@ package com.MAVLink.enums; -/** - * - */ +/** +* Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). + Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. + When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded. +*/ public class MAV_COMPONENT { - public static final int MAV_COMP_ID_ALL = 0; /* | */ - public static final int MAV_COMP_ID_AUTOPILOT1 = 1; /* | */ - public static final int MAV_COMP_ID_CAMERA = 100; /* | */ - public static final int MAV_COMP_ID_CAMERA2 = 101; /* | */ - public static final int MAV_COMP_ID_CAMERA3 = 102; /* | */ - public static final int MAV_COMP_ID_CAMERA4 = 103; /* | */ - public static final int MAV_COMP_ID_CAMERA5 = 104; /* | */ - public static final int MAV_COMP_ID_CAMERA6 = 105; /* | */ - public static final int MAV_COMP_ID_SERVO1 = 140; /* | */ - public static final int MAV_COMP_ID_SERVO2 = 141; /* | */ - public static final int MAV_COMP_ID_SERVO3 = 142; /* | */ - public static final int MAV_COMP_ID_SERVO4 = 143; /* | */ - public static final int MAV_COMP_ID_SERVO5 = 144; /* | */ - public static final int MAV_COMP_ID_SERVO6 = 145; /* | */ - public static final int MAV_COMP_ID_SERVO7 = 146; /* | */ - public static final int MAV_COMP_ID_SERVO8 = 147; /* | */ - public static final int MAV_COMP_ID_SERVO9 = 148; /* | */ - public static final int MAV_COMP_ID_SERVO10 = 149; /* | */ - public static final int MAV_COMP_ID_SERVO11 = 150; /* | */ - public static final int MAV_COMP_ID_SERVO12 = 151; /* | */ - public static final int MAV_COMP_ID_SERVO13 = 152; /* | */ - public static final int MAV_COMP_ID_SERVO14 = 153; /* | */ - public static final int MAV_COMP_ID_GIMBAL = 154; /* | */ - public static final int MAV_COMP_ID_LOG = 155; /* | */ - public static final int MAV_COMP_ID_ADSB = 156; /* | */ - public static final int MAV_COMP_ID_OSD = 157; /* On Screen Display (OSD) devices for video links | */ - public static final int MAV_COMP_ID_PERIPHERAL = 158; /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter sub-protocol | */ - public static final int MAV_COMP_ID_QX1_GIMBAL = 159; /* | */ - public static final int MAV_COMP_ID_MAPPER = 180; /* | */ - public static final int MAV_COMP_ID_MISSIONPLANNER = 190; /* | */ - public static final int MAV_COMP_ID_PATHPLANNER = 195; /* | */ - public static final int MAV_COMP_ID_IMU = 200; /* | */ - public static final int MAV_COMP_ID_IMU_2 = 201; /* | */ - public static final int MAV_COMP_ID_IMU_3 = 202; /* | */ - public static final int MAV_COMP_ID_GPS = 220; /* | */ - public static final int MAV_COMP_ID_GPS2 = 221; /* | */ - public static final int MAV_COMP_ID_UDP_BRIDGE = 240; /* | */ - public static final int MAV_COMP_ID_UART_BRIDGE = 241; /* | */ - public static final int MAV_COMP_ID_SYSTEM_CONTROL = 250; /* | */ - public static final int MAV_COMPONENT_ENUM_END = 251; /* | */ + public static final int MAV_COMP_ID_ALL = 0; /* Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message. | */ + public static final int MAV_COMP_ID_AUTOPILOT1 = 1; /* System flight controller component ("autopilot"). Only one autopilot is expected in a particular system. | */ + public static final int MAV_COMP_ID_USER1 = 25; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER2 = 26; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER3 = 27; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER4 = 28; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER5 = 29; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER6 = 30; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER7 = 31; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER8 = 32; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER9 = 33; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER10 = 34; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER11 = 35; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER12 = 36; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER13 = 37; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER14 = 38; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER15 = 39; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USE16 = 40; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER17 = 41; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER18 = 42; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER19 = 43; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER20 = 44; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER21 = 45; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER22 = 46; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER23 = 47; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER24 = 48; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER25 = 49; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER26 = 50; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER27 = 51; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER28 = 52; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER29 = 53; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER30 = 54; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER31 = 55; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER32 = 56; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER33 = 57; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER34 = 58; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER35 = 59; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER36 = 60; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER37 = 61; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER38 = 62; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER39 = 63; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER40 = 64; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER41 = 65; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER42 = 66; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER43 = 67; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER44 = 68; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER45 = 69; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER46 = 70; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER47 = 71; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER48 = 72; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER49 = 73; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER50 = 74; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER51 = 75; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER52 = 76; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER53 = 77; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER54 = 78; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER55 = 79; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER56 = 80; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER57 = 81; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER58 = 82; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER59 = 83; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER60 = 84; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER61 = 85; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER62 = 86; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER63 = 87; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER64 = 88; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER65 = 89; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER66 = 90; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER67 = 91; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER68 = 92; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER69 = 93; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER70 = 94; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER71 = 95; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER72 = 96; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER73 = 97; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER74 = 98; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_USER75 = 99; /* Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network. | */ + public static final int MAV_COMP_ID_CAMERA = 100; /* Camera #1. | */ + public static final int MAV_COMP_ID_CAMERA2 = 101; /* Camera #2. | */ + public static final int MAV_COMP_ID_CAMERA3 = 102; /* Camera #3. | */ + public static final int MAV_COMP_ID_CAMERA4 = 103; /* Camera #4. | */ + public static final int MAV_COMP_ID_CAMERA5 = 104; /* Camera #5. | */ + public static final int MAV_COMP_ID_CAMERA6 = 105; /* Camera #6. | */ + public static final int MAV_COMP_ID_SERVO1 = 140; /* Servo #1. | */ + public static final int MAV_COMP_ID_SERVO2 = 141; /* Servo #2. | */ + public static final int MAV_COMP_ID_SERVO3 = 142; /* Servo #3. | */ + public static final int MAV_COMP_ID_SERVO4 = 143; /* Servo #4. | */ + public static final int MAV_COMP_ID_SERVO5 = 144; /* Servo #5. | */ + public static final int MAV_COMP_ID_SERVO6 = 145; /* Servo #6. | */ + public static final int MAV_COMP_ID_SERVO7 = 146; /* Servo #7. | */ + public static final int MAV_COMP_ID_SERVO8 = 147; /* Servo #8. | */ + public static final int MAV_COMP_ID_SERVO9 = 148; /* Servo #9. | */ + public static final int MAV_COMP_ID_SERVO10 = 149; /* Servo #10. | */ + public static final int MAV_COMP_ID_SERVO11 = 150; /* Servo #11. | */ + public static final int MAV_COMP_ID_SERVO12 = 151; /* Servo #12. | */ + public static final int MAV_COMP_ID_SERVO13 = 152; /* Servo #13. | */ + public static final int MAV_COMP_ID_SERVO14 = 153; /* Servo #14. | */ + public static final int MAV_COMP_ID_GIMBAL = 154; /* Gimbal #1. | */ + public static final int MAV_COMP_ID_LOG = 155; /* Logging component. | */ + public static final int MAV_COMP_ID_ADSB = 156; /* Automatic Dependent Surveillance-Broadcast (ADS-B) component. | */ + public static final int MAV_COMP_ID_OSD = 157; /* On Screen Display (OSD) devices for video links. | */ + public static final int MAV_COMP_ID_PERIPHERAL = 158; /* Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice. | */ + public static final int MAV_COMP_ID_QX1_GIMBAL = 159; /* Gimbal ID for QX1. | */ + public static final int MAV_COMP_ID_FLARM = 160; /* FLARM collision alert component. | */ + public static final int MAV_COMP_ID_GIMBAL2 = 171; /* Gimbal #2. | */ + public static final int MAV_COMP_ID_GIMBAL3 = 172; /* Gimbal #3. | */ + public static final int MAV_COMP_ID_GIMBAL4 = 173; /* Gimbal #4 | */ + public static final int MAV_COMP_ID_GIMBAL5 = 174; /* Gimbal #5. | */ + public static final int MAV_COMP_ID_GIMBAL6 = 175; /* Gimbal #6. | */ + public static final int MAV_COMP_ID_MISSIONPLANNER = 190; /* Component that can generate/supply a mission flight plan (e.g. GCS or developer API). | */ + public static final int MAV_COMP_ID_PATHPLANNER = 195; /* Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.). | */ + public static final int MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196; /* Component that plans a collision free path between two points. | */ + public static final int MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197; /* Component that provides position estimates using VIO techniques. | */ + public static final int MAV_COMP_ID_PAIRING_MANAGER = 198; /* Component that manages pairing of vehicle and GCS. | */ + public static final int MAV_COMP_ID_IMU = 200; /* Inertial Measurement Unit (IMU) #1. | */ + public static final int MAV_COMP_ID_IMU_2 = 201; /* Inertial Measurement Unit (IMU) #2. | */ + public static final int MAV_COMP_ID_IMU_3 = 202; /* Inertial Measurement Unit (IMU) #3. | */ + public static final int MAV_COMP_ID_GPS = 220; /* GPS #1. | */ + public static final int MAV_COMP_ID_GPS2 = 221; /* GPS #2. | */ + public static final int MAV_COMP_ID_UDP_BRIDGE = 240; /* Component to bridge MAVLink to UDP (i.e. from a UART). | */ + public static final int MAV_COMP_ID_UART_BRIDGE = 241; /* Component to bridge to UART (i.e. from UDP). | */ + public static final int MAV_COMP_ID_TUNNEL_NODE = 242; /* Component handling TUNNEL messages (e.g. vendor specific GUI of a component). | */ + public static final int MAV_COMP_ID_SYSTEM_CONTROL = 250; /* Component for handling system messages (e.g. to ARM, takeoff, etc.). | */ + public static final int MAV_COMPONENT_ENUM_END = 251; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_DATA_STREAM.java b/app/src/main/java/com/MAVLink/enums/MAV_DATA_STREAM.java index 8a8ad65..4b2b684 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_DATA_STREAM.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_DATA_STREAM.java @@ -6,21 +6,21 @@ package com.MAVLink.enums; -/** - * THIS INTERFACE IS DEPRECATED AS OF JULY 2015. Please use MESSAGE_INTERVAL instead. A data stream is not a fixed set of messages, but rather a - * recommendation to the autopilot software. Individual autopilots may or may not obey - * the recommended messages. - */ +/** +* A data stream is not a fixed set of messages, but rather a + recommendation to the autopilot software. Individual autopilots may or may not obey + the recommended messages. +*/ public class MAV_DATA_STREAM { - public static final int MAV_DATA_STREAM_ALL = 0; /* Enable all data streams | */ - public static final int MAV_DATA_STREAM_RAW_SENSORS = 1; /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ - public static final int MAV_DATA_STREAM_EXTENDED_STATUS = 2; /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ - public static final int MAV_DATA_STREAM_RC_CHANNELS = 3; /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ - public static final int MAV_DATA_STREAM_RAW_CONTROLLER = 4; /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ - public static final int MAV_DATA_STREAM_POSITION = 6; /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ - public static final int MAV_DATA_STREAM_EXTRA1 = 10; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_EXTRA2 = 11; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_EXTRA3 = 12; /* Dependent on the autopilot | */ - public static final int MAV_DATA_STREAM_ENUM_END = 13; /* | */ + public static final int MAV_DATA_STREAM_ALL = 0; /* Enable all data streams | */ + public static final int MAV_DATA_STREAM_RAW_SENSORS = 1; /* Enable IMU_RAW, GPS_RAW, GPS_STATUS packets. | */ + public static final int MAV_DATA_STREAM_EXTENDED_STATUS = 2; /* Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS | */ + public static final int MAV_DATA_STREAM_RC_CHANNELS = 3; /* Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW | */ + public static final int MAV_DATA_STREAM_RAW_CONTROLLER = 4; /* Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT. | */ + public static final int MAV_DATA_STREAM_POSITION = 6; /* Enable LOCAL_POSITION, GLOBAL_POSITION/GLOBAL_POSITION_INT messages. | */ + public static final int MAV_DATA_STREAM_EXTRA1 = 10; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_EXTRA2 = 11; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_EXTRA3 = 12; /* Dependent on the autopilot | */ + public static final int MAV_DATA_STREAM_ENUM_END = 13; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java b/app/src/main/java/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java index 65d4fad..a36860b 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_DISTANCE_SENSOR.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * Enumeration of distance sensor types - */ +/** +* Enumeration of distance sensor types +*/ public class MAV_DISTANCE_SENSOR { - public static final int MAV_DISTANCE_SENSOR_LASER = 0; /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */ - public static final int MAV_DISTANCE_SENSOR_ULTRASOUND = 1; /* Ultrasound rangefinder, e.g. MaxBotix units | */ - public static final int MAV_DISTANCE_SENSOR_INFRARED = 2; /* Infrared rangefinder, e.g. Sharp units | */ - public static final int MAV_DISTANCE_SENSOR_RADAR = 3; /* Radar type, e.g. uLanding units | */ - public static final int MAV_DISTANCE_SENSOR_UNKNOWN = 4; /* Broken or unknown type, e.g. analog units | */ - public static final int MAV_DISTANCE_SENSOR_ENUM_END = 5; /* | */ + public static final int MAV_DISTANCE_SENSOR_LASER = 0; /* Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units | */ + public static final int MAV_DISTANCE_SENSOR_ULTRASOUND = 1; /* Ultrasound rangefinder, e.g. MaxBotix units | */ + public static final int MAV_DISTANCE_SENSOR_INFRARED = 2; /* Infrared rangefinder, e.g. Sharp units | */ + public static final int MAV_DISTANCE_SENSOR_RADAR = 3; /* Radar type, e.g. uLanding units | */ + public static final int MAV_DISTANCE_SENSOR_UNKNOWN = 4; /* Broken or unknown type, e.g. analog units | */ + public static final int MAV_DISTANCE_SENSOR_ENUM_END = 5; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_DO_REPOSITION_FLAGS.java b/app/src/main/java/com/MAVLink/enums/MAV_DO_REPOSITION_FLAGS.java index 6225a6d..31c65c7 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_DO_REPOSITION_FLAGS.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_DO_REPOSITION_FLAGS.java @@ -6,11 +6,11 @@ package com.MAVLink.enums; -/** - * Bitmask of options for the MAV_CMD_DO_REPOSITION - */ +/** +* Bitmap of options for the MAV_CMD_DO_REPOSITION +*/ public class MAV_DO_REPOSITION_FLAGS { - public static final int MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1; /* The aircraft should immediately transition into guided. This should not be set for follow me applications | */ - public static final int MAV_DO_REPOSITION_FLAGS_ENUM_END = 2; /* | */ + public static final int MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1; /* The aircraft should immediately transition into guided. This should not be set for follow me applications | */ + public static final int MAV_DO_REPOSITION_FLAGS_ENUM_END = 2; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java index 7d33325..5571a20 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_ESTIMATOR_TYPE.java @@ -6,15 +6,19 @@ package com.MAVLink.enums; -/** - * Enumeration of estimator types - */ +/** +* Enumeration of estimator types +*/ public class MAV_ESTIMATOR_TYPE { - public static final int MAV_ESTIMATOR_TYPE_NAIVE = 1; /* This is a naive estimator without any real covariance feedback. | */ - public static final int MAV_ESTIMATOR_TYPE_VISION = 2; /* Computer vision based estimate. Might be up to scale. | */ - public static final int MAV_ESTIMATOR_TYPE_VIO = 3; /* Visual-inertial estimate. | */ - public static final int MAV_ESTIMATOR_TYPE_GPS = 4; /* Plain GPS estimate. | */ - public static final int MAV_ESTIMATOR_TYPE_GPS_INS = 5; /* Estimator integrating GPS and inertial sensing. | */ - public static final int MAV_ESTIMATOR_TYPE_ENUM_END = 6; /* | */ + public static final int MAV_ESTIMATOR_TYPE_UNKNOWN = 0; /* Unknown type of the estimator. | */ + public static final int MAV_ESTIMATOR_TYPE_NAIVE = 1; /* This is a naive estimator without any real covariance feedback. | */ + public static final int MAV_ESTIMATOR_TYPE_VISION = 2; /* Computer vision based estimate. Might be up to scale. | */ + public static final int MAV_ESTIMATOR_TYPE_VIO = 3; /* Visual-inertial estimate. | */ + public static final int MAV_ESTIMATOR_TYPE_GPS = 4; /* Plain GPS estimate. | */ + public static final int MAV_ESTIMATOR_TYPE_GPS_INS = 5; /* Estimator integrating GPS and inertial sensing. | */ + public static final int MAV_ESTIMATOR_TYPE_MOCAP = 6; /* Estimate from external motion capturing system. | */ + public static final int MAV_ESTIMATOR_TYPE_LIDAR = 7; /* Estimator based on lidar sensor input. | */ + public static final int MAV_ESTIMATOR_TYPE_AUTOPILOT = 8; /* Estimator on autopilot. | */ + public static final int MAV_ESTIMATOR_TYPE_ENUM_END = 9; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_FRAME.java b/app/src/main/java/com/MAVLink/enums/MAV_FRAME.java index 23a4b8a..0c75dd0 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_FRAME.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_FRAME.java @@ -6,22 +6,32 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class MAV_FRAME { - public static final int MAV_FRAME_GLOBAL = 0; /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL) | */ - public static final int MAV_FRAME_LOCAL_NED = 1; /* Local coordinate frame, Z-up (x: north, y: east, z: down). | */ - public static final int MAV_FRAME_MISSION = 2; /* NOT a coordinate frame, indicates a mission command. | */ - public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT = 3; /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - public static final int MAV_FRAME_LOCAL_ENU = 4; /* Local coordinate frame, Z-down (x: east, y: north, z: up) | */ - public static final int MAV_FRAME_GLOBAL_INT = 5; /* Global coordinate frame, WGS84 coordinate system. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL) | */ - public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6; /* Global coordinate frame, WGS84 coordinate system, relative altitude over ground with respect to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ - public static final int MAV_FRAME_LOCAL_OFFSET_NED = 7; /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ - public static final int MAV_FRAME_BODY_NED = 8; /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ - public static final int MAV_FRAME_BODY_OFFSET_NED = 9; /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ - public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT = 10; /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11; /* Global coordinate frame with above terrain level altitude. WGS84 coordinate system, relative altitude over terrain with respect to the waypoint coordinate. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ - public static final int MAV_FRAME_ENUM_END = 12; /* | */ + public static final int MAV_FRAME_GLOBAL = 0; /* Global (WGS84) coordinate frame + MSL altitude. First value / x: latitude, second value / y: longitude, third value / z: positive altitude over mean sea level (MSL). | */ + public static final int MAV_FRAME_LOCAL_NED = 1; /* Local coordinate frame, Z-down (x: north, y: east, z: down). | */ + public static final int MAV_FRAME_MISSION = 2; /* NOT a coordinate frame, indicates a mission command. | */ + public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT = 3; /* Global (WGS84) coordinate frame + altitude relative to the home position. First value / x: latitude, second value / y: longitude, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + public static final int MAV_FRAME_LOCAL_ENU = 4; /* Local coordinate frame, Z-up (x: east, y: north, z: up). | */ + public static final int MAV_FRAME_GLOBAL_INT = 5; /* Global (WGS84) coordinate frame (scaled) + MSL altitude. First value / x: latitude in degrees*1.0e-7, second value / y: longitude in degrees*1.0e-7, third value / z: positive altitude over mean sea level (MSL). | */ + public static final int MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6; /* Global (WGS84) coordinate frame (scaled) + altitude relative to the home position. First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude with 0 being at the altitude of the home location. | */ + public static final int MAV_FRAME_LOCAL_OFFSET_NED = 7; /* Offset to the current local frame. Anything expressed in this frame should be added to the current local frame position. | */ + public static final int MAV_FRAME_BODY_NED = 8; /* Setpoint in body NED frame. This makes sense if all position control is externalized - e.g. useful to command 2 m/s^2 acceleration to the right. | */ + public static final int MAV_FRAME_BODY_OFFSET_NED = 9; /* Offset in body NED frame. This makes sense if adding setpoints to the current flight path, to avoid an obstacle - e.g. useful to command 2 m/s^2 acceleration to the east. | */ + public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT = 10; /* Global (WGS84) coordinate frame with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + public static final int MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11; /* Global (WGS84) coordinate frame (scaled) with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees*10e-7, second value / y: longitude in degrees*10e-7, third value / z: positive altitude in meters with 0 being at ground level in terrain model. | */ + public static final int MAV_FRAME_BODY_FRD = 12; /* Body fixed frame of reference, Z-down (x: forward, y: right, z: down). | */ + public static final int MAV_FRAME_BODY_FLU = 13; /* Body fixed frame of reference, Z-up (x: forward, y: left, z: up). | */ + public static final int MAV_FRAME_MOCAP_NED = 14; /* Odometry local coordinate frame of data given by a motion capture system, Z-down (x: north, y: east, z: down). | */ + public static final int MAV_FRAME_MOCAP_ENU = 15; /* Odometry local coordinate frame of data given by a motion capture system, Z-up (x: east, y: north, z: up). | */ + public static final int MAV_FRAME_VISION_NED = 16; /* Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: north, y: east, z: down). | */ + public static final int MAV_FRAME_VISION_ENU = 17; /* Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: east, y: north, z: up). | */ + public static final int MAV_FRAME_ESTIM_NED = 18; /* Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: north, y: east, z: down). | */ + public static final int MAV_FRAME_ESTIM_ENU = 19; /* Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: east, y: noth, z: up). | */ + public static final int MAV_FRAME_LOCAL_FRD = 20; /* Forward, Right, Down coordinate frame. This is a local frame with Z-down and arbitrary F/R alignment (i.e. not aligned with NED/earth frame). | */ + public static final int MAV_FRAME_LOCAL_FLU = 21; /* Forward, Left, Up coordinate frame. This is a local frame with Z-up and arbitrary F/L alignment (i.e. not aligned with ENU/earth frame). | */ + public static final int MAV_FRAME_ENUM_END = 22; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_GOTO.java b/app/src/main/java/com/MAVLink/enums/MAV_GOTO.java index b33a39c..f627e68 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_GOTO.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_GOTO.java @@ -6,14 +6,14 @@ package com.MAVLink.enums; -/** - * Override command, pauses current mission execution and moves immediately to a position - */ +/** +* Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution. +*/ public class MAV_GOTO { - public static final int MAV_GOTO_DO_HOLD = 0; /* Hold at the current position. | */ - public static final int MAV_GOTO_DO_CONTINUE = 1; /* Continue with the next item in mission execution. | */ - public static final int MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2; /* Hold at the current position of the system | */ - public static final int MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3; /* Hold at the position specified in the parameters of the DO_HOLD action | */ - public static final int MAV_GOTO_ENUM_END = 4; /* | */ + public static final int MAV_GOTO_DO_HOLD = 0; /* Hold at the current position. | */ + public static final int MAV_GOTO_DO_CONTINUE = 1; /* Continue with the next item in mission execution. | */ + public static final int MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2; /* Hold at the current position of the system | */ + public static final int MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3; /* Hold at the position specified in the parameters of the DO_HOLD action | */ + public static final int MAV_GOTO_ENUM_END = 4; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_LANDED_STATE.java b/app/src/main/java/com/MAVLink/enums/MAV_LANDED_STATE.java index f6943ab..5fc729d 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_LANDED_STATE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_LANDED_STATE.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * Enumeration of landed detector states - */ +/** +* Enumeration of landed detector states +*/ public class MAV_LANDED_STATE { - public static final int MAV_LANDED_STATE_UNDEFINED = 0; /* MAV landed state is unknown | */ - public static final int MAV_LANDED_STATE_ON_GROUND = 1; /* MAV is landed (on ground) | */ - public static final int MAV_LANDED_STATE_IN_AIR = 2; /* MAV is in air | */ - public static final int MAV_LANDED_STATE_TAKEOFF = 3; /* MAV currently taking off | */ - public static final int MAV_LANDED_STATE_LANDING = 4; /* MAV currently landing | */ - public static final int MAV_LANDED_STATE_ENUM_END = 5; /* | */ + public static final int MAV_LANDED_STATE_UNDEFINED = 0; /* MAV landed state is unknown | */ + public static final int MAV_LANDED_STATE_ON_GROUND = 1; /* MAV is landed (on ground) | */ + public static final int MAV_LANDED_STATE_IN_AIR = 2; /* MAV is in air | */ + public static final int MAV_LANDED_STATE_TAKEOFF = 3; /* MAV currently taking off | */ + public static final int MAV_LANDED_STATE_LANDING = 4; /* MAV currently landing | */ + public static final int MAV_LANDED_STATE_ENUM_END = 5; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MISSION_RESULT.java b/app/src/main/java/com/MAVLink/enums/MAV_MISSION_RESULT.java index 8a6fdbb..2a61a7f 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MISSION_RESULT.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MISSION_RESULT.java @@ -6,25 +6,26 @@ package com.MAVLink.enums; -/** - * result in a mavlink mission ack - */ +/** +* Result of mission operation (in a MISSION_ACK message). +*/ public class MAV_MISSION_RESULT { - public static final int MAV_MISSION_ACCEPTED = 0; /* mission accepted OK | */ - public static final int MAV_MISSION_ERROR = 1; /* generic error / not accepting mission commands at all right now | */ - public static final int MAV_MISSION_UNSUPPORTED_FRAME = 2; /* coordinate frame is not supported | */ - public static final int MAV_MISSION_UNSUPPORTED = 3; /* command is not supported | */ - public static final int MAV_MISSION_NO_SPACE = 4; /* mission item exceeds storage space | */ - public static final int MAV_MISSION_INVALID = 5; /* one of the parameters has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM1 = 6; /* param1 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM2 = 7; /* param2 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM3 = 8; /* param3 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM4 = 9; /* param4 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM5_X = 10; /* x/param5 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM6_Y = 11; /* y/param6 has an invalid value | */ - public static final int MAV_MISSION_INVALID_PARAM7 = 12; /* param7 has an invalid value | */ - public static final int MAV_MISSION_INVALID_SEQUENCE = 13; /* received waypoint out of sequence | */ - public static final int MAV_MISSION_DENIED = 14; /* not accepting any mission commands from this communication partner | */ - public static final int MAV_MISSION_RESULT_ENUM_END = 15; /* | */ + public static final int MAV_MISSION_ACCEPTED = 0; /* mission accepted OK | */ + public static final int MAV_MISSION_ERROR = 1; /* Generic error / not accepting mission commands at all right now. | */ + public static final int MAV_MISSION_UNSUPPORTED_FRAME = 2; /* Coordinate frame is not supported. | */ + public static final int MAV_MISSION_UNSUPPORTED = 3; /* Command is not supported. | */ + public static final int MAV_MISSION_NO_SPACE = 4; /* Mission item exceeds storage space. | */ + public static final int MAV_MISSION_INVALID = 5; /* One of the parameters has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM1 = 6; /* param1 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM2 = 7; /* param2 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM3 = 8; /* param3 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM4 = 9; /* param4 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM5_X = 10; /* x / param5 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM6_Y = 11; /* y / param6 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_PARAM7 = 12; /* z / param7 has an invalid value. | */ + public static final int MAV_MISSION_INVALID_SEQUENCE = 13; /* Mission item received out of sequence | */ + public static final int MAV_MISSION_DENIED = 14; /* Not accepting any mission commands from this communication partner. | */ + public static final int MAV_MISSION_OPERATION_CANCELLED = 15; /* Current mission operation cancelled (e.g. mission upload, mission download). | */ + public static final int MAV_MISSION_RESULT_ENUM_END = 16; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MISSION_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_MISSION_TYPE.java index 4f8a24f..63c11ca 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MISSION_TYPE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MISSION_TYPE.java @@ -6,14 +6,14 @@ package com.MAVLink.enums; -/** - * Type of mission items being requested/sent in mission protocol. - */ +/** +* Type of mission items being requested/sent in mission protocol. +*/ public class MAV_MISSION_TYPE { - public static final int MAV_MISSION_TYPE_MISSION = 0; /* Items are mission commands for main mission. | */ - public static final int MAV_MISSION_TYPE_FENCE = 1; /* Specifies GeoFence area(s). Items are MAV_CMD_FENCE_ GeoFence items. | */ - public static final int MAV_MISSION_TYPE_RALLY = 2; /* Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_RALLY_POINT rally point items. | */ - public static final int MAV_MISSION_TYPE_ALL = 255; /* Only used in MISSION_CLEAR_ALL to clear all mission types. | */ - public static final int MAV_MISSION_TYPE_ENUM_END = 256; /* | */ + public static final int MAV_MISSION_TYPE_MISSION = 0; /* Items are mission commands for main mission. | */ + public static final int MAV_MISSION_TYPE_FENCE = 1; /* Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items. | */ + public static final int MAV_MISSION_TYPE_RALLY = 2; /* Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items. | */ + public static final int MAV_MISSION_TYPE_ALL = 255; /* Only used in MISSION_CLEAR_ALL to clear all mission types. | */ + public static final int MAV_MISSION_TYPE_ENUM_END = 256; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MODE.java b/app/src/main/java/com/MAVLink/enums/MAV_MODE.java index 5d79e93..79c72de 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MODE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MODE.java @@ -6,22 +6,22 @@ package com.MAVLink.enums; -/** - * These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it - * simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety_layout override. - */ +/** +* These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it + simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override. +*/ public class MAV_MODE { - public static final int MAV_MODE_PREFLIGHT = 0; /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ - public static final int MAV_MODE_MANUAL_DISARMED = 64; /* System is allowed to be active, under manual (RC) control, no stabilization | */ - public static final int MAV_MODE_TEST_DISARMED = 66; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - public static final int MAV_MODE_STABILIZE_DISARMED = 80; /* System is allowed to be active, under assisted RC control. | */ - public static final int MAV_MODE_GUIDED_DISARMED = 88; /* System is allowed to be active, under autonomous control, manual setpoint | */ - public static final int MAV_MODE_AUTO_DISARMED = 92; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - public static final int MAV_MODE_MANUAL_ARMED = 192; /* System is allowed to be active, under manual (RC) control, no stabilization | */ - public static final int MAV_MODE_TEST_ARMED = 194; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ - public static final int MAV_MODE_STABILIZE_ARMED = 208; /* System is allowed to be active, under assisted RC control. | */ - public static final int MAV_MODE_GUIDED_ARMED = 216; /* System is allowed to be active, under autonomous control, manual setpoint | */ - public static final int MAV_MODE_AUTO_ARMED = 220; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by MISSIONs) | */ - public static final int MAV_MODE_ENUM_END = 221; /* | */ + public static final int MAV_MODE_PREFLIGHT = 0; /* System is not ready to fly, booting, calibrating, etc. No flag is set. | */ + public static final int MAV_MODE_MANUAL_DISARMED = 64; /* System is allowed to be active, under manual (RC) control, no stabilization | */ + public static final int MAV_MODE_TEST_DISARMED = 66; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + public static final int MAV_MODE_STABILIZE_DISARMED = 80; /* System is allowed to be active, under assisted RC control. | */ + public static final int MAV_MODE_GUIDED_DISARMED = 88; /* System is allowed to be active, under autonomous control, manual setpoint | */ + public static final int MAV_MODE_AUTO_DISARMED = 92; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */ + public static final int MAV_MODE_MANUAL_ARMED = 192; /* System is allowed to be active, under manual (RC) control, no stabilization | */ + public static final int MAV_MODE_TEST_ARMED = 194; /* UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only. | */ + public static final int MAV_MODE_STABILIZE_ARMED = 208; /* System is allowed to be active, under assisted RC control. | */ + public static final int MAV_MODE_GUIDED_ARMED = 216; /* System is allowed to be active, under autonomous control, manual setpoint | */ + public static final int MAV_MODE_AUTO_ARMED = 220; /* System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints) | */ + public static final int MAV_MODE_ENUM_END = 221; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG.java b/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG.java index 52ecb9e..db59377 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG.java @@ -6,18 +6,18 @@ package com.MAVLink.enums; -/** - * These flags encode the MAV mode. - */ +/** +* These flags encode the MAV mode. +*/ public class MAV_MODE_FLAG { - public static final int MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1; /* 0b00000001 Reserved for future use. | */ - public static final int MAV_MODE_FLAG_TEST_ENABLED = 2; /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ - public static final int MAV_MODE_FLAG_AUTO_ENABLED = 4; /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ - public static final int MAV_MODE_FLAG_GUIDED_ENABLED = 8; /* 0b00001000 guided mode enabled, system flies MISSIONs / mission items. | */ - public static final int MAV_MODE_FLAG_STABILIZE_ENABLED = 16; /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ - public static final int MAV_MODE_FLAG_HIL_ENABLED = 32; /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ - public static final int MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64; /* 0b01000000 remote control input is enabled. | */ - public static final int MAV_MODE_FLAG_SAFETY_ARMED = 128; /* 0b10000000 MAV safety_layout set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state. | */ - public static final int MAV_MODE_FLAG_ENUM_END = 129; /* | */ + public static final int MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1; /* 0b00000001 Reserved for future use. | */ + public static final int MAV_MODE_FLAG_TEST_ENABLED = 2; /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */ + public static final int MAV_MODE_FLAG_AUTO_ENABLED = 4; /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */ + public static final int MAV_MODE_FLAG_GUIDED_ENABLED = 8; /* 0b00001000 guided mode enabled, system flies waypoints / mission items. | */ + public static final int MAV_MODE_FLAG_STABILIZE_ENABLED = 16; /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */ + public static final int MAV_MODE_FLAG_HIL_ENABLED = 32; /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */ + public static final int MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64; /* 0b01000000 remote control input is enabled. | */ + public static final int MAV_MODE_FLAG_SAFETY_ARMED = 128; /* 0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state. | */ + public static final int MAV_MODE_FLAG_ENUM_END = 129; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java b/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java index fcc65fa..68798a7 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MODE_FLAG_DECODE_POSITION.java @@ -6,18 +6,18 @@ package com.MAVLink.enums; -/** - * These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. - */ +/** +* These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not. +*/ public class MAV_MODE_FLAG_DECODE_POSITION { - public static final int MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1; /* Eighth bit: 00000001 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_TEST = 2; /* Seventh bit: 00000010 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4; /* Sixt bit: 00000100 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8; /* Fifth bit: 00001000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16; /* Fourth bit: 00010000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_HIL = 32; /* Third bit: 00100000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64; /* Second bit: 01000000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128; /* First bit: 10000000 | */ - public static final int MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129; /* | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1; /* Eighth bit: 00000001 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_TEST = 2; /* Seventh bit: 00000010 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4; /* Sixth bit: 00000100 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8; /* Fifth bit: 00001000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16; /* Fourth bit: 00010000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_HIL = 32; /* Third bit: 00100000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64; /* Second bit: 01000000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128; /* First bit: 10000000 | */ + public static final int MAV_MODE_FLAG_DECODE_POSITION_ENUM_END = 129; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MODE_GIMBAL.java b/app/src/main/java/com/MAVLink/enums/MAV_MODE_GIMBAL.java index 2fa2e46..06b42e4 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MODE_GIMBAL.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MODE_GIMBAL.java @@ -6,17 +6,17 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class MAV_MODE_GIMBAL { - public static final int MAV_MODE_GIMBAL_UNINITIALIZED = 0; /* Gimbal is powered on but has not started initializing yet | */ - public static final int MAV_MODE_GIMBAL_CALIBRATING_PITCH = 1; /* Gimbal is currently running calibration on the pitch axis | */ - public static final int MAV_MODE_GIMBAL_CALIBRATING_ROLL = 2; /* Gimbal is currently running calibration on the roll axis | */ - public static final int MAV_MODE_GIMBAL_CALIBRATING_YAW = 3; /* Gimbal is currently running calibration on the yaw axis | */ - public static final int MAV_MODE_GIMBAL_INITIALIZED = 4; /* Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter | */ - public static final int MAV_MODE_GIMBAL_ACTIVE = 5; /* Gimbal is actively stabilizing | */ - public static final int MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT = 6; /* Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command | */ - public static final int MAV_MODE_GIMBAL_ENUM_END = 7; /* | */ + public static final int MAV_MODE_GIMBAL_UNINITIALIZED = 0; /* Gimbal is powered on but has not started initializing yet. | */ + public static final int MAV_MODE_GIMBAL_CALIBRATING_PITCH = 1; /* Gimbal is currently running calibration on the pitch axis. | */ + public static final int MAV_MODE_GIMBAL_CALIBRATING_ROLL = 2; /* Gimbal is currently running calibration on the roll axis. | */ + public static final int MAV_MODE_GIMBAL_CALIBRATING_YAW = 3; /* Gimbal is currently running calibration on the yaw axis. | */ + public static final int MAV_MODE_GIMBAL_INITIALIZED = 4; /* Gimbal has finished calibrating and initializing, but is relaxed pending reception of first rate command from copter. | */ + public static final int MAV_MODE_GIMBAL_ACTIVE = 5; /* Gimbal is actively stabilizing. | */ + public static final int MAV_MODE_GIMBAL_RATE_CMD_TIMEOUT = 6; /* Gimbal is relaxed because it missed more than 10 expected rate command messages in a row. Gimbal will move back to active mode when it receives a new rate command. | */ + public static final int MAV_MODE_GIMBAL_ENUM_END = 7; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_MOUNT_MODE.java b/app/src/main/java/com/MAVLink/enums/MAV_MOUNT_MODE.java index 0039397..085e961 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_MOUNT_MODE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_MOUNT_MODE.java @@ -6,15 +6,16 @@ package com.MAVLink.enums; -/** - * Enumeration of possible mount operation modes - */ +/** +* Enumeration of possible mount operation modes +*/ public class MAV_MOUNT_MODE { - public static final int MAV_MOUNT_MODE_RETRACT = 0; /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ - public static final int MAV_MOUNT_MODE_NEUTRAL = 1; /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ - public static final int MAV_MOUNT_MODE_MAVLINK_TARGETING = 2; /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ - public static final int MAV_MOUNT_MODE_RC_TARGETING = 3; /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ - public static final int MAV_MOUNT_MODE_GPS_POINT = 4; /* Load neutral position and start to point to Lat,Lon,Alt | */ - public static final int MAV_MOUNT_MODE_ENUM_END = 5; /* | */ + public static final int MAV_MOUNT_MODE_RETRACT = 0; /* Load and keep safe position (Roll,Pitch,Yaw) from permant memory and stop stabilization | */ + public static final int MAV_MOUNT_MODE_NEUTRAL = 1; /* Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. | */ + public static final int MAV_MOUNT_MODE_MAVLINK_TARGETING = 2; /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ + public static final int MAV_MOUNT_MODE_RC_TARGETING = 3; /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ + public static final int MAV_MOUNT_MODE_GPS_POINT = 4; /* Load neutral position and start to point to Lat,Lon,Alt | */ + public static final int MAV_MOUNT_MODE_SYSID_TARGET = 5; /* Gimbal tracks system with specified system ID | */ + public static final int MAV_MOUNT_MODE_ENUM_END = 6; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_AUTH_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_AUTH_TYPE.java new file mode 100644 index 0000000..5cdfd88 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_AUTH_TYPE.java @@ -0,0 +1,20 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_AUTH_TYPE { + public static final int MAV_ODID_AUTH_TYPE_NONE = 0; /* No authentication type is specified. | */ + public static final int MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1; /* Signature for the UAS (Unmanned Aircraft System) ID. | */ + public static final int MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2; /* Signature for the Operator ID. | */ + public static final int MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3; /* Signature for the entire message set. | */ + public static final int MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4; /* Authentication is provided by Network Remote ID. | */ + public static final int MAV_ODID_AUTH_TYPE_ENUM_END = 5; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_DESC_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_DESC_TYPE.java new file mode 100644 index 0000000..14587af --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_DESC_TYPE.java @@ -0,0 +1,16 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_DESC_TYPE { + public static final int MAV_ODID_DESC_TYPE_TEXT = 0; /* Free-form text description of the purpose of the flight. | */ + public static final int MAV_ODID_DESC_TYPE_ENUM_END = 1; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_HEIGHT_REF.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_HEIGHT_REF.java new file mode 100644 index 0000000..e2db378 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_HEIGHT_REF.java @@ -0,0 +1,17 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_HEIGHT_REF { + public static final int MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0; /* The height field is relative to the take-off location. | */ + public static final int MAV_ODID_HEIGHT_REF_OVER_GROUND = 1; /* The height field is relative to ground. | */ + public static final int MAV_ODID_HEIGHT_REF_ENUM_END = 2; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_HOR_ACC.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_HOR_ACC.java new file mode 100644 index 0000000..842428f --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_HOR_ACC.java @@ -0,0 +1,28 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_HOR_ACC { + public static final int MAV_ODID_HOR_ACC_UNKNOWN = 0; /* The horizontal accuracy is unknown. | */ + public static final int MAV_ODID_HOR_ACC_10NM = 1; /* The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km. | */ + public static final int MAV_ODID_HOR_ACC_4NM = 2; /* The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km. | */ + public static final int MAV_ODID_HOR_ACC_2NM = 3; /* The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km. | */ + public static final int MAV_ODID_HOR_ACC_1NM = 4; /* The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km. | */ + public static final int MAV_ODID_HOR_ACC_0_5NM = 5; /* The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m. | */ + public static final int MAV_ODID_HOR_ACC_0_3NM = 6; /* The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m. | */ + public static final int MAV_ODID_HOR_ACC_0_1NM = 7; /* The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m. | */ + public static final int MAV_ODID_HOR_ACC_0_05NM = 8; /* The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m. | */ + public static final int MAV_ODID_HOR_ACC_30_METER = 9; /* The horizontal accuracy is smaller than 30 meter. | */ + public static final int MAV_ODID_HOR_ACC_10_METER = 10; /* The horizontal accuracy is smaller than 10 meter. | */ + public static final int MAV_ODID_HOR_ACC_3_METER = 11; /* The horizontal accuracy is smaller than 3 meter. | */ + public static final int MAV_ODID_HOR_ACC_1_METER = 12; /* The horizontal accuracy is smaller than 1 meter. | */ + public static final int MAV_ODID_HOR_ACC_ENUM_END = 13; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_ID_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_ID_TYPE.java new file mode 100644 index 0000000..a5f4eb6 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_ID_TYPE.java @@ -0,0 +1,19 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_ID_TYPE { + public static final int MAV_ODID_ID_TYPE_NONE = 0; /* No type defined. | */ + public static final int MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1; /* Manufacturer Serial Number (ANSI/CTA-2063 format). | */ + public static final int MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2; /* CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]. | */ + public static final int MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3; /* UTM (Unmanned Traffic Management) assigned UUID (RFC4122). | */ + public static final int MAV_ODID_ID_TYPE_ENUM_END = 4; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_LOCATION_SRC.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_LOCATION_SRC.java new file mode 100644 index 0000000..c75c882 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_LOCATION_SRC.java @@ -0,0 +1,18 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_LOCATION_SRC { + public static final int MAV_ODID_LOCATION_SRC_TAKEOFF = 0; /* The location of the operator is the same as the take-off location. | */ + public static final int MAV_ODID_LOCATION_SRC_LIVE_GNSS = 1; /* The location of the operator is based on live GNSS data. | */ + public static final int MAV_ODID_LOCATION_SRC_FIXED = 2; /* The location of the operator is a fixed location. | */ + public static final int MAV_ODID_LOCATION_SRC_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_OPERATOR_ID_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_OPERATOR_ID_TYPE.java new file mode 100644 index 0000000..bf5ae12 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_OPERATOR_ID_TYPE.java @@ -0,0 +1,16 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_OPERATOR_ID_TYPE { + public static final int MAV_ODID_OPERATOR_ID_TYPE_CAA = 0; /* CAA (Civil Aviation Authority) registered operator ID. | */ + public static final int MAV_ODID_OPERATOR_ID_TYPE_ENUM_END = 1; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_SPEED_ACC.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_SPEED_ACC.java new file mode 100644 index 0000000..977d9ad --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_SPEED_ACC.java @@ -0,0 +1,20 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_SPEED_ACC { + public static final int MAV_ODID_SPEED_ACC_UNKNOWN = 0; /* The speed accuracy is unknown. | */ + public static final int MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1; /* The speed accuracy is smaller than 10 meters per second. | */ + public static final int MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2; /* The speed accuracy is smaller than 3 meters per second. | */ + public static final int MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3; /* The speed accuracy is smaller than 1 meters per second. | */ + public static final int MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4; /* The speed accuracy is smaller than 0.3 meters per second. | */ + public static final int MAV_ODID_SPEED_ACC_ENUM_END = 5; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_STATUS.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_STATUS.java new file mode 100644 index 0000000..13c69d4 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_STATUS.java @@ -0,0 +1,18 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_STATUS { + public static final int MAV_ODID_STATUS_UNDECLARED = 0; /* The status of the (UA) Unmanned Aircraft is undefined. | */ + public static final int MAV_ODID_STATUS_GROUND = 1; /* The UA is on the ground. | */ + public static final int MAV_ODID_STATUS_AIRBORNE = 2; /* The UA is in the air. | */ + public static final int MAV_ODID_STATUS_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_TIME_ACC.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_TIME_ACC.java new file mode 100644 index 0000000..d47c1a8 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_TIME_ACC.java @@ -0,0 +1,31 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_TIME_ACC { + public static final int MAV_ODID_TIME_ACC_UNKNOWN = 0; /* The timestamp accuracy is unknown. | */ + public static final int MAV_ODID_TIME_ACC_0_1_SECOND = 1; /* The timestamp accuracy is smaller than 0.1 second. | */ + public static final int MAV_ODID_TIME_ACC_0_2_SECOND = 2; /* The timestamp accuracy is smaller than 0.2 second. | */ + public static final int MAV_ODID_TIME_ACC_0_3_SECOND = 3; /* The timestamp accuracy is smaller than 0.3 second. | */ + public static final int MAV_ODID_TIME_ACC_0_4_SECOND = 4; /* The timestamp accuracy is smaller than 0.4 second. | */ + public static final int MAV_ODID_TIME_ACC_0_5_SECOND = 5; /* The timestamp accuracy is smaller than 0.5 second. | */ + public static final int MAV_ODID_TIME_ACC_0_6_SECOND = 6; /* The timestamp accuracy is smaller than 0.6 second. | */ + public static final int MAV_ODID_TIME_ACC_0_7_SECOND = 7; /* The timestamp accuracy is smaller than 0.7 second. | */ + public static final int MAV_ODID_TIME_ACC_0_8_SECOND = 8; /* The timestamp accuracy is smaller than 0.8 second. | */ + public static final int MAV_ODID_TIME_ACC_0_9_SECOND = 9; /* The timestamp accuracy is smaller than 0.9 second. | */ + public static final int MAV_ODID_TIME_ACC_1_0_SECOND = 10; /* The timestamp accuracy is smaller than 1.0 second. | */ + public static final int MAV_ODID_TIME_ACC_1_1_SECOND = 11; /* The timestamp accuracy is smaller than 1.1 second. | */ + public static final int MAV_ODID_TIME_ACC_1_2_SECOND = 12; /* The timestamp accuracy is smaller than 1.2 second. | */ + public static final int MAV_ODID_TIME_ACC_1_3_SECOND = 13; /* The timestamp accuracy is smaller than 1.3 second. | */ + public static final int MAV_ODID_TIME_ACC_1_4_SECOND = 14; /* The timestamp accuracy is smaller than 1.4 second. | */ + public static final int MAV_ODID_TIME_ACC_1_5_SECOND = 15; /* The timestamp accuracy is smaller than 1.5 second. | */ + public static final int MAV_ODID_TIME_ACC_ENUM_END = 16; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_UA_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_UA_TYPE.java new file mode 100644 index 0000000..947611b --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_UA_TYPE.java @@ -0,0 +1,31 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_UA_TYPE { + public static final int MAV_ODID_UA_TYPE_NONE = 0; /* No UA (Unmanned Aircraft) type defined. | */ + public static final int MAV_ODID_UA_TYPE_AEROPLANE = 1; /* Aeroplane/Airplane. Fixed wing. | */ + public static final int MAV_ODID_UA_TYPE_ROTORCRAFT = 2; /* Rotorcraft (including Multirotor). | */ + public static final int MAV_ODID_UA_TYPE_GYROPLANE = 3; /* Gyroplane. | */ + public static final int MAV_ODID_UA_TYPE_VTOL = 4; /* VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically. | */ + public static final int MAV_ODID_UA_TYPE_ORNITHOPTER = 5; /* Ornithopter. | */ + public static final int MAV_ODID_UA_TYPE_GLIDER = 6; /* Glider. | */ + public static final int MAV_ODID_UA_TYPE_KITE = 7; /* Kite. | */ + public static final int MAV_ODID_UA_TYPE_FREE_BALLOON = 8; /* Free Balloon. | */ + public static final int MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9; /* Captive Balloon. | */ + public static final int MAV_ODID_UA_TYPE_AIRSHIP = 10; /* Airship. E.g. a blimp. | */ + public static final int MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11; /* Free Fall/Parachute. | */ + public static final int MAV_ODID_UA_TYPE_ROCKET = 12; /* Rocket. | */ + public static final int MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13; /* Tethered powered aircraft. | */ + public static final int MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14; /* Ground Obstacle. | */ + public static final int MAV_ODID_UA_TYPE_OTHER = 15; /* Other type of aircraft not listed earlier. | */ + public static final int MAV_ODID_UA_TYPE_ENUM_END = 16; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ODID_VER_ACC.java b/app/src/main/java/com/MAVLink/enums/MAV_ODID_VER_ACC.java new file mode 100644 index 0000000..6ce3f99 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_ODID_VER_ACC.java @@ -0,0 +1,22 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_ODID_VER_ACC { + public static final int MAV_ODID_VER_ACC_UNKNOWN = 0; /* The vertical accuracy is unknown. | */ + public static final int MAV_ODID_VER_ACC_150_METER = 1; /* The vertical accuracy is smaller than 150 meter. | */ + public static final int MAV_ODID_VER_ACC_45_METER = 2; /* The vertical accuracy is smaller than 45 meter. | */ + public static final int MAV_ODID_VER_ACC_25_METER = 3; /* The vertical accuracy is smaller than 25 meter. | */ + public static final int MAV_ODID_VER_ACC_10_METER = 4; /* The vertical accuracy is smaller than 10 meter. | */ + public static final int MAV_ODID_VER_ACC_3_METER = 5; /* The vertical accuracy is smaller than 3 meter. | */ + public static final int MAV_ODID_VER_ACC_1_METER = 6; /* The vertical accuracy is smaller than 1 meter. | */ + public static final int MAV_ODID_VER_ACC_ENUM_END = 7; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_PARAM_EXT_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_PARAM_EXT_TYPE.java new file mode 100644 index 0000000..8176ed6 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_PARAM_EXT_TYPE.java @@ -0,0 +1,26 @@ +/* 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.MAVLink.enums; + +/** +* Specifies the datatype of a MAVLink extended parameter. +*/ +public class MAV_PARAM_EXT_TYPE { + public static final int MAV_PARAM_EXT_TYPE_UINT8 = 1; /* 8-bit unsigned integer | */ + public static final int MAV_PARAM_EXT_TYPE_INT8 = 2; /* 8-bit signed integer | */ + public static final int MAV_PARAM_EXT_TYPE_UINT16 = 3; /* 16-bit unsigned integer | */ + public static final int MAV_PARAM_EXT_TYPE_INT16 = 4; /* 16-bit signed integer | */ + public static final int MAV_PARAM_EXT_TYPE_UINT32 = 5; /* 32-bit unsigned integer | */ + public static final int MAV_PARAM_EXT_TYPE_INT32 = 6; /* 32-bit signed integer | */ + public static final int MAV_PARAM_EXT_TYPE_UINT64 = 7; /* 64-bit unsigned integer | */ + public static final int MAV_PARAM_EXT_TYPE_INT64 = 8; /* 64-bit signed integer | */ + public static final int MAV_PARAM_EXT_TYPE_REAL32 = 9; /* 32-bit floating-point | */ + public static final int MAV_PARAM_EXT_TYPE_REAL64 = 10; /* 64-bit floating-point | */ + public static final int MAV_PARAM_EXT_TYPE_CUSTOM = 11; /* Custom Type | */ + public static final int MAV_PARAM_EXT_TYPE_ENUM_END = 12; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_PARAM_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_PARAM_TYPE.java index 7a75c08..dfca8d6 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_PARAM_TYPE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_PARAM_TYPE.java @@ -6,20 +6,20 @@ package com.MAVLink.enums; -/** - * Specifies the datatype of a MAVLink parameter. - */ +/** +* Specifies the datatype of a MAVLink parameter. +*/ public class MAV_PARAM_TYPE { - public static final int MAV_PARAM_TYPE_UINT8 = 1; /* 8-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT8 = 2; /* 8-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT16 = 3; /* 16-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT16 = 4; /* 16-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT32 = 5; /* 32-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT32 = 6; /* 32-bit signed integer | */ - public static final int MAV_PARAM_TYPE_UINT64 = 7; /* 64-bit unsigned integer | */ - public static final int MAV_PARAM_TYPE_INT64 = 8; /* 64-bit signed integer | */ - public static final int MAV_PARAM_TYPE_REAL32 = 9; /* 32-bit floating-point | */ - public static final int MAV_PARAM_TYPE_REAL64 = 10; /* 64-bit floating-point | */ - public static final int MAV_PARAM_TYPE_ENUM_END = 11; /* | */ + public static final int MAV_PARAM_TYPE_UINT8 = 1; /* 8-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT8 = 2; /* 8-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT16 = 3; /* 16-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT16 = 4; /* 16-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT32 = 5; /* 32-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT32 = 6; /* 32-bit signed integer | */ + public static final int MAV_PARAM_TYPE_UINT64 = 7; /* 64-bit unsigned integer | */ + public static final int MAV_PARAM_TYPE_INT64 = 8; /* 64-bit signed integer | */ + public static final int MAV_PARAM_TYPE_REAL32 = 9; /* 32-bit floating-point | */ + public static final int MAV_PARAM_TYPE_REAL64 = 10; /* 64-bit floating-point | */ + public static final int MAV_PARAM_TYPE_ENUM_END = 11; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_POWER_STATUS.java b/app/src/main/java/com/MAVLink/enums/MAV_POWER_STATUS.java index b50ad23..2173425 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_POWER_STATUS.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_POWER_STATUS.java @@ -6,16 +6,16 @@ package com.MAVLink.enums; -/** - * Power supply status flags (bitmask) - */ +/** +* Power supply status flags (bitmask) +*/ public class MAV_POWER_STATUS { - public static final int MAV_POWER_STATUS_BRICK_VALID = 1; /* main brick power supply valid | */ - public static final int MAV_POWER_STATUS_SERVO_VALID = 2; /* main servo power supply valid for FMU | */ - public static final int MAV_POWER_STATUS_USB_CONNECTED = 4; /* USB power is connected | */ - public static final int MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8; /* peripheral supply is in over-current state | */ - public static final int MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16; /* hi-power peripheral supply is in over-current state | */ - public static final int MAV_POWER_STATUS_CHANGED = 32; /* Power status has changed since boot | */ - public static final int MAV_POWER_STATUS_ENUM_END = 33; /* | */ + public static final int MAV_POWER_STATUS_BRICK_VALID = 1; /* main brick power supply valid | */ + public static final int MAV_POWER_STATUS_SERVO_VALID = 2; /* main servo power supply valid for FMU | */ + public static final int MAV_POWER_STATUS_USB_CONNECTED = 4; /* USB power is connected | */ + public static final int MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8; /* peripheral supply is in over-current state | */ + public static final int MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16; /* hi-power peripheral supply is in over-current state | */ + public static final int MAV_POWER_STATUS_CHANGED = 32; /* Power status has changed since boot | */ + public static final int MAV_POWER_STATUS_ENUM_END = 33; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java b/app/src/main/java/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java index bfa4838..1fdbc51 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_PROTOCOL_CAPABILITY.java @@ -6,27 +6,27 @@ package com.MAVLink.enums; -/** - * Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. - */ +/** +* Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability. +*/ public class MAV_PROTOCOL_CAPABILITY { - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1; /* Autopilot supports MISSION float message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2; /* Autopilot supports the new param float message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4; /* Autopilot supports MISSION_INT scaled integer message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8; /* Autopilot supports COMMAND_INT scaled integer message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16; /* Autopilot supports the new param union message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_FTP = 32; /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64; /* Autopilot supports commanding attitude offboard. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128; /* Autopilot supports commanding position and velocity targets in local NED frame. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256; /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ - public static final int MAV_PROTOCOL_CAPABILITY_TERRAIN = 512; /* Autopilot supports terrain protocol / data handling. | */ - public static final int MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024; /* Autopilot supports direct actuator control. | */ - public static final int MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048; /* Autopilot supports the flight termination command. | */ - public static final int MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096; /* Autopilot supports onboard compass calibration. | */ - public static final int MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192; /* Autopilot supports mavlink version 2. | */ - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384; /* Autopilot supports mission fence protocol. | */ - public static final int MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768; /* Autopilot supports mission rally point protocol. | */ - public static final int MAV_PROTOCOL_CAPABILITY_FLIGHT_INFORMATION = 65536; /* Autopilot supports the flight information protocol. | */ - public static final int MAV_PROTOCOL_CAPABILITY_ENUM_END = 65537; /* | */ + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1; /* Autopilot supports MISSION float message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2; /* Autopilot supports the new param float message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4; /* Autopilot supports MISSION_INT scaled integer message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8; /* Autopilot supports COMMAND_INT scaled integer message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_PARAM_UNION = 16; /* Autopilot supports the new param union message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_FTP = 32; /* Autopilot supports the new FILE_TRANSFER_PROTOCOL message type. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64; /* Autopilot supports commanding attitude offboard. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128; /* Autopilot supports commanding position and velocity targets in local NED frame. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256; /* Autopilot supports commanding position and velocity targets in global scaled integers. | */ + public static final int MAV_PROTOCOL_CAPABILITY_TERRAIN = 512; /* Autopilot supports terrain protocol / data handling. | */ + public static final int MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET = 1024; /* Autopilot supports direct actuator control. | */ + public static final int MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048; /* Autopilot supports the flight termination command. | */ + public static final int MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096; /* Autopilot supports onboard compass calibration. | */ + public static final int MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192; /* Autopilot supports MAVLink version 2. | */ + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384; /* Autopilot supports mission fence protocol. | */ + public static final int MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768; /* Autopilot supports mission rally point protocol. | */ + public static final int MAV_PROTOCOL_CAPABILITY_FLIGHT_INFORMATION = 65536; /* Autopilot supports the flight information protocol. | */ + public static final int MAV_PROTOCOL_CAPABILITY_ENUM_END = 65537; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS.java b/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS.java index 2876510..962f212 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS.java @@ -6,12 +6,12 @@ package com.MAVLink.enums; -/** - * Special ACK block numbers control activation of dataflash log streaming - */ +/** +* Special ACK block numbers control activation of dataflash log streaming. +*/ public class MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS { - public static final int MAV_REMOTE_LOG_DATA_BLOCK_STOP = 2147483645; /* UAV to stop sending DataFlash blocks | */ - public static final int MAV_REMOTE_LOG_DATA_BLOCK_START = 2147483646; /* UAV to start sending DataFlash blocks | */ - public static final int MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS_ENUM_END = 2147483647; /* | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_STOP = 2147483645; /* UAV to stop sending DataFlash blocks. | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_START = 2147483646; /* UAV to start sending DataFlash blocks. | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_COMMANDS_ENUM_END = 2147483647; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_STATUSES.java b/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_STATUSES.java index c34673f..4aa6e9c 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_STATUSES.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_REMOTE_LOG_DATA_BLOCK_STATUSES.java @@ -6,12 +6,12 @@ package com.MAVLink.enums; -/** - * Possible remote log data block statuses - */ +/** +* Possible remote log data block statuses. +*/ public class MAV_REMOTE_LOG_DATA_BLOCK_STATUSES { - public static final int MAV_REMOTE_LOG_DATA_BLOCK_NACK = 0; /* This block has NOT been received | */ - public static final int MAV_REMOTE_LOG_DATA_BLOCK_ACK = 1; /* This block has been received | */ - public static final int MAV_REMOTE_LOG_DATA_BLOCK_STATUSES_ENUM_END = 2; /* | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_NACK = 0; /* This block has NOT been received. | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_ACK = 1; /* This block has been received. | */ + public static final int MAV_REMOTE_LOG_DATA_BLOCK_STATUSES_ENUM_END = 2; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_RESULT.java b/app/src/main/java/com/MAVLink/enums/MAV_RESULT.java index 5c09333..21e3bb2 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_RESULT.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_RESULT.java @@ -6,16 +6,16 @@ package com.MAVLink.enums; -/** - * result from a mavlink command - */ +/** +* Result from a MAVLink command (MAV_CMD) +*/ public class MAV_RESULT { - public static final int MAV_RESULT_ACCEPTED = 0; /* Command ACCEPTED and EXECUTED | */ - public static final int MAV_RESULT_TEMPORARILY_REJECTED = 1; /* Command TEMPORARY REJECTED/DENIED | */ - public static final int MAV_RESULT_DENIED = 2; /* Command PERMANENTLY DENIED | */ - public static final int MAV_RESULT_UNSUPPORTED = 3; /* Command UNKNOWN/UNSUPPORTED | */ - public static final int MAV_RESULT_FAILED = 4; /* Command executed, but failed | */ - public static final int MAV_RESULT_IN_PROGRESS = 5; /* WIP: Command being executed | */ - public static final int MAV_RESULT_ENUM_END = 6; /* | */ + public static final int MAV_RESULT_ACCEPTED = 0; /* Command is valid (is supported and has valid parameters), and was executed. | */ + public static final int MAV_RESULT_TEMPORARILY_REJECTED = 1; /* Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work. | */ + public static final int MAV_RESULT_DENIED = 2; /* Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work. | */ + public static final int MAV_RESULT_UNSUPPORTED = 3; /* Command is not supported (unknown). | */ + public static final int MAV_RESULT_FAILED = 4; /* Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc. | */ + public static final int MAV_RESULT_IN_PROGRESS = 5; /* Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation. There is no need for the sender to retry the command, but if done during execution, the component will return MAV_RESULT_IN_PROGRESS with an updated progress. | */ + public static final int MAV_RESULT_ENUM_END = 6; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_ROI.java b/app/src/main/java/com/MAVLink/enums/MAV_ROI.java index 6d80f98..4fd2960 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_ROI.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_ROI.java @@ -6,17 +6,17 @@ package com.MAVLink.enums; -/** - * The ROI (region of interest) for the vehicle. This can be - * be used by the vehicle for camera/vehicle attitude alignment (see - * MAV_CMD_NAV_ROI). - */ +/** +* The ROI (region of interest) for the vehicle. This can be + be used by the vehicle for camera/vehicle attitude alignment (see + MAV_CMD_NAV_ROI). +*/ public class MAV_ROI { - public static final int MAV_ROI_NONE = 0; /* No region of interest. | */ - public static final int MAV_ROI_WPNEXT = 1; /* Point toward next MISSION. | */ - public static final int MAV_ROI_WPINDEX = 2; /* Point toward given MISSION. | */ - public static final int MAV_ROI_LOCATION = 3; /* Point toward fixed location. | */ - public static final int MAV_ROI_TARGET = 4; /* Point toward of given id. | */ - public static final int MAV_ROI_ENUM_END = 5; /* | */ + public static final int MAV_ROI_NONE = 0; /* No region of interest. | */ + public static final int MAV_ROI_WPNEXT = 1; /* Point toward next waypoint, with optional pitch/roll/yaw offset. | */ + public static final int MAV_ROI_WPINDEX = 2; /* Point toward given waypoint. | */ + public static final int MAV_ROI_LOCATION = 3; /* Point toward fixed location. | */ + public static final int MAV_ROI_TARGET = 4; /* Point toward of given id. | */ + public static final int MAV_ROI_ENUM_END = 5; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_SENSOR_ORIENTATION.java b/app/src/main/java/com/MAVLink/enums/MAV_SENSOR_ORIENTATION.java index 7716931..ac1937a 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_SENSOR_ORIENTATION.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_SENSOR_ORIENTATION.java @@ -6,49 +6,52 @@ package com.MAVLink.enums; -/** - * Enumeration of sensor orientation, according to its rotations - */ +/** +* Enumeration of sensor orientation, according to its rotations +*/ public class MAV_SENSOR_ORIENTATION { - public static final int MAV_SENSOR_ROTATION_NONE = 0; /* Roll: 0, Pitch: 0, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_YAW_45 = 1; /* Roll: 0, Pitch: 0, Yaw: 45 | */ - public static final int MAV_SENSOR_ROTATION_YAW_90 = 2; /* Roll: 0, Pitch: 0, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_YAW_135 = 3; /* Roll: 0, Pitch: 0, Yaw: 135 | */ - public static final int MAV_SENSOR_ROTATION_YAW_180 = 4; /* Roll: 0, Pitch: 0, Yaw: 180 | */ - public static final int MAV_SENSOR_ROTATION_YAW_225 = 5; /* Roll: 0, Pitch: 0, Yaw: 225 | */ - public static final int MAV_SENSOR_ROTATION_YAW_270 = 6; /* Roll: 0, Pitch: 0, Yaw: 270 | */ - public static final int MAV_SENSOR_ROTATION_YAW_315 = 7; /* Roll: 0, Pitch: 0, Yaw: 315 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180 = 8; /* Roll: 180, Pitch: 0, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9; /* Roll: 180, Pitch: 0, Yaw: 45 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10; /* Roll: 180, Pitch: 0, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11; /* Roll: 180, Pitch: 0, Yaw: 135 | */ - public static final int MAV_SENSOR_ROTATION_PITCH_180 = 12; /* Roll: 0, Pitch: 180, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13; /* Roll: 180, Pitch: 0, Yaw: 225 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14; /* Roll: 180, Pitch: 0, Yaw: 270 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15; /* Roll: 180, Pitch: 0, Yaw: 315 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90 = 16; /* Roll: 90, Pitch: 0, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17; /* Roll: 90, Pitch: 0, Yaw: 45 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18; /* Roll: 90, Pitch: 0, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19; /* Roll: 90, Pitch: 0, Yaw: 135 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270 = 20; /* Roll: 270, Pitch: 0, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21; /* Roll: 270, Pitch: 0, Yaw: 45 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22; /* Roll: 270, Pitch: 0, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23; /* Roll: 270, Pitch: 0, Yaw: 135 | */ - public static final int MAV_SENSOR_ROTATION_PITCH_90 = 24; /* Roll: 0, Pitch: 90, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_PITCH_270 = 25; /* Roll: 0, Pitch: 270, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26; /* Roll: 0, Pitch: 180, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27; /* Roll: 0, Pitch: 180, Yaw: 270 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28; /* Roll: 90, Pitch: 90, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29; /* Roll: 180, Pitch: 90, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30; /* Roll: 270, Pitch: 90, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31; /* Roll: 90, Pitch: 180, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32; /* Roll: 270, Pitch: 180, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33; /* Roll: 90, Pitch: 270, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34; /* Roll: 180, Pitch: 270, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35; /* Roll: 270, Pitch: 270, Yaw: 0 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36; /* Roll: 90, Pitch: 180, Yaw: 90 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37; /* Roll: 90, Pitch: 0, Yaw: 270 | */ - public static final int MAV_SENSOR_ROTATION_ROLL_315_PITCH_315_YAW_315 = 38; /* Roll: 315, Pitch: 315, Yaw: 315 | */ - public static final int MAV_SENSOR_ORIENTATION_ENUM_END = 39; /* | */ + public static final int MAV_SENSOR_ROTATION_NONE = 0; /* Roll: 0, Pitch: 0, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_YAW_45 = 1; /* Roll: 0, Pitch: 0, Yaw: 45 | */ + public static final int MAV_SENSOR_ROTATION_YAW_90 = 2; /* Roll: 0, Pitch: 0, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_YAW_135 = 3; /* Roll: 0, Pitch: 0, Yaw: 135 | */ + public static final int MAV_SENSOR_ROTATION_YAW_180 = 4; /* Roll: 0, Pitch: 0, Yaw: 180 | */ + public static final int MAV_SENSOR_ROTATION_YAW_225 = 5; /* Roll: 0, Pitch: 0, Yaw: 225 | */ + public static final int MAV_SENSOR_ROTATION_YAW_270 = 6; /* Roll: 0, Pitch: 0, Yaw: 270 | */ + public static final int MAV_SENSOR_ROTATION_YAW_315 = 7; /* Roll: 0, Pitch: 0, Yaw: 315 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180 = 8; /* Roll: 180, Pitch: 0, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9; /* Roll: 180, Pitch: 0, Yaw: 45 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10; /* Roll: 180, Pitch: 0, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11; /* Roll: 180, Pitch: 0, Yaw: 135 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_180 = 12; /* Roll: 0, Pitch: 180, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13; /* Roll: 180, Pitch: 0, Yaw: 225 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14; /* Roll: 180, Pitch: 0, Yaw: 270 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15; /* Roll: 180, Pitch: 0, Yaw: 315 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90 = 16; /* Roll: 90, Pitch: 0, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17; /* Roll: 90, Pitch: 0, Yaw: 45 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18; /* Roll: 90, Pitch: 0, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19; /* Roll: 90, Pitch: 0, Yaw: 135 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270 = 20; /* Roll: 270, Pitch: 0, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21; /* Roll: 270, Pitch: 0, Yaw: 45 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22; /* Roll: 270, Pitch: 0, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23; /* Roll: 270, Pitch: 0, Yaw: 135 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_90 = 24; /* Roll: 0, Pitch: 90, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_270 = 25; /* Roll: 0, Pitch: 270, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26; /* Roll: 0, Pitch: 180, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27; /* Roll: 0, Pitch: 180, Yaw: 270 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28; /* Roll: 90, Pitch: 90, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29; /* Roll: 180, Pitch: 90, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30; /* Roll: 270, Pitch: 90, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31; /* Roll: 90, Pitch: 180, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32; /* Roll: 270, Pitch: 180, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33; /* Roll: 90, Pitch: 270, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34; /* Roll: 180, Pitch: 270, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35; /* Roll: 270, Pitch: 270, Yaw: 0 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36; /* Roll: 90, Pitch: 180, Yaw: 90 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37; /* Roll: 90, Pitch: 0, Yaw: 270 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38; /* Roll: 90, Pitch: 68, Yaw: 293 | */ + public static final int MAV_SENSOR_ROTATION_PITCH_315 = 39; /* Pitch: 315 | */ + public static final int MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40; /* Roll: 90, Pitch: 315 | */ + public static final int MAV_SENSOR_ROTATION_CUSTOM = 100; /* Custom orientation | */ + public static final int MAV_SENSOR_ORIENTATION_ENUM_END = 101; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_SEVERITY.java b/app/src/main/java/com/MAVLink/enums/MAV_SEVERITY.java index 3cfb121..30121f9 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_SEVERITY.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_SEVERITY.java @@ -6,18 +6,18 @@ package com.MAVLink.enums; -/** - * Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. - */ +/** +* Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: http://www.kiwisyslog.com/kb/info:-syslog-message-levels/. +*/ public class MAV_SEVERITY { - public static final int MAV_SEVERITY_EMERGENCY = 0; /* System is unusable. This is a "panic" condition. | */ - public static final int MAV_SEVERITY_ALERT = 1; /* Action should be taken immediately. Indicates error in non-critical systems. | */ - public static final int MAV_SEVERITY_CRITICAL = 2; /* Action must be taken immediately. Indicates failure in a primary system. | */ - public static final int MAV_SEVERITY_ERROR = 3; /* Indicates an error in secondary/redundant systems. | */ - public static final int MAV_SEVERITY_WARNING = 4; /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ - public static final int MAV_SEVERITY_NOTICE = 5; /* An unusual event has occured, though not an error condition. This should be investigated for the root cause. | */ - public static final int MAV_SEVERITY_INFO = 6; /* Normal operational messages. Useful for logging. No action is required for these messages. | */ - public static final int MAV_SEVERITY_DEBUG = 7; /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ - public static final int MAV_SEVERITY_ENUM_END = 8; /* | */ + public static final int MAV_SEVERITY_EMERGENCY = 0; /* System is unusable. This is a "panic" condition. | */ + public static final int MAV_SEVERITY_ALERT = 1; /* Action should be taken immediately. Indicates error in non-critical systems. | */ + public static final int MAV_SEVERITY_CRITICAL = 2; /* Action must be taken immediately. Indicates failure in a primary system. | */ + public static final int MAV_SEVERITY_ERROR = 3; /* Indicates an error in secondary/redundant systems. | */ + public static final int MAV_SEVERITY_WARNING = 4; /* Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning. | */ + public static final int MAV_SEVERITY_NOTICE = 5; /* An unusual event has occurred, though not an error condition. This should be investigated for the root cause. | */ + public static final int MAV_SEVERITY_INFO = 6; /* Normal operational messages. Useful for logging. No action is required for these messages. | */ + public static final int MAV_SEVERITY_DEBUG = 7; /* Useful non-operational messages that can assist in debugging. These should not occur during normal operation. | */ + public static final int MAV_SEVERITY_ENUM_END = 8; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_SMART_BATTERY_FAULT.java b/app/src/main/java/com/MAVLink/enums/MAV_SMART_BATTERY_FAULT.java new file mode 100644 index 0000000..c3728b1 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_SMART_BATTERY_FAULT.java @@ -0,0 +1,21 @@ +/* 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.MAVLink.enums; + +/** +* Smart battery supply status/fault flags (bitmask) for health indication. +*/ +public class MAV_SMART_BATTERY_FAULT { + public static final int MAV_SMART_BATTERY_FAULT_DEEP_DISCHARGE = 1; /* Battery has deep discharged. | */ + public static final int MAV_SMART_BATTERY_FAULT_SPIKES = 2; /* Voltage spikes. | */ + public static final int MAV_SMART_BATTERY_FAULT_SINGLE_CELL_FAIL = 4; /* Single cell has failed. | */ + public static final int MAV_SMART_BATTERY_FAULT_OVER_CURRENT = 8; /* Over-current fault. | */ + public static final int MAV_SMART_BATTERY_FAULT_OVER_TEMPERATURE = 16; /* Over-temperature fault. | */ + public static final int MAV_SMART_BATTERY_FAULT_UNDER_TEMPERATURE = 32; /* Under-temperature fault. | */ + public static final int MAV_SMART_BATTERY_FAULT_ENUM_END = 33; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_STATE.java b/app/src/main/java/com/MAVLink/enums/MAV_STATE.java index 563f60b..b0c42de 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_STATE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_STATE.java @@ -6,19 +6,19 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class MAV_STATE { - public static final int MAV_STATE_UNINIT = 0; /* Uninitialized system, state is unknown. | */ - public static final int MAV_STATE_BOOT = 1; /* System is booting up. | */ - public static final int MAV_STATE_CALIBRATING = 2; /* System is calibrating and not flight-ready. | */ - public static final int MAV_STATE_STANDBY = 3; /* System is grounded and on standby. It can be launched any time. | */ - public static final int MAV_STATE_ACTIVE = 4; /* System is active and might be already airborne. Motors are engaged. | */ - public static final int MAV_STATE_CRITICAL = 5; /* System is in a non-normal flight mode. It can however still navigate. | */ - public static final int MAV_STATE_EMERGENCY = 6; /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ - public static final int MAV_STATE_POWEROFF = 7; /* System just initialized its power-down sequence, will shut down now. | */ - public static final int MAV_STATE_FLIGHT_TERMINATION = 8; /* System is terminating itself. | */ - public static final int MAV_STATE_ENUM_END = 9; /* | */ + public static final int MAV_STATE_UNINIT = 0; /* Uninitialized system, state is unknown. | */ + public static final int MAV_STATE_BOOT = 1; /* System is booting up. | */ + public static final int MAV_STATE_CALIBRATING = 2; /* System is calibrating and not flight-ready. | */ + public static final int MAV_STATE_STANDBY = 3; /* System is grounded and on standby. It can be launched any time. | */ + public static final int MAV_STATE_ACTIVE = 4; /* System is active and might be already airborne. Motors are engaged. | */ + public static final int MAV_STATE_CRITICAL = 5; /* System is in a non-normal flight mode. It can however still navigate. | */ + public static final int MAV_STATE_EMERGENCY = 6; /* System is in a non-normal flight mode. It lost control over parts or over the whole airframe. It is in mayday and going down. | */ + public static final int MAV_STATE_POWEROFF = 7; /* System just initialized its power-down sequence, will shut down now. | */ + public static final int MAV_STATE_FLIGHT_TERMINATION = 8; /* System is terminating itself. | */ + public static final int MAV_STATE_ENUM_END = 9; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java b/app/src/main/java/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java index 7350b94..965339b 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_SYS_STATUS_SENSOR.java @@ -6,36 +6,39 @@ package com.MAVLink.enums; -/** - * These encode the sensors whose status is sent as part of the SYS_STATUS message. - */ +/** +* These encode the sensors whose status is sent as part of the SYS_STATUS message. +*/ public class MAV_SYS_STATUS_SENSOR { - public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO = 1; /* 0x01 3D gyro | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2; /* 0x02 3D accelerometer | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_MAG = 4; /* 0x04 3D magnetometer | */ - public static final int MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8; /* 0x08 absolute pressure | */ - public static final int MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16; /* 0x10 differential pressure | */ - public static final int MAV_SYS_STATUS_SENSOR_GPS = 32; /* 0x20 GPS | */ - public static final int MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64; /* 0x40 optical flow | */ - public static final int MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128; /* 0x80 computer vision position | */ - public static final int MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256; /* 0x100 laser based position | */ - public static final int MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512; /* 0x200 external ground truth (Vicon or Leica) | */ - public static final int MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024; /* 0x400 3D angular rate control | */ - public static final int MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048; /* 0x800 attitude stabilization | */ - public static final int MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096; /* 0x1000 yaw position | */ - public static final int MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192; /* 0x2000 z/altitude control | */ - public static final int MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384; /* 0x4000 x/y position control | */ - public static final int MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768; /* 0x8000 motor outputs / control | */ - public static final int MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536; /* 0x10000 rc receiver | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072; /* 0x20000 2nd 3D gyro | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144; /* 0x40000 2nd 3D accelerometer | */ - public static final int MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288; /* 0x80000 2nd 3D magnetometer | */ - public static final int MAV_SYS_STATUS_GEOFENCE = 1048576; /* 0x100000 geofence | */ - public static final int MAV_SYS_STATUS_AHRS = 2097152; /* 0x200000 AHRS subsystem health | */ - public static final int MAV_SYS_STATUS_TERRAIN = 4194304; /* 0x400000 Terrain subsystem health | */ - public static final int MAV_SYS_STATUS_REVERSE_MOTOR = 8388608; /* 0x800000 Motors are reversed | */ - public static final int MAV_SYS_STATUS_LOGGING = 16777216; /* 0x1000000 Logging | */ - public static final int MAV_SYS_STATUS_SENSOR_BATTERY = 33554432; /* 0x2000000 Battery | */ - public static final int MAV_SYS_STATUS_SENSOR_ENUM_END = 33554433; /* | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO = 1; /* 0x01 3D gyro | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2; /* 0x02 3D accelerometer | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_MAG = 4; /* 0x04 3D magnetometer | */ + public static final int MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8; /* 0x08 absolute pressure | */ + public static final int MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16; /* 0x10 differential pressure | */ + public static final int MAV_SYS_STATUS_SENSOR_GPS = 32; /* 0x20 GPS | */ + public static final int MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64; /* 0x40 optical flow | */ + public static final int MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128; /* 0x80 computer vision position | */ + public static final int MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256; /* 0x100 laser based position | */ + public static final int MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512; /* 0x200 external ground truth (Vicon or Leica) | */ + public static final int MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024; /* 0x400 3D angular rate control | */ + public static final int MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048; /* 0x800 attitude stabilization | */ + public static final int MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096; /* 0x1000 yaw position | */ + public static final int MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192; /* 0x2000 z/altitude control | */ + public static final int MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384; /* 0x4000 x/y position control | */ + public static final int MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768; /* 0x8000 motor outputs / control | */ + public static final int MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536; /* 0x10000 rc receiver | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072; /* 0x20000 2nd 3D gyro | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144; /* 0x40000 2nd 3D accelerometer | */ + public static final int MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288; /* 0x80000 2nd 3D magnetometer | */ + public static final int MAV_SYS_STATUS_GEOFENCE = 1048576; /* 0x100000 geofence | */ + public static final int MAV_SYS_STATUS_AHRS = 2097152; /* 0x200000 AHRS subsystem health | */ + public static final int MAV_SYS_STATUS_TERRAIN = 4194304; /* 0x400000 Terrain subsystem health | */ + public static final int MAV_SYS_STATUS_REVERSE_MOTOR = 8388608; /* 0x800000 Motors are reversed | */ + public static final int MAV_SYS_STATUS_LOGGING = 16777216; /* 0x1000000 Logging | */ + public static final int MAV_SYS_STATUS_SENSOR_BATTERY = 33554432; /* 0x2000000 Battery | */ + public static final int MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864; /* 0x4000000 Proximity | */ + public static final int MAV_SYS_STATUS_SENSOR_SATCOM = 134217728; /* 0x8000000 Satellite Communication | */ + public static final int MAV_SYS_STATUS_PREARM_CHECK = 268435456; /* 0x10000000 pre-arm check status. Always healthy when armed | */ + public static final int MAV_SYS_STATUS_SENSOR_ENUM_END = 268435457; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_TUNNEL_PAYLOAD_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_TUNNEL_PAYLOAD_TYPE.java new file mode 100644 index 0000000..eb91788 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MAV_TUNNEL_PAYLOAD_TYPE.java @@ -0,0 +1,26 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MAV_TUNNEL_PAYLOAD_TYPE { + public static final int MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0; /* Encoding of payload unknown. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209; /* Registered for STorM32 gimbal controller. | */ + public static final int MAV_TUNNEL_PAYLOAD_TYPE_ENUM_END = 210; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_TYPE.java b/app/src/main/java/com/MAVLink/enums/MAV_TYPE.java index afb1420..77197a5 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_TYPE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_TYPE.java @@ -6,38 +6,44 @@ package com.MAVLink.enums; -/** - * - */ +/** +* MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA). +*/ public class MAV_TYPE { - public static final int MAV_TYPE_GENERIC = 0; /* Generic micro air vehicle. | */ - public static final int MAV_TYPE_FIXED_WING = 1; /* Fixed wing aircraft. | */ - public static final int MAV_TYPE_QUADROTOR = 2; /* Quadrotor | */ - public static final int MAV_TYPE_COAXIAL = 3; /* Coaxial helicopter | */ - public static final int MAV_TYPE_HELICOPTER = 4; /* Normal helicopter with tail rotor. | */ - public static final int MAV_TYPE_ANTENNA_TRACKER = 5; /* Ground installation | */ - public static final int MAV_TYPE_GCS = 6; /* Operator control unit / ground control station | */ - public static final int MAV_TYPE_AIRSHIP = 7; /* Airship, controlled | */ - public static final int MAV_TYPE_FREE_BALLOON = 8; /* Free balloon, uncontrolled | */ - public static final int MAV_TYPE_ROCKET = 9; /* Rocket | */ - public static final int MAV_TYPE_GROUND_ROVER = 10; /* Ground rover | */ - public static final int MAV_TYPE_SURFACE_BOAT = 11; /* Surface vessel, boat, ship | */ - public static final int MAV_TYPE_SUBMARINE = 12; /* Submarine | */ - public static final int MAV_TYPE_HEXAROTOR = 13; /* Hexarotor | */ - public static final int MAV_TYPE_OCTOROTOR = 14; /* Octorotor | */ - public static final int MAV_TYPE_TRICOPTER = 15; /* Tricopter | */ - public static final int MAV_TYPE_FLAPPING_WING = 16; /* Flapping wing | */ - public static final int MAV_TYPE_KITE = 17; /* Kite | */ - public static final int MAV_TYPE_ONBOARD_CONTROLLER = 18; /* Onboard companion controller | */ - public static final int MAV_TYPE_VTOL_DUOROTOR = 19; /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */ - public static final int MAV_TYPE_VTOL_QUADROTOR = 20; /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */ - public static final int MAV_TYPE_VTOL_TILTROTOR = 21; /* Tiltrotor VTOL | */ - public static final int MAV_TYPE_VTOL_RESERVED2 = 22; /* VTOL reserved 2 | */ - public static final int MAV_TYPE_VTOL_RESERVED3 = 23; /* VTOL reserved 3 | */ - public static final int MAV_TYPE_VTOL_RESERVED4 = 24; /* VTOL reserved 4 | */ - public static final int MAV_TYPE_VTOL_RESERVED5 = 25; /* VTOL reserved 5 | */ - public static final int MAV_TYPE_GIMBAL = 26; /* Onboard gimbal | */ - public static final int MAV_TYPE_ADSB = 27; /* Onboard ADSB peripheral | */ - public static final int MAV_TYPE_ENUM_END = 28; /* | */ + public static final int MAV_TYPE_GENERIC = 0; /* Generic micro air vehicle | */ + public static final int MAV_TYPE_FIXED_WING = 1; /* Fixed wing aircraft. | */ + public static final int MAV_TYPE_QUADROTOR = 2; /* Quadrotor | */ + public static final int MAV_TYPE_COAXIAL = 3; /* Coaxial helicopter | */ + public static final int MAV_TYPE_HELICOPTER = 4; /* Normal helicopter with tail rotor. | */ + public static final int MAV_TYPE_ANTENNA_TRACKER = 5; /* Ground installation | */ + public static final int MAV_TYPE_GCS = 6; /* Operator control unit / ground control station | */ + public static final int MAV_TYPE_AIRSHIP = 7; /* Airship, controlled | */ + public static final int MAV_TYPE_FREE_BALLOON = 8; /* Free balloon, uncontrolled | */ + public static final int MAV_TYPE_ROCKET = 9; /* Rocket | */ + public static final int MAV_TYPE_GROUND_ROVER = 10; /* Ground rover | */ + public static final int MAV_TYPE_SURFACE_BOAT = 11; /* Surface vessel, boat, ship | */ + public static final int MAV_TYPE_SUBMARINE = 12; /* Submarine | */ + public static final int MAV_TYPE_HEXAROTOR = 13; /* Hexarotor | */ + public static final int MAV_TYPE_OCTOROTOR = 14; /* Octorotor | */ + public static final int MAV_TYPE_TRICOPTER = 15; /* Tricopter | */ + public static final int MAV_TYPE_FLAPPING_WING = 16; /* Flapping wing | */ + public static final int MAV_TYPE_KITE = 17; /* Kite | */ + public static final int MAV_TYPE_ONBOARD_CONTROLLER = 18; /* Onboard companion controller | */ + public static final int MAV_TYPE_VTOL_DUOROTOR = 19; /* Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. | */ + public static final int MAV_TYPE_VTOL_QUADROTOR = 20; /* Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. | */ + public static final int MAV_TYPE_VTOL_TILTROTOR = 21; /* Tiltrotor VTOL | */ + public static final int MAV_TYPE_VTOL_RESERVED2 = 22; /* VTOL reserved 2 | */ + public static final int MAV_TYPE_VTOL_RESERVED3 = 23; /* VTOL reserved 3 | */ + public static final int MAV_TYPE_VTOL_RESERVED4 = 24; /* VTOL reserved 4 | */ + public static final int MAV_TYPE_VTOL_RESERVED5 = 25; /* VTOL reserved 5 | */ + public static final int MAV_TYPE_GIMBAL = 26; /* Gimbal | */ + public static final int MAV_TYPE_ADSB = 27; /* ADSB system | */ + public static final int MAV_TYPE_PARAFOIL = 28; /* Steerable, nonrigid airfoil | */ + public static final int MAV_TYPE_DODECAROTOR = 29; /* Dodecarotor | */ + public static final int MAV_TYPE_CAMERA = 30; /* Camera | */ + public static final int MAV_TYPE_CHARGING_STATION = 31; /* Charging station | */ + public static final int MAV_TYPE_FLARM = 32; /* FLARM collision avoidance system | */ + public static final int MAV_TYPE_SERVO = 33; /* Servo | */ + public static final int MAV_TYPE_ENUM_END = 34; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MAV_VTOL_STATE.java b/app/src/main/java/com/MAVLink/enums/MAV_VTOL_STATE.java index f2d28dc..40fd9fd 100644 --- a/app/src/main/java/com/MAVLink/enums/MAV_VTOL_STATE.java +++ b/app/src/main/java/com/MAVLink/enums/MAV_VTOL_STATE.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * Enumeration of VTOL states - */ +/** +* Enumeration of VTOL states +*/ public class MAV_VTOL_STATE { - public static final int MAV_VTOL_STATE_UNDEFINED = 0; /* MAV is not configured as VTOL | */ - public static final int MAV_VTOL_STATE_TRANSITION_TO_FW = 1; /* VTOL is in transition from multicopter to fixed-wing | */ - public static final int MAV_VTOL_STATE_TRANSITION_TO_MC = 2; /* VTOL is in transition from fixed-wing to multicopter | */ - public static final int MAV_VTOL_STATE_MC = 3; /* VTOL is in multicopter state | */ - public static final int MAV_VTOL_STATE_FW = 4; /* VTOL is in fixed-wing state | */ - public static final int MAV_VTOL_STATE_ENUM_END = 5; /* | */ + public static final int MAV_VTOL_STATE_UNDEFINED = 0; /* MAV is not configured as VTOL | */ + public static final int MAV_VTOL_STATE_TRANSITION_TO_FW = 1; /* VTOL is in transition from multicopter to fixed-wing | */ + public static final int MAV_VTOL_STATE_TRANSITION_TO_MC = 2; /* VTOL is in transition from fixed-wing to multicopter | */ + public static final int MAV_VTOL_STATE_MC = 3; /* VTOL is in multicopter state | */ + public static final int MAV_VTOL_STATE_FW = 4; /* VTOL is in fixed-wing state | */ + public static final int MAV_VTOL_STATE_ENUM_END = 5; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_ORDER.java b/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_ORDER.java new file mode 100644 index 0000000..759c262 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_ORDER.java @@ -0,0 +1,18 @@ +/* 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.MAVLink.enums; + +/** +* +*/ +public class MOTOR_TEST_ORDER { + public static final int MOTOR_TEST_ORDER_DEFAULT = 0; /* default autopilot motor test method | */ + public static final int MOTOR_TEST_ORDER_SEQUENCE = 1; /* motor numbers are specified as their index in a predefined vehicle-specific sequence | */ + public static final int MOTOR_TEST_ORDER_BOARD = 2; /* motor numbers are specified as the output as labeled on the board | */ + public static final int MOTOR_TEST_ORDER_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java b/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java index 5281642..7b36ed4 100644 --- a/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java +++ b/app/src/main/java/com/MAVLink/enums/MOTOR_TEST_THROTTLE_TYPE.java @@ -6,13 +6,14 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class MOTOR_TEST_THROTTLE_TYPE { - public static final int MOTOR_TEST_THROTTLE_PERCENT = 0; /* throttle as a percentage from 0 ~ 100 | */ - public static final int MOTOR_TEST_THROTTLE_PWM = 1; /* throttle as an absolute PWM value (normally in range of 1000~2000) | */ - public static final int MOTOR_TEST_THROTTLE_PILOT = 2; /* throttle pass-through from pilot's transmitter | */ - public static final int MOTOR_TEST_THROTTLE_TYPE_ENUM_END = 3; /* | */ + public static final int MOTOR_TEST_THROTTLE_PERCENT = 0; /* throttle as a percentage from 0 ~ 100 | */ + public static final int MOTOR_TEST_THROTTLE_PWM = 1; /* throttle as an absolute PWM value (normally in range of 1000~2000) | */ + public static final int MOTOR_TEST_THROTTLE_PILOT = 2; /* throttle pass-through from pilot's transmitter | */ + public static final int MOTOR_TEST_COMPASS_CAL = 3; /* per-motor compass calibration test | */ + public static final int MOTOR_TEST_THROTTLE_TYPE_ENUM_END = 4; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/ORBIT_YAW_BEHAVIOUR.java b/app/src/main/java/com/MAVLink/enums/ORBIT_YAW_BEHAVIOUR.java new file mode 100644 index 0000000..feaed4d --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/ORBIT_YAW_BEHAVIOUR.java @@ -0,0 +1,20 @@ +/* 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.MAVLink.enums; + +/** +* Yaw behaviour during orbit flight. +*/ +public class ORBIT_YAW_BEHAVIOUR { + public static final int ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0; /* Vehicle front points to the center (default). | */ + public static final int ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1; /* Vehicle front holds heading when message received. | */ + public static final int ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2; /* Yaw uncontrolled. | */ + public static final int ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3; /* Vehicle front follows flight path (tangential to circle). | */ + public static final int ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4; /* Yaw controlled by RC input. | */ + public static final int ORBIT_YAW_BEHAVIOUR_ENUM_END = 5; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/PARACHUTE_ACTION.java b/app/src/main/java/com/MAVLink/enums/PARACHUTE_ACTION.java index d7fc0bf..1cf935d 100644 --- a/app/src/main/java/com/MAVLink/enums/PARACHUTE_ACTION.java +++ b/app/src/main/java/com/MAVLink/enums/PARACHUTE_ACTION.java @@ -6,13 +6,13 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class PARACHUTE_ACTION { - public static final int PARACHUTE_DISABLE = 0; /* Disable parachute release | */ - public static final int PARACHUTE_ENABLE = 1; /* Enable parachute release | */ - public static final int PARACHUTE_RELEASE = 2; /* Release parachute | */ - public static final int PARACHUTE_ACTION_ENUM_END = 3; /* | */ + public static final int PARACHUTE_DISABLE = 0; /* Disable parachute release. | */ + public static final int PARACHUTE_ENABLE = 1; /* Enable parachute release. | */ + public static final int PARACHUTE_RELEASE = 2; /* Release parachute. | */ + public static final int PARACHUTE_ACTION_ENUM_END = 3; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/PARAM_ACK.java b/app/src/main/java/com/MAVLink/enums/PARAM_ACK.java index a53afc7..fc3eaeb 100644 --- a/app/src/main/java/com/MAVLink/enums/PARAM_ACK.java +++ b/app/src/main/java/com/MAVLink/enums/PARAM_ACK.java @@ -6,14 +6,14 @@ package com.MAVLink.enums; -/** - * Result from a PARAM_EXT_SET message. - */ +/** +* Result from a PARAM_EXT_SET message. +*/ public class PARAM_ACK { - public static final int PARAM_ACK_ACCEPTED = 0; /* Parameter value ACCEPTED and SET | */ - public static final int PARAM_ACK_VALUE_UNSUPPORTED = 1; /* Parameter value UNKNOWN/UNSUPPORTED | */ - public static final int PARAM_ACK_FAILED = 2; /* Parameter failed to set | */ - public static final int PARAM_ACK_IN_PROGRESS = 3; /* Parameter value received but not yet validated or set. A subsequent PARAM_EXT_ACK will follow once operation is completed with the actual result. These are for parameters that may take longer to set. Instead of waiting for an ACK and potentially timing out, you will immediately receive this response to let you know it was received. | */ - public static final int PARAM_ACK_ENUM_END = 4; /* | */ + public static final int PARAM_ACK_ACCEPTED = 0; /* Parameter value ACCEPTED and SET | */ + public static final int PARAM_ACK_VALUE_UNSUPPORTED = 1; /* Parameter value UNKNOWN/UNSUPPORTED | */ + public static final int PARAM_ACK_FAILED = 2; /* Parameter failed to set | */ + public static final int PARAM_ACK_IN_PROGRESS = 3; /* Parameter value received but not yet validated or set. A subsequent PARAM_EXT_ACK will follow once operation is completed with the actual result. These are for parameters that may take longer to set. Instead of waiting for an ACK and potentially timing out, you will immediately receive this response to let you know it was received. | */ + public static final int PARAM_ACK_ENUM_END = 4; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/PID_TUNING_AXIS.java b/app/src/main/java/com/MAVLink/enums/PID_TUNING_AXIS.java index 8e985ba..adc8c1f 100644 --- a/app/src/main/java/com/MAVLink/enums/PID_TUNING_AXIS.java +++ b/app/src/main/java/com/MAVLink/enums/PID_TUNING_AXIS.java @@ -6,16 +6,16 @@ package com.MAVLink.enums; -/** - * - */ +/** +* +*/ public class PID_TUNING_AXIS { - public static final int PID_TUNING_ROLL = 1; /* | */ - public static final int PID_TUNING_PITCH = 2; /* | */ - public static final int PID_TUNING_YAW = 3; /* | */ - public static final int PID_TUNING_ACCZ = 4; /* | */ - public static final int PID_TUNING_STEER = 5; /* | */ - public static final int PID_TUNING_LANDING = 6; /* | */ - public static final int PID_TUNING_AXIS_ENUM_END = 7; /* | */ + public static final int PID_TUNING_ROLL = 1; /* | */ + public static final int PID_TUNING_PITCH = 2; /* | */ + public static final int PID_TUNING_YAW = 3; /* | */ + public static final int PID_TUNING_ACCZ = 4; /* | */ + public static final int PID_TUNING_STEER = 5; /* | */ + public static final int PID_TUNING_LANDING = 6; /* | */ + public static final int PID_TUNING_AXIS_ENUM_END = 7; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/PLANE_MODE.java b/app/src/main/java/com/MAVLink/enums/PLANE_MODE.java new file mode 100644 index 0000000..d795abc --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/PLANE_MODE.java @@ -0,0 +1,37 @@ +/* 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.MAVLink.enums; + +/** +* A mapping of plane flight modes for custom_mode field of heartbeat. +*/ +public class PLANE_MODE { + public static final int PLANE_MODE_MANUAL = 0; /* | */ + public static final int PLANE_MODE_CIRCLE = 1; /* | */ + public static final int PLANE_MODE_STABILIZE = 2; /* | */ + public static final int PLANE_MODE_TRAINING = 3; /* | */ + public static final int PLANE_MODE_ACRO = 4; /* | */ + public static final int PLANE_MODE_FLY_BY_WIRE_A = 5; /* | */ + public static final int PLANE_MODE_FLY_BY_WIRE_B = 6; /* | */ + public static final int PLANE_MODE_CRUISE = 7; /* | */ + public static final int PLANE_MODE_AUTOTUNE = 8; /* | */ + public static final int PLANE_MODE_AUTO = 10; /* | */ + public static final int PLANE_MODE_RTL = 11; /* | */ + public static final int PLANE_MODE_LOITER = 12; /* | */ + public static final int PLANE_MODE_TAKEOFF = 13; /* | */ + public static final int PLANE_MODE_AVOID_ADSB = 14; /* | */ + public static final int PLANE_MODE_GUIDED = 15; /* | */ + public static final int PLANE_MODE_INITIALIZING = 16; /* | */ + public static final int PLANE_MODE_QSTABILIZE = 17; /* | */ + public static final int PLANE_MODE_QHOVER = 18; /* | */ + public static final int PLANE_MODE_QLOITER = 19; /* | */ + public static final int PLANE_MODE_QLAND = 20; /* | */ + public static final int PLANE_MODE_QRTL = 21; /* | */ + public static final int PLANE_MODE_QAUTOTUNE = 22; /* | */ + public static final int PLANE_MODE_ENUM_END = 23; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/POSITION_TARGET_TYPEMASK.java b/app/src/main/java/com/MAVLink/enums/POSITION_TARGET_TYPEMASK.java new file mode 100644 index 0000000..7976f5a --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/POSITION_TARGET_TYPEMASK.java @@ -0,0 +1,27 @@ +/* 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.MAVLink.enums; + +/** +* Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration. +*/ +public class POSITION_TARGET_TYPEMASK { + public static final int POSITION_TARGET_TYPEMASK_X_IGNORE = 1; /* Ignore position x | */ + public static final int POSITION_TARGET_TYPEMASK_Y_IGNORE = 2; /* Ignore position y | */ + public static final int POSITION_TARGET_TYPEMASK_Z_IGNORE = 4; /* Ignore position z | */ + public static final int POSITION_TARGET_TYPEMASK_VX_IGNORE = 8; /* Ignore velocity x | */ + public static final int POSITION_TARGET_TYPEMASK_VY_IGNORE = 16; /* Ignore velocity y | */ + public static final int POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32; /* Ignore velocity z | */ + public static final int POSITION_TARGET_TYPEMASK_AX_IGNORE = 64; /* Ignore acceleration x | */ + public static final int POSITION_TARGET_TYPEMASK_AY_IGNORE = 128; /* Ignore acceleration y | */ + public static final int POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256; /* Ignore acceleration z | */ + public static final int POSITION_TARGET_TYPEMASK_FORCE_SET = 512; /* Use force instead of acceleration | */ + public static final int POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024; /* Ignore yaw | */ + public static final int POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048; /* Ignore yaw rate | */ + public static final int POSITION_TARGET_TYPEMASK_ENUM_END = 2049; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/PRECISION_LAND_MODE.java b/app/src/main/java/com/MAVLink/enums/PRECISION_LAND_MODE.java new file mode 100644 index 0000000..7036e25 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/PRECISION_LAND_MODE.java @@ -0,0 +1,18 @@ +/* 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.MAVLink.enums; + +/** +* Precision land modes (used in MAV_CMD_NAV_LAND). +*/ +public class PRECISION_LAND_MODE { + public static final int PRECISION_LAND_MODE_DISABLED = 0; /* Normal (non-precision) landing. | */ + public static final int PRECISION_LAND_MODE_OPPORTUNISTIC = 1; /* Use precision landing if beacon detected when land command accepted, otherwise land normally. | */ + public static final int PRECISION_LAND_MODE_REQUIRED = 2; /* Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found). | */ + public static final int PRECISION_LAND_MODE_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/RALLY_FLAGS.java b/app/src/main/java/com/MAVLink/enums/RALLY_FLAGS.java index e2d68ee..22c303f 100644 --- a/app/src/main/java/com/MAVLink/enums/RALLY_FLAGS.java +++ b/app/src/main/java/com/MAVLink/enums/RALLY_FLAGS.java @@ -6,12 +6,12 @@ package com.MAVLink.enums; -/** - * Flags in RALLY_POINT message - */ +/** +* Flags in RALLY_POINT message. +*/ public class RALLY_FLAGS { - public static final int FAVORABLE_WIND = 1; /* Flag set when requiring favorable winds for landing. | */ - public static final int LAND_IMMEDIATELY = 2; /* Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. | */ - public static final int RALLY_FLAGS_ENUM_END = 3; /* | */ + public static final int FAVORABLE_WIND = 1; /* Flag set when requiring favorable winds for landing. | */ + public static final int LAND_IMMEDIATELY = 2; /* Flag set when plane is to immediately descend to break altitude and land without GCS intervention. Flag not set when plane is to loiter at Rally point until commanded to land. | */ + public static final int RALLY_FLAGS_ENUM_END = 3; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/RC_TYPE.java b/app/src/main/java/com/MAVLink/enums/RC_TYPE.java new file mode 100644 index 0000000..5e5c14e --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/RC_TYPE.java @@ -0,0 +1,17 @@ +/* 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.MAVLink.enums; + +/** +* RC type +*/ +public class RC_TYPE { + public static final int RC_TYPE_SPEKTRUM_DSM2 = 0; /* Spektrum DSM2 | */ + public static final int RC_TYPE_SPEKTRUM_DSMX = 1; /* Spektrum DSMX | */ + public static final int RC_TYPE_ENUM_END = 2; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/ROVER_MODE.java b/app/src/main/java/com/MAVLink/enums/ROVER_MODE.java new file mode 100644 index 0000000..1d4c8d3 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/ROVER_MODE.java @@ -0,0 +1,25 @@ +/* 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.MAVLink.enums; + +/** +* A mapping of rover flight modes for custom_mode field of heartbeat. +*/ +public class ROVER_MODE { + public static final int ROVER_MODE_MANUAL = 0; /* | */ + public static final int ROVER_MODE_ACRO = 1; /* | */ + public static final int ROVER_MODE_STEERING = 3; /* | */ + public static final int ROVER_MODE_HOLD = 4; /* | */ + public static final int ROVER_MODE_LOITER = 5; /* | */ + public static final int ROVER_MODE_AUTO = 10; /* | */ + public static final int ROVER_MODE_RTL = 11; /* | */ + public static final int ROVER_MODE_SMART_RTL = 12; /* | */ + public static final int ROVER_MODE_GUIDED = 15; /* | */ + public static final int ROVER_MODE_INITIALIZING = 16; /* | */ + public static final int ROVER_MODE_ENUM_END = 17; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/RTK_BASELINE_COORDINATE_SYSTEM.java b/app/src/main/java/com/MAVLink/enums/RTK_BASELINE_COORDINATE_SYSTEM.java new file mode 100644 index 0000000..00d6bde --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/RTK_BASELINE_COORDINATE_SYSTEM.java @@ -0,0 +1,17 @@ +/* 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.MAVLink.enums; + +/** +* RTK GPS baseline coordinate system, used for RTK corrections +*/ +public class RTK_BASELINE_COORDINATE_SYSTEM { + public static final int RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0; /* Earth-centered, Earth-fixed | */ + public static final int RTK_BASELINE_COORDINATE_SYSTEM_NED = 1; /* RTK basestation centered, north, east, down | */ + public static final int RTK_BASELINE_COORDINATE_SYSTEM_ENUM_END = 2; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_DEV.java b/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_DEV.java index dcfc67a..a1bb451 100644 --- a/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_DEV.java +++ b/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_DEV.java @@ -6,15 +6,25 @@ package com.MAVLink.enums; -/** - * SERIAL_CONTROL device types - */ +/** +* SERIAL_CONTROL device types +*/ public class SERIAL_CONTROL_DEV { - public static final int SERIAL_CONTROL_DEV_TELEM1 = 0; /* First telemetry port | */ - public static final int SERIAL_CONTROL_DEV_TELEM2 = 1; /* Second telemetry port | */ - public static final int SERIAL_CONTROL_DEV_GPS1 = 2; /* First GPS port | */ - public static final int SERIAL_CONTROL_DEV_GPS2 = 3; /* Second GPS port | */ - public static final int SERIAL_CONTROL_DEV_SHELL = 10; /* system shell | */ - public static final int SERIAL_CONTROL_DEV_ENUM_END = 11; /* | */ + public static final int SERIAL_CONTROL_DEV_TELEM1 = 0; /* First telemetry port | */ + public static final int SERIAL_CONTROL_DEV_TELEM2 = 1; /* Second telemetry port | */ + public static final int SERIAL_CONTROL_DEV_GPS1 = 2; /* First GPS port | */ + public static final int SERIAL_CONTROL_DEV_GPS2 = 3; /* Second GPS port | */ + public static final int SERIAL_CONTROL_DEV_SHELL = 10; /* system shell | */ + public static final int SERIAL_CONTROL_SERIAL0 = 100; /* SERIAL0 | */ + public static final int SERIAL_CONTROL_SERIAL1 = 101; /* SERIAL1 | */ + public static final int SERIAL_CONTROL_SERIAL2 = 102; /* SERIAL2 | */ + public static final int SERIAL_CONTROL_SERIAL3 = 103; /* SERIAL3 | */ + public static final int SERIAL_CONTROL_SERIAL4 = 104; /* SERIAL4 | */ + public static final int SERIAL_CONTROL_SERIAL5 = 105; /* SERIAL5 | */ + public static final int SERIAL_CONTROL_SERIAL6 = 106; /* SERIAL6 | */ + public static final int SERIAL_CONTROL_SERIAL7 = 107; /* SERIAL7 | */ + public static final int SERIAL_CONTROL_SERIAL8 = 108; /* SERIAL8 | */ + public static final int SERIAL_CONTROL_SERIAL9 = 109; /* SERIAL9 | */ + public static final int SERIAL_CONTROL_DEV_ENUM_END = 110; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java b/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java index 92e3933..9918da6 100644 --- a/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java +++ b/app/src/main/java/com/MAVLink/enums/SERIAL_CONTROL_FLAG.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * SERIAL_CONTROL flags (bitmask) - */ +/** +* SERIAL_CONTROL flags (bitmask) +*/ public class SERIAL_CONTROL_FLAG { - public static final int SERIAL_CONTROL_FLAG_REPLY = 1; /* Set if this is a reply | */ - public static final int SERIAL_CONTROL_FLAG_RESPOND = 2; /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ - public static final int SERIAL_CONTROL_FLAG_EXCLUSIVE = 4; /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ - public static final int SERIAL_CONTROL_FLAG_BLOCKING = 8; /* Block on writes to the serial port | */ - public static final int SERIAL_CONTROL_FLAG_MULTI = 16; /* Send multiple replies until port is drained | */ - public static final int SERIAL_CONTROL_FLAG_ENUM_END = 17; /* | */ + public static final int SERIAL_CONTROL_FLAG_REPLY = 1; /* Set if this is a reply | */ + public static final int SERIAL_CONTROL_FLAG_RESPOND = 2; /* Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message | */ + public static final int SERIAL_CONTROL_FLAG_EXCLUSIVE = 4; /* Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set | */ + public static final int SERIAL_CONTROL_FLAG_BLOCKING = 8; /* Block on writes to the serial port | */ + public static final int SERIAL_CONTROL_FLAG_MULTI = 16; /* Send multiple replies until port is drained | */ + public static final int SERIAL_CONTROL_FLAG_ENUM_END = 17; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/SET_FOCUS_TYPE.java b/app/src/main/java/com/MAVLink/enums/SET_FOCUS_TYPE.java new file mode 100644 index 0000000..8d266a6 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/SET_FOCUS_TYPE.java @@ -0,0 +1,19 @@ +/* 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.MAVLink.enums; + +/** +* Focus types for MAV_CMD_SET_CAMERA_FOCUS +*/ +public class SET_FOCUS_TYPE { + public static final int FOCUS_TYPE_STEP = 0; /* Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity). | */ + public static final int FOCUS_TYPE_CONTINUOUS = 1; /* Continuous focus up/down until stopped (-1 for focusing in, 1 for focusing out towards infinity, 0 to stop focusing) | */ + public static final int FOCUS_TYPE_RANGE = 2; /* Focus value as proportion of full camera focus range (a value between 0.0 and 100.0) | */ + public static final int FOCUS_TYPE_METERS = 3; /* Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera). | */ + public static final int SET_FOCUS_TYPE_ENUM_END = 4; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/STORAGE_STATUS.java b/app/src/main/java/com/MAVLink/enums/STORAGE_STATUS.java new file mode 100644 index 0000000..ce3ce4b --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/STORAGE_STATUS.java @@ -0,0 +1,19 @@ +/* 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.MAVLink.enums; + +/** +* Flags to indicate the status of camera storage. +*/ +public class STORAGE_STATUS { + public static final int STORAGE_STATUS_EMPTY = 0; /* Storage is missing (no microSD card loaded for example.) | */ + public static final int STORAGE_STATUS_UNFORMATTED = 1; /* Storage present but unformatted. | */ + public static final int STORAGE_STATUS_READY = 2; /* Storage present and ready. | */ + public static final int STORAGE_STATUS_NOT_SUPPORTED = 3; /* Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored. | */ + public static final int STORAGE_STATUS_ENUM_END = 4; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/SUB_MODE.java b/app/src/main/java/com/MAVLink/enums/SUB_MODE.java new file mode 100644 index 0000000..754140d --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/SUB_MODE.java @@ -0,0 +1,24 @@ +/* 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.MAVLink.enums; + +/** +* A mapping of sub flight modes for custom_mode field of heartbeat. +*/ +public class SUB_MODE { + public static final int SUB_MODE_STABILIZE = 0; /* | */ + public static final int SUB_MODE_ACRO = 1; /* | */ + public static final int SUB_MODE_ALT_HOLD = 2; /* | */ + public static final int SUB_MODE_AUTO = 3; /* | */ + public static final int SUB_MODE_GUIDED = 4; /* | */ + public static final int SUB_MODE_CIRCLE = 7; /* | */ + public static final int SUB_MODE_SURFACE = 9; /* | */ + public static final int SUB_MODE_POSHOLD = 16; /* | */ + public static final int SUB_MODE_MANUAL = 19; /* | */ + public static final int SUB_MODE_ENUM_END = 20; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/TRACKER_MODE.java b/app/src/main/java/com/MAVLink/enums/TRACKER_MODE.java new file mode 100644 index 0000000..d17f506 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/TRACKER_MODE.java @@ -0,0 +1,21 @@ +/* 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.MAVLink.enums; + +/** +* A mapping of antenna tracker flight modes for custom_mode field of heartbeat. +*/ +public class TRACKER_MODE { + public static final int TRACKER_MODE_MANUAL = 0; /* | */ + public static final int TRACKER_MODE_STOP = 1; /* | */ + public static final int TRACKER_MODE_SCAN = 2; /* | */ + public static final int TRACKER_MODE_SERVO_TEST = 3; /* | */ + public static final int TRACKER_MODE_AUTO = 10; /* | */ + public static final int TRACKER_MODE_INITIALIZING = 16; /* | */ + public static final int TRACKER_MODE_ENUM_END = 17; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/TUNE_FORMAT.java b/app/src/main/java/com/MAVLink/enums/TUNE_FORMAT.java new file mode 100644 index 0000000..0e6e644 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/TUNE_FORMAT.java @@ -0,0 +1,17 @@ +/* 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.MAVLink.enums; + +/** +* Tune formats (used for vehicle buzzer/tone generation). +*/ +public class TUNE_FORMAT { + public static final int TUNE_FORMAT_QBASIC1_1 = 1; /* Format is QBasic 1.1 Play: https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm. | */ + public static final int TUNE_FORMAT_MML_MODERN = 2; /* Format is Modern Music Markup Language (MML): https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML. | */ + public static final int TUNE_FORMAT_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_HEALTH.java b/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_HEALTH.java index eaa3d9d..d779f6d 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_HEALTH.java +++ b/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_HEALTH.java @@ -6,14 +6,14 @@ package com.MAVLink.enums; -/** - * Generalized UAVCAN node health - */ +/** +* Generalized UAVCAN node health +*/ public class UAVCAN_NODE_HEALTH { - public static final int UAVCAN_NODE_HEALTH_OK = 0; /* The node is functioning properly. | */ - public static final int UAVCAN_NODE_HEALTH_WARNING = 1; /* A critical parameter went out of range or the node has encountered a minor failure. | */ - public static final int UAVCAN_NODE_HEALTH_ERROR = 2; /* The node has encountered a major failure. | */ - public static final int UAVCAN_NODE_HEALTH_CRITICAL = 3; /* The node has suffered a fatal malfunction. | */ - public static final int UAVCAN_NODE_HEALTH_ENUM_END = 4; /* | */ + public static final int UAVCAN_NODE_HEALTH_OK = 0; /* The node is functioning properly. | */ + public static final int UAVCAN_NODE_HEALTH_WARNING = 1; /* A critical parameter went out of range or the node has encountered a minor failure. | */ + public static final int UAVCAN_NODE_HEALTH_ERROR = 2; /* The node has encountered a major failure. | */ + public static final int UAVCAN_NODE_HEALTH_CRITICAL = 3; /* The node has suffered a fatal malfunction. | */ + public static final int UAVCAN_NODE_HEALTH_ENUM_END = 4; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_MODE.java b/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_MODE.java index 8a15689..0429f37 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_MODE.java +++ b/app/src/main/java/com/MAVLink/enums/UAVCAN_NODE_MODE.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * Generalized UAVCAN node mode - */ +/** +* Generalized UAVCAN node mode +*/ public class UAVCAN_NODE_MODE { - public static final int UAVCAN_NODE_MODE_OPERATIONAL = 0; /* The node is performing its primary functions. | */ - public static final int UAVCAN_NODE_MODE_INITIALIZATION = 1; /* The node is initializing; this mode is entered immediately after startup. | */ - public static final int UAVCAN_NODE_MODE_MAINTENANCE = 2; /* The node is under maintenance. | */ - public static final int UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3; /* The node is in the process of updating its software. | */ - public static final int UAVCAN_NODE_MODE_OFFLINE = 7; /* The node is no longer available online. | */ - public static final int UAVCAN_NODE_MODE_ENUM_END = 8; /* | */ + public static final int UAVCAN_NODE_MODE_OPERATIONAL = 0; /* The node is performing its primary functions. | */ + public static final int UAVCAN_NODE_MODE_INITIALIZATION = 1; /* The node is initializing; this mode is entered immediately after startup. | */ + public static final int UAVCAN_NODE_MODE_MAINTENANCE = 2; /* The node is under maintenance. | */ + public static final int UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3; /* The node is in the process of updating its software. | */ + public static final int UAVCAN_NODE_MODE_OFFLINE = 7; /* The node is no longer available online. | */ + public static final int UAVCAN_NODE_MODE_ENUM_END = 8; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_EMERGENCY_STATUS.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_EMERGENCY_STATUS.java index 61c4ab6..a94bb7a 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_EMERGENCY_STATUS.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_EMERGENCY_STATUS.java @@ -6,18 +6,18 @@ package com.MAVLink.enums; -/** - * Emergency status encoding - */ +/** +* Emergency status encoding +*/ public class UAVIONIX_ADSB_EMERGENCY_STATUS { - public static final int UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3; /* | */ - public static final int UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4; /* | */ - public static final int UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5; /* | */ - public static final int UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6; /* | */ - public static final int UAVIONIX_ADSB_OUT_RESERVED = 7; /* | */ - public static final int UAVIONIX_ADSB_EMERGENCY_STATUS_ENUM_END = 8; /* | */ + public static final int UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3; /* | */ + public static final int UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4; /* | */ + public static final int UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5; /* | */ + public static final int UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6; /* | */ + public static final int UAVIONIX_ADSB_OUT_RESERVED = 7; /* | */ + public static final int UAVIONIX_ADSB_EMERGENCY_STATUS_ENUM_END = 8; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE.java index e0ad324..f5bd4fd 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE.java @@ -6,26 +6,26 @@ package com.MAVLink.enums; -/** - * Definitions for aircraft size - */ +/** +* Definitions for aircraft size +*/ public class UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE { - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_ENUM_END = 16; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_ENUM_END = 16; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT.java index 962833a..71afc67 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT.java @@ -6,18 +6,18 @@ package com.MAVLink.enums; -/** - * GPS lataral offset encoding - */ +/** +* GPS lataral offset encoding +*/ public class UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT { - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_ENUM_END = 8; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_ENUM_END = 8; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON.java index 3446148..ee95a3b 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON.java @@ -6,12 +6,12 @@ package com.MAVLink.enums; -/** - * GPS longitudinal offset encoding - */ +/** +* GPS longitudinal offset encoding +*/ public class UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON { - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_ENUM_END = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_ENUM_END = 2; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX.java index d001feb..73938bd 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX.java @@ -6,16 +6,16 @@ package com.MAVLink.enums; -/** - * Status for ADS-B transponder dynamic input - */ +/** +* Status for ADS-B transponder dynamic input +*/ public class UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX { - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_ENUM_END = 6; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_ENUM_END = 6; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_STATE.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_STATE.java index 729c384..a0d9456 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_STATE.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_DYNAMIC_STATE.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * State flags for ADS-B transponder dynamic report - */ +/** +* State flags for ADS-B transponder dynamic report +*/ public class UAVIONIX_ADSB_OUT_DYNAMIC_STATE { - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16; /* | */ - public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ENUM_END = 17; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16; /* | */ + public static final int UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ENUM_END = 17; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_RF_SELECT.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_RF_SELECT.java index 2e801fb..2333724 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_RF_SELECT.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_OUT_RF_SELECT.java @@ -6,13 +6,13 @@ package com.MAVLink.enums; -/** - * Transceiver RF control flags for ADS-B transponder dynamic reports - */ +/** +* Transceiver RF control flags for ADS-B transponder dynamic reports +*/ public class UAVIONIX_ADSB_OUT_RF_SELECT { - public static final int UAVIONIX_ADSB_OUT_RF_SELECT_STANDBY = 0; /* | */ - public static final int UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1; /* | */ - public static final int UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2; /* | */ - public static final int UAVIONIX_ADSB_OUT_RF_SELECT_ENUM_END = 3; /* | */ + public static final int UAVIONIX_ADSB_OUT_RF_SELECT_STANDBY = 0; /* | */ + public static final int UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1; /* | */ + public static final int UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2; /* | */ + public static final int UAVIONIX_ADSB_OUT_RF_SELECT_ENUM_END = 3; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_RF_HEALTH.java b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_RF_HEALTH.java index b4776f1..4252f37 100644 --- a/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_RF_HEALTH.java +++ b/app/src/main/java/com/MAVLink/enums/UAVIONIX_ADSB_RF_HEALTH.java @@ -6,14 +6,14 @@ package com.MAVLink.enums; -/** - * Status flags for ADS-B transponder dynamic output - */ +/** +* Status flags for ADS-B transponder dynamic output +*/ public class UAVIONIX_ADSB_RF_HEALTH { - public static final int UAVIONIX_ADSB_RF_HEALTH_INITIALIZING = 0; /* | */ - public static final int UAVIONIX_ADSB_RF_HEALTH_OK = 1; /* | */ - public static final int UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2; /* | */ - public static final int UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16; /* | */ - public static final int UAVIONIX_ADSB_RF_HEALTH_ENUM_END = 17; /* | */ + public static final int UAVIONIX_ADSB_RF_HEALTH_INITIALIZING = 0; /* | */ + public static final int UAVIONIX_ADSB_RF_HEALTH_OK = 1; /* | */ + public static final int UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2; /* | */ + public static final int UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16; /* | */ + public static final int UAVIONIX_ADSB_RF_HEALTH_ENUM_END = 17; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UTM_DATA_AVAIL_FLAGS.java b/app/src/main/java/com/MAVLink/enums/UTM_DATA_AVAIL_FLAGS.java new file mode 100644 index 0000000..abd1c00 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/UTM_DATA_AVAIL_FLAGS.java @@ -0,0 +1,23 @@ +/* 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.MAVLink.enums; + +/** +* Flags for the global position report. +*/ +public class UTM_DATA_AVAIL_FLAGS { + public static final int UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1; /* The field time contains valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2; /* The field uas_id contains valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4; /* The fields lat, lon and h_acc contain valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8; /* The fields alt and v_acc contain valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16; /* The field relative_alt contains valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32; /* The fields vx and vy contain valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64; /* The field vz contains valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128; /* The fields next_lat, next_lon and next_alt contain valid data. | */ + public static final int UTM_DATA_AVAIL_FLAGS_ENUM_END = 129; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/UTM_FLIGHT_STATE.java b/app/src/main/java/com/MAVLink/enums/UTM_FLIGHT_STATE.java new file mode 100644 index 0000000..40c4ed8 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/UTM_FLIGHT_STATE.java @@ -0,0 +1,20 @@ +/* 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.MAVLink.enums; + +/** +* Airborne status of UAS. +*/ +public class UTM_FLIGHT_STATE { + public static final int UTM_FLIGHT_STATE_UNKNOWN = 1; /* The flight state can't be determined. | */ + public static final int UTM_FLIGHT_STATE_GROUND = 2; /* UAS on ground. | */ + public static final int UTM_FLIGHT_STATE_AIRBORNE = 3; /* UAS airborne. | */ + public static final int UTM_FLIGHT_STATE_EMERGENCY = 16; /* UAS is in an emergency flight state. | */ + public static final int UTM_FLIGHT_STATE_NOCTRL = 32; /* UAS has no active controls. | */ + public static final int UTM_FLIGHT_STATE_ENUM_END = 33; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_STATUS_FLAGS.java b/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_STATUS_FLAGS.java new file mode 100644 index 0000000..20de0f5 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_STATUS_FLAGS.java @@ -0,0 +1,17 @@ +/* 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.MAVLink.enums; + +/** +* Stream status flags (Bitmap) +*/ +public class VIDEO_STREAM_STATUS_FLAGS { + public static final int VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1; /* Stream is active (running) | */ + public static final int VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2; /* Stream is thermal imaging | */ + public static final int VIDEO_STREAM_STATUS_FLAGS_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_TYPE.java b/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_TYPE.java new file mode 100644 index 0000000..044fb92 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/VIDEO_STREAM_TYPE.java @@ -0,0 +1,19 @@ +/* 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.MAVLink.enums; + +/** +* Video stream types +*/ +public class VIDEO_STREAM_TYPE { + public static final int VIDEO_STREAM_TYPE_RTSP = 0; /* Stream is RTSP | */ + public static final int VIDEO_STREAM_TYPE_RTPUDP = 1; /* Stream is RTP UDP (URI gives the port number) | */ + public static final int VIDEO_STREAM_TYPE_TCP_MPEG = 2; /* Stream is MPEG on TCP | */ + public static final int VIDEO_STREAM_TYPE_MPEG_TS_H264 = 3; /* Stream is h.264 on MPEG TS (URI gives the port number) | */ + public static final int VIDEO_STREAM_TYPE_ENUM_END = 4; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/VTOL_TRANSITION_HEADING.java b/app/src/main/java/com/MAVLink/enums/VTOL_TRANSITION_HEADING.java index 1217d41..ec13138 100644 --- a/app/src/main/java/com/MAVLink/enums/VTOL_TRANSITION_HEADING.java +++ b/app/src/main/java/com/MAVLink/enums/VTOL_TRANSITION_HEADING.java @@ -6,15 +6,15 @@ package com.MAVLink.enums; -/** - * Direction of VTOL transition - */ +/** +* Direction of VTOL transition +*/ public class VTOL_TRANSITION_HEADING { - public static final int VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0; /* Respect the heading configuration of the vehicle. | */ - public static final int VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1; /* Use the heading pointing towards the next waypoint. | */ - public static final int VTOL_TRANSITION_HEADING_TAKEOFF = 2; /* Use the heading on takeoff (while sitting on the ground). | */ - public static final int VTOL_TRANSITION_HEADING_SPECIFIED = 3; /* Use the specified heading in parameter 4. | */ - public static final int VTOL_TRANSITION_HEADING_ANY = 4; /* Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active). | */ - public static final int VTOL_TRANSITION_HEADING_ENUM_END = 5; /* | */ + public static final int VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0; /* Respect the heading configuration of the vehicle. | */ + public static final int VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1; /* Use the heading pointing towards the next waypoint. | */ + public static final int VTOL_TRANSITION_HEADING_TAKEOFF = 2; /* Use the heading on takeoff (while sitting on the ground). | */ + public static final int VTOL_TRANSITION_HEADING_SPECIFIED = 3; /* Use the specified heading in parameter 4. | */ + public static final int VTOL_TRANSITION_HEADING_ANY = 4; /* Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active). | */ + public static final int VTOL_TRANSITION_HEADING_ENUM_END = 5; /* | */ } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/enums/WINCH_ACTIONS.java b/app/src/main/java/com/MAVLink/enums/WINCH_ACTIONS.java new file mode 100644 index 0000000..3be7083 --- /dev/null +++ b/app/src/main/java/com/MAVLink/enums/WINCH_ACTIONS.java @@ -0,0 +1,18 @@ +/* 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.MAVLink.enums; + +/** +* Winch actions. +*/ +public class WINCH_ACTIONS { + public static final int WINCH_RELAXED = 0; /* Relax winch. | */ + public static final int WINCH_RELATIVE_LENGTH_CONTROL = 1; /* Winch unwinds or winds specified length of cable optionally using specified rate. | */ + public static final int WINCH_RATE_CONTROL = 2; /* Winch unwinds or winds cable at specified rate in meters/seconds. | */ + public static final int WINCH_ACTIONS_ENUM_END = 3; /* | */ +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/icarous/CRC.java b/app/src/main/java/com/MAVLink/icarous/CRC.java new file mode 100644 index 0000000..4cb0139 --- /dev/null +++ b/app/src/main/java/com/MAVLink/icarous/CRC.java @@ -0,0 +1,68 @@ +/* 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.MAVLink.icarous; + +/** +* X.25 CRC calculation for MAVlink messages. The checksum must be initialized, +* updated with witch field of the message, and then finished with the message +* id. +* +*/ +public class CRC { + private static final int[] MAVLINK_MESSAGE_CRCS = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + private static final int CRC_INIT_VALUE = 0xffff; + private int crcValue; + + /** + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + **/ + 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. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ + public void finish_checksum(int msgid) { + update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); + } + + /** + * Initialize the buffer for the X.25 CRC + * + */ + public void start_checksum() { + crcValue = CRC_INIT_VALUE; + } + + public int getMSB() { + return ((crcValue >> 8) & 0xff); + } + + public int getLSB() { + return (crcValue & 0xff); + } + + public CRC() { + start_checksum(); + } + +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/icarous/msg_icarous_heartbeat.java b/app/src/main/java/com/MAVLink/icarous/msg_icarous_heartbeat.java new file mode 100644 index 0000000..2a0a161 --- /dev/null +++ b/app/src/main/java/com/MAVLink/icarous/msg_icarous_heartbeat.java @@ -0,0 +1,84 @@ +/* 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 ICAROUS_HEARTBEAT PACKING +package com.MAVLink.icarous; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* ICAROUS heartbeat +*/ +public class msg_icarous_heartbeat extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ICAROUS_HEARTBEAT = 42000; + public static final int MAVLINK_MSG_LENGTH = 1; + private static final long serialVersionUID = MAVLINK_MSG_ID_ICAROUS_HEARTBEAT; + + + + /** + * See the FMS_STATE enum. + */ + public short status; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ICAROUS_HEARTBEAT; + + packet.payload.putUnsignedByte(status); + + return packet; + } + + /** + * Decode a icarous_heartbeat message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + + this.status = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_icarous_heartbeat(){ + msgid = MAVLINK_MSG_ID_ICAROUS_HEARTBEAT; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_icarous_heartbeat(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ICAROUS_HEARTBEAT; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ICAROUS_HEARTBEAT - sysid:"+sysid+" compid:"+compid+" status:"+status+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/icarous/msg_icarous_kinematic_bands.java b/app/src/main/java/com/MAVLink/icarous/msg_icarous_kinematic_bands.java new file mode 100644 index 0000000..9c933be --- /dev/null +++ b/app/src/main/java/com/MAVLink/icarous/msg_icarous_kinematic_bands.java @@ -0,0 +1,219 @@ +/* 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 ICAROUS_KINEMATIC_BANDS PACKING +package com.MAVLink.icarous; +import com.MAVLink.MAVLinkPacket; +import com.MAVLink.Messages.MAVLinkMessage; +import com.MAVLink.Messages.MAVLinkPayload; + +/** +* Kinematic multi bands (track) output from Daidalus +*/ +public class msg_icarous_kinematic_bands extends MAVLinkMessage{ + + public static final int MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS = 42001; + public static final int MAVLINK_MSG_LENGTH = 46; + private static final long serialVersionUID = MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS; + + + + /** + * min angle (degrees) + */ + public float min1; + + /** + * max angle (degrees) + */ + public float max1; + + /** + * min angle (degrees) + */ + public float min2; + + /** + * max angle (degrees) + */ + public float max2; + + /** + * min angle (degrees) + */ + public float min3; + + /** + * max angle (degrees) + */ + public float max3; + + /** + * min angle (degrees) + */ + public float min4; + + /** + * max angle (degrees) + */ + public float max4; + + /** + * min angle (degrees) + */ + public float min5; + + /** + * max angle (degrees) + */ + public float max5; + + /** + * Number of track bands + */ + public byte numBands; + + /** + * See the TRACK_BAND_TYPES enum. + */ + public short type1; + + /** + * See the TRACK_BAND_TYPES enum. + */ + public short type2; + + /** + * See the TRACK_BAND_TYPES enum. + */ + public short type3; + + /** + * See the TRACK_BAND_TYPES enum. + */ + public short type4; + + /** + * See the TRACK_BAND_TYPES enum. + */ + public short type5; + + + /** + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ + MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); + packet.sysid = 255; + packet.compid = 190; + packet.msgid = MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS; + + packet.payload.putFloat(min1); + + packet.payload.putFloat(max1); + + packet.payload.putFloat(min2); + + packet.payload.putFloat(max2); + + packet.payload.putFloat(min3); + + packet.payload.putFloat(max3); + + packet.payload.putFloat(min4); + + packet.payload.putFloat(max4); + + packet.payload.putFloat(min5); + + packet.payload.putFloat(max5); + + packet.payload.putByte(numBands); + + packet.payload.putUnsignedByte(type1); + + packet.payload.putUnsignedByte(type2); + + packet.payload.putUnsignedByte(type3); + + packet.payload.putUnsignedByte(type4); + + packet.payload.putUnsignedByte(type5); + + return packet; + } + + /** + * Decode a icarous_kinematic_bands message into this class fields + * + * @param payload The message to decode + */ + public void unpack(MAVLinkPayload payload) { + payload.resetIndex(); + + this.min1 = payload.getFloat(); + + this.max1 = payload.getFloat(); + + this.min2 = payload.getFloat(); + + this.max2 = payload.getFloat(); + + this.min3 = payload.getFloat(); + + this.max3 = payload.getFloat(); + + this.min4 = payload.getFloat(); + + this.max4 = payload.getFloat(); + + this.min5 = payload.getFloat(); + + this.max5 = payload.getFloat(); + + this.numBands = payload.getByte(); + + this.type1 = payload.getUnsignedByte(); + + this.type2 = payload.getUnsignedByte(); + + this.type3 = payload.getUnsignedByte(); + + this.type4 = payload.getUnsignedByte(); + + this.type5 = payload.getUnsignedByte(); + + } + + /** + * Constructor for a new message, just initializes the msgid + */ + public msg_icarous_kinematic_bands(){ + msgid = MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS; + } + + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_icarous_kinematic_bands(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS; + unpack(mavLinkPacket.payload); + } + + + /** + * Returns a string with the MSG name and data + */ + public String toString(){ + return "MAVLINK_MSG_ID_ICAROUS_KINEMATIC_BANDS - sysid:"+sysid+" compid:"+compid+" min1:"+min1+" max1:"+max1+" min2:"+min2+" max2:"+max2+" min3:"+min3+" max3:"+max3+" min4:"+min4+" max4:"+max4+" min5:"+min5+" max5:"+max5+" numBands:"+numBands+" type1:"+type1+" type2:"+type2+" type3:"+type3+" type4:"+type4+" type5:"+type5+""; + } +} + \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/uAvionix/CRC.java b/app/src/main/java/com/MAVLink/uAvionix/CRC.java index 5f9688f..f1dc589 100644 --- a/app/src/main/java/com/MAVLink/uAvionix/CRC.java +++ b/app/src/main/java/com/MAVLink/uAvionix/CRC.java @@ -7,28 +7,26 @@ package com.MAVLink.uAvionix; /** - * X.25 CRC calculation for MAVlink messages. The checksum must be initialized, - * updated with witch field of the message, and then finished with the message - * id. - */ +* X.25 CRC calculation for MAVlink messages. The checksum must be initialized, +* updated with witch field of the message, and then finished with the message +* id. +* +*/ public class CRC { private static final int[] MAVLINK_MESSAGE_CRCS = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; private static final int CRC_INIT_VALUE = 0xffff; private int crcValue; - public CRC() { - start_checksum(); - } - /** - * Accumulate the X.25 CRC by adding one char at a time. - *

- * The checksum function adds the hash of one char at a time to the 16 bit - * checksum (uint16_t). - * - * @param data new char to hash - **/ - public void update_checksum(int data) { + * Accumulate the X.25 CRC by adding one char at a time. + * + * The checksum function adds the hash of one char at a time to the 16 bit + * checksum (uint16_t). + * + * @param data + * new char to hash + **/ + 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; @@ -36,18 +34,20 @@ public void update_checksum(int data) { } /** - * Finish the CRC calculation of a message, by running the CRC with the - * Magic Byte. This Magic byte has been defined in MAVlink v1.0. - * - * @param msgid The message id number - */ + * Finish the CRC calculation of a message, by running the CRC with the + * Magic Byte. This Magic byte has been defined in MAVlink v1.0. + * + * @param msgid + * The message id number + */ public void finish_checksum(int msgid) { update_checksum(MAVLINK_MESSAGE_CRCS[msgid]); } /** - * Initialize the buffer for the X.25 CRC - */ + * Initialize the buffer for the X.25 CRC + * + */ public void start_checksum() { crcValue = CRC_INIT_VALUE; } @@ -60,5 +60,9 @@ public int getLSB() { return (crcValue & 0xff); } + public CRC() { + start_checksum(); + } + } \ No newline at end of file diff --git a/app/src/main/java/com/MAVLink/uAvionix/msg_uavionix_adsb_out_cfg.java b/app/src/main/java/com/MAVLink/uAvionix/msg_uavionix_adsb_out_cfg.java index 77e2928..a2ea2e6 100644 --- a/app/src/main/java/com/MAVLink/uAvionix/msg_uavionix_adsb_out_cfg.java +++ b/app/src/main/java/com/MAVLink/uAvionix/msg_uavionix_adsb_out_cfg.java @@ -6,178 +6,179 @@ // MESSAGE UAVIONIX_ADSB_OUT_CFG PACKING package com.MAVLink.uAvionix; - import com.MAVLink.MAVLinkPacket; import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.Messages.MAVLinkPayload; - + /** - * Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) - */ -public class msg_uavionix_adsb_out_cfg extends MAVLinkMessage { +* Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) +*/ +public class msg_uavionix_adsb_out_cfg extends MAVLinkMessage{ public static final int MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG = 10001; public static final int MAVLINK_MSG_LENGTH = 20; private static final long serialVersionUID = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; + /** - * Vehicle address (24 bit) - */ + * Vehicle address (24 bit) + */ public long ICAO; - + /** - * Aircraft stall speed in cm/s - */ + * Aircraft stall speed in cm/s + */ public int stallSpeed; - + /** - * Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only) - */ + * Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, " " only) + */ public byte callsign[] = new byte[9]; - + /** - * Transmitting vehicle type. See ADSB_EMITTER_TYPE enum - */ + * Transmitting vehicle type. See ADSB_EMITTER_TYPE enum + */ public short emitterType; - + /** - * Aircraft length and width encoding (table 2-35 of DO-282B) - */ + * Aircraft length and width encoding (table 2-35 of DO-282B) + */ public short aircraftSize; - + /** - * GPS antenna lateral offset (table 2-36 of DO-282B) - */ + * GPS antenna lateral offset (table 2-36 of DO-282B) + */ public short gpsOffsetLat; - + /** - * GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B) - */ + * GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B) + */ public short gpsOffsetLon; - + /** - * ADS-B transponder reciever and transmit enable flags - */ + * ADS-B transponder reciever and transmit enable flags + */ public short rfSelect; - + /** - * Constructor for a new message, just initializes the msgid - */ - public msg_uavionix_adsb_out_cfg() { - msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; - } - - /** - * Constructor for a new message, initializes the message with the payload - * from a mavlink packet - */ - public msg_uavionix_adsb_out_cfg(MAVLinkPacket mavLinkPacket) { - this.sysid = mavLinkPacket.sysid; - this.compid = mavLinkPacket.compid; - this.msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; - unpack(mavLinkPacket.payload); - } - - /** - * Generates the payload for a mavlink message for a message of this type - * - * @return - */ - public MAVLinkPacket pack() { + * Generates the payload for a mavlink message for a message of this type + * @return + */ + public MAVLinkPacket pack(){ MAVLinkPacket packet = new MAVLinkPacket(MAVLINK_MSG_LENGTH); packet.sysid = 255; packet.compid = 190; packet.msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; - + packet.payload.putUnsignedInt(ICAO); - + packet.payload.putUnsignedShort(stallSpeed); - - + + for (int i = 0; i < callsign.length; i++) { packet.payload.putByte(callsign[i]); } - - + + packet.payload.putUnsignedByte(emitterType); - + packet.payload.putUnsignedByte(aircraftSize); - + packet.payload.putUnsignedByte(gpsOffsetLat); - + packet.payload.putUnsignedByte(gpsOffsetLon); - + packet.payload.putUnsignedByte(rfSelect); - + return packet; } /** - * Decode a uavionix_adsb_out_cfg message into this class fields - * - * @param payload The message to decode - */ + * Decode a uavionix_adsb_out_cfg message into this class fields + * + * @param payload The message to decode + */ public void unpack(MAVLinkPayload payload) { payload.resetIndex(); - + this.ICAO = payload.getUnsignedInt(); - + this.stallSpeed = payload.getUnsignedShort(); - - + + for (int i = 0; i < this.callsign.length; i++) { this.callsign[i] = payload.getByte(); } - - + + this.emitterType = payload.getUnsignedByte(); - + this.aircraftSize = payload.getUnsignedByte(); - + this.gpsOffsetLat = payload.getUnsignedByte(); - + this.gpsOffsetLon = payload.getUnsignedByte(); - + this.rfSelect = payload.getUnsignedByte(); - + } /** - * Gets the message, formated 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(); + * Constructor for a new message, just initializes the msgid + */ + public msg_uavionix_adsb_out_cfg(){ + msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; + } + /** + * Constructor for a new message, initializes the message with the payload + * from a mavlink packet + * + */ + public msg_uavionix_adsb_out_cfg(MAVLinkPacket mavLinkPacket){ + this.sysid = mavLinkPacket.sysid; + this.compid = mavLinkPacket.compid; + this.msgid = MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_CFG; + unpack(mavLinkPacket.payload); } + /** - * Sets the buffer of this message with a string, adds the necessary padding - */ + * 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++) { + for (int i=0; i missingPermission = new ArrayList<>(); + + + //region Registration n' Permissions Helpers + + /** + * Checks if there is any missing permissions, and + * requests runtime permission if needed. + */ + private void checkAndRequestPermissions() { + // Check for permissions + for (String eachPermission : REQUIRED_PERMISSION_LIST) { + if (ContextCompat.checkSelfPermission(this, eachPermission) != PackageManager.PERMISSION_GRANTED) { + missingPermission.add(eachPermission); + } + } + // Request for missing permissions + if (missingPermission.isEmpty()) { + startSDKRegistration(); + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + ActivityCompat.requestPermissions(this, + missingPermission.toArray(new String[missingPermission.size()]), + REQUEST_PERMISSION_CODE); + } + + } + + private void startSDKRegistration() { + if (isRegistrationInProgress.compareAndSet(false, true)) { + Log.e(TAG, "startSDKRegistration"); + AsyncTask.execute(new Runnable() { + @Override + public void run() { + DJISDKManager.getInstance().registerApp(ConnectionActivity.this.getApplicationContext(), new DJISDKManager.SDKManagerCallback() { + @Override + public void onRegister(DJIError djiError) { + if (djiError == DJISDKError.REGISTRATION_SUCCESS) { + DJILog.v("App registration", DJISDKError.REGISTRATION_SUCCESS.getDescription()); + DJISDKManager.getInstance().startConnectionToProduct(); + showToast("Register SDK Success"); + runOnUiThread(new Runnable() { + @Override + public void run() { + loginDJIUserAccount(); + } + }); + } else { + showToast("Register sdk fails, check network is available"); + } + Log.v(TAG, djiError.getDescription()); + isRegistrationInProgress.set(false); + } + @Override + public void onProductDisconnect() { + showToast("Product Disconnected"); + notifyStatusChange(); + } + @Override + public void onProductConnect(BaseProduct baseProduct) { + Log.e(TAG,"Product Connected"); + + notifyStatusChange(); + isRegistrationInProgress.set(false); + if (baseProduct != null) { + // RDApplication.updateProduct(baseProduct); + } + } + @Override + public void onComponentChange(BaseProduct.ComponentKey componentKey, + BaseComponent oldComponent, + BaseComponent newComponent) { + if (newComponent != null && oldComponent == null) { + Log.v(TAG,componentKey.name() + " Component Found index:" + newComponent.getIndex()); + } + if (newComponent != null) { + newComponent.setComponentListener(new BaseComponent.ComponentListener() { + @Override + public void onConnectivityChange(boolean b) { + Log.v(TAG," Component " + (b?"connected":"disconnected")); + notifyStatusChange(); + } + }); + } + notifyStatusChange(); + } + + @Override + public void onInitProcess(DJISDKInitEvent djisdkInitEvent, int i) { + //notify the init progress + } + + @Override + public void onDatabaseDownloadProgress(long l, long l1) { + + } + + + }); + } + }); + } + } + + + private void loginDJIUserAccount() { + + UserAccountManager.getInstance().logIntoDJIUserAccount(this, + new CommonCallbacks.CompletionCallbackWith() { + @Override + public void onSuccess(final UserAccountState userAccountState) { + showToast("login success! Account state is:" +userAccountState.name()); + } + + @Override + public void onFailure(DJIError error) { + showToast(error.getDescription()); + } + }); + + } + + private void notifyStatusChange() { + runOnUiThread(new Runnable() { + @Override + public void run() { + refreshSDKRelativeUI(); + } + }); + + } + + //endregion + + /** + * Result of runtime permission request + */ + @Override + public void onRequestPermissionsResult(int requestCode, + @NonNull String[] permissions, + @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + + // Check for granted permission and remove from missing list + if (requestCode == REQUEST_PERMISSION_CODE) { + for (int i = grantResults.length - 1; i >= 0; i--) { + if (grantResults[i] == PackageManager.PERMISSION_GRANTED) { + missingPermission.remove(permissions[i]); + } + } + } + // If there is enough permission, we will start the registration + if (missingPermission.isEmpty()) { + startSDKRegistration(); + } else { + Toast.makeText(getApplicationContext(), "Missing permissions!!!", Toast.LENGTH_LONG).show(); + } + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + checkAndRequestPermissions(); + setContentView(R.layout.activity_connection); + initUI(); + + // Register the broadcast receiver for receiving the device connection's changes. + IntentFilter filter = new IntentFilter(); + filter.addAction(DJISimulatorApplication.FLAG_CONNECTION_CHANGE); + registerReceiver(mReceiver, filter); + + } + + protected BroadcastReceiver mReceiver = new BroadcastReceiver() { + + @Override + public void onReceive(Context context, Intent intent) { + mTextConnectionStatus.setText(R.string.connection_sim); + notifyStatusChange(); + } + }; + + + @Override + public void onResume() { + Log.v(TAG, "onResume"); + super.onResume(); + updateTitleBar(); + } + + @Override + protected void onDestroy() { + Log.v(TAG, "onDestroy"); + if (KeyManager.getInstance() != null) { + KeyManager.getInstance().removeListener(firmVersionListener); + } + super.onDestroy(); + } + + private void initUI() { + + mTextConnectionStatus = (TextView) findViewById(R.id.text_connection_status); + mTextModelAvailable = (TextView) findViewById(R.id.text_model_available); + mTextProduct = (TextView) findViewById(R.id.text_product_info); + + mBtnOpen = (Button) findViewById(R.id.btn_start); + mBtnOpen.setOnClickListener(this); + mBtnOpen.setEnabled(false); + + mBtnSim = (Button) findViewById(R.id.btn_sim); + mBtnSim.setOnClickListener(this); + + mBtnTest = (Button) findViewById(R.id.btn_test); + mBtnTest.setOnClickListener(this); + + ((TextView)findViewById(R.id.textView2)).setText(getResources().getString(R.string.sdk_version, DJISDKManager.getInstance().getSDKVersion())); + Context appContext = this.getBaseContext(); + String version = "Version: "+getAppVersion(appContext); + Log.v(TAG,""+version); + ((TextView)findViewById(R.id.textView3)).setText(version); + + if(CustomName.length() > 0) + ((TextView)findViewById(R.id.textView)).setText(CustomName); + + } + + public static String getAppVersion(Context context){ + PackageManager localPackageManager = context.getPackageManager(); + try{ + String str = localPackageManager.getPackageInfo(context.getPackageName(), 0).versionName; + return str; + } + catch (PackageManager.NameNotFoundException e){ + Log.v(TAG, "getAppVersion error" + e.getMessage()); + e.printStackTrace(); + } + return ""; + } + + private void updateTitleBar() { + boolean ret = false; + BaseProduct product; + + if (RDApplication.getSim() == true) { + product = DJISimulatorApplication.getAircraftInstance(); + }else { + product = RDApplication.getProductInstance(); + } + + if (product != null) { + if (product.isConnected()) { + //The product is connected + showToast(RDApplication.getProductInstance().getModel() + " Connected"); + ret = true; + } else { + if (product instanceof Aircraft) { + Aircraft aircraft = (Aircraft) product; + if (aircraft.getRemoteController() != null && aircraft.getRemoteController().isConnected()) { + // The product is not connected, but the remote controller is connected + showToast("only RC Connected"); + ret = true; + } + } + } + } + + if (!ret) { + // The product or the remote controller are not connected. + showToast("Disconnected"); + } + } + + public void showToast(final String msg) { + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast.makeText(ConnectionActivity.this, msg, Toast.LENGTH_SHORT).show(); + } + }); + } + + private void updateVersion() { + + if (RDApplication.getProductInstance() != null) { + final String version = RDApplication.getProductInstance().getFirmwarePackageVersion(); + this.runOnUiThread(new Runnable() { + @Override + public void run() { + if (TextUtils.isEmpty(version)) { + mTextModelAvailable.setText("N/A"); //Firmware version: + } else { + mTextModelAvailable.setText(version); //"Firmware version: " + + } + } + }); + } + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + + // For debugging we can tap the drone icon 5 times to be able to open the software without a drone connected. + case R.id.btn_test: + if (++hiddenkey > 5) { + showToast("TestMode enabled..."); + mBtnOpen.setEnabled(true); + TextView lTextConnectionStatus = (TextView) findViewById(R.id.text_model_test); + lTextConnectionStatus.setText("TestMode"); + } + break; + + case R.id.btn_sim: { + if (RDApplication.getSim() == true){ + TextView lTextConnectionStatus = (TextView) findViewById(R.id.text_model_simulated); + lTextConnectionStatus.setText(""); + + showToast("noSimulate..."); + RDApplication.setSim(false); + mTextConnectionStatus.setText(R.string.connection_loose); + }else{ + showToast("Simulate..."); + RDApplication.setSim(true); + TextView lTextConnectionStatus = (TextView) findViewById(R.id.text_model_simulated); + lTextConnectionStatus.setText("Active"); + } + break; + } + case R.id.btn_start: { + Intent intent = new Intent(this, MainActivity.class); + startActivity(intent); + break; + } + default: + break; + } + } + + private void refreshSDKRelativeUI() { + + BaseProduct mProduct = RDApplication.getProductInstance(); + Log.e(TAG, "refreshSDKRelativeUI"); + + if (null != mProduct && mProduct.isConnected()) { + Log.v(TAG, "refreshSDK: True"); + mBtnOpen.setEnabled(true); + + String str = mProduct instanceof Aircraft ? "DJIAircraft" : "DJIHandHeld"; + mTextConnectionStatus.setText("Status: " + str + " connected"); + + if (null != mProduct.getModel()) { + mTextProduct.setText("" + mProduct.getModel().getDisplayName()); + } else { + mTextProduct.setText(R.string.product_information); + } + if (KeyManager.getInstance() != null) { + KeyManager.getInstance().addListener(firmkey, firmVersionListener); + } + } else if (RDApplication.getSim() == true){ + Log.v(TAG, "refreshSDK: Sim"); + mBtnOpen.setEnabled(true); + + mTextProduct.setText(R.string.product_information); + // mTextConnectionStatus.setText(R.string.connection_sim); + } else { + Log.v(TAG, "refreshSDK: False"); + mBtnOpen.setEnabled(false); + + mTextProduct.setText(R.string.product_information); + mTextConnectionStatus.setText(R.string.connection_loose); + } + } + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + String action = intent.getAction(); + if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) { + Intent attachedIntent = new Intent(); + attachedIntent.setAction(DJISDKManager.USB_ACCESSORY_ATTACHED); + sendBroadcast(attachedIntent); + } + } +} diff --git a/app/src/main/java/sq/rogue/rosettadrone/DJISimulatorApplication.java b/app/src/main/java/sq/rogue/rosettadrone/DJISimulatorApplication.java new file mode 100644 index 0000000..e052b74 --- /dev/null +++ b/app/src/main/java/sq/rogue/rosettadrone/DJISimulatorApplication.java @@ -0,0 +1,179 @@ +package sq.rogue.rosettadrone; + +import android.app.Application; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Handler; +import android.os.Looper; +import android.util.Log; +import android.widget.Toast; + +import androidx.core.content.ContextCompat; +import dji.common.error.DJIError; +import dji.common.error.DJISDKError; +import dji.sdk.base.BaseComponent; +import dji.sdk.base.BaseProduct; +import dji.sdk.products.Aircraft; +import dji.sdk.sdkmanager.DJISDKInitEvent; +import dji.sdk.sdkmanager.DJISDKManager; + +public class DJISimulatorApplication extends Application { + + private static final String TAG = DJISimulatorApplication.class.getName(); + public static final String FLAG_CONNECTION_CHANGE = "com_dji_simulatorDemo_connection_change"; + private static BaseProduct mProduct; + private Handler mHandler; + private DJISDKManager.SDKManagerCallback mDJISDKManagerCallback; + + private Application instance; + + public void setContext(Application application) { + instance = application; + } + + @Override + public Context getApplicationContext() { + return instance; + } + + public DJISimulatorApplication() { + + } + + /** + * Gets instance of the specific product connected after the + * API KEY is successfully validated. Please make sure the + * API_KEY has been added in the Manifest + */ + public static synchronized BaseProduct getProductInstance() { + if (null == mProduct) { + mProduct = DJISDKManager.getInstance().getProduct(); + } + return mProduct; + } + + public static boolean isAircraftConnected() { + return getProductInstance() != null && getProductInstance() instanceof Aircraft; + } + + public static synchronized Aircraft getAircraftInstance() { + if (!isAircraftConnected()) return null; + return (Aircraft) getProductInstance(); + } + + @Override + public void onCreate() { + super.onCreate(); + mHandler = new Handler(Looper.getMainLooper()); + + + /** + * When starting SDK services, an instance of interface DJISDKManager.DJISDKManagerCallback will be used to listen to + * the SDK Registration result and the product changing. + */ + mDJISDKManagerCallback = new DJISDKManager.SDKManagerCallback() { + + //Listens to the SDK registration result + @Override + public void onRegister(DJIError error) { + + if(error == DJISDKError.REGISTRATION_SUCCESS) { + + Handler handler = new Handler(Looper.getMainLooper()); + handler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(getApplicationContext(), "Register Success", Toast.LENGTH_LONG).show(); + } + }); + + DJISDKManager.getInstance().startConnectionToProduct(); + + } else { + + Handler handler = new Handler(Looper.getMainLooper()); + handler.post(new Runnable() { + + @Override + public void run() { + Toast.makeText(getApplicationContext(), "Register sdk fails, check network is available", Toast.LENGTH_LONG).show(); + } + }); + + } + Log.e("TAG", error.toString()); + } + + @Override + public void onProductDisconnect() { + Log.d("TAG", "onProductDisconnect"); + notifyStatusChange(); + } + @Override + public void onProductConnect(BaseProduct baseProduct) { + Log.d("TAG", String.format("onProductConnect newProduct:%s", baseProduct)); + notifyStatusChange(); + + } + @Override + public void onComponentChange(BaseProduct.ComponentKey componentKey, BaseComponent oldComponent, + BaseComponent newComponent) { + if (newComponent != null) { + newComponent.setComponentListener(new BaseComponent.ComponentListener() { + + @Override + public void onConnectivityChange(boolean isConnected) { + Log.d("TAG", "onComponentConnectivityChanged: " + isConnected); + notifyStatusChange(); + } + }); + } + + Log.d("TAG", + String.format("onComponentChange key:%s, oldComponent:%s, newComponent:%s", + componentKey, + oldComponent, + newComponent)); + + } + @Override + public void onInitProcess(DJISDKInitEvent djisdkInitEvent, int i) { + + } + + @Override + public void onDatabaseDownloadProgress(long l, long l1) { + + } + + + }; + //Check the permissions before registering the application for android system 6.0 above. + int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.WRITE_EXTERNAL_STORAGE); + int permissionCheck2 = ContextCompat.checkSelfPermission(getApplicationContext(), android.Manifest.permission.READ_PHONE_STATE); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (permissionCheck == 0 && permissionCheck2 == 0)) { + //This is used to start SDK services and initiate SDK. + DJISDKManager.getInstance().registerApp(getApplicationContext(), mDJISDKManagerCallback); + Toast.makeText(getApplicationContext(), "registering, pls wait...", Toast.LENGTH_LONG).show(); + + } else { + Toast.makeText(getApplicationContext(), "Please check if the permission is granted.", Toast.LENGTH_LONG).show(); + } + } + + private void notifyStatusChange() { + mHandler.removeCallbacks(updateRunnable); + mHandler.postDelayed(updateRunnable, 500); + } + + private Runnable updateRunnable = new Runnable() { + + @Override + public void run() { + Intent intent = new Intent(FLAG_CONNECTION_CHANGE); + getApplicationContext().sendBroadcast(intent); + } + }; + +} diff --git a/app/src/main/java/sq/rogue/rosettadrone/DroneModel.java b/app/src/main/java/sq/rogue/rosettadrone/DroneModel.java index fa8fb4b..8ec6f31 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/DroneModel.java +++ b/app/src/main/java/sq/rogue/rosettadrone/DroneModel.java @@ -1,6 +1,9 @@ package sq.rogue.rosettadrone; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; + +import android.os.Handler; +import android.os.Looper; import android.util.Log; import com.MAVLink.MAVLinkPacket; @@ -45,6 +48,8 @@ import java.net.PortUnreachableException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Timer; +import java.util.TimerTask; import dji.common.airlink.SignalQualityCallback; import dji.common.battery.AggregationState; @@ -54,26 +59,49 @@ import dji.common.flightcontroller.Attitude; import dji.common.flightcontroller.ConnectionFailSafeBehavior; import dji.common.flightcontroller.ControlMode; +import dji.common.flightcontroller.FlightOrientationMode; import dji.common.flightcontroller.GPSSignalLevel; +import dji.common.flightcontroller.LEDsSettings; import dji.common.flightcontroller.LocationCoordinate3D; +import dji.common.flightcontroller.simulator.InitializationData; +import dji.common.flightcontroller.simulator.SimulatorState; +import dji.common.flightcontroller.virtualstick.FlightControlData; +import dji.common.flightcontroller.virtualstick.FlightCoordinateSystem; import dji.common.flightcontroller.virtualstick.RollPitchControlMode; import dji.common.flightcontroller.virtualstick.VerticalControlMode; import dji.common.flightcontroller.virtualstick.YawControlMode; +import dji.common.gimbal.Rotation; +import dji.common.gimbal.RotationMode; +import dji.common.mission.MissionState; +import dji.common.mission.followme.FollowMeHeading; +import dji.common.mission.followme.FollowMeMission; +import dji.common.mission.followme.FollowMeMissionState; +import dji.common.mission.tapfly.TapFlyMission; +import dji.common.mission.tapfly.TapFlyMode; import dji.common.mission.waypoint.Waypoint; import dji.common.mission.waypoint.WaypointMission; import dji.common.mission.waypoint.WaypointMissionState; +import dji.common.model.LocationCoordinate2D; import dji.common.remotecontroller.HardwareState; import dji.common.util.CommonCallbacks; import dji.sdk.battery.Battery; +import dji.sdk.flightcontroller.FlightController; +import dji.sdk.gimbal.Gimbal; import dji.sdk.mission.MissionControl; +import dji.sdk.mission.followme.FollowMeMissionOperator; import dji.sdk.mission.waypoint.WaypointMissionOperator; import dji.sdk.products.Aircraft; +import dji.sdk.mission.timeline.actions.GoToAction; +import dji.sdk.sdkmanager.DJISDKManager; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_COMPONENT_ARM_DISARM; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_DIGICAM_CONTROL; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_NAV_TAKEOFF; +import static com.MAVLink.enums.MAV_CMD.MAV_CMD_VIDEO_START_CAPTURE; +import static com.MAVLink.enums.MAV_CMD.MAV_CMD_VIDEO_STOP_CAPTURE; import static com.MAVLink.enums.MAV_COMPONENT.MAV_COMP_ID_AUTOPILOT1; import static sq.rogue.rosettadrone.util.getTimestampMicroseconds; +import static sq.rogue.rosettadrone.util.safeSleep; public class DroneModel implements CommonCallbacks.CompletionCallback { @@ -98,15 +126,102 @@ public class DroneModel implements CommonCallbacks.CompletionCallback { private int mDownlinkQuality = 0; private int mUplinkQuality = 0; + private float mPitch; + private float mRoll; + private float mYaw; + private float mThrottle; + private double m_Latitude; + private double m_Longitude; + private double m_head; + private float m_alt; + + private SendVelocityDataTask mSendVirtualStickDataTask = null;; + private Timer mSendVirtualStickDataTimer = null; + private boolean mSafetyEnabled = true; private boolean mMotorsArmed = false; private RosettaMissionOperatorListener mMissionOperatorListener; + private FollowMeMissionOperator fmmo; + private FlightController mFlightController; + private Gimbal mGimbal = null; - public DroneModel(MainActivity parent, DatagramSocket socket) { + public DroneModel(MainActivity parent, DatagramSocket socket, boolean sim) { this.parent = parent; this.socket = socket; + initFlightController(sim); + } + + public float get_battery_status(){ + if(mFullChargeCapacity_mAh > 0) { + return (mChargeRemaining_mAh * 100 / mFullChargeCapacity_mAh); + } + return 0; + } + + private void initFlightController(boolean sim) { + parent.logMessageDJI("Starting FlightController..."); + Aircraft aircraft = (Aircraft) RDApplication.getProductInstance(); //DJISimulatorApplication.getAircraftInstance(); + if (aircraft == null || !aircraft.isConnected()) { + parent.logMessageDJI("No target..."); + mFlightController = null; + return; + } else { + mGimbal = aircraft.getGimbal(); + mFlightController = aircraft.getFlightController(); + mFlightController.setRollPitchControlMode(RollPitchControlMode.VELOCITY); + mFlightController.setYawControlMode(YawControlMode.ANGULAR_VELOCITY); + mFlightController.setVerticalControlMode(VerticalControlMode.VELOCITY); + mFlightController.setRollPitchCoordinateSystem(FlightCoordinateSystem.BODY); + mFlightController.setFlightOrientationMode(FlightOrientationMode.COURSE_LOCK,null); + if(sim == true) { + parent.logMessageDJI("Starting Simulator..."); + mFlightController.getSimulator().setStateCallback(new SimulatorState.Callback() { + @Override + public void onUpdate(final SimulatorState stateData) { + new Handler(Looper.getMainLooper()).post(new Runnable() { + @Override + public void run() { +/* + String yaw = String.format("%.2f", stateData.getYaw()); + String pitch = String.format("%.2f", stateData.getPitch()); + String roll = String.format("%.2f", stateData.getRoll()); + String positionX = String.format("%.2f", stateData.getPositionX()); + String positionY = String.format("%.2f", stateData.getPositionY()); + String positionZ = String.format("%.2f", stateData.getPositionZ()); + + Log.v("SIM", "Yaw : " + yaw + ", Pitch : " + pitch + ", Roll : " + roll + "\n" + ", PosX : " + positionX + + ", PosY : " + positionY + + ", PosZ : " + positionZ); + + */ + } + }); + } + }); + } + } + + if (mFlightController != null) { + parent.logMessageDJI("Target found..."); + + if(sim == true) { + mFlightController.getSimulator() + .start(InitializationData.createInstance(new LocationCoordinate2D(23, 113), 10, 10), + new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError != null) { + parent.logMessageDJI(djiError.getDescription()); + } else { + parent.logMessageDJI("Start Simulator Success"); + } + } + }); + } + } } + public int getSystemId() { return mSystemId; } @@ -172,7 +287,10 @@ public void onResult(DJIError djiError) { } public void setForwardLEDsEnabled(final boolean enabled) { - djiAircraft.getFlightController().setLEDsEnabled(enabled, new CommonCallbacks.CompletionCallback() { + LEDsSettings.Builder Tmp = new LEDsSettings.Builder(); + Tmp.frontLEDsOn(enabled); + + djiAircraft.getFlightController().setLEDsEnabledSettings(Tmp.build(), new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if (djiError == null) { @@ -320,6 +438,7 @@ public boolean setDjiAircraft(Aircraft djiAircraft) { if (djiAircraft == null || djiAircraft.getRemoteController() == null) return false; + this.djiAircraft = djiAircraft; Arrays.fill(mCellVoltages, 0xffff); // indicates no cell per mavlink definition @@ -342,6 +461,9 @@ public void onUpdate(@NonNull HardwareState rcHardwareState) { if (this.djiAircraft != null) { + + parent.logMessageDJI("setBatteryCallback"); + this.djiAircraft.getBattery().setStateCallback(new BatteryState.Callback() { @Override @@ -837,7 +959,8 @@ public void send_home_position() { msg.latitude = (int) (djiAircraft.getFlightController().getState().getHomeLocation().getLatitude() * Math.pow(10, 7)); msg.longitude = (int) (djiAircraft.getFlightController().getState().getHomeLocation().getLongitude() * Math.pow(10, 7)); - msg.altitude = (int) (djiAircraft.getFlightController().getState().getHomePointAltitude()); + // msg.altitude = (int) (djiAircraft.getFlightController().getState().getHomePointAltitude()); + msg.altitude = (int) (djiAircraft.getFlightController().getState().getGoHomeHeight()); // msg.x = 0; // msg.y = 0; @@ -1248,6 +1371,148 @@ public void onResult(DJIError djiError) { }); } + /******************************************** + * Motion implementation * + ********************************************/ + + + public void do_set_Gimbal(float channel, float value) + { + Rotation.Builder builder = new Rotation.Builder().mode(RotationMode.ABSOLUTE_ANGLE).time(2); + float param = (value-(float)1500.0)/(float)5.5; + if (channel == 9) { + builder.pitch(param); + } else if (channel == 8) { + builder.yaw(param); + } + if (mGimbal == null) { + return; + } + + mGimbal.rotate(builder.build(),new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError != null) + parent.logMessageDJI("Error: " + djiError.toString()); + } + }); + util.safeSleep(500); + } + + public void do_set_velocity_mode() { + // Set mode to Head-forward... + // mFlightController.setFlightOrientationMode(FlightOrientationMode.COURSE_LOCK,null); +/* mFlightController.setFlightOrientationMode(FlightOrientationMode.COURSE_LOCK,new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError != null) + parent.logMessageDJI("Error: " + djiError.toString()); + else + parent.logMessageDJI("Mode set successful!\n"); + } + }); +*/ +/* + mFlightController.setYawControlMode(YawControlMode.ANGULAR_VELOCITY); + mFlightController.setRollPitchControlMode(RollPitchControlMode.VELOCITY); + mFlightController.setVerticalControlMode(VerticalControlMode.VELOCITY); + + */ + // parent.logMessageDJI(String.valueOf(djiAircraft.getFlightController().getVerticalControlMode())); + + } + + public void do_set_motion_velocity(float x, float y, float z, float yaw) { + mPitch = y; mRoll = x; mYaw = yaw; mThrottle = z; + + // If first time... + if (null == mSendVirtualStickDataTimer) { + mSendVirtualStickDataTask = new SendVelocityDataTask(); + mSendVirtualStickDataTimer = new Timer(); + mSendVirtualStickDataTimer.schedule(mSendVirtualStickDataTask, 100, 150); + }else{ + mSendVirtualStickDataTask.repeat = 14; + } + } + + public void do_set_motion_absolute(float lat, float lon, float alt, float yaw) { + parent.logMessageDJI("Initiating abs move"); + } + + // Run the velocity command for 2 seconds... + class SendVelocityDataTask extends TimerTask { + public int repeat = 14; + + @Override + public void run() { + if (mFlightController != null) { + if(--repeat <= 0){ + mSendVirtualStickDataTimer.cancel(); + mSendVirtualStickDataTimer.purge(); + mSendVirtualStickDataTimer = null; + // parent.logMessageDJI("Motion done!\n"); + return; + } +// parent.logMessageDJI("X: " + String.valueOf(mPitch) + " Y: " + String.valueOf(mRoll) + " Z: " + String.valueOf(mYaw) + " T: " + String.valueOf(mThrottle)); + mFlightController.sendVirtualStickFlightControlData( + new FlightControlData(mPitch, mRoll, mYaw, mThrottle) + , new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError != null) + parent.logMessageDJI("Motion Error: " + djiError.toString()); + // else + // parent.logMessageDJI("Motion OK!"); + } + } + ); + } + } + } + + // Follow me is not used by Mavlink for now, in the DJI implementation it for a + // limit to a few meters from current location. + public void startSimpleFollowMe() + { + if(fmmo == null){ + fmmo = DJISDKManager.getInstance().getMissionControl().getFollowMeMissionOperator(); + } + final FollowMeMissionOperator followMeMissionOperator = fmmo; + if (followMeMissionOperator.getCurrentState().equals(MissionState.READY_TO_EXECUTE)){ + followMeMissionOperator.startMission(new FollowMeMission(FollowMeHeading.TOWARD_FOLLOW_POSITION,m_Latitude , m_Longitude, m_alt) + , new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if(djiError != null){ + parent.logMessageDJI(djiError.getDescription()); + } else { + parent.logMessageDJI("Mission Start: Successfully"); + } + } + }); + } + } + + public void updateSimpleFollowMe(){ + if(fmmo == null){ + fmmo = DJISDKManager.getInstance().getMissionControl().getFollowMeMissionOperator(); + } + final FollowMeMissionOperator followMeMissionOperator = fmmo; + if(followMeMissionOperator.getCurrentState().equals(FollowMeMissionState.EXECUTING)) { + followMeMissionOperator.updateFollowingTarget(new LocationCoordinate2D(m_Latitude , m_Longitude), + new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError error) { + if (error != null) { + parent.logMessageDJI(followMeMissionOperator.getCurrentState().getName().toString() + " " + error.getDescription()); + } else { + parent.logMessageDJI("Mission Update Successfully"); + } + } + }); + } + } + // public void set_flight_mode(FlightControlState djiMode) { // // TODO // return; @@ -1431,4 +1696,40 @@ public void onFailure(DJIError djiError) { } } + + /******************************************** + * Start Stop callbacks * + ********************************************/ + + public void startRecordingVideo() { + djiAircraft.getCamera().startRecordVideo(new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError == null) { + parent.logMessageDJI("Started recording video"); + send_command_ack(MAV_CMD_VIDEO_START_CAPTURE, MAV_RESULT.MAV_RESULT_ACCEPTED); + } else { + parent.logMessageDJI("Error starting video recording: " + djiError.toString()); + send_command_ack(MAV_CMD_VIDEO_START_CAPTURE, MAV_RESULT.MAV_RESULT_FAILED); + } + } + }); + } + + public void stopRecordingVideo() { + djiAircraft.getCamera().stopRecordVideo(new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError == null) { + parent.logMessageDJI("Stopped recording video"); + send_command_ack(MAV_CMD_VIDEO_STOP_CAPTURE, MAV_RESULT.MAV_RESULT_ACCEPTED); + } else { + parent.logMessageDJI("Error stopping video recording: " + djiError.toString()); + send_command_ack(MAV_CMD_VIDEO_STOP_CAPTURE, MAV_RESULT.MAV_RESULT_FAILED); + } + } + }); + } + + } diff --git a/app/src/main/java/sq/rogue/rosettadrone/MAVLinkReceiver.java b/app/src/main/java/sq/rogue/rosettadrone/MAVLinkReceiver.java index 88bac53..e1def3a 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/MAVLinkReceiver.java +++ b/app/src/main/java/sq/rogue/rosettadrone/MAVLinkReceiver.java @@ -4,6 +4,7 @@ import com.MAVLink.Messages.MAVLinkMessage; import com.MAVLink.common.msg_command_long; +import com.MAVLink.common.msg_manual_control; import com.MAVLink.common.msg_mission_ack; import com.MAVLink.common.msg_mission_count; import com.MAVLink.common.msg_mission_item; @@ -11,11 +12,16 @@ import com.MAVLink.common.msg_param_request_read; import com.MAVLink.common.msg_param_set; import com.MAVLink.common.msg_set_mode; +import com.MAVLink.common.msg_set_position_target_global_int; import com.MAVLink.enums.MAV_CMD; +import com.MAVLink.enums.MAV_PROTOCOL_CAPABILITY; import com.MAVLink.enums.MAV_RESULT; +import com.MAVLink.common.msg_set_position_target_local_ned; import java.util.ArrayList; +import java.util.TimerTask; +import dji.common.error.DJIError; import dji.common.mission.waypoint.Waypoint; import dji.common.mission.waypoint.WaypointAction; import dji.common.mission.waypoint.WaypointActionType; @@ -26,9 +32,11 @@ import dji.common.mission.waypoint.WaypointMissionHeadingMode; import dji.common.mission.waypoint.WaypointMissionState; + import static com.MAVLink.common.msg_command_int.MAVLINK_MSG_ID_COMMAND_INT; import static com.MAVLink.common.msg_command_long.MAVLINK_MSG_ID_COMMAND_LONG; import static com.MAVLink.common.msg_heartbeat.MAVLINK_MSG_ID_HEARTBEAT; +import static com.MAVLink.common.msg_manual_control.MAVLINK_MSG_ID_MANUAL_CONTROL; import static com.MAVLink.common.msg_mission_ack.MAVLINK_MSG_ID_MISSION_ACK; import static com.MAVLink.common.msg_mission_clear_all.MAVLINK_MSG_ID_MISSION_CLEAR_ALL; import static com.MAVLink.common.msg_mission_count.MAVLINK_MSG_ID_MISSION_COUNT; @@ -41,11 +49,14 @@ import static com.MAVLink.common.msg_param_request_read.MAVLINK_MSG_ID_PARAM_REQUEST_READ; import static com.MAVLink.common.msg_param_set.MAVLINK_MSG_ID_PARAM_SET; import static com.MAVLink.common.msg_set_mode.MAVLINK_MSG_ID_SET_MODE; +import static com.MAVLink.common.msg_set_position_target_global_int.MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT; +import static com.MAVLink.common.msg_set_position_target_local_ned.MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_COMPONENT_ARM_DISARM; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_DIGICAM_CONTROL; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_SET_CAM_TRIGG_DIST; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_SET_HOME; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_SET_MODE; +import static com.MAVLink.enums.MAV_CMD.MAV_CMD_DO_SET_SERVO; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_GET_HOME_POSITION; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_MISSION_START; import static com.MAVLink.enums.MAV_CMD.MAV_CMD_NAV_LAND; @@ -62,6 +73,9 @@ import static sq.rogue.rosettadrone.util.TYPE_WAYPOINT_MIN_ALTITUDE; import static sq.rogue.rosettadrone.util.TYPE_WAYPOINT_MIN_SPEED; +import dji.common.flightcontroller.virtualstick.FlightControlData; +import dji.common.util.CommonCallbacks; + public class MAVLinkReceiver { private final String TAG = this.getClass().getSimpleName(); private final int WP_STATE_INACTIVE = 0; @@ -84,11 +98,14 @@ public MAVLinkReceiver(MainActivity parent, DroneModel model) { this.parent = parent; this.mModel = model; - } public void process(MAVLinkMessage msg) { + if(msg.msgid != 0) { + parent.logMessageDJI(String.valueOf(msg)); // parent.logMessageDJI(String.valueOf(msg.msgid)); + } + switch (msg.msgid) { case MAVLINK_MSG_ID_HEARTBEAT: this.mTimeStampLastGCSHeartbeat = System.currentTimeMillis(); @@ -146,8 +163,10 @@ public void process(MAVLinkMessage msg) { mModel.send_autopilot_version(); break; case MAV_CMD_VIDEO_START_CAPTURE: + mModel.startRecordingVideo(); break; case MAV_CMD_VIDEO_STOP_CAPTURE: + mModel.stopRecordingVideo(); break; case MAV_CMD_DO_DIGICAM_CONTROL: // DEPRECATED but still used by QGC @@ -156,6 +175,10 @@ public void process(MAVLinkMessage msg) { case MAV_CMD_MISSION_START: mModel.startWaypointMission(); break; + + case MAV_CMD_DO_SET_SERVO: + mModel.do_set_Gimbal(msg_cmd.param1, msg_cmd.param2); + break; } break; @@ -170,6 +193,63 @@ public void process(MAVLinkMessage msg) { changeFlightMode((int) msg_set_mode.custom_mode); break; + /************************************************************** + * These messages are used when GCS sends Velocity commands * + **************************************************************/ + case MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED: + msg_set_position_target_local_ned msg_param = (msg_set_position_target_local_ned) msg; + if ((msg_param.x + msg_param.y + msg_param.z) == 0) { + mModel.do_set_motion_velocity(msg_param.vx, msg_param.vy, -1 * msg_param.vz, msg_param.yaw_rate); + } else { + parent.logMessageDJI("Single point mission!" ); + generateNewMission(); + mMissionItemList = new ArrayList(); + mNumGCSWaypoints = 1; + wpState = WP_STATE_REQ_WP; + mModel.request_mission_item(0); + + msg_mission_item lmsg = new msg_mission_item(); + lmsg.param1 = 0; + lmsg.param2 = 0; + lmsg.param3 = 0; + lmsg.param4 = 0; + lmsg.x = msg_param.x; + lmsg.y = msg_param.y; + lmsg.z = msg_param.z; + lmsg.command = MAV_CMD.MAV_CMD_NAV_WAYPOINT; + mMissionItemList.add(lmsg); + + // We are done fetching a complete mission from the GCS... + wpState = WP_STATE_INACTIVE; + finalizeNewMission(); + mModel.send_mission_ack(); +// mModel.do_set_motion_absolute(msg_param.x, msg_param.y, -1 * msg_param.z, msg_param.yaw); + } + break; +/* + case MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT: + // This command must be sent every second... + msg_set_position_target_global_int msg_param_4 = (msg_set_position_target_global_int) msg; + + // If position is set to zero then it must be a velocity command... + if ((msg_param_4.lat_int + msg_param_4.lon_int + msg_param_4.yaw) == 0) { + mModel.do_set_motion_velocity(msg_param_4.vx, msg_param_4.vy, msg_param_4.vz, msg_param_4.yaw_rate); + } else{ + mModel.do_set_motion_absolute(msg_param_4.lat_int, msg_param_4.lon_int, msg_param_4.alt, msg_param_4.yaw); + } + break; + + + msg_manual_control +*/ + + // This command must be sent at 1Hz minimum... + case MAVLINK_MSG_ID_MANUAL_CONTROL: + msg_manual_control msg_param_5 = (msg_manual_control) msg; + mModel.do_set_motion_velocity(msg_param_5.x / (float) 100.0, msg_param_5.y / (float) 100.0, msg_param_5.z / (float) 260.0, msg_param_5.r / (float) 50.0); + break; + + /************************************************************** * These messages are used when GCS requests params from MAV * **************************************************************/ @@ -179,10 +259,10 @@ public void process(MAVLinkMessage msg) { break; case MAVLINK_MSG_ID_PARAM_REQUEST_READ: - msg_param_request_read msg_param = (msg_param_request_read) msg; + msg_param_request_read msg_param_3 = (msg_param_request_read) msg; //String paramStr = msg_param.getParam_Id(); //parent.logMessageFromGCS("***" + paramStr); - mModel.send_param(msg_param.param_index); + mModel.send_param(msg_param_3.param_index); // TODO I am not able to convert the param_id bytearray into String // for(int i = 0; i < mModel.getParams().size(); i++) // if(mModel.getParams().get(i).getParamName().equals(msg_param.getParam_Id())) { @@ -238,7 +318,7 @@ public void process(MAVLinkMessage msg) { if (mModel.getSystemId() != msg_count.target_system) { return; } - + parent.logMessageDJI("Mission Counter: " + msg_count.count); mNumGCSWaypoints = msg_count.count; wpState = WP_STATE_REQ_WP; mMissionItemList = new ArrayList(); @@ -251,6 +331,18 @@ public void process(MAVLinkMessage msg) { if (mModel.getSystemId() != msg_item.target_system) { return; } + parent.logMessageDJI("Add mission: " + msg_item.seq ); + + // Somehow the GOTO from QGroundControl does not issue a mission count... + if (mMissionItemList == null){ + parent.logMessageDJI("Special single point mission!" ); + generateNewMission(); + mMissionItemList = new ArrayList(); + mNumGCSWaypoints = 1; + wpState = WP_STATE_REQ_WP; + mModel.request_mission_item(0); + } + mMissionItemList.add(msg_item); // We are done fetching a complete mission from the GCS... @@ -342,7 +434,7 @@ protected void finalizeNewMission() { parent.logMessageDJI(String.valueOf(m.command)); switch (m.command) { - case MAV_CMD_NAV_TAKEOFF: + case MAV_CMD.MAV_CMD_NAV_TAKEOFF: // parent.logMessageDJI("P1 = " + m.param1); // parent.logMessageDJI("P2 = " + m.param2); // parent.logMessageDJI("P3 = " + m.param3); @@ -352,47 +444,48 @@ protected void finalizeNewMission() { // parent.logMessageDJI("z = " + m.z); break; case MAV_CMD.MAV_CMD_NAV_WAYPOINT: + // TODO: It this to handle the first way point being the current location ???? if (isHome) { + parent.logMessageDJI("Is Home..."); // homeValue = m.z; isHome = false; - } else { - if ((m.z) > 500) { + } //else + { + if ((m.z) > 500) { // TODO: Shuld reqest max altitude not assume 500... // m.z = 500; parent.runOnUiThread(new Runnable() { @Override public void run() { - NotificationHandler.notifyAlert(parent, TYPE_WAYPOINT_MAX_ALTITUDE, - null, null); + NotificationHandler.notifyAlert(parent, TYPE_WAYPOINT_MAX_ALTITUDE, null, null); } }); stopUpload = true; break waypoint_loop; - } else if ((m.z) < -200) { + } else if ((m.z) < -200) { // TODO: hmm so we can not take off from a mountain and fly down?? ... // m.z = -200; parent.runOnUiThread(new Runnable() { @Override public void run() { - NotificationHandler.notifyAlert(parent, TYPE_WAYPOINT_MIN_ALTITUDE, - null, null); + NotificationHandler.notifyAlert(parent, TYPE_WAYPOINT_MIN_ALTITUDE, null, null); } }); stopUpload = true; break waypoint_loop; } + currentWP = new Waypoint(m.x, m.y, m.z); // TODO check altitude conversion - if (m.command == MAV_CMD.MAV_CMD_NAV_WAYPOINT) { - if (m.param1 > 0) - currentWP.addAction(new WaypointAction(WaypointActionType.STAY, (int) m.param1 * 1000)); - } + if (m.param1 > 0) + currentWP.addAction(new WaypointAction(WaypointActionType.STAY, (int) m.param1 * 1000)); if (curvedFlightPath) { currentWP.cornerRadiusInMeters = flightPathRadius; } dji_wps.add(currentWP); -// parent.logMessageDJI("Waypoint: " + m.x + ", " + m.y + " at " + m.z + "m"); + + parent.logMessageDJI("Waypoint: " + m.x + ", " + m.y + " at " + m.z + "m"); // parent.logMessageDJI("P1 = " + m.param1); // parent.logMessageDJI("P2 = " + m.param2); // parent.logMessageDJI("P3 = " + m.param3); @@ -439,16 +532,19 @@ public void run() { mBuilder.autoFlightSpeed(m.param2); } break; + case MAV_CMD.MAV_CMD_DO_MOUNT_CONTROL: currentWP.addAction(new WaypointAction(WaypointActionType.GIMBAL_PITCH, (int) m.param1)); parent.logMessageDJI("Set gimbal pitch: " + m.param1); break; + case MAV_CMD.MAV_CMD_IMAGE_START_CAPTURE: if (currentWP != null) currentWP.addAction(new WaypointAction(WaypointActionType.START_TAKE_PHOTO, 0)); parent.logMessageDJI("Take photo"); break; - case MAV_CMD_DO_SET_CAM_TRIGG_DIST: + + case MAV_CMD.MAV_CMD_DO_SET_CAM_TRIGG_DIST: if (!triggerDistanceEnabled) { if (m.param1 != 0) { @@ -459,7 +555,8 @@ public void run() { } } break; - case MAV_CMD_NAV_RETURN_TO_LAUNCH: + + case MAV_CMD.MAV_CMD_NAV_RETURN_TO_LAUNCH: mBuilder.finishedAction(WaypointMissionFinishedAction.GO_HOME); parent.logMessageDJI("Waypoint RTL"); break; @@ -482,7 +579,7 @@ public void run() { correctedWps = addIntermediateWaypoints(dji_wps); } logWaypointstoRD(correctedWps); - + parent.logMessageDJI("WP size " + correctedWps.size()); mBuilder.waypointList(correctedWps).waypointCount(correctedWps.size()); WaypointMission builtMission = mBuilder.build(); mModel.setWaypointMission(builtMission); diff --git a/app/src/main/java/sq/rogue/rosettadrone/MainActivity.java b/app/src/main/java/sq/rogue/rosettadrone/MainActivity.java index 430aa8d..e6d313d 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/MainActivity.java +++ b/app/src/main/java/sq/rogue/rosettadrone/MainActivity.java @@ -6,40 +6,43 @@ // MenuItemTetColor: RPP @ https://stackoverflow.com/questions/31713628/change-menuitem-text-color-programmatically import android.Manifest; -import android.content.ComponentName; +import android.content.BroadcastReceiver; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; -import android.content.ServiceConnection; +import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; +import android.graphics.SurfaceTexture; import android.graphics.drawable.Drawable; import android.hardware.usb.UsbManager; -import android.net.ConnectivityManager; -import android.net.Network; -import android.net.NetworkCapabilities; +import android.media.MediaFormat; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.Handler; -import android.os.IBinder; import android.os.Looper; -import android.os.RemoteException; -import android.support.annotation.NonNull; -import android.support.design.widget.BottomNavigationView; -import android.support.v4.app.ActivityCompat; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.preference.PreferenceManager; +import androidx.annotation.NonNull; + +import com.google.android.material.bottomnavigation.BottomNavigationView; + +import androidx.core.content.ContextCompat; +import androidx.preference.PreferenceManager; +import static com.google.android.material.snackbar.Snackbar.LENGTH_LONG; + +import androidx.core.app.ActivityCompat; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.TextureView; import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; @@ -56,6 +59,7 @@ import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.BufferedWriter; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -67,42 +71,52 @@ import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; -import java.net.MalformedURLException; import java.net.SocketException; -import java.net.URL; import java.net.UnknownHostException; +import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.Timer; import java.util.TimerTask; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import dji.common.camera.SettingsDefinitions; import dji.common.error.DJIError; import dji.common.error.DJISDKError; -import dji.midware.natives.SDKRelativeJNI; +import dji.common.flightcontroller.simulator.InitializationData; +import dji.common.flightcontroller.simulator.SimulatorState; +import dji.common.flightcontroller.virtualstick.FlightCoordinateSystem; +import dji.common.flightcontroller.virtualstick.RollPitchControlMode; +import dji.common.flightcontroller.virtualstick.VerticalControlMode; +import dji.common.flightcontroller.virtualstick.YawControlMode; +import dji.common.model.LocationCoordinate2D; +import dji.common.product.Model; +import dji.common.util.CommonCallbacks; import dji.sdk.base.BaseComponent; import dji.sdk.base.BaseProduct; +import dji.sdk.camera.Camera; +import dji.sdk.camera.VideoFeeder; +import dji.sdk.codec.DJICodecManager; +import dji.sdk.flightcontroller.FlightController; import dji.sdk.products.Aircraft; +import dji.sdk.sdkmanager.DJISDKInitEvent; import dji.sdk.sdkmanager.DJISDKManager; import sq.rogue.rosettadrone.logs.LogFragment; import sq.rogue.rosettadrone.settings.SettingsActivity; -import sq.rogue.rosettadrone.video.VideoService; +import sq.rogue.rosettadrone.settings.HelpActivity; +import sq.rogue.rosettadrone.video.DJIVideoStreamDecoder; +import sq.rogue.rosettadrone.video.H264Packetizer; +import sq.rogue.rosettadrone.video.NativeHelper; -import static android.support.design.widget.Snackbar.LENGTH_LONG; import static sq.rogue.rosettadrone.util.safeSleep; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_DRONE_CONNECTED; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_DRONE_DISCONNECTED; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_RESTART; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_SET_MODEL; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_START; -import static sq.rogue.rosettadrone.video.VideoService.ACTION_STOP; -public class MainActivity extends AppCompatActivity { + +public class MainActivity extends AppCompatActivity implements DJICodecManager.YuvDataCallback { public static final String FLAG_CONNECTION_CHANGE = "dji_sdk_connection_change"; private final static int RESULT_SETTINGS = 1001; + private final static int RESULT_HELP = 1002; public static boolean FLAG_PREFS_CHANGED = false; public static boolean FLAG_VIDEO_ADDRESS_CHANGED = false; public static boolean FLAG_TELEMETRY_ADDRESS_CHANGED = false; @@ -116,6 +130,7 @@ public class MainActivity extends AppCompatActivity { public static boolean FLAG_DRONE_LANDING_PROTECTION_CHANGED = false; public static boolean FLAG_DRONE_FLIGHT_PATH_MODE_CHANGED = false; public static boolean FLAG_DRONE_MAX_HEIGHT_CHANGED = false; + private static BaseProduct mProduct; private final String TAG = "RosettaDrone"; private final int GCS_TIMEOUT_mSEC = 2000; @@ -141,6 +156,18 @@ public class MainActivity extends AppCompatActivity { private GCSCommunicatorAsyncTask mGCSCommunicator; private boolean connectivityHasChanged = false; private boolean shouldConnect = false; + protected TextureView mVideoSurface = null; + + private VideoFeeder.VideoFeed standardVideoFeeder; + protected VideoFeeder.VideoDataListener mReceivedVideoDataListener = null; + private TextureView videostreamPreviewTtView; + private Camera mCamera; + private DJICodecManager mCodecManager; + private int videoViewWidth; + private int videoViewHeight; + protected H264Packetizer mPacketizer; + private SurfaceHolder.Callback surfaceCallback; + protected SharedPreferences sharedPreferences; private Runnable djiUpdateRunnable = new Runnable() { @Override @@ -184,91 +211,156 @@ public void run() { } }; - private DJISDKManager.SDKManagerCallback mDJISDKManagerCallback = new DJISDKManager.SDKManagerCallback() { - @Override - public void onProductDisconnect() { - notifyStatusChange(); - } + private void initPacketizer() { + Log.e(TAG, "initPacketizer"); - @Override - public void onProductConnect(BaseProduct newProduct) { - mProduct = newProduct; + String videoIPString = "127.0.0.1"; - if (mProduct == null) { - logMessageDJI("No DJI drone detected"); - onDroneDisconnected(); + sharedPreferences = android.preference.PreferenceManager.getDefaultSharedPreferences(this); + if (sharedPreferences.getBoolean("pref_external_gcs", false)) { + if (!sharedPreferences.getBoolean("pref_separate_gcs", false)) { + videoIPString = sharedPreferences.getString("pref_gcs_ip", "127.0.0.1"); } else { - if (mProduct instanceof Aircraft) { - logMessageDJI("DJI aircraft detected"); - onDroneConnected(); - } else { - logMessageDJI("DJI non-aircraft product detected"); - onDroneDisconnected(); - } + videoIPString = sharedPreferences.getString("pref_video_ip", "127.0.0.1"); } + } else if (sharedPreferences.getBoolean("pref_separate_gcs", false)) { + videoIPString = sharedPreferences.getString("pref_video_ip", "127.0.0.1"); + } - notifyStatusChange(); + int videoPort = Integer.parseInt(sharedPreferences.getString("pref_video_port", "5600")); + int videoBitrate = Integer.parseInt(sharedPreferences.getString("pref_video_bitrate", "2000")); + int encodeSpeed = Integer.parseInt((sharedPreferences.getString("pref_encode_speed", "5"))); + + VideoFeeder.getInstance().setTranscodingDataRate(encodeSpeed); + + try { + if (mPacketizer != null && mPacketizer.getRtpSocket() != null) + mPacketizer.getRtpSocket().close(); + mPacketizer = new H264Packetizer(); + + Log.e(TAG, "Receiver: " + videoIPString + ":"+videoPort); + mPacketizer.getRtpSocket().setDestination(InetAddress.getByName(videoIPString), videoPort, 5000); + } catch (UnknownHostException e) { + Log.e(TAG, "Error setting destination for RTP packetizer", e); } + } - @Override - public void onComponentChange(BaseProduct.ComponentKey componentKey, BaseComponent oldComponent, BaseComponent newComponent) { - if (newComponent != null) { - newComponent.setComponentListener(new BaseComponent.ComponentListener() { - @Override - public void onConnectivityChange(boolean isConnected) { - Log.d(TAG, "onComponentConnectivityChanged: " + isConnected); - notifyStatusChange(); - } - }); - } + /** + * onResume is called whenever RosettaDrone takes the foreground. This happens if we open the + * RosettaDrone application or return from the preferences window. Need to rebind to the AIDL service. + */ + @Override + protected void onResume() { + Log.e(TAG, "onResume()"); + + if (mDroneDetails != null) { + String droneID = prefs.getString("pref_drone_id", "1"); + String rtlAlt = prefs.getString("pref_drone_rtl_altitude", "60") + "m"; + String text = "ID:" + "\t" + droneID + System.getProperty("line.separator") + "RTL:" + "\t" + rtlAlt; + mDroneDetails.setText(text); } - @Override - public void onRegister(DJIError error) { - Log.d(TAG, error == null ? "success" : error.getDescription()); - if (error == DJISDKError.REGISTRATION_SUCCESS) { - DJISDKManager.getInstance().startConnectionToProduct(); - Handler handler = new Handler(Looper.getMainLooper()); - handler.post(new Runnable() { - @Override - public void run() { - //Toast.makeText(getApplicationContext(), "DJI SDK registered", Toast.LENGTH_LONG).show(); - logMessageDJI("DJI SDK registered"); + + super.onResume(); + + initPreviewerTextureView(); // Decoded data to UDP... + //notifyStatusChange(); + + // If we use a camera... Remove Listeners if needed... + if (mCamera != null) { + if (!prefs.getBoolean("pref_enable_video", true)) { + if (isTranscodedVideoFeedNeeded()) { + if (standardVideoFeeder != null) { + standardVideoFeeder.removeVideoDataListener(mReceivedVideoDataListener); } - }); + } else { + if (VideoFeeder.getInstance().getPrimaryVideoFeed() != null) { + VideoFeeder.getInstance().getPrimaryVideoFeed().removeVideoDataListener(mReceivedVideoDataListener); + } + } } else { - Handler handler = new Handler(Looper.getMainLooper()); - handler.post(new Runnable() { - @Override - public void run() { - logMessageDJI("DJI SDK registration failed"); - //Toast.makeText(getApplicationContext(), "DJI SDK registration failed", Toast.LENGTH_LONG).show(); + if (isTranscodedVideoFeedNeeded()) { + if (standardVideoFeeder != null) { + standardVideoFeeder.addVideoDataListener(mReceivedVideoDataListener); } - }); + return; + } + if (VideoFeeder.getInstance().getPrimaryVideoFeed() != null) { + VideoFeeder.getInstance().getPrimaryVideoFeed().addVideoDataListener(mReceivedVideoDataListener); + } } - if (error != null) { - Log.e(TAG, error.toString()); + } + } + + + /** + * Called whenever RosettaDrone leaves the foreground, such as when the home button is pressed or + * we enter the preferences/settings screen. We unbind the AIDL service since we don't need it if we're not + * currently within RosettaDrone. + * NOTE: Pressing the back button from the RosettaDrone application also calls onDestroy. + */ + @Override + protected void onPause() { + Log.e(TAG, "onPause()"); +/* + // Remove Listeners... + if (mCamera != null) { + if (isTranscodedVideoFeedNeeded()) { + if (standardVideoFeeder != null) { + standardVideoFeeder.removeVideoDataListener(mReceivedVideoDataListener); + } + } else { + if (VideoFeeder.getInstance().getPrimaryVideoFeed() != null) { + VideoFeeder.getInstance().getPrimaryVideoFeed().removeVideoDataListener(mReceivedVideoDataListener); + } } } - }; + */ + super.onPause(); + // We have to save text when onPause is called or it will be erased +// mNewOutbound = logToGCS.getLogText() + mNewOutbound; +// mNewInbound = logFromGCS.getLogText() + mNewInbound; +// mNewDJI = logDJI.getLogText() + mNewDJI; + } @Override - protected void onNewIntent(@NonNull Intent intent) { - String action = intent.getAction(); - if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) { - Intent attachedIntent = new Intent(); - attachedIntent.setAction(DJISDKManager.USB_ACCESSORY_ATTACHED); - sendBroadcast(attachedIntent); + protected void onStop() { + Log.e(TAG, "onStop"); + super.onStop(); + } + + @Override + protected void onDestroy() { + Log.e(TAG, "onDestroy"); +// logMessageDJI("onDestroy()"); + sendDroneDisconnected(); + closeGCSCommunicator(); + + if (mUIHandler != null) { + mUIHandler.removeCallbacksAndMessages(null); } + + if (mDJIHandler != null) { + mDJIHandler.removeCallbacksAndMessages(null); + } + + if (mCodecManager != null) { + mCodecManager.cleanSurface(); + mCodecManager.destroyCodec(); + } + + super.onDestroy(); } @Override protected void onCreate(Bundle savedInstanceState) { -// Log.d(TAG, "onCreate()"); + Log.e(TAG, "onCreate()"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + mProduct = RDApplication.getProductInstance(); // Should be set by Connection ... + String versionName = ""; try { PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0); @@ -278,8 +370,6 @@ protected void onCreate(Bundle savedInstanceState) { } getSupportActionBar().setTitle("Rosetta Drone " + versionName); - requestPermissions(); - if (savedInstanceState != null) { navState = savedInstanceState.getInt("navigation_state"); } @@ -297,7 +387,7 @@ protected void onCreate(Bundle savedInstanceState) { initLogs(); initBottomNav(); - mModel = new DroneModel(this, null); + mModel = new DroneModel(this, null, RDApplication.getSim()); mModel.setSystemId(Integer.parseInt(prefs.getString("pref_drone_id", "1"))); mMavlinkReceiver = new MAVLinkReceiver(this, mModel); @@ -317,8 +407,273 @@ protected void onCreate(Bundle savedInstanceState) { sendBroadcast(attachedIntent); } } + + // The one we must have... + initUi(); + initPacketizer(); + + DJISDKManager.getInstance().registerApp(this, mDJISDKManagerCallback); +/* + // If simulator... + if(RDApplication.getSim() == true) { + logMessageDJI("Simulation mode......"); + // Register the broadcast receiver for receiving the device connection's changes. + IntentFilter filter = new IntentFilter(); + filter.addAction(DJISimulatorApplication.FLAG_CONNECTION_CHANGE); + registerReceiver(mReceiver, filter); + } + + */ + } + + protected BroadcastReceiver mReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + updateTitleBar(); + logMessageDJI("Simulator state change..."); + } + }; + + private void updateTitleBar() { + boolean ret = false; + BaseProduct product = DJISimulatorApplication.getProductInstance(); + if (product != null) { + if(product.isConnected()) { + //The product is connected + logMessageDJI(DJISimulatorApplication.getProductInstance().getModel() + " Connected"); + ret = true; + } else { + if(product instanceof Aircraft) { + Aircraft aircraft = (Aircraft)product; + if(aircraft.getRemoteController() != null && aircraft.getRemoteController().isConnected()) { + // The product is not connected, but the remote controller is connected + logMessageDJI("only RC Connected"); + ret = true; + } + } + } + } + + if(!ret) { + // The product or the remote controller are not connected. + logMessageDJI("Disconnected"); + } + } + + private void initUi() { + Log.e(TAG, "initUi()"); + + // The one were we get transcoded data... + videostreamPreviewTtView = (TextureView) findViewById(R.id.livestream_preview_ttv); + + VideoFeeder.getInstance().setTranscodingDataRate(3.0f); + //logMessageDJI("set rate to 3Mbps"); + + videostreamPreviewTtView.setVisibility(View.VISIBLE); + } + + @Override + protected void onNewIntent(@NonNull Intent intent) { + + super.onNewIntent(intent); + + String action = intent.getAction(); + if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) { + Intent attachedIntent = new Intent(); + attachedIntent.setAction(DJISDKManager.USB_ACCESSORY_ATTACHED); + sendBroadcast(attachedIntent); + } + } + + private void notifyStatusChange() + { + mDJIHandler.removeCallbacks(djiUpdateRunnable); + mDJIHandler.postDelayed(djiUpdateRunnable, 500); + final BaseProduct product = RDApplication.getProductInstance(); + if (product != null && product.isConnected() && product.getModel() != null) { + logMessageDJI(product.getModel().name() + " Connected " ); + } else { + logMessageDJI("Disconnected"); + } + + // The callback for receiving the raw H264 video data for camera live view + mReceivedVideoDataListener = new VideoFeeder.VideoDataListener() { + + @Override + public void onReceive(byte[] videoBuffer, int size) { + splitNALs(videoBuffer); + } + }; + + if (null == product || !product.isConnected()) { + mCamera = null; + } else { + if (!product.getModel().equals(Model.UNKNOWN_AIRCRAFT)) { + mCamera = product.getCamera(); + mCamera.setMode(SettingsDefinitions.CameraMode.SHOOT_PHOTO, new CommonCallbacks.CompletionCallback() { + @Override + public void onResult(DJIError djiError) { + if (djiError != null) { + Log.e(TAG, "can't change mode of camera, error: "+djiError.getDescription()); + logMessageDJI("can't change mode of camera, error: "+djiError.getDescription()); + } + } + }); + + //When calibration is needed or the fetch key frame is required by SDK, should use the provideTranscodedVideoFeed + //to receive the transcoded video feed from main camera. + if (isTranscodedVideoFeedNeeded()) { + standardVideoFeeder = VideoFeeder.getInstance().provideTranscodedVideoFeed(); + if (prefs.getBoolean("pref_enable_video", true)) { + standardVideoFeeder.addVideoDataListener(mReceivedVideoDataListener); + } + return; + } + if (VideoFeeder.getInstance().getPrimaryVideoFeed() != null) { + if (prefs.getBoolean("pref_enable_video", true)) { + VideoFeeder.getInstance().getPrimaryVideoFeed().addVideoDataListener(mReceivedVideoDataListener); + } + } + + } + } } + /** + * Init a fake texture view to for the codec manager, so that the video raw data can be received + * by the camera needed to get video to the UDP handler... + */ + private void initPreviewerTextureView() { + Log.e(TAG, "initPreviewerTextureView"); + + videostreamPreviewTtView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() { + @Override + public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { + videoViewWidth = width; + videoViewHeight = height; + Log.d(TAG, "real onSurfaceTextureAvailable: width " + videoViewWidth + " height " + videoViewHeight); + if (mCodecManager == null) { + mCodecManager = new DJICodecManager(getApplicationContext(), surface, width, height); + } + } + + @Override + public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { + videoViewWidth = width; + videoViewHeight = height; + Log.d(TAG, "real onSurfaceTextureAvailable2: width " + videoViewWidth + " height " + videoViewHeight); + } + + @Override + public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { + Log.e(TAG, "onSurfaceTextureDestroyed"); + if (mCodecManager != null) { + mCodecManager.cleanSurface(); + } + return false; + } + + @Override + public void onSurfaceTextureUpdated(SurfaceTexture surface) { + // Log.e(TAG, "onSurfaceTextureUpdated"); + + } + }); + } + + @Override + public void onYuvDataReceived(MediaFormat format, final ByteBuffer yuvFrame, int dataSize, final int width, final int height) { +// public void onYuvDataReceived(final ByteBuffer yuvFrame, int dataSize, final int width, final int height) { + //In this demo, we test the YUV data by saving it into JPG files. + Log.e(TAG, "onYuvDataReceived " + dataSize + " " + format); +// Log.e(TAG, "onYuvDataReceived " + dataSize ); + + } + + + //--------------------------------------------------------------------------------------- + //--------------------------------------------------------------------------------------- + //--------------------------------------------------------------------------------------- + //--------------------------------------------------------------------------------------- + + private DJISDKManager.SDKManagerCallback mDJISDKManagerCallback = new DJISDKManager.SDKManagerCallback() { + + @Override + public void onDatabaseDownloadProgress(long x, long y){ + } + + @Override + public void onInitProcess(DJISDKInitEvent a, int x){ + } + + @Override + public void onProductDisconnect() { + //notifyStatusChange(); + } + + @Override + public void onProductConnect(BaseProduct newProduct) { + mProduct = newProduct; + + if (mProduct == null) { + logMessageDJI("No DJI drone detected"); + onDroneDisconnected(); + } else { + if (mProduct instanceof Aircraft) { + logMessageDJI("DJI aircraft detected"); + onDroneConnected(); + } else { + logMessageDJI("DJI non-aircraft product detected"); + onDroneDisconnected(); + } + } + notifyStatusChange(); + } + + @Override + public void onComponentChange(BaseProduct.ComponentKey componentKey, BaseComponent oldComponent, BaseComponent newComponent) { + if (newComponent != null) { + newComponent.setComponentListener(new BaseComponent.ComponentListener() { + @Override + public void onConnectivityChange(boolean isConnected) { + notifyStatusChange(); + } + }); + } + } + + @Override + public void onRegister(DJIError error) { + Log.d(TAG, error == null ? "success" : error.getDescription()); + if (error == DJISDKError.REGISTRATION_SUCCESS) { + DJISDKManager.getInstance().startConnectionToProduct(); + Handler handler = new Handler(Looper.getMainLooper()); + handler.post(new Runnable() { + @Override + public void run() { + logMessageDJI("DJI SDK registered"); + } + }); + } else { + Handler handler = new Handler(Looper.getMainLooper()); + handler.post(new Runnable() { + @Override + public void run() { + logMessageDJI("DJI SDK registration failed"); + } + }); + } + if (error != null) { + Log.e(TAG, error.toString()); + } + } + + }; + + //--------------------------------------------------------------------------------------- + //--------------------------------------------------------------------------------------- + //endregion + /** * */ @@ -533,109 +888,6 @@ private void deleteApplicationDirectory() { } - private void requestPermissions() { - // When the compile and target version is higher than 22, please request the following permission at runtime to ensure the SDK works well. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - ActivityCompat.requestPermissions(this, - new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.VIBRATE, - Manifest.permission.INTERNET, Manifest.permission.ACCESS_WIFI_STATE, - Manifest.permission.WAKE_LOCK, Manifest.permission.ACCESS_COARSE_LOCATION, - Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.CHANGE_WIFI_STATE, Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS, - Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SYSTEM_ALERT_WINDOW, - Manifest.permission.READ_PHONE_STATE, - } - , 1); - } - } - - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - super.onRequestPermissionsResult(requestCode, permissions, grantResults); - - boolean permissionGrantedForAll = false; - if (grantResults.length > 0 && permissions.length == grantResults.length) { - for (int i = 0; i < permissions.length; i++) { - if (grantResults[i] == PackageManager.PERMISSION_GRANTED) { - permissionGrantedForAll = true; - } else { - permissionGrantedForAll = false; - } - } - - } else { - permissionGrantedForAll = true; - } - if (permissionGrantedForAll) { - permissionGranted = true; - } else { - permissionGranted = false; - finish(); - } - - DJISDKManager.getInstance().registerApp(this, mDJISDKManagerCallback); - -// invalidateOptionsMenu(); - } - - /** - * onResume is called whenever RosettaDrone takes the foreground. This happens if we open the - * RosettaDrone application or return from the preferences window. Need to rebind to the AIDL service. - */ - @Override - protected void onResume() { - Log.d(TAG, "onResume()"); - - if (mDroneDetails != null) { - String droneID = prefs.getString("pref_drone_id", "1"); - String rtlAlt = prefs.getString("pref_drone_rtl_altitude", "60") + "m"; - String text = "ID:" + "\t" + droneID + System.getProperty("line.separator") + "RTL:" + "\t" + rtlAlt; - mDroneDetails.setText(text); - } - - super.onResume(); - } - - /** - * Called whenever RosettaDrone leaves the foreground, such as when the home button is pressed or - * we enter the preferences/settings screen. We unbind the AIDL service since we don't need it if we're not - * currently within RosettaDrone. - * NOTE: Pressing the back button from the RosettaDrone application also calls onDestroy. - */ - @Override - protected void onPause() { -// Log.d(TAG, "onPause()"); - super.onPause(); - // We have to save text when onPause is called or it will be erased -// mNewOutbound = logToGCS.getLogText() + mNewOutbound; -// mNewInbound = logFromGCS.getLogText() + mNewInbound; -// mNewDJI = logDJI.getLogText() + mNewDJI; - } - - @Override - protected void onStop() { -// Log.i(TAG, "onStop"); - super.onStop(); - } - - @Override - protected void onDestroy() { -// Log.i(TAG, "onDestroy"); -// logMessageDJI("onDestroy()"); - sendDroneDisconnected(); - closeGCSCommunicator(); - - if (mUIHandler != null) { - mUIHandler.removeCallbacksAndMessages(null); - } - - if (mDJIHandler != null) { - mDJIHandler.removeCallbacksAndMessages(null); - } - - super.onDestroy(); - } - /** * Called when we start GCSAsyncTask which is used for comms. If we're opening a comms channel * we assume we also need to start the Video Service as well. @@ -684,11 +936,14 @@ public boolean onCreateOptionsMenu(Menu menu) { MenuItem droneItem = menu.findItem(R.id.drone_details); mDroneDetails = (TextView) droneItem.getActionView(); - mDroneDetails.setTextSize(12); + mDroneDetails.setTextSize(14); String droneID = prefs.getString("pref_drone_id", "1"); String rtlAlt = prefs.getString("pref_drone_rtl_altitude", "60") + "m"; - String text = "ID:" + "\t" + droneID + System.getProperty("line.separator") + "RTL:" + "\t" + rtlAlt; + float dronebattery = mMavlinkReceiver.mModel.get_battery_status(); + + String text = "Drone Battery: " + "\t" + dronebattery + "%" + "\t" + "ID: " + "\t" + droneID + System.getProperty("line.separator") + + "Controller Battery: " + "\t" + dronebattery + "%" + "\t" + "RTL:" + "\t" + rtlAlt; mDroneDetails.setText(text); mDroneDetails.setPadding(mDroneDetails.getPaddingLeft(), @@ -741,6 +996,7 @@ public boolean onOptionsItemSelected(MenuItem item) { onClickSettings(); break; case R.id.action_help: + onClickHelp(); break; default: // Log.d(TAG, String.valueOf(item.getItemId())); @@ -765,6 +1021,12 @@ private void onClickSettings() { startActivityForResult(intent, RESULT_SETTINGS); } + private void onClickHelp() { +// Log.d(TAG, "onClickSettings()"); + Intent intent = new Intent(MainActivity.this, HelpActivity.class); + startActivityForResult(intent, RESULT_HELP); + } + private void onClickClearLogs() { logDJI.clearLogText(); logOutbound.clearLogText(); @@ -814,11 +1076,7 @@ private void onDroneConnected() { } - if (prefs.getBoolean("pref_enable_video", false)) { - sendDroneConnected(); - } else { - sendDroneDisconnected(); - } + sendDroneConnected(); final Drawable connectedDrawable = getResources().getDrawable(R.drawable.ic_baseline_connected_24px); @@ -863,12 +1121,6 @@ private void closeGCSCommunicator() { } } - private void notifyStatusChange() { - mDJIHandler.removeCallbacks(djiUpdateRunnable); -// Log.d(TAG, "notifyStatusChange()"); - mDJIHandler.postDelayed(djiUpdateRunnable, 500); - } - private void loadMockParamFile() { mModel.getParams().clear(); try { @@ -911,42 +1163,13 @@ public void logMessageDJI(String msg) { mNewDJI += "\n" + msg; } - /** - * - */ - private void sendStartVideoService() { - Intent intent = setupIntent(ACTION_START); - sendIntent(intent); - } - - /** - * - */ - private void sendStopVideoService() { - Intent intent = setupIntent(ACTION_STOP); - sendIntent(intent); - } - /** * */ private void sendRestartVideoService() { String videoIP = getVideoIP(); - int videoPort = Integer.parseInt(prefs.getString("pref_video_port", "5600")); - logMessageDJI("Restarting Video link to " + videoIP + ":" + videoPort); - Intent intent = setupIntent(ACTION_RESTART); - intent.putExtra("model", mProduct.getModel()); - sendIntent(intent); - } - - /** - * - */ - private void sendSetBackingMode() { - Intent intent = setupIntent(ACTION_SET_MODEL); - sendIntent(intent); } /** @@ -975,17 +1198,13 @@ private void sendDroneConnected() { logMessageDJI("Starting Video link to " + videoIP + ":" + videoPort); - Intent intent = setupIntent(ACTION_DRONE_CONNECTED); - intent.putExtra("model", mProduct.getModel()); - sendIntent(intent); } /** * */ private void sendDroneDisconnected() { - Intent intent = setupIntent(ACTION_DRONE_DISCONNECTED); - sendIntent(intent); + } private String getVideoIP() { @@ -1005,6 +1224,7 @@ private String getVideoIP() { } private void setDroneParameters() { + logMessageDJI("setDroneParameters"); if (FLAG_DRONE_FLIGHT_PATH_MODE_CHANGED) { if (Integer.parseInt((prefs.getString("pref_drone_flight_path_mode", "2"))) == 0) { @@ -1070,40 +1290,6 @@ private void setDroneParameters() { //region GCS Timer Task //--------------------------------------------------------------------------------------- - /** - * @param action - * @param extras - * @return - */ - private Intent setupIntent(String action, Object... extras) { - Intent intent = new Intent(this, VideoService.class); - intent.setAction(action); - -// for (Object extra : extras) { -//// intent.putExtra() -// } - - return intent; - } - - /** - * @param intent - */ - private void sendIntent(Intent intent) { -// Log.d(TAG, "sendIntent"); - if (intent != null) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - try { - startService(intent); - } catch (IllegalStateException e) { - startForegroundService(intent); - } - } else { - startService(intent); - } - } - } - //--------------------------------------------------------------------------------------- //endregion @@ -1363,7 +1549,54 @@ public void run() { } } + //--------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------- + // To be moved later for better structure.... + + private boolean isTranscodedVideoFeedNeeded() { + if (VideoFeeder.getInstance() == null) { + return false; + } + + return VideoFeeder.getInstance().isFetchKeyFrameNeeded() || VideoFeeder.getInstance() + .isLensDistortionCalibrationNeeded(); + } + + //--------------------------------------------------------------------------------------- + // -------------------------------------------------------------------------------------------- + public void splitNALs(byte[] buffer) { + + // One H264 frame can contain multiple NALs + int packet_start_idx = 0; + int packet_end_idx = 0; + if (buffer.length < 4) + return; + + for (int i = 3; i < buffer.length - 3; i++) { + // This block handles all but the last NAL in the frame + if ((buffer[i] & 0xff) == 0 && (buffer[i + 1] & 0xff) == 0 && (buffer[i + 2] & 0xff) == 0 && (buffer[i + 3] & 0xff) == 1) { + packet_end_idx = i; + byte[] packet = Arrays.copyOfRange(buffer, packet_start_idx, packet_end_idx); + sendNAL(packet); + packet_start_idx = i; + } + } + // This block handles the last NAL in the frame, or the single NAL if only one exists + packet_end_idx = buffer.length; + byte[] packet = Arrays.copyOfRange(buffer, packet_start_idx, packet_end_idx); + sendNAL(packet); + } + + protected void sendNAL(byte[] buffer) { + // Pack a single NAL for RTP and send + if (mPacketizer != null) { + mPacketizer.setInputStream(new ByteArrayInputStream(buffer)); + mPacketizer.run(); + } + } + //--------------------------------------------------------------------------------------- //endregion } + diff --git a/app/src/main/java/sq/rogue/rosettadrone/NotificationHandler.java b/app/src/main/java/sq/rogue/rosettadrone/NotificationHandler.java index ef5d086..449af9d 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/NotificationHandler.java +++ b/app/src/main/java/sq/rogue/rosettadrone/NotificationHandler.java @@ -2,8 +2,8 @@ import android.content.Context; import android.content.DialogInterface; -import android.support.design.widget.Snackbar; -import android.support.v7.app.AlertDialog; +import com.google.android.material.snackbar.Snackbar; +import androidx.appcompat.app.AlertDialog; import android.view.View; import static sq.rogue.rosettadrone.util.TYPE_DRONE_ID; diff --git a/app/src/main/java/sq/rogue/rosettadrone/RDApplication.java b/app/src/main/java/sq/rogue/rosettadrone/RDApplication.java index 8f31ee3..fd5b0fa 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/RDApplication.java +++ b/app/src/main/java/sq/rogue/rosettadrone/RDApplication.java @@ -2,28 +2,59 @@ import android.app.Application; import android.content.Context; - import com.secneo.sdk.Helper; -//import com.squareup.leakcanary.LeakCanary; + + +import dji.sdk.base.BaseProduct; +import dji.sdk.sdkmanager.DJISDKManager; public class RDApplication extends Application { + private static BaseProduct mProduct; + private static DJISimulatorApplication simulatorApplication; + private static boolean m_sim = false; + + // True if simulate... + public static boolean getSim(){ + return m_sim; + } + public static void setSim(boolean sim){ + m_sim = sim; + } + + public static synchronized BaseProduct getProductInstance() { + if (null == mProduct) { + if( getSim() == false) { + mProduct = DJISDKManager.getInstance().getProduct(); + }else { + mProduct = simulatorApplication.getProductInstance(); + } + } + return mProduct; + } + @Override public void onCreate() { super.onCreate(); -// if (LeakCanary.isInAnalyzerProcess(this)) { -// // This process is dedicated to LeakCanary for heap analysis. -// // You should not init your app in this process. -// return; -// } -// LeakCanary.install(this); -// // Normal app init code... + m_sim = false; + simulatorApplication.onCreate(); + } + + public static synchronized void updateProduct(BaseProduct product) { + mProduct = product; } @Override protected void attachBaseContext(Context paramContext) { super.attachBaseContext(paramContext); Helper.install(RDApplication.this); + + if (simulatorApplication == null) { + simulatorApplication = new DJISimulatorApplication(); + simulatorApplication.setContext(this); + } } } + + diff --git a/app/src/main/java/sq/rogue/rosettadrone/RosettaMissionOperatorListener.java b/app/src/main/java/sq/rogue/rosettadrone/RosettaMissionOperatorListener.java index 3b65fc3..2011990 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/RosettaMissionOperatorListener.java +++ b/app/src/main/java/sq/rogue/rosettadrone/RosettaMissionOperatorListener.java @@ -1,8 +1,8 @@ package sq.rogue.rosettadrone; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.util.Log; import dji.common.error.DJIError; diff --git a/app/src/main/java/sq/rogue/rosettadrone/logs/LogFragment.java b/app/src/main/java/sq/rogue/rosettadrone/logs/LogFragment.java index fe91181..c6f9b32 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/logs/LogFragment.java +++ b/app/src/main/java/sq/rogue/rosettadrone/logs/LogFragment.java @@ -2,16 +2,12 @@ import android.annotation.SuppressLint; import android.os.Bundle; -import android.os.Handler; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import android.text.Editable; import android.text.TextWatcher; -import android.text.method.ScrollingMovementMethod; -import android.util.Log; -import android.view.GestureDetector; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; diff --git a/app/src/main/java/sq/rogue/rosettadrone/settings/HelpActivity.java b/app/src/main/java/sq/rogue/rosettadrone/settings/HelpActivity.java new file mode 100644 index 0000000..c6f604a --- /dev/null +++ b/app/src/main/java/sq/rogue/rosettadrone/settings/HelpActivity.java @@ -0,0 +1,61 @@ +package sq.rogue.rosettadrone.settings; + +import android.os.Bundle; +import android.util.Log; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.FragmentTransaction; +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceScreen; +import sq.rogue.rosettadrone.R; +import sq.rogue.rosettadrone.settings.drone.DroneSettingsFragment; + +public class HelpActivity extends AppCompatActivity implements PreferenceFragmentCompat.OnPreferenceStartScreenCallback { + private static final String TAG = HelpActivity.class.getSimpleName(); + + /** + * @param savedInstanceState Any saved state we are carrying over into the new activity instance + */ + @Override + protected void onCreate(Bundle savedInstanceState) { + Log.d(TAG, "onCreate"); + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_help); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + +// // Display the fragment as the main content. +// getFragmentManager().beginTransaction() +// .replace(android.R.id.content, new SettingsFragment()) +// .commit(); + } + + @Override + public boolean onSupportNavigateUp() { + onBackPressed(); + return true; + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + setTitle(R.string.settings); + } + + @Override + public boolean onPreferenceStartScreen(PreferenceFragmentCompat caller, PreferenceScreen preferenceScreen) { + Log.d(TAG, "onPreferenceStartScreen"); +// Log.d(TAG, "callback called to attach the preference sub screen"); + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + DroneSettingsFragment fragment = new DroneSettingsFragment(); + Bundle args = new Bundle(); + args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey()); + fragment.setArguments(args); + ft.replace(R.id.pref_container, fragment, preferenceScreen.getKey()); + ft.addToBackStack(preferenceScreen.getKey()); + ft.commit(); + setTitle(preferenceScreen.getTitle()); + return true; + } +} \ No newline at end of file diff --git a/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsActivity.java b/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsActivity.java index bc8c520..9860832 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsActivity.java +++ b/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsActivity.java @@ -1,11 +1,11 @@ package sq.rogue.rosettadrone.settings; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.preference.PreferenceFragmentCompat; -import android.support.v7.preference.PreferenceScreen; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; +import androidx.appcompat.app.AppCompatActivity; +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceScreen; import android.util.Log; import sq.rogue.rosettadrone.R; diff --git a/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsFragment.java b/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsFragment.java index 5dd8100..5a2aaab 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsFragment.java +++ b/app/src/main/java/sq/rogue/rosettadrone/settings/SettingsFragment.java @@ -2,11 +2,11 @@ import android.content.SharedPreferences; import android.os.Bundle; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.ListPreference; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceFragmentCompat; -import android.support.v7.preference.PreferenceGroup; +import androidx.preference.EditTextPreference; +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceGroup; import android.util.Patterns; import sq.rogue.rosettadrone.MainActivity; diff --git a/app/src/main/java/sq/rogue/rosettadrone/settings/drone/DroneSettingsFragment.java b/app/src/main/java/sq/rogue/rosettadrone/settings/drone/DroneSettingsFragment.java index 4e8be15..4f702bc 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/settings/drone/DroneSettingsFragment.java +++ b/app/src/main/java/sq/rogue/rosettadrone/settings/drone/DroneSettingsFragment.java @@ -2,10 +2,10 @@ import android.content.SharedPreferences; import android.os.Bundle; -import android.support.v7.preference.EditTextPreference; -import android.support.v7.preference.ListPreference; -import android.support.v7.preference.Preference; -import android.support.v7.preference.PreferenceFragmentCompat; +import androidx.preference.EditTextPreference; +import androidx.preference.ListPreference; +import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; import java.util.Map; diff --git a/app/src/main/java/sq/rogue/rosettadrone/video/DJIVideoStreamDecoder.java b/app/src/main/java/sq/rogue/rosettadrone/video/DJIVideoStreamDecoder.java new file mode 100755 index 0000000..e055aaf --- /dev/null +++ b/app/src/main/java/sq/rogue/rosettadrone/video/DJIVideoStreamDecoder.java @@ -0,0 +1,870 @@ +package sq.rogue.rosettadrone.video; + +import android.annotation.TargetApi; +import android.content.Context; +import android.media.MediaCodec; +import android.media.MediaCodecInfo; +import android.media.MediaFormat; +import android.os.Build; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Message; +import android.util.Log; +import android.view.Surface; + +import sq.rogue.rosettadrone.R; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.LinkedList; +import java.util.Queue; +import java.util.concurrent.ArrayBlockingQueue; + +import dji.common.product.Model; +import dji.log.DJILog; +import dji.midware.data.model.P3.DataCameraGetPushStateInfo; +import dji.sdk.base.BaseProduct; +import dji.sdk.codec.DJICodecManager; +import dji.sdk.products.Aircraft; +import dji.sdk.sdkmanager.DJISDKManager; + +/** + * This class is a helper class for hardware decoding. Please follow the following steps to use it: + * + * 1. Initialize and set the instance as a listener of NativeDataListener to receive the frame data. + * + * 2. Send the raw data from camera to ffmpeg for frame parsing. + * + * 3. Get the parsed frame data from ffmpeg parsing frame callback and cache the parsed framed data into the frameQueue. + * + * 4. Initialize the MediaCodec as a decoder and then check whether there is any i-frame in the MediaCodec. If not, get + * the default i-frame from sdk resource and insert it at the head of frameQueue. Then dequeue the framed data from the + * frameQueue and feed it(which is Byte buffer) into the MediaCodec. + * + * 5. Get the output byte buffer from MediaCodec, if a surface(Video Previewing View) is configured in the MediaCodec, + * the output byte buffer is only need to be released. If not, the output yuv data should invoke the callback and pass + * it out to external listener, it should also be released too. + * + * 6. Release the ffmpeg and the MediaCodec, stop the decoding thread. + */ +public class DJIVideoStreamDecoder implements NativeHelper.NativeDataListener { + private static final String TAG = DJIVideoStreamDecoder.class.getSimpleName(); + private static final int BUF_QUEUE_SIZE = 30; + private static final int MSG_INIT_CODEC = 0; + private static final int MSG_FRAME_QUEUE_IN = 1; + private static final int MSG_DECODE_FRAME = 2; + private static final int MSG_YUV_DATA = 3; + public static final String VIDEO_ENCODING_FORMAT = "video/avc"; + private HandlerThread handlerThreadNew; + private Handler handlerNew; + private final boolean DEBUG = false; + private static DJIVideoStreamDecoder instance; + private Queue frameQueue; + private HandlerThread dataHandlerThread; + private Handler dataHandler; + private Context context; + private MediaCodec codec; + private Surface surface; + + public int frameIndex = -1; + private long currentTime; + public int width; + public int height; + private boolean hasIFrameInQueue = false; + MediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo(); + LinkedList bufferChangedQueue=new LinkedList(); + + private long createTime; + + /** + * Set the yuv frame data receiving callback. The callback method will be invoked when the decoder + * output yuv frame data. What should be noted here is that the hardware decoder would not output + * any yuv data if a surface is configured into, which mean that if you want the yuv frames, you + * should set "null" surface when calling the "configure" method of MediaCodec. + * @param yuvDataListener + */ + public void setYuvDataListener(DJICodecManager.YuvDataCallback yuvDataListener) { + this.yuvDataListener = yuvDataListener; + } + + private DJICodecManager.YuvDataCallback yuvDataListener; + + /** + * A data structure for containing the frames. + */ + private static class DJIFrame { + public byte[] videoBuffer; + public int size; + public long pts; + public long incomingTimeMs; + public long fedIntoCodecTime; + public long codecOutputTime; + public boolean isKeyFrame; + public int frameNum; + public long frameIndex; + public int width; + public int height; + + public DJIFrame(byte[] videoBuffer, int size, long pts, long incomingTimeUs, boolean isKeyFrame, + int frameNum, long frameIndex, int width, int height){ + this.videoBuffer=videoBuffer; + this.size=size; + this.pts =pts; + this.incomingTimeMs=incomingTimeUs; + this.isKeyFrame=isKeyFrame; + this.frameNum=frameNum; + this.frameIndex=frameIndex; + this.width=width; + this.height=height; + } + + public long getQueueDelay() + { + return fedIntoCodecTime-incomingTimeMs; + } + + public long getDecodingDelay() + { + return codecOutputTime-fedIntoCodecTime; + } + + public long getTotalDelay() + { + return codecOutputTime-fedIntoCodecTime; + } + } + + private void logd(String tag, String log) { + if (!DEBUG) { + return; + } + Log.d(tag, log); + } + private void loge(String tag, String log) { + if (!DEBUG) { + return; + } + Log.e(tag, log); + } + + private void logd(String log) { + logd(TAG, log); + } + private void loge(String log) { + loge(TAG, log); + } + + private DJIVideoStreamDecoder() { + createTime = System.currentTimeMillis(); + frameQueue = new ArrayBlockingQueue(BUF_QUEUE_SIZE); + startDataHandler(); + handlerThreadNew = new HandlerThread("native parser thread"); + handlerThreadNew.start(); + handlerNew = new Handler(handlerThreadNew.getLooper(), new Handler.Callback() { + @Override + public boolean handleMessage(Message msg) { + byte[] buf = (byte[])msg.obj; + NativeHelper.getInstance().parse(buf, msg.arg1); + return false; + } + }); + } + + + public synchronized static DJIVideoStreamDecoder getInstance() { + if (instance == null) { + instance = new DJIVideoStreamDecoder(); + } + return instance; + } + + /** + * Initialize the decoder + * @param context The application context + * @param surface The displaying surface for the video stream. What should be noted here is that the hardware decoder would not output + * any yuv data if a surface is configured into, which mean that if you want the yuv frames, you + * should set "null" surface when calling the "configure" method of MediaCodec. + */ + public void init(Context context, Surface surface) { + this.context = context; + this.surface = surface; + NativeHelper.getInstance().setDataListener(this); + if (dataHandler != null && !dataHandler.hasMessages(MSG_INIT_CODEC)) { + dataHandler.sendEmptyMessage(MSG_INIT_CODEC); + } + } + + /** + * Framing the raw data from the camera. + * @param buf Raw data from camera. + * @param size Data length + */ + public void parse(byte[] buf, int size) { + Message message =handlerNew.obtainMessage(); + message.obj = buf; + message.arg1 = size; + handlerNew.sendMessage(message); + } + + /** + * Get the resource ID of the IDR frame. + * @param pModel Product model of connecting DJI product. + * @param width Width of current video stream. + * @return Resource ID of the IDR frame + */ + public int getIframeRawId(Model pModel, int width) { + int iframeId = R.raw.iframe_1280x720_ins; + + switch(pModel) { + case PHANTOM_3_ADVANCED: + case PHANTOM_3_STANDARD: + if (width == 960) { + //for photo mode, 960x720, GDR + iframeId = R.raw.iframe_960x720_3s; + } else if (width == 640){ + iframeId = R.raw.iframe_640x368_osmo_gop; + } else { + //for record mode, 1280x720, GDR + iframeId = R.raw.iframe_1280x720_3s; + } + break; + case INSPIRE_1: { + DataCameraGetPushStateInfo.CameraType cameraType = DataCameraGetPushStateInfo.getInstance().getCameraType(); + if (cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeCV600) { //ZENMUSE_Z3 + if (width == 960) { + //for photo mode, 960x720, GDR + iframeId = R.raw.iframe_960x720_3s; + } else if (width == 640){ + iframeId = R.raw.iframe_640x368_osmo_gop; + } else { + //for record mode, 1280x720, GDR + iframeId = R.raw.iframe_1280x720_3s; + } + } + break; + } + case Phantom_3_4K: + switch(width) { + case 640: + //for P3-4K with resolution 640*480 + iframeId = R.raw.iframe_640x480; + break; + case 848: + //for P3-4K with resolution 848*480 + iframeId = R.raw.iframe_848x480; + break; + case 896: + iframeId = R.raw.iframe_896x480; + break; + case 960: + //DJILog.i(TAG, "Selected Iframe=iframe_960x720_3s"); + //for photo mode, 960x720, GDR + iframeId = R.raw.iframe_960x720_3s; + break; + default: + iframeId = R.raw.iframe_1280x720_3s; + break; + } + break; + case OSMO: + if (DataCameraGetPushStateInfo.getInstance().getVerstion() >= 4) { + iframeId = -1; + } else { + iframeId = R.raw.iframe_1280x720_ins; + } + break; + case OSMO_PLUS: + if (width == 960) { + iframeId = R.raw.iframe_960x720_osmo_gop; + } else if (width==1280) { + //for record mode, 1280x720, GDR + //DJILog.i(TAG, "Selected Iframe=iframe_1280x720_3s"); + // iframeId = R.raw.iframe_1280x720_3s; + iframeId = R.raw.iframe_1280x720_osmo_gop; + } else if (width == 640){ + iframeId = R.raw.iframe_640x368_osmo_gop; + } else { + iframeId = R.raw.iframe_1280x720_3s; + } + break; + case OSMO_PRO: + case OSMO_RAW: + iframeId = R.raw.iframe_1280x720_ins; + break; + case MAVIC_PRO: //product small drone + case MAVIC_2: + if (((Aircraft) DJISDKManager.getInstance().getProduct()).getMobileRemoteController() != null) { + iframeId = R.raw.iframe_1280x720_wm220; + } else{ + iframeId = -1; + } + break; + case Spark: + switch (width) { + case 1280: // 与P4相同 + iframeId = R.raw.iframe_1280x720_p4; + break; + case 1024: + iframeId = R.raw.iframe_1024x768_wm100; + break; + default: + iframeId = R.raw.iframe_1280x720_p4; + break; + } + break; + case MAVIC_AIR: + switch (height) { + case 960: + iframeId = R.raw.iframe_1280x960_wm230; + break; + case 720: + iframeId = R.raw.iframe_1280x720_wm230; + break; + default: + iframeId = R.raw.iframe_1280x720_wm230; + break; + } + break; + case PHANTOM_4: + iframeId = R.raw.iframe_1280x720_p4; + break; + case PHANTOM_4_PRO: // p4p + case PHANTOM_4_ADVANCED: // p4p + switch (width) { + case 1280: + iframeId = R.raw.iframe_p4p_720_16x9; + break; + case 960: + iframeId = R.raw.iframe_p4p_720_4x3; + break; + case 1088: + iframeId = R.raw.iframe_p4p_720_3x2; + break; + case 1344: + iframeId = R.raw.iframe_p4p_1344x720; + break; + case 1440: + iframeId = R.raw.iframe_1440x1088_wm620; + break; + case 1920: + switch (height) { + case 1024: + iframeId = R.raw.iframe_1920x1024_wm620; + break; + case 800: + iframeId = R.raw.iframe_1920x800_wm620; + break; + default: + iframeId = R.raw.iframe_1920x1088_wm620; + break; + } + break; + default: + iframeId = R.raw.iframe_p4p_720_16x9; + break; + } + break; + case MATRICE_600: + case MATRICE_600_PRO: { + DataCameraGetPushStateInfo.CameraType cameraType = DataCameraGetPushStateInfo.getInstance().getCameraType(); + if (width == 720 && height == 480) { + iframeId = R.raw.iframe_720x480_m600; + } else if (width == 720 && height == 576) { + iframeId = R.raw.iframe_720x576_m600; + } else { + if (width == 1280 && height == 720) { + if (cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeGD600) { + iframeId = R.raw.iframe_gd600_1280x720; + } else if (cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeCV600) { + iframeId = R.raw.iframe_1280x720_osmo_gop; + } else if (cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeFC350) { + iframeId = R.raw.iframe_1280x720_ins; + } else { + iframeId = R.raw.iframe_1280x720_m600; + } + } else if (width == 1920 && (height == 1080 || height == 1088)) { + iframeId = R.raw.iframe_1920x1080_m600; + } else if (width == 1080 && height == 720) { + iframeId = R.raw.iframe_1080x720_gd600; + } else if (width == 960 && height == 720) { + iframeId = R.raw.iframe_960x720_3s; + } else { + iframeId = -1; + } + } + break; + } + case MATRICE_100: { + DataCameraGetPushStateInfo.CameraType cameraType = DataCameraGetPushStateInfo.getInstance().getCameraType(); + if (cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeGD600) { + + if (width == 1280 && height == 720){ + iframeId = R.raw.iframe_gd600_1280x720; + }else { + iframeId = R.raw.iframe_1080x720_gd600; + } + + } else { + iframeId = R.raw.iframe_1280x720_ins; + } + break; + } + case MATRICE_200: + case MATRICE_210: + case MATRICE_210_RTK: + case INSPIRE_2: //inspire2 + DataCameraGetPushStateInfo.CameraType cameraType = DataCameraGetPushStateInfo.getInstance().getCameraType(0); + if(cameraType == DataCameraGetPushStateInfo.CameraType.DJICameraTypeGD600) { + iframeId = R.raw.iframe_1080x720_gd600; + } else { + if (width == 640 && height == 368) { + DJILog.i(TAG, "Selected Iframe=iframe_640x368_wm620"); + iframeId = R.raw.iframe_640x368_wm620; + } + if (width == 608 && height == 448) { + DJILog.i(TAG, "Selected Iframe=iframe_608x448_wm620"); + iframeId = R.raw.iframe_608x448_wm620; + } else if (width == 720 && height == 480) { + DJILog.i(TAG, "Selected Iframe=iframe_720x480_wm620"); + iframeId = R.raw.iframe_720x480_wm620; + } else if (width == 1280 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1280x720_wm620"); + iframeId = R.raw.iframe_1280x720_wm620; + } else if (width == 1080 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1080x720_wm620"); + iframeId = R.raw.iframe_1080x720_wm620; + } else if (width == 1088 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1088x720_wm620"); + iframeId = R.raw.iframe_1088x720_wm620; + } else if (width == 960 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_960x720_wm620"); + iframeId = R.raw.iframe_960x720_wm620; + } else if (width == 1360 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1360x720_wm620"); + iframeId = R.raw.iframe_1360x720_wm620; + } else if (width == 1344 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1344x720_wm620"); + iframeId = R.raw.iframe_1344x720_wm620; + } else if (width == 1440 && height == 1088) { + DJILog.i(TAG, "Selected Iframe=iframe_1440x1088_wm620"); + iframeId = R.raw.iframe_1440x1088_wm620; + } else if (width == 1632 && height == 1080){ + DJILog.i(TAG, "Selected Iframe=iframe_1632x1080_wm620"); + iframeId = R.raw.iframe_1632x1080_wm620; + } else if (width == 1760 && height == 720) { + DJILog.i(TAG, "Selected Iframe=iframe_1760x720_wm620"); + iframeId = R.raw.iframe_1760x720_wm620; + } else if (width == 1920 && height == 800) { + DJILog.i(TAG, "Selected Iframe=iframe_1920x800_wm620"); + iframeId = R.raw.iframe_1920x800_wm620; + } else if (width == 1920 && height == 1024) { + DJILog.i(TAG, "Selected Iframe=iframe_1920x1024_wm620"); + iframeId = R.raw.iframe_1920x1024_wm620; + } else if (width == 1920 && height == 1088) { + DJILog.i(TAG, "Selected Iframe=iframe_1920x1080_wm620"); + iframeId = R.raw.iframe_1920x1088_wm620; + } else if (width == 1920 && height == 1440) { + DJILog.i(TAG, "Selected Iframe=iframe_1920x1440_wm620"); + iframeId = R.raw.iframe_1920x1440_wm620; + } + } + break; + case PHANTOM_4_PRO_V2: + case PHANTOM_4_RTK: { + iframeId = -1; + } + break; + default: //for P3P, Inspire1, etc/ + iframeId = R.raw.iframe_1280x720_ins; + break; + } + return iframeId; + } + + /** Get default black IDR frame. + * @param width Width of current video stream. + * @return IDR frame data + * @throws IOException + */ + private byte[] getDefaultKeyFrame(int width) throws IOException { + BaseProduct product = DJISDKManager.getInstance().getProduct(); + if (product == null || product.getModel() == null) { + return null; + } + int iframeId=getIframeRawId(product.getModel(), width); + if (iframeId >= 0){ + + InputStream inputStream = context.getResources().openRawResource(iframeId); + int length = inputStream.available(); + logd("iframeId length=" + length); + byte[] buffer = new byte[length]; + inputStream.read(buffer); + inputStream.close(); + + return buffer; + } + return null; + } + + + /** + * Initialize the hardware decoder. + */ + private void initCodec() { + if (width == 0 || height == 0) { + return; + } + if (codec != null) { + releaseCodec(); + } + loge("initVideoDecoder----------------------------------------------------------"); + loge("initVideoDecoder video width = " + width + " height = " + height); + // create the media format + MediaFormat format = MediaFormat.createVideoFormat(VIDEO_ENCODING_FORMAT, width, height); + if (surface == null) { + logd("initVideoDecoder: yuv output"); + // The surface is null, which means that the yuv data is needed, so the color format should + // be set to YUV420. + format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar); + } else { + logd("initVideoDecoder: display"); + // The surface is set, so the color format should be set to format surface. + format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface); + } + try { + // Create the codec instance. + codec = MediaCodec.createDecoderByType(VIDEO_ENCODING_FORMAT); + logd( "initVideoDecoder create: " + (codec == null)); + // Configure the codec. What should be noted here is that the hardware decoder would not output + // any yuv data if a surface is configured into, which mean that if you want the yuv frames, you + // should set "null" surface when calling the "configure" method of MediaCodec. + codec.configure(format, surface, null, 0); + logd( "initVideoDecoder configure"); + // codec.configure(format, null, null, 0); + if (codec == null) { + loge("Can't find video info!"); + return; + } + // Start the codec + codec.start(); + } catch (Exception e) { + loge("init codec failed, do it again: " + e); + e.printStackTrace(); + } + } + + private void startDataHandler() { + if (dataHandlerThread != null && dataHandlerThread.isAlive()) { + return; + } + dataHandlerThread = new HandlerThread("frame data handler thread"); + dataHandlerThread.start(); + dataHandler = new Handler(dataHandlerThread.getLooper()) { + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case MSG_INIT_CODEC: + try { + initCodec(); + } catch (Exception e) { + loge("init codec error: " + e.getMessage()); + e.printStackTrace(); + } + + removeCallbacksAndMessages(null); + sendEmptyMessageDelayed(MSG_DECODE_FRAME, 1); + break; + case MSG_FRAME_QUEUE_IN: + try { + onFrameQueueIn(msg); + } catch (Exception e) { + loge("queue in frame error: " + e); + e.printStackTrace(); + } + + if (!hasMessages(MSG_DECODE_FRAME)) { + sendEmptyMessage(MSG_DECODE_FRAME); + } + break; + case MSG_DECODE_FRAME: + try { + decodeFrame(); + } catch (Exception e) { + loge("handle frame error: " + e); + if (e instanceof MediaCodec.CodecException) { + } + e.printStackTrace(); + initCodec(); + }finally { + if (frameQueue.size() > 0) { + sendEmptyMessage(MSG_DECODE_FRAME); + } + } + break; + case MSG_YUV_DATA: + + break; + default: + break; + } + } + }; + } + + /** + * Stop the data processing thread + */ + private void stopDataHandler() { + if (dataHandlerThread == null || !dataHandlerThread.isAlive()) { + return; + } + if (dataHandler != null) { + dataHandler.removeCallbacksAndMessages(null); + } + if (Build.VERSION.SDK_INT >= 18) { + dataHandlerThread.quitSafely(); + } else { + dataHandlerThread.quit(); + } + + try { + dataHandlerThread.join(3000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + releaseCodec(); + dataHandler = null; + } + + /** + * Change the displaying surface of the decoder. What should be noted here is that the hardware decoder would not output + * any yuv data if a surface is configured into, which mean that if you want the yuv frames, you + * should set "null" surface when calling the "configure" method of MediaCodec. + * @param surface + */ + public void changeSurface(Surface surface) { + if (this.surface != surface) { + this.surface = surface; + if (dataHandler != null && !dataHandler.hasMessages(MSG_INIT_CODEC)) { + dataHandler.sendEmptyMessage(MSG_INIT_CODEC); + } + } + } + + /** + * Release and close the codec. + */ + private void releaseCodec() { + if (frameQueue!=null){ + frameQueue.clear(); + hasIFrameInQueue = false; + } + if (codec != null) { + try { + codec.flush(); + } catch (Exception e) { + loge("flush codec error: " + e.getMessage()); + } + + try { + codec.stop(); + codec.release(); + } catch (Exception e) { + loge("close codec error: " + e.getMessage()); + } finally { + codec = null; + } + } + } + + /** + * Queue in the frame. + * @param msg + */ + private void onFrameQueueIn(Message msg) { + DJIFrame inputFrame = (DJIFrame)msg.obj; + if (inputFrame == null) { + return; + } + if (!hasIFrameInQueue) { // check the I frame flag + if (inputFrame.frameNum !=1 && !inputFrame.isKeyFrame) { + loge("the timing for setting iframe has not yet come."); + return; + } + byte[] defaultKeyFrame = null; + try { + defaultKeyFrame = getDefaultKeyFrame(inputFrame.width); // Get I frame data + } catch (IOException e) { + loge("get default key frame error: " + e.getMessage()); + } + if (defaultKeyFrame != null) { + DJIFrame iFrame = new DJIFrame( + defaultKeyFrame, + defaultKeyFrame.length, + inputFrame.pts, + System.currentTimeMillis(), + inputFrame.isKeyFrame, + 0, + inputFrame.frameIndex - 1, + inputFrame.width, + inputFrame.height + ); + frameQueue.clear(); + frameQueue.offer(iFrame); // Queue in the I frame. + logd("add iframe success!!!!"); + hasIFrameInQueue = true; + } else if (inputFrame.isKeyFrame) { + logd("onFrameQueueIn no need add i frame!!!!"); + hasIFrameInQueue = true; + } else { + loge("input key frame failed"); + } + } + if (inputFrame.width!=0 && inputFrame.height != 0 && + (inputFrame.width != this.width || + inputFrame.height != this.height)) { + this.width = inputFrame.width; + this.height = inputFrame.height; + /* + * On some devices, the codec supports changing of resolution during the fly + * However, on some devices, that is not the case. + * So, reset the codec in order to fix this issue. + */ + loge("init decoder for the 1st time or when resolution changes"); + if (dataHandler != null && !dataHandler.hasMessages(MSG_INIT_CODEC)) { + dataHandler.sendEmptyMessage(MSG_INIT_CODEC); + } + } + // Queue in the input frame. + if (this.frameQueue.offer(inputFrame)){ + logd("put a frame into the Extended-Queue with index=" + inputFrame.frameIndex); + } else { + // If the queue is full, drop a frame. + DJIFrame dropFrame = frameQueue.poll(); + this.frameQueue.offer(inputFrame); + loge("Drop a frame with index=" + dropFrame.frameIndex+" and append a frame with index=" + inputFrame.frameIndex); + } + } + + /** + * Dequeue the frames from the queue and decode them using the hardware decoder. + * @throws Exception + */ + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + private void decodeFrame() throws Exception { + DJIFrame inputFrame = frameQueue.poll(); + MediaFormat format = MediaFormat.createVideoFormat(VIDEO_ENCODING_FORMAT, width, height); + if (inputFrame == null) { + return; + } + if (codec == null) { + if (dataHandler != null && !dataHandler.hasMessages(MSG_INIT_CODEC)) { + dataHandler.sendEmptyMessage(MSG_INIT_CODEC); + } + return; + } + + int inIndex = codec.dequeueInputBuffer(0); + + // Decode the frame using MediaCodec + if (inIndex >= 0) { + //Log.d(TAG, "decodeFrame: index=" + inIndex); + ByteBuffer buffer = codec.getInputBuffer(inIndex); + buffer.put(inputFrame.videoBuffer); + inputFrame.fedIntoCodecTime = System.currentTimeMillis(); + long queueingDelay = inputFrame.getQueueDelay(); + // Feed the frame data to the decoder. + codec.queueInputBuffer(inIndex, 0, inputFrame.size, inputFrame.pts, 0); + + // Get the output data from the decoder. + int outIndex = codec.dequeueOutputBuffer(bufferInfo, 0); + + if (outIndex >= 0) { + //Log.d(TAG, "decodeFrame: outIndex: " + outIndex); + if (surface == null && yuvDataListener != null) { + // If the surface is null, the yuv data should be get from the buffer and invoke the callback. + logd("decodeFrame: need callback"); + ByteBuffer yuvDataBuf = codec.getOutputBuffer(outIndex); + yuvDataBuf.position(bufferInfo.offset); + yuvDataBuf.limit(bufferInfo.size - bufferInfo.offset); + if (yuvDataListener != null) { +// yuvDataListener.onYuvDataReceived(yuvDataBuf, bufferInfo.size - bufferInfo.offset, width, height); + yuvDataListener.onYuvDataReceived(format, yuvDataBuf, bufferInfo.size - bufferInfo.offset, width, height); + } + } + // All the output buffer must be release no matter whether the yuv data is output or + // not, so that the codec can reuse the buffer. + codec.releaseOutputBuffer(outIndex, true); + } else if (outIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { + // The output buffer set is changed. So the decoder should be reinitialized and the + // output buffers should be retrieved. + long curTime = System.currentTimeMillis(); + bufferChangedQueue.addLast(curTime); + if (bufferChangedQueue.size() >= 10) { + long headTime = bufferChangedQueue.pollFirst(); + if (curTime - headTime < 1000) { + // reset decoder + loge("Reset decoder. Get INFO_OUTPUT_BUFFERS_CHANGED more than 10 times within a second."); + bufferChangedQueue.clear(); + dataHandler.removeCallbacksAndMessages(null); + dataHandler.sendEmptyMessage(MSG_INIT_CODEC); + return; + } + } + } else if (outIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { + loge("format changed, color: " + codec.getOutputFormat().getInteger(MediaFormat.KEY_COLOR_FORMAT)); + } + }else { + codec.flush(); + } + } + + /** + * Stop the decoding process. + */ + public void stop() { + if (dataHandler != null) { + dataHandler.removeCallbacksAndMessages(null); + } + + if (frameQueue!=null){ + frameQueue.clear(); + hasIFrameInQueue = false; + } + if (codec != null) { + try { + codec.flush(); + } catch (IllegalStateException e) { + } + } + stopDataHandler(); + } + + public void resume() { + startDataHandler(); + } + + public void destroy() { + } + + @Override + public void onDataRecv(byte[] data, int size, int frameNum, boolean isKeyFrame, int width, int height) { + if (dataHandler == null || dataHandlerThread == null || !dataHandlerThread.isAlive()) { + return; + } + if (data.length != size) { + loge( "recv data size: " + size + ", data lenght: " + data.length); + } else { + logd( "recv data size: " + size + ", frameNum: "+frameNum+", isKeyframe: "+isKeyFrame+"," + + " width: "+width+", height: " + height); + currentTime = System.currentTimeMillis(); + frameIndex ++; + DJIFrame newFrame = new DJIFrame(data, size, currentTime, currentTime, isKeyFrame, + frameNum, frameIndex, width, height); + dataHandler.obtainMessage(MSG_FRAME_QUEUE_IN, newFrame).sendToTarget(); + + } + } +} \ No newline at end of file diff --git a/app/src/main/java/sq/rogue/rosettadrone/video/H264Packetizer.java b/app/src/main/java/sq/rogue/rosettadrone/video/H264Packetizer.java index 9618e9e..130d8bf 100755 --- a/app/src/main/java/sq/rogue/rosettadrone/video/H264Packetizer.java +++ b/app/src/main/java/sq/rogue/rosettadrone/video/H264Packetizer.java @@ -51,7 +51,7 @@ public H264Packetizer() { super(); socket.setClockFrequency(90000); try { - socket.setDestination(InetAddress.getByName("127.0.0.1"), 5601, 5000); + socket.setDestination(InetAddress.getByName("192.168.1.124"), 5600, 5000); Log.d(TAG, "socket address configured"); } catch (IOException e) { Log.d(TAG, "error setting socket", e); @@ -191,6 +191,8 @@ private void send() throws IOException, InterruptedException { socket.updateTimestamp(ts); System.arraycopy(stapa, 0, buffer, rtphl, stapa.length); super.send(rtphl + stapa.length); + // Log.e(TAG,"----- NAL unit - len:"+len+" delay: "+delay); + } //Log.d(TAG,"- Nal unit length: " + naluLength + " delay: "+delay/1000000+" type: "+type); @@ -203,7 +205,7 @@ private void send() throws IOException, InterruptedException { socket.updateTimestamp(ts); socket.markNextPacket(); super.send(naluLength + rtphl); - //Log.d(TAG,"----- Single NAL unit - len:"+len+" delay: "+delay); + // Log.e(TAG,"----- Single NAL unit - len:"+len+" delay: "+delay); } // Large NAL unit => Split nal unit else { @@ -232,7 +234,7 @@ private void send() throws IOException, InterruptedException { super.send(len + rtphl + 2); // Switch start bit header[1] = (byte) (header[1] & 0x7F); - //Log.d(TAG,"----- FU-A unit, sum:"+sum); + // Log.e(TAG,"----- FU-A unit, sum:"+sum); } } } diff --git a/app/src/main/java/sq/rogue/rosettadrone/video/RtpSocket.java b/app/src/main/java/sq/rogue/rosettadrone/video/RtpSocket.java index 5f0052d..6f950ee 100755 --- a/app/src/main/java/sq/rogue/rosettadrone/video/RtpSocket.java +++ b/app/src/main/java/sq/rogue/rosettadrone/video/RtpSocket.java @@ -24,8 +24,10 @@ import java.io.IOException; import java.io.OutputStream; import java.net.DatagramPacket; +import java.net.DatagramSocket; import java.net.InetAddress; import java.net.MulticastSocket; +import java.net.SocketException; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; @@ -52,6 +54,7 @@ public class RtpSocket implements Runnable { public static final int RTP_HEADER_LENGTH = 12; public static final int MTU = 1300; public MulticastSocket mSocket; + public DatagramSocket mSocketUDP; protected OutputStream mOutputStream = null; private DatagramPacket[] mPackets; private byte[][] mBuffers; @@ -84,6 +87,12 @@ public RtpSocket() { mTransport = TRANSPORT_UDP; mTcpHeader = new byte[]{'$', 0, 0, 0}; + try { + mSocketUDP = new DatagramSocket(); + } catch (SocketException e) { + Log.e(TAG, "Error creating Gstreamer datagram socket", e); + } + resetFifo(); for (int i = 0; i < mBufferCount; i++) { @@ -136,6 +145,7 @@ private void resetFifo() { */ public void close() { mSocket.close(); + mSocketUDP.close(); } /** @@ -184,6 +194,7 @@ public void setDestination(InetAddress dest, int dport, int rtcpPort) { if (dport != 0 && rtcpPort != 0) { mTransport = TRANSPORT_UDP; mPort = dport; + Log.d(TAG, "setDestination: " +dest +":"+dport ); for (int i = 0; i < mBufferCount; i++) { mPackets[i].setPort(dport); mPackets[i].setAddress(dest); @@ -212,7 +223,8 @@ public int getPort() { public int[] getLocalPorts() { return new int[]{ - mSocket.getLocalPort(), + mSocketUDP.getLocalPort(), +// mSocket.getLocalPort(), //mReport.getLocalPort() }; @@ -328,7 +340,9 @@ public void run() { mOldTimestamp = mTimestamps[mBufferOut]; if (mCount++ > 30) { if (mTransport == TRANSPORT_UDP) { - mSocket.send(mPackets[mBufferOut]); + // Log.e(TAG,"sening..."); + mSocketUDP.send(mPackets[mBufferOut]); +// mSocket.send(mPackets[mBufferOut]); } else { sendTCP(); } diff --git a/app/src/main/java/sq/rogue/rosettadrone/video/VideoService.java b/app/src/main/java/sq/rogue/rosettadrone/video/VideoService.java index 9d6ce30..d92aa6a 100644 --- a/app/src/main/java/sq/rogue/rosettadrone/video/VideoService.java +++ b/app/src/main/java/sq/rogue/rosettadrone/video/VideoService.java @@ -12,9 +12,9 @@ import android.os.Handler; import android.os.IBinder; import android.preference.PreferenceManager; -import android.support.annotation.Nullable; -import android.support.annotation.RequiresApi; -import android.support.v4.app.NotificationCompat; +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; +import androidx.core.app.NotificationCompat; import android.util.Log; import org.freedesktop.gstreamer.GStreamer; @@ -31,7 +31,7 @@ import dji.sdk.camera.VideoFeeder; import sq.rogue.rosettadrone.R; -import static android.support.v4.app.NotificationCompat.PRIORITY_MIN; +import static androidx.core.app.NotificationCompat.PRIORITY_MIN; public class VideoService extends Service implements NativeHelper.NativeDataListener { @@ -53,7 +53,7 @@ public class VideoService extends Service implements NativeHelper.NativeDataList protected H264Packetizer mPacketizer; private Handler handler; - protected VideoFeeder.VideoDataCallback mReceivedVideoDataCallBack = null; + protected VideoFeeder.VideoDataListener mReceivedVideoDataCallBack = null; protected Model mModel; protected SharedPreferences sharedPreferences; protected Thread thread; @@ -62,19 +62,14 @@ public class VideoService extends Service implements NativeHelper.NativeDataList private DatagramSocket mGstSocket; private boolean mGstEnabled = true; private long native_custom_data; // Native code will use this to keep private data + private VideoFeeder.VideoFeed standardVideoFeeder; private static native boolean nativeClassInit(); // Initialize native class: cache Method IDs for callbacks - private native void nativeInit(String ip, int port, int bitrate, int encodeSpeed); // Initialize native code, build pipeline, etc - private native void nativeFinalize(); // Destroy pipeline and shutdown native code - private native void nativePlay(); // Set pipeline to PLAYING - private native void nativePause(); // Set pipeline to PAUSED - private native void nativeSetDestination(String ip, int port); - private native void nativeSetBitrate(int bitrate); @Override @@ -200,7 +195,7 @@ public void setActionDroneConnected() { initVideoStreamDecoder(); initPacketizer(); - mReceivedVideoDataCallBack = new VideoFeeder.VideoDataCallback() { + mReceivedVideoDataCallBack = new VideoFeeder.VideoDataListener() { @Override public void onReceive(byte[] videoBuffer, int size) { @@ -208,9 +203,14 @@ public void onReceive(byte[] videoBuffer, int size) { } }; - if (VideoFeeder.getInstance() != null) { - mVideoFeed = VideoFeeder.getInstance().getPrimaryVideoFeed(); - mVideoFeed.setCallback(mReceivedVideoDataCallBack); + //to receive the transcoded video feed from main camera. + if (isTranscodedVideoFeedNeeded()) { + standardVideoFeeder = VideoFeeder.getInstance().provideTranscodedVideoFeed(); + standardVideoFeeder.addVideoDataListener(mReceivedVideoDataCallBack); + return; + } + if (VideoFeeder.getInstance().getPrimaryVideoFeed() != null) { + VideoFeeder.getInstance().getPrimaryVideoFeed().addVideoDataListener(mReceivedVideoDataCallBack); } @@ -283,7 +283,7 @@ private void initPacketizer() { int videoBitrate = Integer.parseInt(sharedPreferences.getString("pref_video_bitrate", "2000")); int encodeSpeed = Integer.parseInt((sharedPreferences.getString("pref_encode_speed", "2"))); - + Log.e(TAG, "mGstEnabled: "+ mGstEnabled); if (mGstEnabled) { try { nativeInit(videoIPString, videoPort, videoBitrate, encodeSpeed); @@ -304,7 +304,6 @@ private void initPacketizer() { } } - } public boolean isRunning() { @@ -372,4 +371,14 @@ protected void sendNAL(byte[] buffer) { mPacketizer.run(); } } + + private boolean isTranscodedVideoFeedNeeded() { + if (VideoFeeder.getInstance() == null) { + return false; + } + + return VideoFeeder.getInstance().isFetchKeyFrameNeeded() || VideoFeeder.getInstance() + .isLensDistortionCalibrationNeeded(); + } + } diff --git a/app/src/main/res/.DS_Store b/app/src/main/res/.DS_Store new file mode 100644 index 0000000..c52e67d Binary files /dev/null and b/app/src/main/res/.DS_Store differ diff --git a/app/src/main/res/drawable-xhdpi/back_button_disable.png b/app/src/main/res/drawable-xhdpi/back_button_disable.png new file mode 100755 index 0000000..288b55f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/back_button_disable.png differ diff --git a/app/src/main/res/drawable-xhdpi/back_button_normal.png b/app/src/main/res/drawable-xhdpi/back_button_normal.png new file mode 100755 index 0000000..455b588 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/back_button_normal.png differ diff --git a/app/src/main/res/drawable-xhdpi/back_button_press.png b/app/src/main/res/drawable-xhdpi/back_button_press.png new file mode 100755 index 0000000..5b0cee8 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/back_button_press.png differ diff --git a/app/src/main/res/drawable-xhdpi/playvideo.png b/app/src/main/res/drawable-xhdpi/playvideo.png new file mode 100755 index 0000000..a7e8403 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/playvideo.png differ diff --git a/app/src/main/res/drawable-xhdpi/round_btn.xml b/app/src/main/res/drawable-xhdpi/round_btn.xml new file mode 100755 index 0000000..afce083 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/round_btn.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/round_btn_disable.xml b/app/src/main/res/drawable-xhdpi/round_btn_disable.xml new file mode 100755 index 0000000..0ece78d --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/round_btn_disable.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/round_btn_normal.xml b/app/src/main/res/drawable-xhdpi/round_btn_normal.xml new file mode 100755 index 0000000..51f68bc --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/round_btn_normal.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/round_btn_pressed.xml b/app/src/main/res/drawable-xhdpi/round_btn_pressed.xml new file mode 100755 index 0000000..0b1d3ef --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/round_btn_pressed.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/selector_back_button.xml b/app/src/main/res/drawable-xhdpi/selector_back_button.xml new file mode 100755 index 0000000..6ca1084 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/selector_back_button.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_connection.xml b/app/src/main/res/layout-land/activity_connection.xml new file mode 100644 index 0000000..d68845d --- /dev/null +++ b/app/src/main/res/layout-land/activity_connection.xml @@ -0,0 +1,141 @@ + + + + + + + + + + +