Hello Everyone,
I must admit that I am still quite a beginner. I was doing the Step_By_Step-Guide, given here: https://www.bitcraze.io/documentation/r ... commander/, and a problem has occurred. I don't understand why my deck, which I use, is not found. Can somebody help me out?
According to the client: I'm using the Deck: bcDWM1000.
What i did now is. I just changed the name of my Deck in the given script from the Step_By_Step-Guide:
And unfortunately my deck still can not be found. And i really need some advice, please.
Deck connection Python_script
-
jonasdn
- Expert
- Posts: 132
- Joined: Mon Mar 01, 2021 3:13 pm
Re: Deck connection Python_script
Hi RubICS!
Let's see if we can figure this out! It seems like the code change you did should work, it should at least find the deck one thinks.
What is the output when you run that script? And what is the output if you run the basicparam.py example script?
Thanks
Jonas
Let's see if we can figure this out! It seems like the code change you did should work, it should at least find the deck one thinks.
What is the output when you run that script? And what is the output if you run the basicparam.py example script?
Thanks
Jonas
-
RubICS
- Beginner
- Posts: 8
- Joined: Thu Feb 03, 2022 1:16 pm
Re: Deck connection Python_script
First of all thank you very much jonasdn for replying.
The output when i run the script is: "no deck is detected" as it is written in the function.
And the Output of the basicparam.py example is this:
As I can see, my deck (bcDWM1000) is also found in that.
Thanks,
RubICS
The output when i run the script is: "no deck is detected" as it is written in the function.
And the Output of the basicparam.py example is this:
As I can see, my deck (bcDWM1000) is also found in that.
Thanks,
RubICS
-
jonasdn
- Expert
- Posts: 132
- Joined: Mon Mar 01, 2021 3:13 pm
Re: Deck connection Python_script
Thank you!
Could you give me the complete code of the script that is not working?
Jonas
Could you give me the complete code of the script that is not working?
Jonas
-
RubICS
- Beginner
- Posts: 8
- Joined: Thu Feb 03, 2022 1:16 pm
Re: Deck connection Python_script
Yeah for sure! Thanks for you patience.
The output is "Deck is NOT attached!"
Thank you very much.
RubICS
The output is "Deck is NOT attached!"
Thank you very much.
RubICS
-
jonasdn
- Expert
- Posts: 132
- Joined: Mon Mar 01, 2021 3:13 pm
Re: Deck connection Python_script
Hi!
Could you post the entire script? Perhaps on pastebin.com ?
Could you post the entire script? Perhaps on pastebin.com ?
-
RubICS
- Beginner
- Posts: 8
- Joined: Thu Feb 03, 2022 1:16 pm
Re: Deck connection Python_script
Hello Jonasdn,
i hope i did everything right. If so my code can be found here here: https://pastebin.com/SegtpYjL.
Thank you very much.
i hope i did everything right. If so my code can be found here here: https://pastebin.com/SegtpYjL.
Thank you very much.
-
jonasdn
- Expert
- Posts: 132
- Joined: Mon Mar 01, 2021 3:13 pm
Re: Deck connection Python_script
Thank you!
Am I right in understanding you do not get either of the:
print('Deck is attached!')
print('Deck is NOT attached!')
Outputs?
Could you try the following script? I modified it to ask for a parameter update.
Am I right in understanding you do not get either of the:
print('Deck is attached!')
print('Deck is NOT attached!')
Outputs?
Could you try the following script? I modified it to ask for a parameter update.
Code: Select all
import logging
import sys
import time
from threading import Event
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.positioning.motion_commander import MotionCommander
from cflib.utils import uri_helper
URI = uri_helper.uri_from_env(default='radio://0/80/2M/E7E7E7E7E7')
DEFAULT_HEIGHT = 0.5
deck_attached_event = Event()
logging.basicConfig(level=logging.ERROR)
def take_off_simple(scf):
with MotionCommander(scf, default_height=DEFAULT_HEIGHT) as mc:
time.sleep(3)
mc.stop()
def param_deck_flow(_, value_str):
value = int(value_str)
print(value)
if value:
deck_attached_event.set()
print('Deck is attached!')
else:
print('Deck is NOT attached!')
if __name__ == '__main__':
cflib.crtp.init_drivers()
with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf:
scf.cf.param.add_update_callback(group='deck', name='bcDWM1000',cb=param_deck_flow)
scf.cf.param.request_param_update('deck.bcDWM1000')
if not deck_attached_event.wait(timeout=5):
print('No flow deck detected!')
sys.exit(1)
#take_off_simple(scf)
-
RubICS
- Beginner
- Posts: 8
- Joined: Thu Feb 03, 2022 1:16 pm
Re: Deck connection Python_script
Hello jonasdn,
i dont know what you did
, but now my deck is going to be detected. Thank you soooooo much 
The Output is:
1
Deck is attached!
yours,
RubIcs
i dont know what you did
The Output is:
1
Deck is attached!
yours,
RubIcs