Velocity

Firmware/software/electronics
Post Reply
RyanMco
Expert
Posts: 158
Joined: Tue Apr 09, 2019 6:15 am

Velocity

Post by RyanMco »

Hi !
I send by Goto a yaw value : 0.2 so my drone is yawing with angle about 36 degree ..
what Ima trying to do is that I want the speed of yawing with that angle would be more slowly as a result Im trying to see if I can decrease the speed of yawing with given yaw's value, I have searched in file of crazyflie_ros 's scripts (python scripts) but didn't figure out where I can modify the speed .. ofcourse there's a calculation to speed of yawing or something like that .. if not in crazyflie_ros's scripts as in my firmware, but where could I find that?! in goTo? I searched it step by step and didn't find out where I can decrease the speed of yawing ...
my script:

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.2, duration = 2.0, relative = True)
    time.sleep(3.0)

    cf.goTo(goal = [-0.5, 0.0, 0.0], yaw=0.2, duration = 2.0, relative = True)
    time.sleep(3.0)

    cf.land(targetHeight = 0.0, duration = 2.0)
    
Any help please? much appreciated !

arnaud
Bitcraze
Posts: 2275
Joined: Tue Feb 06, 2007 12:36 pm

Re: Velocity

Post by arnaud »

To change the speed of yaw you need to increase the duration of your goto, for example duration = 4.0 will yaw (and move) twice as slow.

Note that both the way and the linear movement will be slowed down.

Post Reply