-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI model info dump #893
CLI model info dump #893
Conversation
I will review it while the tests are finished. |
f4e5cdd
to
df9eee1
Compare
Here is a little demo running the diff_drive world. You can see here the usage of the model command, requesting the list of available models in the world, the whole model description, and even the link list and then a link in particular. You can request all the joints and a particular joint the same way. modelDemo.mp4I am of course open to any suggestion about the way the information is displayed here. |
The functionality yet to be tested is to display the properties of a bounding box component, even though the implementation for it is ready. The reason for this is that I haven't found a world containing such component. Any suggestions about a world I could use for this? |
bc3d437
to
5e33380
Compare
We don't have any systems or examples using that component. Some system needs to create the My suggestion is to leave this functionality out for now. In the future we could add a simple system that enables bounding box calculation on demand (because it's too expensive to do it all the time). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice new feature!
I left a bunch of minor comments. ptal!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments!. Just added a few nits
CI is failing when running test because of :
I haven't faced this error when running it locally though. |
Probably adding a tutorial using the |
+1, that would help giving the tool some visibility, otherwise it's difficult for users to discover it. It doesn't need to be too detailed, just straight to the point showing that the tool exists and some examples. Thanks! |
5eb97ed
to
bc9c373
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tutorial! I left a couple of comments.
13bc30a
to
154b625
Compare
Codecov Report
@@ Coverage Diff @@
## ign-gazebo3 #893 +/- ##
===============================================
+ Coverage 77.92% 78.14% +0.22%
===============================================
Files 215 216 +1
Lines 12089 12262 +173
===============================================
+ Hits 9420 9582 +162
- Misses 2669 2680 +11
Continue to review full report at Codecov.
|
154b625 fixes this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! I left just some nits
@chapulina Ready for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me! I did a first pass. Let me know if any comments seem unreasonable 👍
CMakeLists.txt
Outdated
@@ -149,7 +149,9 @@ set(IGNITION_GAZEBO_GUI_PLUGIN_INSTALL_DIR | |||
#============================================================================ | |||
# Configure the build | |||
#============================================================================ | |||
ign_configure_build(QUIT_IF_BUILD_ERRORS) | |||
ign_configure_build(QUIT_IF_BUILD_ERRORS | |||
COMPONENTS model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was separated into a new folder following the log structure
Usually following an existing pattern is a good idea, but I'm not sure that creating a separate component is necessary in this case.
On ign-transport
the log feature was kept in a separate component because it brings a new dependency which we didn't want to add to the core of the library (SQLite). But in this case, the model
command is not bringing any new dependencies and I think it's not sufficiently separate from the core to justify being its own component.
Would it be possible to move the new command into src/cmd
? I think this should also simplify a lot of the current CMake code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a commit with only this change so you can have a look at it. I didn't merge cmdgazebo.rb.in and cmdmodel.rb.in files into one single file because the gazebo command implements many defaults value and sub-commands itself and mixing them would be difficult to follow. Because of this I had to also leave gazebo.yaml.in and ignmodel.yaml.in in different files so the command find different ruby files to process it.
Implementing both commands in the same file was my initial approach when I first started so its doable, but I thought it was really messy and I had to adapt some of the gazebo command implementation so it could coexist with the model one, so thats the reason I decided to look for a way to keep them in different files.
Let me know what you think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #928 for a possible solution
Signed-off-by: Marcos Wagner <[email protected]>
Signed-off-by: Marcos Wagner <[email protected]>
Signed-off-by: Marcos Wagner <[email protected]>
Signed-off-by: Franco Cipollone <[email protected]>
Signed-off-by: Marcos Wagner <[email protected]>
084ead9
to
2f8d28c
Compare
Signed-off-by: Marcos Wagner <[email protected]>
2f8d28c
to
66bb5cf
Compare
Signed-off-by: Marcos Wagner <[email protected]>
55018ee
to
25c21d0
Compare
I have various suggestions on #928 |
Signed-off-by: Louise Poubel <[email protected]> Signed-off-by: Franco Cipollone <[email protected]> Co-authored-by: Franco Cipollone <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get it in! Thanks for the new feature! 🎉
🎉 New feature
Related to #313
Summary
Adding a model command that is able to print:
For this, the command can be used the following way:
ign model -m [model_name]
to get the full information of the model.ign model -m [model_name] --pose
to get the pose information.ign model -m [model_name] --links
to get the links information.ign model -m [model_name] --joints
to get the joints information.ign model -m [model_name] --link [link_name]
to get a certain link information.ign model -m [model_name] --joint [joint_name]
to get a certain joint information.Pendings in this PR:
Description
This features implements a new command allowing the user to request information about a model in the running world. To get this information, a copy of the ECM is created making use of the serialized state message, which is acquired from the
/state
service, as shown in #859. From there, each desired component is taken from the ECM snapshot and serialized.This command was going to be initially implemented along the gazebo command, but then it was separated into a new folder following the log structure, in order to separate the responsibilities of each command and also avoid any unwanted conflict between the subcommands.
Using this command you will be able to the following information:
Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge