Turning copter with python scripts

I'm trying to turn my copter using a python script, but the copter is not turning.


Script.SendRC(3,1450,True) #throttle
Script.SendRC(4,1750, True) #yaw
while(cs.yaw < 300):
    print cs.yaw
    Script.Sleep(600)

It stays in the while loop forever because it is not turning, so does someone know how to make it turn?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi Bob,

    can you please tell me on which air frame you mounted your APM?? also can you please tell me the web page where I can get the above mentioned python scrip?

    Thanks

    • The frame depends on your application, so I don't think knowing what frame I used will help you, but we used a vulcan octaframe.

      I made that code myself.

  • You should monitor the yaw value in the while loop to see if it is changed or not. If it is not changed, may be another value for throttle and/or yaw PWM should be set.

    • Actually the problem was that the scripts won't make the copter turn unless it is in the air, but I was testing on the ground. But it actually worked in the air.

      • So how did you check whether the copter was actually in the air or not? I'm a bit curious.

        • I think you misunderstood?

          The first time I tried it, I ran the script while the copter was on the ground, and manually turned the copter, but didn't notice any difference in motor pwms.

          Later, I actually flew it in the air first, and then ran the script, which actually made it turn.

          • Thanks for your explanation. Now I understand.

            In fact, you have suggested me one good way to check if the drone starts leaving the ground. It can be done by monitoring the yaw.

            • Shouldn't you check the altitude instead to tell if it leaves the ground?

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
DIY Robocars via Twitter
RT @araffin2: 🏎️ After hours of video editing, I'm happy to share a best of my Twitch videos on learning to race with RL. 🏎️ Each part is…
Oct 13, 2022
More…