[SOLVED] flight of flowdeck

Discussions about all things Bitcraze
Post Reply
curiousstudent
Beginner
Posts: 18
Joined: Sun Jan 05, 2020 6:52 pm

[SOLVED] flight of flowdeck

Post by curiousstudent » Sat Feb 01, 2020 4:14 am

Hi,

Quick question. I was able to get the crazyflie to take off.
But every time it takes off it flies straight into the ceiling(more than 3m from the ground).

Why does it go so high?
Is there anyway to change this?

This is the code I used:

import logging
import time

import cflib.crtp
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.positioning.motion_commander import MotionCommander

URI = 'radio://0/80/2M'

# Only output errors from the logging framework
logging.basicConfig(level=logging.ERROR)


if __name__ == '__main__':
# Initialize the low-level drivers (don't list the debug drivers)
cflib.crtp.init_drivers(enable_debug_driver=False)

with SyncCrazyflie(URI) as scf:
# We take off when the commander is created
with MotionCommander(scf) as mc:
print('Taking off!')
time.sleep(1)

# There is a set of functions that move a specific distance
# We can move in all directions
print('Moving forward 0.5m')
mc.forward(0.5)
# Wait a bit
time.sleep(1)

print('Moving up 0.2m')
mc.up(0.2)
# Wait a bit
time.sleep(1)

print('Doing a 270deg circle');
mc.circle_right(0.5, velocity=0.5, angle_degrees=270)

print('Moving down 0.2m')
mc.down(0.2)
# Wait a bit
time.sleep(1)

print('Rolling left 0.2m at 0.6m/s')
mc.left(0.2, velocity=0.6)
# Wait a bit
time.sleep(1)

print('Moving forward 0.5m')
mc.forward(0.5)

# We land when the MotionCommander goes out of scope
print('Landing!')



kristoffer
Bitcraze
Posts: 278
Joined: Tue Jun 30, 2015 7:47 am

Re: flight of flowdeck

Post by kristoffer » Mon Feb 03, 2020 11:22 am

It might be that the Flow deck has not been recognized by the Crazyflie.
Please send us your console log.
  • Connect to your Crazyflie with the python client
  • Open the Console tab
  • Copy/paste the contents here

curiousstudent
Beginner
Posts: 18
Joined: Sun Jan 05, 2020 6:52 pm

Re: flight of flowdeck

Post by curiousstudent » Sat Feb 08, 2020 12:00 am

Hey,

Thank you for your reply.

I tried it again today and I think there might have been a faulty connection initially (or maybe I did not plug the board in fully).
But now it works.

The first time (before asking) the drone did not redo the start sequence one i plugged it in but now it does!

kristoffer
Bitcraze
Posts: 278
Joined: Tue Jun 30, 2015 7:47 am

Re: [SOLVED] flight of flowdeck

Post by kristoffer » Mon Feb 10, 2020 11:19 am

Great!

Post Reply