Skip to content

Commit

Permalink
Support printing sensors using ign model (#1157)
Browse files Browse the repository at this point in the history
* 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 <nate@openrobotics.org>

* Added tests

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Update documentation

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* use joinPaths

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Use commas

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* More commas

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Moved test to require DRI

Signed-off-by: Nate Koenig <nate@openrobotics.org>

Co-authored-by: Nate Koenig <nate@openrobotics.org>
  • Loading branch information
nkoenig and Nate Koenig authored Nov 5, 2021
1 parent 4e879a8 commit 3f5706e
Show file tree
Hide file tree
Showing 11 changed files with 907 additions and 335 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ else()
set (EXTRA_TEST_LIB_DEPS)
endif()

include(test/find_dri.cmake)
FindDRI()

#============================================================================
# Search for project-specific dependencies
#============================================================================
Expand Down
19 changes: 18 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ set (gtest_sources
EventManager_TEST.cc
Link_TEST.cc
Model_TEST.cc
ModelCommandAPI_TEST.cc
SdfEntityCreator_TEST.cc
SdfGenerator_TEST.cc
ServerConfig_TEST.cc
Expand All @@ -95,6 +94,24 @@ set (gtest_sources
network/NetworkManager_TEST.cc
)

# Tests that require a valid display
set(tests_needing_display
ModelCommandAPI_TEST.cc
)

# Add systems that need a valid display here.
# \todo(anyone) Find a way to run these tests with a virtual display such Xvfb
# or Xdummy instead of skipping them
if(VALID_DISPLAY AND VALID_DRI_DISPLAY)
list(APPEND gtest_sources ${tests_needing_display})
else()
message(STATUS
"Skipping these UNIT tests because a valid display was not found:")
foreach(test ${tests_needing_display})
message(STATUS " ${test}")
endforeach(test)
endif()

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
# by a class are not being exported. These generated source files have private
Expand Down
Loading

0 comments on commit 3f5706e

Please sign in to comment.