I started this project recently to make ROS 2 package creation easier and to reduce the likelihood of user-made errors. I believe Turtle Nest will help the beginners to get started faster with ROS 2, while also helping professional developers to create new packages.
For instance, I often found myself reviewing the documentation to refresh my memory of ros2 pkg create command and its possible options. I also needed to check how to create new nodes and launch files, and how to add them to CMakeLists.txt or setup.py files. This whole process has many potential pitfalls and places for possible mistakes, especially for new users.
With Turtle Nest, you can just simply run turtle-nest command and let the application guide you through the package creation.
Here are some key advantages of using Turtle Nest instead of the ‘ros2 pkg create’ command:
Easy to use - no need to dig through the ROS 2 documentation for the right commands or manually add things to CMakeLists.txt or setup.py.
Create C++ and/or Python nodes - which are ready for further development.
Automatically adds necessary dependencies - rclpy, rclcpp, and std_msgs.
Option to create a launch file - that launches the created node.
Create C++ and Python nodes within the same package - combine languages that typically require separate packages.
Naming conventions enforced - no more failing builds due to incorrect package or node names.
Remembers the important details - workspace path, maintainer name, and maintainer email for the future packages.
Future enhancements may include:
Easy creation of _msgs -packages
Adding parameter files
Including more dependencies
Adding nodes, launch files, etc., to existing packages
I plan to release this package via apt, but before that I wanted to post it here to hear your thoughts and have you try it out first. All feedback is greatly appreciated!
Great work! Maybe it could include the ability to add sub/pubs for user provided topic names. I see it as an efficiency tool that could even possibly be integrated into code editors through an extension (like the Arduino or PlatformIO VSCode extensions). Would be interested in contributing to whatever you have planned for it
However it doesn’t provide the kind of guidance that a GUI tool can. If you can think of additional options to add to it, please implement them and send in a PR! It’s not that hard to add additional options.
Love it! Creating a package is something that my brain always forgets the exact terminal line and I (shamefully) always have to go to the ROSdocs to copy paste😅 so a gui would indeed help out here for us forgetful people.
Yep, as @gbiggs said, the ROS 2 CLI is always there to do these things over the command line.
The GUI will create the template node with the chosen language, if the user provides a node name. It can create both Cpp and Python nodes at the same time.
The difference to CLI is that the CLI currently only provides a Cpp or Python file that has a main function to print the hello world, while Turtle Nest provides an actual ROS 2 Node that is spinning and printing a hello world. This gives a faster starting point for the users to start adding their custom subscribers, publishers, etc.
Interesting that you mentioned the code editor extensions. This is actually something I was also thinking about in the very beginning of the development, if this tool should instead be an extension to an editor. But I decided to make it as a standalone application not to tie it into a single editor, as users tend to have different preferences
I will definitely think about adding the subs/pubs based on user input. Adding new features will be a lot of balancing on having the UI as simple as possible vs. adding as much as helpful options for the package creation as possible. Adding subscribers and publishers might be one of the features that could end up being somewhat difficult to add, considering all the possible options user might need to customise (custom message types, qos, etc.). But I’ll see what can be done. Thanks for the suggestion!
Contributions to the package are definitely welcome. You can open a new issue in the package, where we can discuss the new feature to plan it before the implementation. For example one of the next things I would like to have is Windows support for the package.
Thanks @jak for the contribution! This will definitely be very helpful.
But I am wondering why is the code written in C++? Using python with a template library like Jinja2 would have made it more flexible and easier to extend.
C++ as a coding language was more of a personal preference, as one of the motivations for the project was to learn something new; to use Qt on C++
I checked out Jinja2, I hadn’t heard of it before. It looks like a handy tool! And seems to be available on C++ as well. There would be definitely a place for improvement what comes to the code generation. I also learned today that ros2cli uses Python em library to achieve the same thing.
ROS uses em in many places, but don’t consider that an endorsement that em is currently the best one to use. ROS has been using it for over a decade now, and there may be better libraries that have appeared since then.
Good job.
I thought, only I have the problem of forgetting the commands and it’s format, but it seems its normal because I see many mates are on the same page with me.