I am using android application and try to modify the source code.
As I understand this code line is used to send commands to Crazyflie:
mCrazyradioLink.send(new CommanderPacket(mController.getRoll(), mController.getPitch(), mController.getYaw(), (char) (mController.getThrust()/100 * MAX_THRUST), mControls.isXmode()));
To test this code line, I change value for roll, pitch and yaw to 0:
mCrazyradioLink.send(new CommanderPacket(0, 0, 0, (char) (mController.getThrust()/100 * MAX_THRUST), mControls.isXmode()));
Everything works as expected, just thrust works when I use joysticks on android.
Then I change thrust variable to constance (50), I expect that after connecting, the Crazyflie should fly up. But nothing happens.!!
mCrazyradioLink.send(new CommanderPacket(0, 0, 0, (char) (50/100 * MAX_THRUST), mControls.isXmode()));
Could you plz tell me the reason?
How to send a constant thrust to Crazyflie?
-
- Beginner
- Posts: 2
- Joined: Tue Jul 08, 2014 2:59 am
-
- Beginner
- Posts: 2
- Joined: Tue Jul 08, 2014 2:59 am
Re: How to send a constant thrust to Crazyflie?
I know the reason, because 50/100 is always equal 0. After casting float type, the quad-copter fly.
Thanks God!
Thanks God!
Re: How to send a constant thrust to Crazyflie?
Cool, you fixed it yourself. Any more problems just make a post.
Re: How to send a constant thrust to Crazyflie?
Can you share your code pls?