Welcome to the Robolink Community forum!
Issues in demo unit for KMSO in NY
I have used time.sleep() before, but doesn't help a lot before. But, I will test this again after refreshing the connection.
However, currently it is solid green (tail LED) when a battery is plugged in
Even reset doesn't work
I setup the 30 min tech support this afternoon, but no show.
robolink_leila last edited by
@jaykay0408 That landing looks about right. It varies from drone to drone. You can probably write your own function if you would like that decreases the throttle in increments. For the skipped commands you were mentioning, I have found it useful to insert a
time.sleep(1)in between commands. If you use the time library make sure to
import time. Let me know if these answer your questions.
@ixmclean One more question:
As you can see from a video, when a drone lands on a floor using land( ), it hit a ground hardly. I guess this may cause a problem of a motor (position).
So, is there way for very soft landing using library?
(see the last part of video for landing)
Yes, sometimes, the communication drops to the drone (1 in 6 times is a rough guess) I've made it a habit to unplug the BLE cable, and re-seat the CoDrone Battery to ensure a fresh connection most of the time.
--> Mine is almost every time of the communication drop. Anyway, your suggested workaround (i.e., reconnect BLE and battery every try) is working so far (I tested successfully 4 times in a row)
However, the first case of my failures (in my previous note) still happened to me. Even after successful landing, the right front motor is now running. So, my another question is:
Do you have any library to test a specific motor without takingoff nor calibration?
Now, whenever the motor is not working, I run calibrate( ) with holding a drone by left hand, and adjusting motor position in a arm until running. Then, re calibrate() -> run the code.
This is not convenient also not safe (a couple of times hit my fingers). Any suggestions?
Thank you in advance.
sadly, I can't take the drone home to test on my Apple.
With regards to your code and videos, Yes, sometimes, the communication drops to the drone (1 in 6 times is a rough guess) I've made it a habit to unplug the BLE cable, and re-seat the CoDrone Battery to ensure a fresh connection most of the time. I would say that I don't think I've had mine not execute the rest of the code post takeoff though (if it falters it errors out before take off, or if it does falter [this is rare] it would not take off but continue with the program [and no solid green pairing light])
Thank you so much for your suggestion.
- Did you test the code with Mac using terminal and vi?
- Based on your suggestion, I tested the following code with PyCharm and here are the results:
====== Code ======
from CoDrone import Direction
drone = CoDrone.CoDrone()
======= End of code (I added sleep in case of latency, but not helpful ====
(i) first case of results: sometimes right-front motor is not working see a video below.
--> I plugged the motor into other position. Then, work. So, a motor is not a problem. After adjusting a position of motor to a arm, it works. But, not clearly understand what is a problem
(ii) second case of results: sometimes couldn't pair, but no error message. The rest of code are executed, but no movement. I checked this with print(). See a video below:
(iii) third case of results: sometimes can be paired and takeoff(), but rest of commands didn't work. A drone is just landed (looks like forcely because the program is not ended yet). See video below:
(iv) forth case of results: just one time. a dron moved to LEFT, but rest of commands didn't work. Then same as case (iii).
Also, from time to time, I need to reconnect a battery to be paired.
3. Any advices and comments are welcome.
I'd like to know if this is caused by a drone (specific) or programming problem.
Thank you in advance for your help.
ok run some tests, and I'm having no issues with my code running at command line
Using Ububtu (I have a mac at home, but doubt they'd let me take my project out of the building)
any IDE should work. even nano/vi/emacs
as far as your a1.py code, I copy/pasted into nano, (added the Direction and ended with a drone.close() ) and it worked the 2nd (and 3rd time) time I ran it (I've noticed that it is common [1 in 4] for the execution to get interrupted (like when I have a battery check for anything under 10% and it would close on a fresh battery, or close itself before my check)
as for the runtime, it barely did a forward/backward nudge
I added a "1" time component: drone.go(Direction.FORWARD, 1)
(and to the backward) and it ran smoothly for 1 sec forward and backward
ATM I'm using PyCharm. Works well so far. odd that command line isn't working for you though. I run a test on my own system to see if I'm encountering problems.
@ixmclean Thank you so much for your quick reply. I just figure out the problem.
I have run the program using terminal python script as below:
i) MacOS -> Start terminal
ii) at command line:
Sometimes, command line interpreter looks like lose some data (not sure, there might be byte data...), which caused the problem.
However, using Jupyter is fine.
So, my question is :
"What are suggested IDE for CoDrone programming rather than Jupyter?"
During the competition, some of students are not familiar with Jupyter, so I'd better know what are the suggested IDE.
Also, any work around of the problem using command line script programming?
Thank you in advance.
here are some correcitons I see:
when using go():
drone.go(Direction.RIGHT, 1, 30)
where your import section must also include: from CoDrone import Direction
(here is a the basic page for the go() command: https://support.robolink.com/codrone-library/go)
with regards to the set_pitch()/move() based on reading the code, it should work (though I've found that 30 and below sometimes has minimal effect, but not consistent)