Fixed wing circle on bebop2


#1

Hi,
Is there any native command that make the bebop2 make wing circle like disco drone?
Thanks


#2

take a look here:

https://developer.parrot.com/docs/reference/all/index.html#start-spiral


#3

Thanks Synman,
I tried to use that command and it didn’t work, I’m using sphinx first to test these commands, so is there any limitation to run that commands? also does it work on simulator? and how to get the firmware version on sphinx?
Thanks,


#4

I don’t use sphinx to any useful extent. Over the years I have found the best method for testing is real world experimentation (although I admit it has cost me a couple drones – going all the way back to the original V1 ARDrone).

I would make sure you are using the latest firmware and these animations are only available on the Bebop 2.

I guarantee they work based on my own real world usage.

public class AnimationState {
    private ARCOMMANDS_ANIMATION_STATE_ENUM state = ARCOMMANDS_ANIMATION_STATE_ENUM.UNKNOWN;
    private ARCOMMANDS_ANIMATION_TYPE_ENUM type = ARCOMMANDS_ANIMATION_TYPE_ENUM.UNKNOWN;
    private ARCOMMANDS_ANIMATION_FLIP_TYPE_ENUM flipType = ARCOMMANDS_ANIMATION_FLIP_TYPE_ENUM.UNKNOWN;

    private short progress = 0;

    private float speed = Float.MIN_VALUE;
    private float rotation_speed = Float.MIN_VALUE;

    private float distance = Float.MIN_VALUE;
    private float radius_variation = Float.MIN_VALUE;
    private short revolution_nb = 0;
    private float angle = Float.MIN_VALUE;

    private ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM play_mode = ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM.UNKNOWN;

    public void setState(final ARCOMMANDS_ANIMATION_TYPE_ENUM type, final byte percent) {
        this.type = type;
        progress = percent;
    }

    public ARCOMMANDS_ANIMATION_TYPE_ENUM getType() {
        return type;
    }

    public short getProgress() {
        return progress;
    }

    public ARCOMMANDS_ANIMATION_FLIP_TYPE_ENUM getFlipType() {
        return flipType;
    }

    public void setFlipType(ARCOMMANDS_ANIMATION_FLIP_TYPE_ENUM flipType) {
        this.flipType = flipType;
    }

    public ARCOMMANDS_ANIMATION_STATE_ENUM getState() {
        return state;
    }

    public void setState(ARCOMMANDS_ANIMATION_STATE_ENUM state) {
        this.state = state;
    }

    public float getSpeed() {
        return speed;
    }

    public void setSpeed(float speed) {
        this.speed = speed;
    }

    public float getRotation_speed() {
        return rotation_speed;
    }

    public void setRotation_speed(float rotation_speed) {
        this.rotation_speed = rotation_speed;
    }

    public float getDistance() {
        return distance;
    }

    public void setDistance(float distance) {
        this.distance = distance;
    }

    public float getRadius_variation() {
        return radius_variation;
    }

    public void setRadius_variation(float radius_variation) {
        this.radius_variation = radius_variation;
    }

    public short getRevolution_nb() {
        return revolution_nb;
    }

    public void setRevolution_nb(short revolution_nb) {
        this.revolution_nb = revolution_nb;
    }

    public float getAngle() {
        return angle;
    }

    public void setAngle(float angle) {
        this.angle = angle;
    }

    public ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM getPlay_mode() {
        return play_mode;
    }

    public void setPlay_mode(ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM play_mode) {
        this.play_mode = play_mode;
    }
}

public class AnimationOption extends AnimationState {
    private boolean defaultOverridden;

    public boolean isDefaultOverridden() {
        return defaultOverridden;
    }

    public void setDefaultOverridden(boolean defaultOverridden) {
        this.defaultOverridden = defaultOverridden;
    }

    public void setType(ARCOMMANDS_ANIMATION_TYPE_ENUM type) {
        super.type = type;
    }
}

if (featureAnimation != null) {
    byte flags = 0;
    float speed = 0;
    float radius_variation = 0;
    float revolution_nb = 0;
    float distance = 0;

    ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM playMode = ARCOMMANDS_ANIMATION_PLAY_MODE_ENUM.NORMAL;

    for (DroneData.AnimationOption option : droneData.getAnimationOptions()) {
        if (option.getType() == ARCOMMANDS_ANIMATION_TYPE_ENUM.SPIRAL) {
            if (option.isDefaultOverridden()) {
                flags |= (1 << ARCOMMANDS_ANIMATION_SPIRAL_CONFIG_PARAM_ENUM.RADIUS_VARIATION.getValue());
                flags |= (1 << ARCOMMANDS_ANIMATION_SPIRAL_CONFIG_PARAM_ENUM.SPEED.getValue());
                flags |= (1 << ARCOMMANDS_ANIMATION_SPIRAL_CONFIG_PARAM_ENUM.REVOLUTION_NB.getValue());
                flags |= (1 << ARCOMMANDS_ANIMATION_SPIRAL_CONFIG_PARAM_ENUM.VERTICAL_DISTANCE.getValue());

                flags |= (1 << ARCOMMANDS_ANIMATION_SPIRAL_CONFIG_PARAM_ENUM.PLAY_MODE.getValue());

                speed = option.getSpeed();
                distance = option.getDistance();
                radius_variation = option.getRadius_variation();
                revolution_nb = option.getRevolution_nb();

                playMode = option.getPlay_mode();
            }
            break;
        }
    }
    
    featureAnimation.sendStartSpiral(flags, speed, radius_variation, distance, revolution_nb, playMode);
}

#5

Thanks Synman
It still didn’t work on the simulator :slightly_frowning_face:
Should I open another question about testing that commands with sphinx?
How do we know the version of the firmware that Sphinx use?


#6

https://developer.parrot.com/docs/reference/all/index.html#product-version

While I haven’t tried it on sphinx I imagine you could at least try to update the firmware assuming it is an older version. Bebop 2 animations were introduced about the same time Follow Me was added.

The procedure is fairly trivial.


#7

I tired to uninstall sphinx and re install it again, and it didn’t work. installing sphinx should install the last firmware version right? if not, it there any doc about updating the firmware on sphinx?
may be it isn’t supported by the simulated bebop2.