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

Support printing sensors using ign model #1157

Merged
merged 8 commits into from
Nov 5, 2021
Merged

Conversation

nkoenig
Copy link
Contributor

@nkoenig nkoenig commented Nov 1, 2021

Signed-off-by: Nate Koenig [email protected]

🎉 New feature

Summary

Print some sensor information using ign model. Output is currently limited to altimeter, imu, camera, and rgbd cameras.

Test it

  1. ign gazebo -v4 sensors.sdf
  2. ign model -m sensors_box

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Nate Koenig added 2 commits November 1, 2021 14:49
  ign model [options]

Available Options:
  --list                     Get a list of the available models.
  -m [--model] arg           Select the model to be shown.
  -p [--pose]                Print the pose of the model.
  -l [--link]  arg           Select a link to show its properties.
                             If no arg is passed all links are printed
                             Requires the -m option

                             E.g. to get information about the
                             caster link in the diff_drive world, run:
                             ign model -m vehicle_blue -l caster

  -s [--sensor]  arg         Select a sensor to show its properties.
                             If no arg is passed all sensors are printed
                             Requires the -m and -l options

                             E.g. to get information about the
                             imu sensor in the sensors world, run:
                             ign model -m sensors_box -l link -s imu

  -j [--joint] arg           Select a joint to show its properties.
                             If no arg is passed all joints are printed
                             Requires the -m option

                             E.g. to get information about the
                             caster_wheel joint in the diff_drive
                             world, run:
                             ign model -m vehicle_blue -j caster_wheel

  -h [--help]                Print this help message.

  --force-version <VERSION>  Use a specific library version.

  --versions                 Show the available versions.

Signed-off-by: Nate Koenig <[email protected]>
Signed-off-by: Nate Koenig <[email protected]>
@nkoenig nkoenig requested a review from chapulina as a code owner November 1, 2021 23:57
@github-actions github-actions bot added 🌱 garden Ignition Garden 🏯 fortress Ignition Fortress labels Nov 1, 2021
@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #1157 (7a69e68) into ign-gazebo6 (4e879a8) will decrease coverage by 1.51%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo6    #1157      +/-   ##
===============================================
- Coverage        63.69%   62.18%   -1.52%     
===============================================
  Files              256      256              
  Lines            20116    20355     +239     
===============================================
- Hits             12813    12657     -156     
- Misses            7303     7698     +395     
Impacted Files Coverage Δ
src/cmd/ModelCommandAPI.cc 0.00% <0.00%> (-90.18%) ⬇️
src/ServerPrivate.cc 84.65% <0.00%> (-3.41%) ⬇️
src/SimulationRunner.cc 93.92% <0.00%> (+1.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e879a8...7a69e68. Read the comment docs.

@nkoenig nkoenig requested a review from iche033 November 2, 2021 02:54
src/cmd/ModelCommandAPI.cc Outdated Show resolved Hide resolved
src/cmd/ModelCommandAPI.cc Outdated Show resolved Hide resolved
Signed-off-by: Nate Koenig <[email protected]>
@nkoenig nkoenig requested a review from ahcorde November 2, 2021 17:09
src/ModelCommandAPI_TEST.cc Outdated Show resolved Hide resolved
src/ModelCommandAPI_TEST.cc Outdated Show resolved Hide resolved
src/ModelCommandAPI_TEST.cc Outdated Show resolved Hide resolved
@nkoenig nkoenig requested a review from ahcorde November 4, 2021 15:51
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Same in the other JoinPaths

Comment on lines 93 to 94
ignition::common::joinPaths(std::string(PROJECT_SOURCE_PATH) +
"/test/worlds/static_diff_drive_vehicle.sdf"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ignition::common::joinPaths(std::string(PROJECT_SOURCE_PATH) +
"/test/worlds/static_diff_drive_vehicle.sdf"));
ignition::common::joinPaths(std::string(PROJECT_SOURCE_PATH), "test", "worlds", "static_diff_drive_vehicle.sdf"));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, thanks. Done.

Nate Koenig added 2 commits November 4, 2021 10:41
Signed-off-by: Nate Koenig <[email protected]>
Signed-off-by: Nate Koenig <[email protected]>
src/ModelCommandAPI_TEST.cc Outdated Show resolved Hide resolved
Signed-off-by: Nate Koenig <[email protected]>
@nkoenig nkoenig merged commit 3f5706e into ign-gazebo6 Nov 5, 2021
@nkoenig nkoenig deleted the model_info_sensors branch November 5, 2021 03:58
WilliamLewww pushed a commit to WilliamLewww/ign-gazebo that referenced this pull request Dec 7, 2021
* Support printing sensors using Print information about models.

  ign model [options]

Available Options:
  --list                     Get a list of the available models.
  -m [--model] arg           Select the model to be shown.
  -p [--pose]                Print the pose of the model.
  -l [--link]  arg           Select a link to show its properties.
                             If no arg is passed all links are printed
                             Requires the -m option

                             E.g. to get information about the
                             caster link in the diff_drive world, run:
                             ign model -m vehicle_blue -l caster

  -s [--sensor]  arg         Select a sensor to show its properties.
                             If no arg is passed all sensors are printed
                             Requires the -m and -l options

                             E.g. to get information about the
                             imu sensor in the sensors world, run:
                             ign model -m sensors_box -l link -s imu

  -j [--joint] arg           Select a joint to show its properties.
                             If no arg is passed all joints are printed
                             Requires the -m option

                             E.g. to get information about the
                             caster_wheel joint in the diff_drive
                             world, run:
                             ign model -m vehicle_blue -j caster_wheel

  -h [--help]                Print this help message.

  --force-version <VERSION>  Use a specific library version.

  --versions                 Show the available versions.

Signed-off-by: Nate Koenig <[email protected]>

* Added tests

Signed-off-by: Nate Koenig <[email protected]>

* Update documentation

Signed-off-by: Nate Koenig <[email protected]>

* use joinPaths

Signed-off-by: Nate Koenig <[email protected]>

* Use commas

Signed-off-by: Nate Koenig <[email protected]>

* More commas

Signed-off-by: Nate Koenig <[email protected]>

* Moved test to require DRI

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
Signed-off-by: William Lew <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress 🌱 garden Ignition Garden
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants