Im facing a problem like this, Im trying to do square coordination path by my drone by using crazyflie_ros scripts, and takeoff is working, goto is working but something weird is happenning..
I run this code:
Code: Select all
import rospy import crazyflie import time import uav_trajectory if __name__ == '__main__': rospy.init_node('test_high_level') cf = crazyflie.Crazyflie("crazyflie", "/vicon/crazyflie/crazyflie") cf.setParam("commander/enHighLevel", 1) cf.setParam("stabilizer/estimator", 2) # Use EKF cf.setParam("stabilizer/controller", 1) # Use mellinger controller cf.takeoff(targetHeight = 0.5, duration = 2.0) time.sleep(3.0) cf.goTo(goal = [0.5, 0.0, 0.0], yaw=0.0, duration = 2.0, relative = True) time.sleep(3.0) cf.goTo(goal = [-0.5, 0.0, 0.0], yaw=0.0, duration = 2.0, relative = True) time.sleep(3.0) cf.land(targetHeight = 0.0, duration = 2.0)
I tried to do
Code: Select all
cf.goTo(goal = [0.0, 0.0, 0.0], yaw=0.0, duration = 2.0, relative = True) time.sleep(3.0)
I don't know why if I send by goTo a point other than 0 0 0 then he will not hover on that new point in proper and steady hovering but yeah he goes there but not hovering steady on that point!, my yaw is 0 so actually I don't know why he's doing like a circle on hovering to the new point!
any help? maybe I should put kp and kd as 0? I don't know how can I fix the problem, truly he goes to the required point that he gets by goTo but its hovering there isn't steady! although if I send him 0 0 0 by goTo then it's steady!
any help to solve the problem to be more steady on the new point that I give by goTo?!
the data that I send isn't from flowdeck it's from slam (ROS) , I verified the data that I get from slam and it's fine I get it correctly !