Can someone please help me understand how to make a request to get Main IMU angles and ROTOR_STATOR angles at the same time.
I have spent several hours tryng to find a correct way to of following instructions in Serial Protocol Specification on how to make a custom request on real-time data, but nothing worked. At the end of that message I have attached the quote from tha manual. In preamble I have put a command ID 58 (hex from 88) And in an actual command body, which if I get it right, should be 10 bytes long, I put 4 bytes that represent FLAGs to the front and 6 zero bytes to the end of bytearray. In the custom real-time data request I wanted to get Main IMU angles and ROTOR_STATOR, so according to the manual, •bit0: IMU angles and •bit3: Stator-rotor angle, so I took two 32 bit unsigned ints (because the result is supposed to occupy 4 bytes) of values 1 (•bit0) and 16 (•bit3) and made a bitwise OR operation. Then I used memcpu to put the result to the front. And nothing worked =(. I have tried moving the lowest byte value from 0 to 3 byte in the 4 byte array but it did not yield any result. Other commands which consider sending requests longer then 1 byte are still working fine (like rotation ommand), but this one I just can't figure out.
Can someone please explain how to build the request that I mentioned above?
According to the manual: CMD_REALTIME_DATA_CUSTOM – request configurable realtime data (frw. ver. 2.60+) The request consists of 1) FLAGS - 4u Each bit specify which data to include in response •bit0: IMU angles •bit1: RC target angles •bit2: RC target speed •bit3: Stator-rotor angle •bit4: IMU sensor gyro data •bit5: RC signal assigned to standard inputs •bit6: IMU attitude as rotation matrix •bit7: All RC channels captured from s-bus, Sum-PPM or spektrum input. •bit8: IMU sensor ACC data 2) RESERVED - 6b
Yes i have freaking succeeded at sending this command man. Turned out that I actually received them, but did not realise it for the reason so dumb that I won't write it here. But thanks for the suggestion/
I assume you format command correctly (header, body, checksums)? Regarding body, it should have exactly 10 bytes length. Set all bits to 1 (FLAGS=0xFFFFFFFF) for testing.