Dear Gazebo community, Hope you are well ,
I am Amr Elsersy, a 3rd year computer engineering student @ ASU, Egypt.
I am very interested in software robotics, and i am really excited to contribute in ignition , specially Plotting UI for Ignition Project , i have an experience in Qt C++ Framework in many projects in both (Qt Widget & Qt Quick, QML), i also have experience in ROS as i participated for 2 years in a ROV team that enters the ROV MATE Competition & we use ROS in our project.
And as i am interested in both robotics and qt applications, i felt that this project is the best choice for me.
This field is very interesting for me and i want to get that amazing experience of open source contributing in ignition.
i followed all the tutorials of ignition gui and i got familiar with it. also i learnt Qt Charts in QML and got familiar with it.
i want to know what is the next step that i can do ?
thank you very much for your time
Thank you for your interest in the plotting project! I see youāve already been playing with Ignition GUI and Qt Charts, which is great! Thatās probably the best way you have get a feeling for what the project would be like!
Thatās great! Ignition GUI also has some examples here which are not easy to find, be sure to check those out too. Iād also recommend you go over Ignition Gazeboās tutorials and examples, because those will be important for you to know how to extract data from simulation.
Hello Louise, hope you are fine
i have followed your suggestions for a while and that is what i did :
I followed the examples of the ign-gui and knew how to build a gui plugin
I followed the tutorials and examples of ign-gazebo and got familiar with it and with its
entity component structure and learnt how to extract data from it via the ECM
I also followed the tutorials-examples of the ign-transport to get familiar with it
I tried to apply all that so i write a code to plot the x-coordinates of a car in ign-gazebo (i used the ālevels.sdfā in the examples to get the car & āstandalone keyboardā to control it)
and i make 2 plugins , a System plugin & Gui Plugin, the system plugin extracts the position of the car and publish it via ign-transport publisher to the gui plugin, and the gui plugin subscribes to that topic to get the data and plot it via Qt Charts
i want to ask about your opinion in what i did
is that is the best way to extract data from ign-gazebo ? via ign-transport ?
or it can be done only by the gui plugin ?
i tried to make the gui plugin and system plugin in one plugin (making the class inherits from Plugin, System and ISystemPostUpdate ) but i had i huge amount of CMake errors ,but i guess that they are 2 different types of plugins and cannot be merged, what do you think about that ?
thank you for your time Louise, i will be waiting for you
That sounds like a great approach! Plotting values from Ignition Transport topics is definitely a very common use case that needs to be supported. Iām super impressed you got it to work so fast!
Thatās definitely one of the ways. I think many users will be using that. The advantage of Ignition Transport is that itās not limited to Ignition Gazebo. Other applications could be publishing on those topics and using your plugin to plot them.
Another use case, specific to Ignition Gazebo, is plotting data directly from components. See below.
Iām not sure if youāve seen this, but thereās a plugin type in Ignition Gazebo which sounds like it does exactly what you want, ignition::GuiSystem Iām adding an example on this pull request. That should give you access to components on the GUI. I think that would be the 2nd most common use case for the plot.
I just replied! Youāre welcome to open a pull request against ign-guiās default branch with your changes! Be sure to update all other libraries according to this list. Thanks a lot!
This is really very helpful
no i didnāt see it before, this definitely solves the problem, i was using the ign-transport not for only plotting via topics, but also to plot via entitiesās components ! , because i thought that i canāt do that in the gui plugin so i made a system plugin and connect it with the gui plugin with ign-transport as a bridge to transfer the entities and components data, but the GuiSystem plugin is a perfect solution ! thank you very much
I re-implemented the code to use the GuiSystem so that we will implement one plugin that has the logic of the plotting in 2 ways (via ignition transport and entities-components after we get access to the ECM ) and this is the code https://github.com/AmrElsersy/Ignition-plotting/tree/master/gui_system_plugin ,
of course it is hard coded to subscribe to a cretin topic, and access specific component, but the next step is to make the user choose them
this is a 35 seconds video shows the plotting via car position and plotting via ign transport ( publishing via the terminal )
but i had a small problem, that the GuiSystem Plugin can run only via ign gazebo with ign-gui ! i canāt run it via only ign-gui, so how can the user use it outside ign-gazebo?
is that normal ??
my updates are in ign-gui only, what do you mean by updating other libraries ?
Yes, thatās a good point. The GuiSystem only works with ign-gazebo. I think it would be great to:
have the bulk of the plotting code on ign-gui, outside a plugin
have a pure ign-gui plugin which implements the Ignition Transport interface on top of the plotting code
have an ignition::gazebo::GuiSystem which implements the components interface on top
What do you think?
Oh sorry, what I meant is that since this is targeting an unreleased Ignition version (Ignition Dome), youāll need to build several libraries from source. Iād recommend you actually build them all from source, using the branches on the file linked above. You can find instructions here.
i have installed all the libraries listed here from source.
i worked on accessing all the transport topics to let the user choose from them which topic to plot , i made a topics model by subclassing QStandaredItemModel and accessed all topics to fill that model to show it to the user.
in this video i publish 3 different topics with constant value msgs float , double , int , and the user chooses from them and the code checks the type of the subscribed topicās msg and assign a siutable callback to update the values.
also i tried to make the 2 plugins ( pure ign-gui plugin & gui system plugin )
I thought that both plugins will use transport plotting because when simulating any robot, the user may want to plot transport values from his controlling code.
So i made a transport plotting behavior outside the plugins and made the 2 plugins composite that transport behavior. and the gui system plugin implements also the entity-component plotting .
this is the code GuiPlottingGazeboPlotting
and this is a class diagram of the code
the GuiPlotting is just an interface between the transport and UML
there is a lot of redundant code between GuiPlotting and GazeboPlotting, both have the same functions that QML calls, i couldnāt make this functions general and both plugins inheretes them as the 2 plugins has different names and Qml accesses that functions through the plugin name so i had to copy them in the 2 plugins.
also this is a video that shows the running of the plugins
actually after i finished that, i felt that i did something wrong or i donāt understand the whole design that should be done, as there is a lot of redundant code
what do you think about that ?
Cool! Note that weāre migrating everything to GitHub. So that gazebodistro file is now here: https://github.com/ignition-tooling/gazebodistro/blob/master/collection-dome.yaml . Also, youāll need to update your entire environment with git clones instead of the old mercurial ones, and manually copy your changes to the new clones.
This is looking great!
Humm good point that QML is using the plugin names. Maybe we can work around this by creating a new class, say PlottingIface, and setting it as a new context property as done here? That should expose the new class to the QML. Then the plugins wouldnāt inherit from that class, but they could maybe keep it as a member variable?
This is great!
@claireyywang, feel free to pitch in if you have any ideas.
do you mean that i should install all of them from source again ? or just cloning them ?
Ok i tried this, but i couldnāt composite any class that inherits from QObject in the Gui Plugin Class ! i donāt know why but when i do that it gives me that error
error while loading the library libGuiPlotting.so: undefined symbol: _ZTV17PlottingInterface
it canāt see my interface, and when i remove the QOjbect inheretance and Q_OBJECT macro, it works
i tried this in many ways but it dosnāt work, and i didnāt find any other plugin that do a thing like that, so is it because of ignition or it can be done ?
Hi Amr, I think just cloning repos into /src + copy your changes should be fine. Also quick tip if you are building with colcon, using colcon build --cmake-args -DBUILD_TESTING=OFF can speed up the build process.
That looks like a linking error. We need the QObject for Qt to work. Iāll give a stab at the code.
Hi Amr, would you mind adding more documentation on the repo about how you are running/testing your code? The demo you recorded looks amazing, would be great to know how to reproduce it. Also sorry itās taking me a while to figure out the problem. We have a release this week and thatās been hogging my bandwidth. Will get back to you asap.