Hello! I've recently dug into the platform to power an AR Drone 2.0
I've worked with various methods trying to get autonomous flight (ROS, python, etc..) and had little luch. EZ Builder is great, with the object detection.
Now, what I want to do is:
Modify the code and how the drone reacts to input, ie: instead of moving towards recognized object, I want to have the drone move towards it until it fills 3/4 of the video frame, then stop, turn, ... eventually I want the drone to identify all objects and approach them, but not collide with them, then turn and find new object to investigate.
Can you help me with this? I'm on the Windows EZ Builder and have no idea where to access the code in order to edit it.
Upgrade to ARC Pro
Synthiam ARC Pro is a cool new tool that will help unleash your creativity with programming robots in just seconds!
ARC is different than ROS, Python, or really any other robot programming language. The code is held within the individual controls or plugins. There is universal code that ties everything together. These controls all work independent of each other within the confines of the universal code. You can use scripting components to make the robot do whatever you want it to do by using bits and pieces from all of the various controls. The scripting controls are their own controls and run in their own thread. Really, everything runs in its own thread. The script can access variables (which are all global) to share information between these controls. You can also write your own plugins if a control doesn't exist that you need. These plugins are developed as DLL's in C#.
There isn't coding as you had with the other platforms, but scripting which is far easier to pickup and run with. The scripting language is very simple to understand but quite powerful. The script controls are under Project then Add, then Scripting then EZ-Script for example.
If a control isnt available that you need, you can get to the back end code via plugins. There is a great tutorial for plugins at http://www.ez-robot.com/Tutorials/UserTutorials/146/1.
If you used ROS, this is kind of like that only much simpler to use. Each control is kind of like a publisher and your script is kind of like a subscriber. Of course your plugin could be a publish and/or a subscriber if you opted to go that route.
I would start by spending some time here though.
I think CochranRobotics answered your question really well. The only thing I would add here is I would focus on the scripting controls inside of ARC. Once you dive in you'll find it to be very robust. Looking at the script example projects (if you have not already) can be a great way to see some the things scripting can do.
Do you happen to have an EZ-Robot robot kit as well? You might find it easier to experiment with a rolling robot for scripting actions based on camera input instead of a flying drone. (At least I would.)
There is a thread on this forum from a year ago or so with someone accomplishing the same thing - but I'm unable to find it. So we'll just start from scratch
The ARC.software does have an option for having the drone move forward when tracking an object with the camera. However, you can override that option with a simple script.
If you are familiar with the concept of variables in programming, and a few logic statements, it's easy. And I mean really easy.
The ARC.camera control configures a bunch of variables about the detected objects. One of those variables is the object width, the other is the object height. These are the two variables that directly relate to your question.
So, a simple script that loops and checks the detected object status, height, and width... And then determines if the robot should "stop" or move "forward".
I'm on my phone at the moment, so coding examples aren't possible. But it's literally 5 or 6 lines of code. Put the code in the tracking script of the camera control.
To start, I recommend adding the variable watcher control to your project. You can watch the detected object variables. The control can be found in the scripting category of ARC.add control menu.