How do I use a function?

Ken Kroeker

I don't want to write a function - I just want to use a function contributed by someone else.  Can someone provide some guidance or post an example??

0

Comments

9 comments

  • Comment author
    Jim McAndrew Dronelink Staff

    Just copy it into one of your repos.

    0
  • Comment author
    Ken Kroeker

    I've done that JIm, but how do I implement it as part of a component?

    0
  • Comment author
    Jim McAndrew Dronelink Staff

    That's not how functions work. You either run a function, or do a re-planned mission. Functions can take components as inputs, but that requires programming (which you don't want to do).

    0
  • Comment author
    Ken Kroeker

    It would have been more instructive if you had said that the functions are called by the native app directly.

    I have yet to find anything that I want to do that can't be done using the existing components. I was concerned though about the amount of data that has to flow between the app and the drone and how that might cause jerkiness or other issues. I thought that the use of functions might be more efficient and so result in smoother operation.

    0
  • Comment author
    franknitty69

    Ken, I'm not sure you are understanding the power of functions. When you plan with components you are working with a set of assumptions based on what you see on the map. With functions, it allows you to run components but in real-time with real-world info.

    For instance, I've planned orbits using the web UI, I set the alt at some high arbitrary number that I know clears obstacles (like 200 ft). I set the POI based on the map. I go fly, alt is higher than necessary, the center of the POI is off by 6m and my gimbal pitch is too shallow.

    With functions, I can run that same orbit, but from within the mobile app while I am on location with real information from the location. For the orbit I fly the drone to the center of my poi, I fly to the correct alt, set my radius by flying to it, and set my gimbal pitch. So now all of this real information is used to generate my orbit.

    And if somebody gave you a function, simply add it to the WebUI and it will appear in the mobile app. if the function is written correctly, it will prompt you to do things (like fly to center of your poi) and for information (speed, etc), it needs to generate a mission. And then execute the mission.

    0
  • Comment author
    Ken Kroeker

    The original post is 18 days old. I have figured it out since then. Thanks for the response though - The more responses that come from users, the easier it will be for new users to learn how to use Dronelink particularly since there is currently no documentation.

    0
  • Comment author
    Jim McAndrew Dronelink Staff

    In fairness, we do have the video tutorials, the open source code, the Kernel typings,  and when in doubt, you can always look at the DJI SDK documentation of a description of what a command does (all the commands are just pass-thru to API calls here).

    0
  • Comment author
    Ken Kroeker

    Judging from the number of times documentation has been mentioned, I suggest that written documentation is necessary. Oddly enough, documentation does not appear in the Trello matrix.

    Have you considered making the first round of documentation a community project?  You would still end up editing it, but you might get there sooner. 

    I recognize that the speed with which Dronelink is developing makes documentation a rapidly moving target - it's a fact of a developer's life. Still, I think there is a lot in Dronelink that is not that subject to change and could be documented.

    While I thought the tutorials could have been better, they got me flying successfully.  Reading the forum has helped me understand why missions fail and enabled me to avoid incorporating those errors into my own flights. I would say the Forum should have been in your list ahead of the source code, Kernel typings and SDK documentation - all of which I have looked at.  Not everyone wants to read code - or is able to.  I think most users just want to fly.

    Think about a community documentation project - there's a pandemic and a long cold winter ahead (at least for me). I won't be flying much in the snow at -30C - the drone would be fine, but not me.

     

     

     

     

    0
  • Comment author
    Jim McAndrew Dronelink Staff

    I am not saying written documentation is not necessary, I was just pointing out that there are resources available. The issue is we give white-glove support to our enterprise customers (which is who most of these features were created for in the first place) to make up for the lack of documentation, and it seems to be working well for the moment. Documentation will happen, but as you can see, we are a small team and the list is a mile long. If the community wants to start a wiki I will happily link to it, but in the end we will have to do it ourselves (as you point out) to make sure it is accurate and useful.

    0

Please sign in to leave a comment.