Bluetooth attribute definitions for roll, pitch, yaw, rotation, and altitude


#1

Hi All,

I have worked through the SDK to get the rolling spider under node.js control. We have pretty much all the basic operations of flight enabled at this point, but would love some assistance/pointers to the following items that I am trying to extract from the complex SDK.

  • Roll, pitch, yaw, rotation, and altitude values as output; I can set these and the Rolling Spider does respond appropriately, but there are times on take off that the RS will rotate, it would be ideal to get environmental state information to allow for host controlled autonomous state management.
  • Camera capture.

If anyone has any pointers on either of these, it would be much appreciated as we would love to get full parity with the existing SDK but in JS so others can easily port to any language/platform/system.

Cheers

Chris Williams | @voodootikigod


#2

Hey voodootikigod, I’m trying to control the parrot minidrone by an android app on my phone…like I want to do an image processing task in which the drone follows a black line on the ground…Im a total begineer and have no idea about how to get started…I guess android studio would be good for developing the app…but then how do I send commands to the drone and acquire image/video streaming of the black line and do image processing on the app???..PLEASE NEED HELP !!!


#3

Hi,

  1. The Rolling Spider does not send back its roll/pitch/yaw/altitude values to the controller, so you currently can not get them.

  2. Are you talking about “requesting a picture to be taken”, or “transferring a picture from the rolling spider to the controller” ?

Regardless, I’ve looked a bit inside your code, and I think that an explanation of the network protocol and the ARCommands encoding would help you change from “hardcoded constants” to a more flexible way:

Let’s take your takeoff command: new Buffer([0x02, ++this.steps.fa0b & 0xFF, 0x02, 0x00, 0x01, 0x00]), and strip it to the components:

0x02 --> Type of data (0x02 means "non acknowledged data"). In ARFreeFlight, we send the takeoff as an acknowledged command (type 0x04)
second byte is a per-characteristic sequence number
0x02 0x00 0x01 0x00 --> The ARCommand

This is slightly different from the UDP protocol (described here), because we do not code the buffer ID (as we use one characteristic per buffer) nor the data size (useless since we do not multiplex multiple messages into one packet on BLE).

An ARCommand is coded in the following way:

  1. 1 byte for the project identifier (0x02 is for Rolling Spider, named MiniDrone in ARCommands)

  2. 1 byte for the command class identifier (The class 0x00 in project Rolling Spider is Piloting)

  3. 2 bytes for the command identifier (The command 0x0001 in class RollingSpider.Piloting is TakeOff). The “backwards” notation is due to the endianness.

  4. N bytes of data (all arguments to the command), packed.

The ARCommands are described in those Xml files. Each .xml file represent a project (first byte), in each file, there are a number of class (second byte), each with a given id. In each class, the commands identifiers are “in order” from the file (i.e. the first command of a class has id 0, the second id 1 …)

When built, the libARCommands generate a private (will be public in future releases) file with multiple C enum definitions for each project, class, and command ids. You can find an example of the file here. For the MiniDrone.Piloting.TakeOff command, we can see that:

  1. In the eARCOMMANDS_ID_PROJECT enum, ARCOMMANDS_ID_PROJECT_MINIDRONE has the value 2.

  2. In the eARCOMMANDS_ID_MINIDRONE_CLASS enum, ARCOMMANDS_ID_MINIDRONE_CLASS_PILOTING has the value 0.

  3. In the eARCOMMANDS_ID_MINIDRONE_PILOTING_CMD enum, ARCOMMANDS_ID_MINIDRONE_PILOTING_CMD_TAKEOFF has the value 1.

And so the command is [0x02 0x00 0x01 0x00]

Using the same method, we can find that a MiniDrone.Animations.Flip(left) command is coded as [0x02 0x04 0x00 0x00 0x03 0x00 0x00 0x00]: 0x02 for the MiniDrone (Rolling Spider) project, 0x04 for the Animations class, 0x00 0x00 for the Flip command, and then 0x03 0x00 0x00 0x00 for the 3rd entry of the direction enum (enums are coded as unsigned 32bits values in ARCommands), which is “Left”

Regards,
Nicolas.


Minidrone takeoff with BLED112 dongle
Drone SDK for plain Java
#4

Hi Nicolas,

I’m also a newbie and was wondering about adding camera capture commands to the Node.JS library. I want to know how to request a picture to be taken and transfer a picture from the rolling spider to the app.

// Rashed


#5

+1 to adding the “take picture” and “transfer picture” commands to voodootikigod’s awesome node.js lib. Could any one help with the related commands for this?