Page 1 of 1

Cannot send RPYT using setpoint function in Python

Posted: Sun Dec 30, 2018 10:38 am
by dowias
Hi all,
I want to send some values for roll pitch yaw and thrust by using the send_setpoint(self, roll, pitch, yaw, thrust) function of the python cflib.
At the moment I can connect to the Crazyflie and also send the package, but the motors are not turning.

I don't understand where the problem is because the close_link function of the Crazyflie class in the __init__.py file is using the send_setpoint(0,0,0,0) and that seems to work fine.

The code is running on a Raspberry Pi and I also tryed it with the VM on Windows. On both systems is the connection and sending ok but the motors don't turn.

Do you have any idea what I can do to send RPYT values.
Thanks for your help.

Edit:

Code: Select all

import logging
import time

import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.utils.callbacks import Caller

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

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

# Called when the link is established and the TOCs (that are not
# cached) have been downloaded
connected = Caller()

cflib.crtp.init_drivers(enable_debug_driver=False)

cf = Crazyflie()

cf.connected.add_callback(connected)
cf.open_link(URI)

roll = 0.0
pitch = 0.0
yaw = 0
thrust = 20000 

for _ in range(10):
    cf.commander.send_setpoint(roll, pitch, yaw, thrust)
    time.sleep(0.1)

time.sleep(0.1)
cf.commander.send_stop_setpoint()
cf.close_link()

Re: Cannot send RPYT using setpoint function in Python

Posted: Fri Jan 04, 2019 1:42 pm
by tobias
There is a safety lock in the FW so a zero setpoint must first be sent to unlock it. If you start by sending send_setpoint(0,0,0,0) it should work.

Re: Cannot send RPYT using setpoint function in Python

Posted: Sun Jan 06, 2019 8:56 am
by dowias
Thanks for your help, it's working.

Are the other functions of the Commander class secured identically?