Cannot send RPYT using setpoint function in Python
Posted: Sun Dec 30, 2018 10:38 am
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:
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()