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

Migrate XYOrbitViewController #282

Merged
merged 20 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1643c54
Introduce view controller test fixture
Martin-Idel-SI May 28, 2018
369740d
Expose update for testing
Martin-Idel-SI May 28, 2018
752d8ec
Initial move
Martin-Idel-SI May 28, 2018
a1f3b89
Make xy_orbit_view_controller compile
Martin-Idel-SI May 28, 2018
4cded40
Get rid of OgreAdapter and use camera directly
Martin-Idel-SI May 28, 2018
32c527f
Add test setup for xy_orbit camera
Martin-Idel-SI May 28, 2018
f95ca26
Add tests for handleMouseEvent in xy_orbit_view_controller
Martin-Idel-SI May 29, 2018
f5c6134
Add test for handleMouseEvent in orbit_view_controller
Martin-Idel-SI May 29, 2018
ae9f749
Fix failing tests
botteroa-si May 29, 2018
58e1869
Refactor handleMouseEvent to avoid code duplication
Martin-Idel-SI May 30, 2018
3d442fa
Minor refactoring of view_controllers
Martin-Idel-SI May 30, 2018
9d052ac
Add tests for mimic functionality
Martin-Idel-SI May 30, 2018
cc7ce64
Refactoring of mimic in orbit_view_controller and xy_orbit_view_contr…
Martin-Idel-SI May 30, 2018
cff90da
Minor refactoring of orbit_view_controller
Martin-Idel-SI May 30, 2018
9085a1a
Fix different viewport size on different OS during testing
Martin-Idel-SI Jun 1, 2018
551a275
Better mimicing of ViewControllers
Martin-Idel-SI Jun 5, 2018
0900b5e
Fix XY orbit mimic when in a shifted tf frame
greimela-si Jun 8, 2018
8901ee6
Fix missing initialization of member variables
Martin-Idel-SI Jun 11, 2018
5f97ed6
fix new headers that needed to be refactored
wjwwood Jun 12, 2018
bf95910
fixup cpplint issues
wjwwood Jun 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ namespace rviz_common
{

FramePositionTrackingViewController::FramePositionTrackingViewController()
: target_scene_node_(nullptr), camera_scene_node_(nullptr)
: target_scene_node_(nullptr),
reference_orientation_(Ogre::Quaternion::IDENTITY),
reference_position_(Ogre::Vector3::ZERO),
camera_scene_node_(nullptr)
{
target_frame_property_ = new rviz_common::properties::TfFrameProperty(
"Target Frame",
Expand Down Expand Up @@ -148,6 +151,7 @@ void FramePositionTrackingViewController::mimic(ViewController * source_view)
QVariant target_frame = source_view->subProp("Target Frame")->getValue();
if (target_frame.isValid()) {
target_frame_property_->setValue(target_frame);
getNewTransform();
}
}

Expand Down
28 changes: 28 additions & 0 deletions rviz_default_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ set(rviz_default_plugins_source_files
src/rviz_default_plugins/tools/select/selection_tool.cpp
src/rviz_default_plugins/view_controllers/orbit/orbit_view_controller.cpp
src/rviz_default_plugins/view_controllers/ortho/fixed_orientation_ortho_view_controller.cpp
src/rviz_default_plugins/view_controllers/xy_orbit/xy_orbit_view_controller.cpp
)

add_library(rviz_default_plugins SHARED
Expand Down Expand Up @@ -389,6 +390,7 @@ if(BUILD_TESTING)

ament_add_gmock(ortho_view_controller_test
test/rviz_default_plugins/view_controllers/ortho/ortho_view_controller_test.cpp
test/rviz_default_plugins/view_controllers/view_controller_test_fixture.hpp
test/rviz_default_plugins/displays/display_test_fixture.cpp
test/rviz_default_plugins/scene_graph_introspection.cpp
APPEND_ENV AMENT_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} PATH=${CMAKE_INSTALL_PREFIX}/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_assimp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_yaml_cpp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor/bin)
Expand All @@ -399,6 +401,32 @@ if(BUILD_TESTING)
${TEST_LINK_LIBRARIES})
endif()

ament_add_gmock(orbit_view_controller_test
test/rviz_default_plugins/view_controllers/orbit/orbit_view_controller_test.cpp
test/rviz_default_plugins/view_controllers/view_controller_test_fixture.hpp
test/rviz_default_plugins/displays/display_test_fixture.cpp
test/rviz_default_plugins/scene_graph_introspection.cpp
APPEND_ENV AMENT_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} PATH=${CMAKE_INSTALL_PREFIX}/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_assimp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_yaml_cpp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor/bin)
if(TARGET orbit_view_controller_test)
target_include_directories(orbit_view_controller_test PUBLIC
${TEST_INCLUDE_DIRS})
target_link_libraries(orbit_view_controller_test
${TEST_LINK_LIBRARIES})
endif()

ament_add_gmock(xy_orbit_view_controller_test
test/rviz_default_plugins/view_controllers/xy_orbit/xy_orbit_view_controller_test.cpp
test/rviz_default_plugins/view_controllers/view_controller_test_fixture.hpp
test/rviz_default_plugins/displays/display_test_fixture.cpp
test/rviz_default_plugins/scene_graph_introspection.cpp
APPEND_ENV AMENT_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} PATH=${CMAKE_INSTALL_PREFIX}/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_assimp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_yaml_cpp_vendor/bin;${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor/bin)
if(TARGET xy_orbit_view_controller_test)
target_include_directories(xy_orbit_view_controller_test PUBLIC
${TEST_INCLUDE_DIRS})
target_link_libraries(xy_orbit_view_controller_test
${TEST_LINK_LIBRARIES})
endif()

if(EnableVisualTests STREQUAL "True")
find_package(ament_index_cpp REQUIRED)

Expand Down
Loading