Page 1 of 1

Trim Parameter Packets

Posted: Tue Sep 08, 2015 4:14 pm
by Johannes
My plan is to set the trim parameters on my CF2 from an iPhone app. I've seen someone set the altHold parameter (packet shown below) but I don't understand how to generate the packets to send trim parameter updates.

Code: Select all

struct __attribute__((packed)) {
            uint8_t header;
            uint8_t ident;
            uint8_t val;
        } altHoldPacket;
        
        NSData *myData;
        altHoldPacket.header = ((0x02 & 0x0f) << 4 | 3 << 2 |(2 & 0x03));
        altHoldPacket.ident = 11;
        altHoldPacket.val = 1;
I tried searching the forum and google but I could not find out how a trim parameter packet looks like.

Re: Trim Parameter Packets

Posted: Thu Sep 17, 2015 10:14 am
by arnaud
Hi,

There is no timing parameter in Crazyflie.

The trim parameters on the PC client are used on the client side (the pitch and roll are corrected before being sent to the Crazyflie).

If you want to write the new trim parameters in the Crazyflie 2 EEPROM memory you will have to use the memory packets: https://wiki.bitcraze.io/doc:crazyflie:crtp:mem to write the new configuration in the eeprom (the format can be found there: https://github.com/bitcraze/crazyflie-f ... prom.c#L61).