Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurbenemann committed Nov 3, 2014
2 parents f8bde99 + 5663448 commit c6c6c54
Show file tree
Hide file tree
Showing 23 changed files with 551 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.droidplanner"
android:versionCode="107"
android:versionCode="108"
android:versionName="please run version.sh to get the version name">

<uses-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<TextView
style="@style/ModeDetailText"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/mode_desc_rectangle"
android:padding="12dp"
Expand Down
84 changes: 84 additions & 0 deletions Android/res/layout/fragment_editor_detail_epm_grabber.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/missionItemDetailLayout" >

<org.droidplanner.android.widgets.spinners.SpinnerSelfSelect
android:id="@+id/spinnerWaypointType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:entries="@array/ExampleWaypointType" />

<RelativeLayout
android:id="@+id/title_rect"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_alignParentTop="true"
android:background="@drawable/wp_title_rectangle" >

<TextView
android:id="@+id/WaypointIndex"
style="@style/largeMissionDetailText"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
tools:text="22" />

<View
android:id="@+id/title_div"
android:layout_width="1dp"
android:layout_height="54dp"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/WaypointIndex"
android:background="@drawable/wp_title_div" />

<RelativeLayout
android:id="@+id/title_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/title_div"
android:orientation="vertical" >

<TextView
android:id="@+id/WaypointType"
style="@style/missionHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:text="@string/waypointType_EPM" />

<TextView
android:id="@+id/DistanceLabel"
style="@style/missionHeaderlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/WaypointType"
android:layout_below="@id/WaypointType" />
</RelativeLayout>
</RelativeLayout>

<ImageView
android:id="@+id/menuHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/title_rect"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:src="@drawable/ic_menu_hint"
tools:ignore="ContentDescription" />


<TextView
style="@style/ModeDetailText"
android:layout_width="match_parent"
android:layout_below="@id/title_rect"
android:layout_height="wrap_content"
android:background="@drawable/mode_desc_rectangle"
android:padding="12dp"
android:text="@string/waypointInfo_EpmGrabber" />

</RelativeLayout>
117 changes: 117 additions & 0 deletions Android/res/layout/fragment_editor_detail_set_servo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/missionItemDetailLayout" >

<org.droidplanner.android.widgets.spinners.SpinnerSelfSelect
android:id="@+id/spinnerWaypointType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:entries="@array/ExampleWaypointType" />

<RelativeLayout
android:id="@+id/title_rect"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_alignParentTop="true"
android:background="@drawable/wp_title_rectangle" >

<TextView
android:id="@+id/WaypointIndex"
style="@style/largeMissionDetailText"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
tools:text="22" />

<View
android:id="@+id/title_div"
android:layout_width="1dp"
android:layout_height="54dp"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/WaypointIndex"
android:background="@drawable/wp_title_div" />

<RelativeLayout
android:id="@+id/title_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/title_div"
android:orientation="vertical" >

<TextView
android:id="@+id/WaypointType"
style="@style/missionHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:text="@string/waypointType_Set_Servo" />

<TextView
android:id="@+id/DistanceLabel"
style="@style/missionHeaderlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/WaypointType"
android:layout_below="@id/WaypointType" />
</RelativeLayout>
</RelativeLayout>

<ImageView
android:id="@+id/menuHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/title_rect"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:src="@drawable/ic_menu_hint"
tools:ignore="ContentDescription" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title_rect"
android:orientation="vertical"
android:paddingBottom="5dp" >

<TextView
style="@style/ModeDetailText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/mode_desc_rectangle"
android:padding="12dp"
android:text="@string/waypointInfo_SetServo" />

<org.droidplanner.android.widgets.spinnerWheel.CardWheelHorizontalView
android:id="@+id/picker1"
style="@style/missionItemDetailCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:text="@string/channel_label" />

<TextView
style="@style/ModeDetailText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/pwm"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/PwmEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:imeOptions="actionDone"
android:paddingLeft="16dp"
android:paddingRight="16dp"
/>

</LinearLayout>

</RelativeLayout>
21 changes: 1 addition & 20 deletions Android/res/layout/fragment_editor_detail_survey.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,10 @@
android:layout_toRightOf="@id/staticText"
android:entries="@array/ExampleCameraArray" />

<CheckBox
android:id="@+id/checkBoxInnerWPs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/cameraFileSpinner"
android:text="@string/inner_wps"
android:visibility="gone" />

<CheckBox
android:id="@+id/CheckBoxFootprints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="false"
android:layout_below="@id/cameraFileSpinner"
android:layout_toRightOf="@id/checkBoxInnerWPs"
android:text="@string/footprint"
android:visibility="gone" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/checkBoxInnerWPs"
android:layout_below="@id/cameraFileSpinner"
android:orientation="vertical" >

