Use of Relative Position Move


#1

Product: [Bebop]
Use of libARController: [YES] (Only for ARSDK)
SDK platform: [Android]

Hi guys,

May i know how the relative move position works.
I insert these values but it did not move.
mBebopDrone.moveRelativePosition(0.0f, 0.0f, 0.0f, 90.0f);

dX is move forward or back = pitch value
dY is move left or right = roll value
dZ is move up or down = gaz value
dPsi is rotate few degrees = yaw value

Is this correct?
Please someone help me, i’m new to the development?


#2

As said here the given angle is in radian. 90 rad should make a rotation of 116 degrees.

Can I have more information about the firmware version of your Bebop?
Could you also log what you’re receiving in the relative move ended event?

Thanks.


#3

Hi Djavan,

The firmware version is,
Hardware version : HW_11
Software version : 4.0.6

I didn’t get any values or error for the relative move ended.
And it did not rotate 90 degrees. It was moving irregularly.
May I know whether this method move require GPS fix or not?

The following is my code.

public void moveRelativePosition(float dX, float dY, float dZ, float dPsi){
    if ((mDeviceController != null) && (mState.equals(ARCONTROLLER_DEVICE_STATE_ENUM.ARCONTROLLER_DEVICE_STATE_RUNNING))) {
        Log.i(TAG, "moved");
        mDeviceController.getFeatureARDrone3().sendPilotingMoveBy(dX, dY, dZ, dPsi);
        Log.i(TAG, "dX: " + String.valueOf(dX));
        Log.i(TAG, "dY: " + String.valueOf(dY));
        Log.i(TAG, "dZ: " + String.valueOf(dZ));
        Log.i(TAG, "dPsi: " + String.valueOf(dPsi));
        Log.i(TAG, "dPsi Radian: " + String.valueOf(dPsi));
    }
}

public void initIHM(){
   mTakeOffLandBt.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            switch (mBebopDrone.getFlyingState()) {
                case ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED:
                    if (droneLat == 500.0 && droneLng == 500.0 && droneAlt == 500.0) {
                        mHomeBt.setVisibility(View.INVISIBLE);
                    } else {
                        takeoffLatLng = new LatLng(droneLat, droneLng);
                    }
                    mBebopDrone.takeOff();
                    float rad = droneMovement.degToRad(90); // 90 degree is converted to radian
                    // rad = 69.827586
                    mBebopDrone.moveRelativePosition(0.0f, 0.0f, 0.0f, rad);
                    break;
                case ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_FLYING:
                case ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_HOVERING:
                    mBebopDrone.land();
                    takeoffLatLng = null;
                    if (mHomeBt.getVisibility() == View.INVISIBLE) {
                        mHomeBt.setVisibility(View.VISIBLE);
                    }
                    break;
                default:
            }
        }
    });
}

#4

You should listen to the dedicated event to better understand what’s going on.

The root cause of this problem might be that you’re not waiting the drone to be hovering.
You’d better listen to the flying state and when the state is hovering (for the first time), send your move to a relative position.


#5

Does it require the gps to be fixed before sending the move to a relative position?


#6

No it does not require a gps fix.