Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7531f7a
Merge pull request #61 from 3drobotics/release-1.5.2
m4gr3d Mar 8, 2016
4f965d9
Merge pull request #378 from dronekit/release-1.5.2
m4gr3d Mar 8, 2016
b3ab758
Merge branch 'develop' of github.com:dronekit/dronekit-android into u…
m4gr3d Mar 8, 2016
1b6d327
Update client library dependencies to fix travis build issues
m4gr3d Mar 8, 2016
5be162e
Merge pull request #68 from 3drobotics/upstream_sync
m4gr3d Mar 8, 2016
bc98385
Disable stream rates update for solo
m4gr3d Mar 10, 2016
cd79db6
Fix the issue causing follow exit on follow mode switch
m4gr3d Mar 13, 2016
1186254
Add method to the VehicleApi to update the vehicle data stream rate.
m4gr3d Mar 13, 2016
0191c7f
Merge branches 'disable_stream_rate_update_for_solo' and 'fix_issue_w…
m4gr3d Mar 14, 2016
8643cf1
Add support for look at functionality (set the roi programmatically)
m4gr3d Mar 17, 2016
080c7dd
Bump client library version
m4gr3d Mar 17, 2016
22f3236
Update documentation for the `VehicleApi#updateVehicleDataStreamRate(…
m4gr3d Mar 18, 2016
0a98305
Merge pull request #70 from 3drobotics/disable_stream_rate_update_for…
Mar 18, 2016
24c1b36
Merge branches 'develop' and 'fix_issue_with_follow_mode_switch' of g…
m4gr3d Mar 18, 2016
7a9d3fa
Added tlv pause packet. Added docs for other sitescan messages
Mar 21, 2016
8062f60
Update docs to match ShotManager
Mar 21, 2016
2a648fa
Merge pull request #71 from 3drobotics/pause_tlv_msg
m4gr3d Mar 21, 2016
e63d716
Merge pull request #69 from 3drobotics/fix_issue_with_follow_mode_switch
Mar 21, 2016
7c700cc
Bump version for release 1.5.3
m4gr3d Mar 24, 2016
c23e5a9
Updated to alpha2
Mar 24, 2016
b658c23
Merge branch 'develop' of github.com:3drobotics/dronekit-android-dev …
m4gr3d Mar 25, 2016
adb4db5
Update gradle build dependency for the client library to fix compilat…
m4gr3d Mar 27, 2016
204cb06
Fix connection bug on nexus devices when switching from home wifi to …
m4gr3d Mar 29, 2016
5e0975a
Fix the sensors size for the s110 s120 canon camera
m4gr3d Mar 29, 2016
e6e2eb8
Merge pull request #384 from dronekit/fix_connection_issue
m4gr3d Mar 29, 2016
cd85fb1
Merge pull request #385 from dronekit/fix_s100_s110_sensors_size
m4gr3d Mar 29, 2016
ca0f1a1
Bump version for beta 1
m4gr3d Mar 29, 2016
af51a77
Merge pull request #386 from dronekit/release-1.5.3-beta1
m4gr3d Mar 29, 2016
3468190
Added new follow preferences
Mar 30, 2016
de57ee7
Merge pull request #388 from chaviw/add_follow_modes
m4gr3d Mar 30, 2016
583037e
Updated library and service version
Mar 30, 2016
6b86100
Merge pull request #389 from chaviw/version_bump
m4gr3d Mar 30, 2016
0764286
Fixed copy dir for mavlink jar
Mar 31, 2016
dd7814a
Reverted change so debug and release compile different mavlink files
Apr 1, 2016
a3f59cb
bumped client lib version to 2.9.0.alpha4
Apr 1, 2016
4dee1ca
Merge pull request #390 from chaviw/mavlink_jar_fix
m4gr3d Apr 1, 2016
16d576c
Fix issue preventing restore of the original home location when disab…
m4gr3d Apr 1, 2016
3f9e53f
Merge pull request #391 from dronekit/fix_return_to_me
m4gr3d Apr 1, 2016
d249da7
Bump version numbers for beta 3
m4gr3d Apr 1, 2016
a05a361
Only send brake command for non-Solo shot follow
phmagic Apr 4, 2016
d7be13f
Merge pull request #394 from phmagic/solo_follow_shot_update
m4gr3d Apr 4, 2016
820e4e6
Merge pull request #392 from dronekit/release-1.5.3-beta3
m4gr3d Apr 4, 2016
7c10a36
Bump version for beta 4
m4gr3d Apr 4, 2016
be33648
Add plugin to evaluate project method counts
m4gr3d Apr 8, 2016
118b999
Merge pull request #395 from dronekit/release-1.5.3-beta4
m4gr3d Apr 8, 2016
abb55d3
Bump version for the client library
m4gr3d Apr 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ClientLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apply plugin: 'com.android.library'

ext {
VERSION_MAJOR = 2
VERSION_MINOR = 8
VERSION_PATCH = 1
VERSION_MINOR = 9
VERSION_PATCH = 0
VERSION_SUFFIX = "release"

PUBLISH_ARTIFACT_ID = 'dronekit-android'
Expand Down Expand Up @@ -58,8 +58,8 @@ dependencies {
compile "com.android.support:support-v4:${support_lib_version}"
compile "com.google.android.gms:play-services-base:${play_services_version}"

compile project(':Mavlink')
compile files('libs/Mavlink.jar')
debugCompile project(':Mavlink')
releaseCompile files('libs/Mavlink.jar')
}

assemble.dependsOn ':Mavlink:jar'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@

import com.o3dr.android.client.Drone;
import com.o3dr.services.android.lib.coordinate.LatLong;
import com.o3dr.services.android.lib.drone.attribute.AttributeType;
import com.o3dr.services.android.lib.coordinate.LatLongAlt;
import com.o3dr.services.android.lib.drone.attribute.error.CommandExecutionError;
import com.o3dr.services.android.lib.drone.property.Gps;
import com.o3dr.services.android.lib.model.AbstractCommandListener;
import com.o3dr.services.android.lib.model.action.Action;

import java.util.concurrent.ConcurrentHashMap;

import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_DO_GUIDED_TAKEOFF;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_ENABLE_MANUAL_CONTROL;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_LOOK_AT_TARGET;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SEND_BRAKE_VEHICLE;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SEND_GUIDED_POINT;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SET_CONDITION_YAW;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SET_GUIDED_ALTITUDE;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SET_VELOCITY;
import static com.o3dr.services.android.lib.drone.action.ControlActions.ACTION_SEND_BRAKE_VEHICLE;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_ALTITUDE;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_DO_ENABLE;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_FORCE_GUIDED_POINT;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_GUIDED_POINT;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_LOOK_AT_TARGET;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_VELOCITY_X;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_VELOCITY_Y;
import static com.o3dr.services.android.lib.drone.action.ControlActions.EXTRA_VELOCITY_Z;
Expand Down Expand Up @@ -99,6 +100,21 @@ public void goTo(LatLong point, boolean force, AbstractCommandListener listener)
drone.performAsyncActionOnDroneThread(new Action(ACTION_SEND_GUIDED_POINT, params), listener);
}

/**
* Instructs the vehicle to orient toward the specified location
*
* @param point
* @param force
* @param listener
* @since 2.9.0
*/
public void lookAt(LatLongAlt point, boolean force, AbstractCommandListener listener){
Bundle params = new Bundle();
params.putBoolean(EXTRA_FORCE_GUIDED_POINT, force);
params.putParcelable(EXTRA_LOOK_AT_TARGET, point);
drone.performAsyncActionOnDroneThread(new Action(ACTION_LOOK_AT_TARGET, params), listener);
}

/**
* Instructs the vehicle to climb to the specified altitude.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
import static com.o3dr.services.android.lib.drone.action.StateActions.ACTION_ENABLE_RETURN_TO_ME;
import static com.o3dr.services.android.lib.drone.action.StateActions.ACTION_SET_VEHICLE_HOME;
import static com.o3dr.services.android.lib.drone.action.StateActions.ACTION_SET_VEHICLE_MODE;
import static com.o3dr.services.android.lib.drone.action.StateActions.ACTION_UPDATE_VEHICLE_DATA_STREAM_RATE;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_ARM;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_EMERGENCY_DISARM;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_IS_RETURN_TO_ME_ENABLED;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_VEHICLE_DATA_STREAM_RATE;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_VEHICLE_HOME_LOCATION;
import static com.o3dr.services.android.lib.drone.action.StateActions.EXTRA_VEHICLE_MODE;

Expand Down Expand Up @@ -245,4 +247,20 @@ public void enableReturnToMe(boolean isEnabled, final AbstractCommandListener li
params.putBoolean(EXTRA_IS_RETURN_TO_ME_ENABLED, isEnabled);
drone.performAsyncActionOnDroneThread(new Action(ACTION_ENABLE_RETURN_TO_ME, params), listener);
}

/**
* Update the vehicle data stream rate.
*
* Note: This is ineffective for Solo vehicles since their data stream rate is handled
* by the onboard companion computer.
*
* @param rate The new data stream rate
* @param listener Register a callback to receive update of the command execution state
* @since 2.9.0
*/
public void updateVehicleDataStreamRate(int rate, final AbstractCommandListener listener){
Bundle params = new Bundle();
params.putInt(EXTRA_VEHICLE_DATA_STREAM_RATE, rate);
drone.performAsyncActionOnDroneThread(new Action(ACTION_UPDATE_VEHICLE_DATA_STREAM_RATE, params), listener);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public class ControlActions {

public static final String EXTRA_DO_ENABLE = "extra_do_enable";

public static final String ACTION_LOOK_AT_TARGET = PACKAGE_NAME + ".action.LOOK_AT_TARGET";

/**
* Geo coordinate to orient the vehicle to
*/
public static final String EXTRA_LOOK_AT_TARGET = "extra_look_at_target";

//Private to prevent instantiation
private ControlActions(){}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
public class StateActions {

private static final String PACKAGE_NAME = "com.o3dr.services.android.lib.drone.action.state";

public static final String ACTION_ARM = Utils.PACKAGE_NAME + ".action.ARM";
public static final String EXTRA_ARM = "extra_arm";
public static final String EXTRA_EMERGENCY_DISARM = "extra_emergency_disarm";
Expand All @@ -20,6 +22,9 @@ public class StateActions {
public static final String ACTION_ENABLE_RETURN_TO_ME = Utils.PACKAGE_NAME + ".action.ENABLE_RETURN_TO_ME";
public static final String EXTRA_IS_RETURN_TO_ME_ENABLED = "extra_is_return_to_me_enabled";

public static final String ACTION_UPDATE_VEHICLE_DATA_STREAM_RATE = PACKAGE_NAME + ".action.UPDATE_VEHICLE_DATA_STREAM_RATE";
public static final String EXTRA_VEHICLE_DATA_STREAM_RATE = "extra_vehicle_data_stream_rate";

//Private to prevent instantiation
private StateActions(){}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,11 @@ public SoloFollowOptions[] newArray(int size) {
return new SoloFollowOptions[size];
}
};

@Override
public String toString() {
return "SoloFollowOptions{" +
"lookAt=" + lookAt +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.o3dr.services.android.lib.drone.companion.solo.tlv;

import android.os.Parcel;
import android.support.annotation.IntDef;

import java.nio.ByteBuffer;

Expand All @@ -9,70 +10,64 @@
*/
public class SoloFollowOptionsV2 extends SoloFollowOptions {

private static final int FREE_LOOK_ENABLED_VALUE = 1;
private static final int FREE_LOOK_DISABLED_VALUE = 0;
@IntDef ({
FOLLOW_PREFERENCE_NONE,
FOLLOW_PREFERENCE_ORBIT,
FOLLOW_PREFERENCE_FREE_LOOK,
FOLLOW_PREFERENCE_LEASH
})
public @interface FollowPreference{}

private boolean freeLook;
public static final int FOLLOW_PREFERENCE_NONE = -1;
public static final int FOLLOW_PREFERENCE_ORBIT = 0;
public static final int FOLLOW_PREFERENCE_FREE_LOOK = 1;
public static final int FOLLOW_PREFERENCE_LEASH = 2;

@FollowPreference
private int followPreference;

public SoloFollowOptionsV2() {
this(PAUSED_CRUISE_SPEED, true, false);
this(PAUSED_CRUISE_SPEED, true, FOLLOW_PREFERENCE_NONE);
}

public SoloFollowOptionsV2(float cruiseSpeed, boolean lookAt, boolean freeLook){
public SoloFollowOptionsV2(float cruiseSpeed, boolean lookAt, @FollowPreference int followPreference) {
super(TLVMessageTypes.TYPE_SOLO_FOLLOW_OPTIONS_V2, 12, cruiseSpeed, lookAt);
this.freeLook = freeLook;
this.followPreference = followPreference;
}

SoloFollowOptionsV2(float cruiseSpeed, int lookAtValue, int freeLookValue){
this(cruiseSpeed, lookAtValue == LOOK_AT_ENABLED_VALUE, freeLookValue == FREE_LOOK_ENABLED_VALUE);
SoloFollowOptionsV2(float cruiseSpeed, int lookAtValue, int followPreference) {
this(cruiseSpeed, lookAtValue == LOOK_AT_ENABLED_VALUE, followPreference);
}

SoloFollowOptionsV2(ByteBuffer buffer){
SoloFollowOptionsV2(ByteBuffer buffer) {
this(buffer.getFloat(), buffer.getInt(), buffer.getInt());
}

public boolean isFreeLook() {
return freeLook;
}

public void setFreeLook(boolean freeLook) {
this.freeLook = freeLook;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof SoloFollowOptionsV2)) return false;
if (!super.equals(o)) return false;

SoloFollowOptionsV2 that = (SoloFollowOptionsV2) o;

return freeLook == that.freeLook;

@FollowPreference
public int getFollowPreference() {
return followPreference;
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (freeLook ? FREE_LOOK_ENABLED_VALUE : FREE_LOOK_DISABLED_VALUE);
return result;
public void setFollowPreference(@FollowPreference int followPreference) {
this.followPreference = followPreference;
}

@Override
protected void getMessageValue(ByteBuffer valueCarrier){
protected void getMessageValue(ByteBuffer valueCarrier) {
super.getMessageValue(valueCarrier);
valueCarrier.putInt(freeLook ? FREE_LOOK_ENABLED_VALUE : FREE_LOOK_DISABLED_VALUE);
valueCarrier.putInt(followPreference);
}

@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeByte(freeLook ? (byte) FREE_LOOK_ENABLED_VALUE : (byte) FREE_LOOK_DISABLED_VALUE);
dest.writeInt(followPreference);
}

protected SoloFollowOptionsV2(Parcel in) {
super(in);
this.freeLook = in.readByte() != FREE_LOOK_DISABLED_VALUE;
@FollowPreference int followPreference = in.readInt();
this.followPreference = followPreference;
}

public static final Creator<SoloFollowOptionsV2> CREATOR = new Creator<SoloFollowOptionsV2>() {
Expand All @@ -84,4 +79,36 @@ public SoloFollowOptionsV2[] newArray(int size) {
return new SoloFollowOptionsV2[size];
}
};

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}

SoloFollowOptionsV2 that = (SoloFollowOptionsV2) o;

return followPreference == that.followPreference;

}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + followPreference;
return result;
}

@Override
public String toString() {
return "SoloFollowOptionsV2{" +
"followPreference=" + followPreference +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.o3dr.services.android.lib.drone.companion.solo.tlv;

import android.os.Parcel;

import java.nio.ByteBuffer;

/**
* Used by ShotManager or app to transmit a pause request.
*/
public class SoloPause extends TLVPacket {

public SoloPause() {
super(TLVMessageTypes.TYPE_SOLO_PAUSE_BUTTON, 0);
}

@Override
protected void getMessageValue(ByteBuffer valueCarrier) {
}

@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
}

protected SoloPause(Parcel in) {
super(in);
}

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

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

@Override
public String toString() {
return "SoloPause{}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_MESSAGE_RECORD_POSITION;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_MESSAGE_SET_CURRENT_SHOT;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_MESSAGE_SHOT_MANAGER_ERROR;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_PAUSE_BUTTON;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_SCAN_START;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_SET_BUTTON_SETTING;
import static com.o3dr.services.android.lib.drone.companion.solo.tlv.TLVMessageTypes.TYPE_SOLO_SHOT_ERROR;
Expand Down Expand Up @@ -304,6 +305,11 @@ public static List<TLVPacket> parseTLVPacket(ByteBuffer packetBuffer) {
break;
}

case TYPE_SOLO_PAUSE_BUTTON:{
packet = new SoloPause();
break;
}

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class TLVMessageTypes {
public static final int TYPE_SOLO_CABLE_CAM_OPTIONS = 4;
public static final int TYPE_SOLO_GET_BUTTON_SETTING = 5;
public static final int TYPE_SOLO_SET_BUTTON_SETTING = 6;
public static final int TYPE_SOLO_PAUSE_BUTTON = 7;

public static final int TYPE_SOLO_FOLLOW_OPTIONS = 19;
public static final int TYPE_SOLO_FOLLOW_OPTIONS_V2 = 119;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
import java.nio.ByteBuffer;

/**
* Created by chavi on 12/9/15.
* Sent by the app to ShotManager to instruct Solo to actuate gimbal to desired orientation.
*/
public class SoloInspectMoveGimbal extends TLVPacket {
/**
* Body-relative pitch in degrees (0 to -90)
*/
private float pitch;
/**
* Body-relative roll in degrees
*/
private float roll;
/**
* Earth frame Yaw (heading) in degrees (0 to 360)
*/
private float yaw;

public SoloInspectMoveGimbal(float pitch, float roll, float yaw) {
Expand Down
Loading