commander values for the crazyflie problem
Posted: Tue Jan 27, 2015 2:18 pm
Hello,
I'm working on crazyflie controlled by hand gestures using Kinect developing under c#, and i ran into a big problem.
For setting thrust there is no problem, but if i want to set any of the others 4byte values, the crazycopter wents literally crazy. It reacts to different values, different ways and i havent found any link between them.
My question is, what values is crazyflie meant to receive? is it ok to be floating point data type (float) or integer datatype (like ushort at thrust)? Are there any bounds for the values?
Or am I missing some knowledge? Are the sent values considered as incremental or absolute for the copter?
Thank you for time, iam adding a c# code of my value serialization to packet.
I'm working on crazyflie controlled by hand gestures using Kinect developing under c#, and i ran into a big problem.
For setting thrust there is no problem, but if i want to set any of the others 4byte values, the crazycopter wents literally crazy. It reacts to different values, different ways and i havent found any link between them.
My question is, what values is crazyflie meant to receive? is it ok to be floating point data type (float) or integer datatype (like ushort at thrust)? Are there any bounds for the values?
Or am I missing some knowledge? Are the sent values considered as incremental or absolute for the copter?
Thank you for time, iam adding a c# code of my value serialization to packet.
Code: Select all
MemoryStream buffer = new MemoryStream();
BinaryWriter bw = new BinaryWriter(buffer);
byte[] roll = floatToByteArray(Roll);
byte[] pitch = floatToByteArray(-Pitch);
byte[] yaw = floatToByteArray(Yaw);
byte[] thrust = BitConverter.GetBytes(Thrust).Reverse().ToArray();
bw.Write(roll);
bw.Write(pitch);
bw.Write(yaw);
bw.Write(thrust);
bw.Flush();
bw.Close();
buffer.Flush();
byte[] result = buffer.ToArray();