Giter Site home page Giter Site logo

Comments (12)

whoenig avatar whoenig commented on July 29, 2024

Splitting it in two parts increases modularity, but also dramatically worsens maintainability. As an example, consider you are adding a new feature. In the current version, one can just have a single commit (or single PR), that includes the new feature in C++, updates the Python bindings, and adds a test (perhaps using the Python bindings, since that makes testing easier). If the repo is split, you need at least two commits (or PRs) to achieve the same and it becomes cumbersome to track related changes in the history.

For that reason, many projects actually including the Python bindings in their repos (e.g., OMPL, Drake). However, it is also common to disable the Python bindings by default or offer an option to disable it to avoid unnecessary dependencies. Would that solve your problem?

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

Thanks for the quick answer, yes I think adding an option to disable the Python bindings would be very helpful, maybe add a cmake module file which could then be included by us in our CMakeLists.txt file without the python bindings.

from crazyflie-link-cpp.

whoenig avatar whoenig commented on July 29, 2024

Sounds good - I'll look into this (but PRs are also welcome). FYI, I started working on the crazyflie_cpp port at https://github.com/whoenig/crazyflie_cpp/tree/dev-crazyflie-link-cpp, which already uses this repo as a submodule (but with Python bindings still active). It might make sense to combine our efforts, depending on which features you have and what your goals are etc. For crazyflie_cpp the short-term goal is to stick with the current API as much as possible, to minimize required changes in the dependencies (crazyflie_ros and crazyswarm). Longer term, I also want to re-visit some of the API choices.

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

I'm sure we'd be happy to help you with this, our goals currently are to write a c++ version of the python library to increase performance and get all the benefits that c++ gives over python, like better multi-threading.

We started working on this after the promising performance boost describe in this blog, we thought "If replacing the python crtp code with c++ code would increase performance so well, why not try replacing all the code with c++ and seeing if the performance increases even more?". Hoping for a performance boost was one of the main reasons that we started working on the crazyflie-lib-cpp.

While you're looking into adding the ability to disable the python bindings I'll discuss with my colleagues about your proposal to help you out with what you're doing, and hopefully we'll get back to you soon. In the mean time I am quite certain they'd be happy to help.

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

OK, we can move the higher level code into a "cflib" folder , like in the python version. and then we will do a PR back into crazyflie-link-cpp. Is that acceptable?

from crazyflie-link-cpp.

whoenig avatar whoenig commented on July 29, 2024

There should be no higher-level code in crazyflie-link-cpp - this repository is for link-related code only. As discussed earlier, you can use this as a submodule in another project (e.g., crazyflie-lib-cpp if you want to follow the bitcraze naming convention). I am doing the same with crazyflie_cpp and I am happy to help with any issues regarding that.

By the way, crazyflie_cpp has been around for at least 5 years and is written in C++. From what I can tell so far, it mostly had performance benefits because of the link layer being implemented natively. I don't expect very big performance otherwise, unless you operate a swarm (a use-case the Crazyswarm at https://crazyswarm.readthedocs.io/en/latest/ has been optimized for, which also relies on crazyflie_cpp under the hood).

from crazyflie-link-cpp.

whoenig avatar whoenig commented on July 29, 2024

@trakevital Let me know if this change is acceptable for your use-case, so we can close this issue. You may find an example usage at https://github.com/whoenig/crazyflie_cpp/blob/dev-crazyflie-link-cpp/CMakeLists.txt#L11-L13.

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

I'll start checking right away hopefully will answer you in the next 24 hours

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

I am right now checking the tweak you've made and I run into this error when trying to make the files. I am able to use cmake successfully and build a Makefile however when I run the Makefile it stops at 90% and outputs the follwoing message:

crazyflie_cpp/src/crtp.cpp: In static member function ‘static std::string crtpConsoleResponse::text(const bitcraze::crazyflieLinkCpp::Packet&)’:
crazyflie_cpp/src/crtp.cpp:78:12: error: ‘const class bitcraze::crazyflieLinkCpp::Packet’ has no member named ‘payloadAtString’

In vscode I hovered over the lines which give out the error and this is what it said:

class "bitcraze::crazyflieLinkCpp::Packet" has no member "payloadAtString"C/C++(135)
‘const class bitcraze::crazyflieLinkCpp::Packet’ has no member named ‘payloadAtString’

Despite this, I have succeeded in building Makefile without python bindings

from crazyflie-link-cpp.

whoenig avatar whoenig commented on July 29, 2024

You would need to try an older commit, since I made some changes in crazyflie-link-cpp that are not pull-requested, yet. This should be independent of of this issue, though.

from crazyflie-link-cpp.

trakevital avatar trakevital commented on July 29, 2024

Yep it worked. Only one last thing: I recommend changing the crazyflie-link-cpp submodule url from: [email protected]:bitcraze/crazyflie-link-cpp.git to: https://github.com/bitcraze/crazyflie-link-cpp.git as described in here

from crazyflie-link-cpp.

whoenig avatar whoenig commented on July 29, 2024

Thanks! I'll also need to set up CI, which should be able to find those sort of problems.

from crazyflie-link-cpp.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.