Skip to content
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

Suggestions to model CLI (#893) #928

Merged
merged 5 commits into from
Jul 23, 2021

Conversation

chapulina
Copy link
Contributor

Pull request #893 is working well for me. These are some suggestions ranging from small styling nitpicks (indentation, empty spaces) to large infrastructure changes (no separate component).

Everything is a suggestion, let me know what you think, @WagnerMarcos !

Here's a summary of the changes:

  • Don't create a separate model component, because this would make users install a new libignition-gazebo3-model.so library). Instead, put the new functionality into the existing ign component / library. I kept the yaml and ruby files separate, which I think addresses the concerns in CLI model info dump #893 (comment)
  • (hopefully) made the new test pass on macOS by applying all the logic that's applied to ign_TEST (these are the changes with CMD_TEST, as well as BREW*)
  • Various styling updates to the output:
    • Consistent indentation
    • Removed double spaces, or spaces at the end of a line
    • Consistent entity + name printing (added helper function entityInfo) - some entities missed their IDs
    • Consistent pose printing (added helper function poseInfo) - the inertial pose was missing RPY
  • Fixed joint parent and child links, which were swapped
  • Fixed running the ign model command without arguments (now it prints help)
  • Using ignition::gazebo namespace to make code shorter and more readable
  • Did more null pointer checking for the components
  • Removed the hardcoded world entity as 1 (that assumption may change)

@chapulina chapulina added the 🏰 citadel Ignition Citadel label Jul 23, 2021
@osrf-triage osrf-triage added this to Inbox in Core development Jul 23, 2021
@chapulina chapulina mentioned this pull request Jul 23, 2021
9 tasks
@chapulina chapulina moved this from Inbox to In review in Core development Jul 23, 2021
Copy link
Contributor

@WagnerMarcos WagnerMarcos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pushing this! It looks good to me.

@chapulina
Copy link
Contributor Author

(hopefully) made the new test pass on macOS

Argh, it's still not working on macOS:

/Users/jenkins/workspace/ignition_gazebo-ci-pr_any-homebrew-amd64/ign-gazebo/src/ModelCommandAPI_TEST.cc:83
Expected equality of these values:
  expectedOutput
    Which is: "\nService call to [/gazebo/worlds] timed out\nCommand failed when trying to get the world name of the running simulation.\n"
  output
    Which is: "The 'ign' command provides a command line interface to the ignition tools.\n\n  ign <command> [options]\n\nList of available commands:\n\n  help:          Print this help text.\n  gazebo:        Run and manage Gazebo.\n\nOptions:\n\n  --force-version <VERSION>  Use a specific library version.\n  --versions                 Show the available versions.\n  --commands                 Show the available commands.\nUse 'ign help <command>' to print help for a command.\n"
With diff:
@@ -1,3 +1,15 @@
+The 'ign' command provides a command line interface to the ignition tools.
+
+  ign <command> [options]
+
+List of available commands:
+
+  help:          Print this help text.
+  gazebo:        Run and manage Gazebo.
+
+Options:
 
-Service call to [/gazebo/worlds] timed out
-Command failed when trying to get the world name of the running simulation.\n
+  --force-version <VERSION>  Use a specific library version.
+  --versions                 Show the available versions.
+  --commands                 Show the available commands.
+Use 'ign help <command>' to print help for a command.\n

Gotta double-check that all the fixes from #477 are applied to the new tool

Copy link
Contributor

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for all the changes!

I will take a look at CI

@chapulina
Copy link
Contributor Author

Thanks, @francocipollone ! Let me know how I can help. I'd like to get this in today to make a Citadel release. Feel free to merge this and work on top of #893 or to work directly here

@francocipollone
Copy link
Contributor

Thanks, @francocipollone ! Let me know how I can help. I'd like to get this in today to make a Citadel release. Feel free to merge this and work on top of #893 or to work directly here

It is also failing on Ubuntu, the test file isn't finding the command. I am on it, hopefully, it will fix the problem for both platforms.

@chapulina chapulina merged commit b907c86 into wagnermarcos/CLI_model_info_dump Jul 23, 2021
@chapulina chapulina deleted the chapulina/3/model_CLI branch July 23, 2021 22:22
Core development automation moved this from In review to Done Jul 23, 2021
@j-rivero j-rivero removed this from Done in Core development May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants