fps_view_controller.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef RVIZ_FPS_VIEW_CONTROLLER_H
31 #define RVIZ_FPS_VIEW_CONTROLLER_H
32 
34 
35 namespace rviz
36 {
37 class FloatProperty;
38 class VectorProperty;
39 
42 {
43  Q_OBJECT
44 
45 public:
47  ~FPSViewController() override = default;
48  void onInitialize() override;
49 
50  void reset() override;
51  void mimic(ViewController* source_view) override;
52  void lookAt(const Ogre::Vector3& point) override;
53  void handleMouseEvent(ViewportMouseEvent& event) override;
54 
55  void move(float x, float y, float z);
56  void rotate(float yaw, float pitch, float roll);
57 
58 protected:
59  void onTargetFrameChanged(const Ogre::Vector3& old_reference_position,
60  const Ogre::Quaternion& old_reference_orientation) override;
61 
63  Ogre::Quaternion getOrientation(float yaw, float pitch, float roll);
67  void resetRoll();
68 
69  static const Ogre::Quaternion ROBOT_TO_CAMERA_ROTATION;
70 
75 
76 protected Q_SLOTS:
77  virtual void changedPosition();
78  virtual void changedOrientation();
79 };
80 
81 } // end namespace rviz
82 
83 #endif // RVIZ_VIEW_CONTROLLER_H
rviz::FPSViewController::pitch_property_
FloatProperty * pitch_property_
The camera's pitch (rotation around the y-axis), in radians.
Definition: fps_view_controller.h:72
rviz::FPSViewController::position_property_
VectorProperty * position_property_
The camera's position.
Definition: fps_view_controller.h:74
rviz::FPSViewController::setPropertiesFromCamera
void setPropertiesFromCamera()
set yaw, pitch, roll, position properties from camera
Definition: fps_view_controller.cpp:169
rviz::ViewportMouseEvent
Definition: viewport_mouse_event.h:45
rviz::FPSViewController::move
void move(float x, float y, float z)
Definition: fps_view_controller.cpp:200
rviz::FPSViewController::lookAt
void lookAt(const Ogre::Vector3 &point) override
This should be implemented in each subclass to aim the camera at the given point in space (relative t...
Definition: fps_view_controller.cpp:98
rviz::FPSViewController
A first-person camera, controlled by yaw, pitch, roll, and position.
Definition: fps_view_controller.h:41
rviz::FPSViewController::changedPosition
virtual void changedPosition()
Definition: fps_view_controller.cpp:206
rviz::FPSViewController::ROBOT_TO_CAMERA_ROTATION
static const Ogre::Quaternion ROBOT_TO_CAMERA_ROTATION
Definition: fps_view_controller.h:69
rviz::FPSViewController::onTargetFrameChanged
void onTargetFrameChanged(const Ogre::Vector3 &old_reference_position, const Ogre::Quaternion &old_reference_orientation) override
Override to implement the change in properties which nullifies the change in target frame.
Definition: fps_view_controller.cpp:194
rviz::FPSViewController::yaw_property_
FloatProperty * yaw_property_
The camera's yaw (rotation around the z-axis), in radians.
Definition: fps_view_controller.h:71
rviz::FPSViewController::getOrientation
Ogre::Quaternion getOrientation(float yaw, float pitch, float roll)
yield camera orientation for given Euler angles
Definition: fps_view_controller.cpp:160
rviz::FloatProperty
Property specialized to enforce floating point max/min.
Definition: float_property.h:37
frame_position_tracking_view_controller.h
rviz::FPSViewController::roll_property_
FloatProperty * roll_property_
The camera's roll (rotation around the x-axis), in radians.
Definition: fps_view_controller.h:73
rviz::FPSViewController::reset
void reset() override
Definition: fps_view_controller.cpp:80
rviz::FPSViewController::onInitialize
void onInitialize() override
Do subclass-specific initialization. Called by ViewController::initialize after context_ and camera_ ...
Definition: fps_view_controller.cpp:73
rviz::FPSViewController::FPSViewController
FPSViewController()
Definition: fps_view_controller.cpp:50
rviz
Definition: add_display_dialog.cpp:54
rviz::FPSViewController::handleMouseEvent
void handleMouseEvent(ViewportMouseEvent &event) override
Definition: fps_view_controller.cpp:105
rviz::FPSViewController::mimic
void mimic(ViewController *source_view) override
Configure the settings of this view controller to give, as much as possible, a similar view as that g...
Definition: fps_view_controller.cpp:89
rviz::FPSViewController::rotate
void rotate(float yaw, float pitch, float roll)
Definition: fps_view_controller.cpp:229
rviz::ViewController
Definition: view_controller.h:55
rviz::FramePositionTrackingViewController
Base class of ViewControllers which have a "Target Frame" which is a TF frame whose position they tra...
Definition: frame_position_tracking_view_controller.h:45
rviz::VectorProperty
Definition: vector_property.h:39
rviz::FPSViewController::resetRoll
void resetRoll()
zero roll angle
Definition: fps_view_controller.cpp:186
rviz::FPSViewController::changedOrientation
virtual void changedOrientation()
Definition: fps_view_controller.cpp:237
rviz::FPSViewController::~FPSViewController
~FPSViewController() override=default


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:09