Hi, I'd like to control the RPY angles using the UART api just like when feeding a pwm on RC_PITCH .. channels. I'm currently using CMD_CONTROL message, check http://pastebin.com/z6RnvrG7 Am i doing anything wrong ?
"Am i doing anything wrong ?" It is a bit difficult to say without knowing if there is a problem and what the problem is. What FW, what Serial API are you using?
fw 2.56b9, board v3, serial 2.5 I'm trying to communicate with the board (ultimately set an angle) but right now, it doesn't respond to anything. So i've tried using the GUI "debug" tab , send a "52" command (eg) then read the console output, I can see the board receives the message and answers back, but i cant get this behavior without using GUI. Also I tried to use the GUI to set an angle : command : 67 data(hex) : 01 55 00 00 00 00 00 which is supposed to set the control mode to speed , and put 0x55 speed on roll axis, but nothing happens So the real question is : Is my protocol wrong or not ?
It is too complicated question to verify if your code is correct or not, I would propose to see the examples and start from there. Also have you ensured the connection is ok, how have you connected the serial interface to the board? Debug tab, I do not know, I have connected Arduino Tx to Rx and Rx to Tx and GND and it works.
Well, when using the GUI debug tab, I send command 52 (CMD_BOARD_INFO) the board answers. But when sending 67 (CMD_CONTROL), with 01 55 00 00 00 00 00 (control = speed, speed_roll = 0x55) it doesn't do anything.
When using a logic analyzer, this is the frame i get when sending 67 [01 55 00 00 00 00 00 00 00 00 00 00 00] http://imgur.com/Io41K07 Gimbal connected, it turns. This works, but doesnt make sense, 0x43 should be sent, not 0x42. checksum doenst make sense neither
In you code, types in the CMD_CONTROL_t are uint_16 but actualy they are all signed: int16_t. Also be carefull in converting structures to a bytes: for 32-bit systems members like int16_t may take 4 bytes actually, unless you specify structure as 'packed'.
I still advise to use libraries and start from examples that published at github. SerialControl.ino contains various use cases of CMD_CONTROL command.