<HorizontalScrollView
Expand Down
13 changes: 13 additions & 0 deletions Android/res/menu/menu_super_activiy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
android:id="@+id/menu_load_mission"
android:showAsAction="never"
android:title="@string/load_mission"/>

<item
android:id="@+id/menu_triggerCamera"
android:showAsAction="never"
android:title="Picture"/>
<item
android:id="@+id/menu_epm_release"
android:showAsAction="never"
android:title="Release"/>
<item
android:id="@+id/menu_epm_grab"
android:showAsAction="never"
android:title="Grab"/>
</group>

<item
Expand Down
8 changes: 8 additions & 0 deletions Android/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
<string name="waypointType_Land">Land</string>
<string name="waypointType_Change_Speed">Change Speed</string>
<string name="waypointType_Camera_Trigger">Camera Trigger</string>
<string name="waypointType_Set_Servo">Set Servo</string>
<string name="waypointType_EPM">EPM</string>
<string name="waypointType_Circle">Circle</string>
<string name="waypointType_Loiter">Loiter</string>
<string name="waypointType_ROI">Region of Interest</string>
Expand All @@ -203,8 +205,13 @@
<string name="waypointInfo_SetHome">Changes the home location either to the current location or a specified location.</string>
<string name="waypointInfo_SetSpeed">Change vehicle speed until the end of this mission.</string>
<string name="waypointInfo_CameraTrigger">Trigger the camera shutter at regular distance intervals.</string>
<string name="waypointInfo_SetServo">Move a servo to a particular PWM value.</string>
<string name="waypointInfo_EpmGrabber">Release the payload of the EPM grabber</string>
<string name="waypointInfo_ROI">Sets a location and altitude to point copter towards and to aim an optional camera.</string>
<string name="waypointInfo_SetJump">Repeat waypoint</string>

<!-- Custom waypoint info -->
<string name="pwm">PWM:</string>

<!-- Waypoint editor -->
<string name="editor_err_land_rtl_added">One cannot add new waypoints after LAND or RTL</string>
Expand Down Expand Up @@ -344,6 +351,7 @@
<string name="speed_unit">m/s</string>
<string name="speed_label">Speed</string>
<string name="length_label">Length</string>
<string name="channel_label">Channel</string>
<string name="ground_speed_label">Ground Speed</string>
<string name="air_speed_label">Air Speed</string>
<string name="default_angle_value">--°</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ public void onDroneEvent(DroneEventsType event, Drone drone) {
enableSlidingUpPanel(drone);
break;

case FOLLOW_START:
//Extend the sliding drawer if collapsed.
if(!mSlidingPanelCollapsing.get() && mSlidingPanel.isSlidingEnabled() &&
!mSlidingPanel.isPanelExpanded()){
mSlidingPanel.expandPanel();
}
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.droidplanner.android.utils.Utils;
import org.droidplanner.android.utils.prefs.DroidPlannerPrefs;
import org.droidplanner.android.widgets.actionProviders.InfoBarActionProvider;
import org.droidplanner.core.MAVLink.MavLinkROI;
import org.droidplanner.core.drone.DroneInterfaces.DroneEventsType;
import org.droidplanner.core.drone.DroneInterfaces.OnDroneListener;
import org.droidplanner.core.gcs.GCSHeartbeat;
Expand Down Expand Up @@ -234,11 +235,18 @@ public void onNo() {
case R.id.menu_load_mission:
drone.getWaypointManager().getWaypoints();
return true;

case R.id.menu_triggerCamera:
MavLinkROI.triggerCamera(drone);
return true;
case R.id.menu_epm_grab:
MavLinkROI.empCommand(drone, false);
return true;
case R.id.menu_epm_release:
MavLinkROI.empCommand(drone, true);
return true;
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;

default:
return super.onOptionsItemSelected(item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ private static class OpenFileAsyncTask extends AsyncTask<String, Void, Boolean>
public OpenFileAsyncTask(OpenFileDialog dialog){
containerRef = new WeakReference<OpenFileDialog>(dialog);
progressDialog = new ProgressDialog(dialog.context);
progressDialog.setTitle("Processing...");
progressDialog.setMessage("Please wait.");
progressDialog.setIndeterminate(true);
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private void updateFlightModeButtons() {
break;

case ROTOR_GUIDED:
if (drone.getGuidedPoint().isIdle() && !followMe.isEnabled()) {
if (drone.getGuidedPoint().isInitialized() && !followMe.isEnabled()) {
pauseBtn.setActivated(true);
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public static MissionDetailFragment newInstance(MissionItemType itemType) {
case CAMERA_TRIGGER:
fragment = new MissionCameraTriggerFragment();
break;
case EPM_GRIPPER:
fragment = new MissionEpmGrabberFragment();
break;
case SET_SERVO:
fragment = new SetServoFragment();
break;
default:
fragment = null;
break;
Expand Down
Loading

0 comments on commit c6c6c54

Please sign in to comment.