GSOC 2022:Tools for creating new ignition projects

Hello Community,

I am Harsh Mahesheka (https://harshmahesheka.github.io), an Electrical Engineering sophomore from IIT (BHU) passionate about robotics, especially ROS and Gazebo. I have been working with these for over a year now and recently started working with ROS2 and Ignition Gaezbo and loved the improvements. I came across the project list for this year’s Google Summer of Code and found the project titled “Tools for creating new ignition projects” quite interesting and useful. I think such a tool will be handy for a lot of users and would like to contribute more to the Ignition Gazebo repositories through this project.

After guidance from a potential mentor of this project @arjo129 , I source built ignition fortress and created a new package with some custom worlds, models, and plugins.

The major pain points that I felt were-

  1. There was no documentation, instructions, or template repository to build a standalone ignition package. I had to read through the examples he sent along with CMake documentation to create a base package.

  2. Adding anything to the package was a multiple-step procedure from multiple lines of code in Cmakelist.txt to Hooks and can surely get clumsy.

So, in conclusion, building an ignition package now can be a tedious task, especially for beginners, and indeed requires good knowledge of many topics like CMake, etc.

Possible Solutions-

  1. Firstly, we can work on a program that generates a template package like ros2 package create
    does with various options like whether the package will depend on ament or not, what custom things(like world, plugins, etc.) they want to add.

  2. Then, we can work on easing the mechanism of adding custom plugins, worlds, etc.; as discussed in this https://github.com/ignitionrobotics/ign-cmake/issues/185.As discussed, we can create macros that will do the work for the user.

Any type of questions,suggestions or guidance is most welcomed :smile:
Thanks!

4 Likes

As discussed above, we could have an ign pkg create, which would create a template repository. It could have two significant arguments -

  1. To depend or not depend on ament
  2. Option to create a base package or advance package(with pre-made folders for worlds, plugins, tests, etc., and hooks pre-created, so you just need to add files within respective folders).

Also rather than going into creating an ign subcommand, we can write a python file that will paste the template repository based on given arguments in the location where it is executed. We can make the file an executable inside CMakelists.txt.

Any ideas, suggestions will be very helpful and appreciated.

Just to aid you you can create ignition subcommands using ruby. Examples of such subcommands are here ign-gui/cmdgui.rb.in at ign-gui6 · ignitionrobotics/ign-gui · GitHub and ign-gazebo/cmdmodel.rb.in at ign-gazebo6 · ignitionrobotics/ign-gazebo · GitHub . These commands are wrappers around a C++ core, but it may be possible to use just ruby for your use case.

Hello Everyone,
I tried to create some prototypes for getting a better idea of the project.

Firstly for macros, I have created 4 macros: ign_add_resources,ign_add_plugins,ign_add_executables and ign_environment_hook with features as mentioned above

You can check the code at Prototype Macros.
Also, I have created a video demonstration of them working here.

Now for package tool,I think ignition subcommand will be best way to go forward.But for getting a better idea of project I have created a prototype of it in python.

You can check the code at Ign_pkg_create.
Also, I have created a video demonstration of it working here.

Any kind of suggestion,review or criticism is much welcomed and needed.

1 Like

Hi @Harsh_Mahesheka_5-Ye ,

That’s really impressive work in such short time! The tool is very powerful already! Looking forward to your application!

See some replies to your questions below.

Cheers,

Louise

I don’t think that using ign-tools for this tool would be a requirement, but even if we want to use it, we may be able to plug in your python code to the tool instead of using C++.

I can think of various cool features that can be added, like more fine-grained control of the package type instead of just basic / advanced, adding some placeholder C++ / python code and the required CMake instructions to build and install them correctly, adding comments to the generated CMake file for users to know what each part is for… For the implementation, I think it would be nice to remove the hardcoded library versions and instead fetch them from gazebodistro.

As I mentioned in my email, this is incredibly impressive useful and awesome stuff you’re doing. For the purpose of maintainability we should probably use ERB or empy for the templates. While @chapulina has suggested directly plugging the python code in I think we probably have the time to refactor out the code so you could consider using just ruby to save you some hassle.

1 Like

Thank you so much @chapulina and @arjo129 :smile: ,

I think an ign subcommand would be cleaner and more familiar for a new user and considering the duration of the GSoC program we can tilt towards that side. For implementation, we can try out plugging my python if it does not work using ruby as suggested by @arjo129 also seems fine to me.

I was also thinking about this.We can look into various ignition projects for getting a better idea what common package types users wants.

Yeah, I was also working on macros for adding and sourcing codes. We can combine these two to create a tutorial cum template placeholder for users.

This will be quite necessary I guess as the whole tool is targeting the new users.I was also thinking of eventually creating a detailed tutorial for creating ignition packages using this tool.

Yeah, this seems a better way of doing it.I will try implementing it and get back to you.

Sure,I will read about these and get back to you.

All these suggestions seem really cool and I would love to work on them. The current ideas that I mentioned will just be the base of the project but I would love to work on suggestions like this from mentors and the community.

1 Like

Hello Everyone,
I tried to implement some of the suggestions suggested by the mentors. I have added a mechanism to fetch library versions from gazebodistro, added comments to generate CMake files for users, etc. Also, I have created a prototype for ign create pkg -add_plugin plugin_name -add_executable executable_name and pushed them into a different branch.These options will create and install boilerplate/example plugins and executables for users. I will be working on implementing other suggestions for now.

Any type of questions, suggestions, or guidance is most welcomed.
Thanks!

2 Likes

Hey Harsh is this package available anywhere for us to try?

Yes, the package is available at GitHub - harshmahesheka/ign_pkg_create and for ign create pkg function I have created another branch within the repo here GitHub - harshmahesheka/ign_pkg_create at add_plugin/executable.

Hello Everyone,
I am more than excited to inform you that my proposal has been selected for this year’s GSoC program :tada:.
I will be working on this project for the next few months and will keep updating my progress here. Starting with the work, I have created a pr regarding macros here.
The project is quite a user-orientated project, so any kind of review or suggestion around the project is much welcomed!

2 Likes

Hello Everyone,
I have finished the first iteration of the project. I have created two pull requests for-

  1. Macros- Macros for creating new gazebo package by harshmahesheka · Pull Request #262 · gazebosim/gz-cmake · GitHub

  2. Subcommand- Ign pkg_create by harshmahesheka · Pull Request #1582 · gazebosim/gz-sim · GitHub

Would love all your reviews and suggestions!!! Do try it out!!

1 Like