Using curves in block coding

I have been teaching my students the basics right now using the block coding, but can’t seem to get the curve function to work correctly unless you leave z at 0. Using the simulator I see that if I change z to 1 while making a circle the circle would tilt 45 degrees. If I change z to 2, it turns the circle up on end 90 degrees. Should I be able to use z to make the curve do something like a corkscrew? Does someone have a good explanation of curves that can help me? I am not a beginner programmer, I programmed for many years before becoming a teacher.

Hi Seth, let me see if I can help explain and I will point you to a lesson where we talk about this:

Understanding the Curve Block | DroneBlocks Curriculum

First off, keep in mind that we try to stay consistent with how the Tello drone behaves when flying a curve. That means a positive X value is forward and a positive Y value is left. Here is an example of the curve block with the default values. This is looking straight down on the X/Y plane since Z is 0 in the default case.

You’ll notice I’ve plotted the values on the simulator output. Think of it this way… when any curve command is being executed Tello assumes its current location as 0, 0, 0. Then the two points in the curve block are plotted based on this starting location. Once they are plotted Tello then flies the curve pattern. When I use the term “plot” Tello (and our simulator) are doing a real-time calculation of where to fly.

Here is another example except that negative Y values are used and therefore flies the curve to the right:

The following example includes the Z axis and therefore Tello flies a vertical arc. The view is from the right looking left:

I also just ran a test in our V2 simulator that we will be launching in a couple of weeks. I like to make sure our code still works properly in the new sim. This is the 3rd example from above, but in the new DroneBlocks simulator:

I hope this helps and please feel free to respond with any questions or concerns.

Thanks for the pictures and comments, but I still have the same issue. Let me try to rephrase my question.

Let’s say that I want the drone to fly in a corkscrew pattern. Is that possible? So as it curves, I want the drone to rise slowly. In your last example, if I put in 50 for z2, would that do it? In the simulator, it look like if I put in a 1 for z1 in your example it would do the same thing as your picture. Am I better off not changing the values for all x, y, and z when using a curve but only change 2 of them? I will go back to the simulator and try some more things.

Thanks.
Seth

This isn’t perfect due to the way Tello flies its curve pattern but you can probably experiment with these values. I’ll spend some time later trying to get this to be a tighter corkscrew:

https://dev.droneblocks.io/simulator.html?share=1&missionId=sdomfa8y8qlvpuvg6bf37d46ghme7n17&uid=google:103480883879447963317

here is a screenshot of the pattern in our new Tello sim:

Here is a much cleaner version:

https://dev.droneblocks.io/simulator.html?share=1&missionId=qjqkv8zjiglisv7l2bhvqr9bqtrfzwhb&uid=google:103480883879447963317

Dennis,

Thanks, I have it now. I think what was throwing me off was trying to force the drone to do more than a half circle in the curve. What you wrote was what I wanted to do, but something threw me off. If you have the drone fly most of the circle in one curve command, it works fine until you mix in z. If I stay with half circles, the problem goes away. Just need to learn the limitations better and that will come with time. Thanks for the reply.

Seth

Glad to hear you got it working Seth! When you’re done please share your Tello code so we can give it a run. Thanks!

Dennis,

I’m very new to the DroneBlocks community and could use some help. My students and I are having challenges getting the Tello drones to execute the Curve command in any fashion. The drone completes the Takeoff command and then just hovers at the Curve command. We have tried this using Chromebooks and Windows PC’s.

Here is the code we are attempting.

Thank you for your support,

Chris

Hi Chris,

I successfully tested the curve block values above. The described behavior can be firmware-related. Can you verify if your Tellos are fully updated? We have a video that covers firmware updates linked below. Let me know if you have any questions.

Have a great day!

Thanks,
Ryan

What I don’t understand, is why would they completely flip the axis from typical algebraic standards? Not to mention, negative is to the right, instead of left? Why would they even do that? If there is a reason, I am willing to listen, but it makes no sense based upon what we have all learned through school.

I hear you loud and clear. It is confusing from what we may have been taught in school and traditional math classes. I’d say it’s more of a robotics convention. For example, we have developed our new DEXI drone based on ROS. In ROS the axis convention is the following:

  • x forward
  • y left
  • z up

From here:

https://www.ros.org/reps/rep-0103.html

I hope this helps.