Sending/Receiving Data by Crazyradio dongle

Firmware/software/electronics
Post Reply
sky2857
Beginner
Posts: 1
Joined: Tue Mar 24, 2015 2:29 pm

Sending/Receiving Data by Crazyradio dongle

Post by sky2857 »

Hi everyone,
I'm trying to control crazyflies by computer,
But now there's some problom.

I have learned to connect crazyradio and send some radio setting.
http://wiki.bitcraze.se/doc:crazyradio:usb:index

For example
bmRequestType=0x40
bRequest=0x03(SET_DATA_RATE)
wValue=0(250Kbps)
wIndex=0

And than
bmRequestType=0x40
bRequest=0x21(START_SCAN_CHANNELS)
wValue=1(?)
wIndex=125(?)
Than motors will rotate for few second than stop.(Successful connected)
(I don't konw wValue&wIndex in here actually)

Here is my question,
I don't know where to get the data on crazyflies(ex: acc,mag,M1M2M3M4......)
And how to send the value or control the crazyflies(ex:roll,pitch,pid......)

I get some information here, but I still can't realize how to so.
http://wiki.bitcraze.se/projects:crazyf ... l#usb_port


Thanks for reading my question.
Please give me some suggession,thanks!!!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Sending/Receiving Data by Crazyradio dongle

Post by arnaud »

Hi and welcome,

We have a wiki page explaining the communication stack: http://wiki.bitcraze.se/doc:crazyflie:d ... munication, you are looking at the bottom of the stack on the host part which only deals with the 'link' part and not the copter control.

It would be useful to know what you are trying to achieve exactly. There is already existing libs in python(http://wiki.bitcraze.se/doc:crazyflie:api:python:index) and other languages (http://wiki.bitcraze.se/doc:crazyflie:api:community) to control programatically the Crazyflie from a PC. There is also an existing PC client to control Crazyflie from a Gamepad.

To answer your question:
- All communication are done using a protocol called CRTP (it defines ports for different services in the copter): http://wiki.bitcraze.se/doc:crazyflie:crtp:index
- Values (acc/mag/...) are fetched from the Crazyflie using the LOG subsytem: http://wiki.bitcraze.se/doc:crazyflie:crtp:log
- Fast values (ie. setoints) are send using the commander packet: http://wiki.bitcraze.se/doc:crazyflie:crtp:commander
- Slow values (pid, ...) are set using the parameter subsystem: http://wiki.bitcraze.se/doc:crazyflie:crtp:param

I linked to the protocol documentation as I assume you are interested in coding you own lib, there is also documentation and examples on how to access these with the official python lib. Do not hesitate to tell us what you want to achieve so that we can guide you better.
Post Reply