Public Member Functions | Protected Member Functions | List of all members
gazebo::rendering::UserCamera Class Reference

A camera used for user visualization of a scene. More...

#include <rendering/rendering.hh>

Inheritance diagram for gazebo::rendering::UserCamera:
Inheritance graph
[legend]

Public Member Functions

 UserCamera (const std::string &_name, ScenePtr _scene, bool _stereoEnabled=false)
 Constructor. More...
 
virtual ~UserCamera ()
 Destructor. More...
 
math::Pose DefaultPose () const
 Get the default pose in the world coordinate frame. More...
 
void EnableStereo (bool _enable)
 Turn on/off stereo rendering. More...
 
void EnableViewController (bool _value) const
 Set whether the view controller is enabled. More...
 
void Fini ()
 Finialize. More...
 
virtual unsigned int GetImageHeight () const
 Get the height of the image. More...
 
virtual unsigned int GetImageWidth () const
 Get the width of the image. More...
 
std::string GetViewControllerTypeString ()
 Get current view controller type. More...
 
VisualPtr GetVisual (const math::Vector2i &_mousePos, std::string &_mod)
 Get an entity at a pixel location using a camera. More...
 
VisualPtr GetVisual (const math::Vector2i &_mousePos) const
 Get a visual at a mouse position. More...
 
void HandleKeyPressEvent (const std::string &_key)
 Handle a key press. More...
 
void HandleKeyReleaseEvent (const std::string &_key)
 Handle a key release. More...
 
void HandleMouseEvent (const common::MouseEvent &_evt)
 Handle a mouse event. More...
 
void Init ()
 Initialize. More...
 
bool IsCameraSetInWorldFile ()
 brief Show if the user camera pose has changed in the world file. More...
 
void Load (sdf::ElementPtr _sdf)
 Load the user camera. More...
 
void Load ()
 Generic load function. More...
 
virtual bool MoveToPosition (const math::Pose &_pose, double _time)
 Move the camera to a position (this is an animated motion). More...
 
void MoveToVisual (VisualPtr _visual)
 Move the camera to focus on a visual. More...
 
void MoveToVisual (const std::string &_visualName)
 Move the camera to focus on a visual. More...
 
virtual void PostRender ()
 Post render. More...
 
void Resize (unsigned int _w, unsigned int _h)
 Resize the camera. More...
 
virtual void SetClipDist (float _near, float _far)
 Set the clip distances. More...
 
void SetDefaultPose (const math::Pose &_pose)
 Set the default pose in the world coordinate frame and set that as the current camera world pose. More...
 
void SetFocalPoint (const math::Vector3 &_pt)
 Set the point the camera should orbit around. More...
 
void SetJoyPoseControl (bool _value)
 brief Enable or disable camera control through ~/user_camera/joy_pose gz topic. More...
 
void SetJoyTwistControl (bool _value)
 brief Enable or disable camera control through ~/user_camera/joy_twist gz topic. More...
 
virtual bool SetProjectionType (const std::string &_type)
 Set the type of projection used by the camera. More...
 
virtual void SetRenderTarget (Ogre::RenderTarget *_target)
 Set to true to enable rendering. More...
 
void SetUseSDFPose (bool _value)
 brief Set if the user camera pose has changed in the world file. More...
 
void SetViewController (const std::string &_type)
 Set view controller. More...
 
void SetViewController (const std::string &_type, const math::Vector3 &_pos)
 Set view controller. More...
 
void SetViewportDimensions (float _x, float _y, float _w, float _h)
 Set the dimensions of the viewport. More...
 
virtual void SetWorldPose (const math::Pose &_pose)
 Set the pose in the world coordinate frame. More...
 
bool StereoEnabled () const
 Get whether stereo is enabled. More...
 
virtual void Update ()
 Render the camera. More...
 
- Public Member Functions inherited from gazebo::rendering::Camera
 Camera (const std::string &_namePrefix, ScenePtr _scene, bool _autoRender=true)
 Constructor. More...
 
virtual ~Camera ()
 Destructor. More...
 
float AspectRatio () const
 Get the apect ratio. More...
 
void AttachToVisual (const std::string &_visualName, const bool _inheritOrientation, const double _minDist=0.0, const double _maxDist=0.0)
 Attach the camera to a scene node. More...
 
void AttachToVisual (uint32_t _id, const bool _inheritOrientation, const double _minDist=0.0, const double _maxDist=0.0)
 Attach the camera to a scene node. More...
 
virtual float AvgFPS () const
 Get the average FPS. More...
 
void CameraToViewportRay (const int _screenx, const int _screeny, ignition::math::Vector3d &_origin, ignition::math::Vector3d &_dir) const
 Get a world space ray as cast from the camera through the viewport. More...
 
bool CaptureData () const
 Return the value of this->captureData. More...
 
event::ConnectionPtr ConnectNewImageFrame (std::function< void(const unsigned char *, unsigned int, unsigned int, unsigned int, const std::string &)> _subscriber)
 Connect to the new image signal. More...
 
void CreateRenderTexture (const std::string &_textureName)
 Set the render target. More...
 
ignition::math::Vector3d Direction () const
 Get the camera's direction vector. More...
 
void DisconnectNewImageFrame (event::ConnectionPtr &_c)
 Disconnect from an image frame. More...
 
void EnableSaveFrame (const bool _enable)
 Enable or disable saving. More...
 
double FarClip () const
 Get the far clip distance. More...
 
float GetAspectRatio () const GAZEBO_DEPRECATED(7.0)
 Get the apect ratio. More...
 
virtual float GetAvgFPS () const GAZEBO_DEPRECATED(7.0)
 Get the average FPS. More...
 
void GetCameraToViewportRay (int _screenx, int _screeny, math::Vector3 &_origin, math::Vector3 &_dir) GAZEBO_DEPRECATED(7.0)
 Get a world space ray as cast from the camera through the viewport. More...
 
bool GetCaptureData () const GAZEBO_DEPRECATED(7.0)
 Return the value of this->captureData. More...
 
math::Vector3 GetDirection () const GAZEBO_DEPRECATED(7.0)
 Get the camera's direction vector. More...
 
DistortionPtr GetDistortion () const GAZEBO_DEPRECATED(7.0)
 Get the distortion model of this camera. More...
 
double GetFarClip () GAZEBO_DEPRECATED(7.0)
 Get the far clip distance. More...
 
math::Angle GetHFOV () const GAZEBO_DEPRECATED(7.0)
 Get the camera FOV (horizontal) More...
 
size_t GetImageByteSize () const GAZEBO_DEPRECATED(7.0)
 Get the image size in bytes. More...
 
virtual const unsigned char * GetImageData (unsigned int i=0) GAZEBO_DEPRECATED(7.0)
 Get a pointer to the image data. More...
 
unsigned int GetImageDepth () const GAZEBO_DEPRECATED(7.0)
 Get the depth of the image. More...
 
std::string GetImageFormat () const GAZEBO_DEPRECATED(7.0)
 Get the string representation of the image format. More...
 
bool GetInitialized () const GAZEBO_DEPRECATED(7.0)
 Return true if the camera has been initialized. More...
 
common::Time GetLastRenderWallTime () GAZEBO_DEPRECATED(7.0)
 Get the last time the camera was rendered. More...
 
std::string GetName () const GAZEBO_DEPRECATED(7.0)
 Get the camera's unscoped name. More...
 
double GetNearClip () GAZEBO_DEPRECATED(7.0)
 Get the near clip distance. More...
 
Ogre::Camera * GetOgreCamera () const GAZEBO_DEPRECATED(7.0)
 Get a pointer to the ogre camera. More...
 
std::string GetProjectionType () const GAZEBO_DEPRECATED(7.0)
 Return the projection type as a string. More...
 
double GetRenderRate () const GAZEBO_DEPRECATED(7.0)
 Get the render Hz rate. More...
 
Ogre::Texture * GetRenderTexture () const GAZEBO_DEPRECATED(7.0)
 Get the render texture. More...
 
math::Vector3 GetRight () GAZEBO_DEPRECATED(7.0)
 Get the viewport right vector. More...
 
ScenePtr GetScene () const
 Get the scene this camera is in. More...
 
Ogre::SceneNode * GetSceneNode () const GAZEBO_DEPRECATED(7.0)
 Get the camera's scene node. More...
 
std::string GetScopedName () const GAZEBO_DEPRECATED(7.0)
 Get the camera's scoped name (scene_name::camera_name) More...
 
std::string GetScreenshotPath () const GAZEBO_DEPRECATED(7.0)
 Get the path to saved screenshots. More...
 
unsigned int GetTextureHeight () const GAZEBO_DEPRECATED(7.0)
 Get the height of the off-screen render texture. More...
 
unsigned int GetTextureWidth () const GAZEBO_DEPRECATED(7.0)
 Get the width of the off-screen render texture. More...
 
virtual unsigned int GetTriangleCount () const GAZEBO_DEPRECATED(7.0)
 Get the triangle count. More...
 
math::Vector3 GetUp () GAZEBO_DEPRECATED(7.0)
 Get the viewport up vector. More...
 
math::Angle GetVFOV () const GAZEBO_DEPRECATED(7.0)
 Get the camera FOV (vertical) More...
 
Ogre::Viewport * GetViewport () const GAZEBO_DEPRECATED(7.0)
 Get a pointer to the Ogre::Viewport. More...
 
unsigned int GetViewportHeight () const GAZEBO_DEPRECATED(7.0)
 Get the viewport height in pixels. More...
 
unsigned int GetViewportWidth () const GAZEBO_DEPRECATED(7.0)
 Get the viewport width in pixels. More...
 
unsigned int GetWindowId () const GAZEBO_DEPRECATED(7.0)
 Get the ID of the window this camera is rendering into. More...
 
bool GetWorldPointOnPlane (int _x, int _y, const math::Plane &_plane, math::Vector3 &_result) GAZEBO_DEPRECATED(7.0)
 Get point on a plane. More...
 
math::Pose GetWorldPose () const GAZEBO_DEPRECATED(7.0)
 Get the world pose. More...
 
math::Vector3 GetWorldPosition () const GAZEBO_DEPRECATED(7.0)
 Get the camera position in the world. More...
 
math::Quaternion GetWorldRotation () const GAZEBO_DEPRECATED(7.0)
 Get the camera's orientation in the world. More...
 
double GetZValue (int _x, int _y) GAZEBO_DEPRECATED(7.0)
 Get the Z-buffer value at the given image coordinate. More...
 
ignition::math::Angle HFOV () const
 Get the camera FOV (horizontal) More...
 
size_t ImageByteSize () const
 Get the image size in bytes. More...
 
virtual const unsigned char * ImageData (const unsigned int i=0) const
 Get a pointer to the image data. More...
 
unsigned int ImageDepth () const
 Get the depth of the image. More...
 
std::string ImageFormat () const
 Get the string representation of the image format. More...
 
virtual unsigned int ImageHeight () const
 Get the height of the image. More...
 
virtual unsigned int ImageWidth () const
 Get the width of the image. More...
 
bool Initialized () const
 Return true if the camera has been initialized. More...
 
bool IsAnimating () const
 Return true if the camera is moving due to an animation. More...
 
bool IsVisible (VisualPtr _visual)
 Return true if the visual is within the camera's view frustum. More...
 
bool IsVisible (const std::string &_visualName)
 Return true if the visual is within the camera's view frustum. More...
 
common::Time LastRenderWallTime () const
 Get the last time the camera was rendered. More...
 
DistortionPtr LensDistortion () const
 Get the distortion model of this camera. More...
 
virtual bool MoveToPosition (const ignition::math::Pose3d &_pose, const double _time)
 Move the camera to a position (this is an animated motion). More...
 
bool MoveToPositions (const std::vector< math::Pose > &_pts, double _time, std::function< void()> _onComplete=NULL) GAZEBO_DEPRECATED(7.0)
 Move the camera to a series of poses (this is an animated motion). More...
 
bool MoveToPositions (const std::vector< ignition::math::Pose3d > &_pts, const double _time, std::function< void()> _onComplete=NULL)
 Move the camera to a series of poses (this is an animated motion). More...
 
std::string Name () const
 Get the camera's unscoped name. More...
 
double NearClip () const
 Get the near clip distance. More...
 
Ogre::Camera * OgreCamera () const
 Get a pointer to the ogre camera. More...
 
Ogre::Viewport * OgreViewport () const
 Get a pointer to the Ogre::Viewport. More...
 
void Pitch (const math::Angle &_angle, Ogre::Node::TransformSpace _relativeTo=Ogre::Node::TS_LOCAL) GAZEBO_DEPRECATED(7.0)
 Rotate the camera around the y-axis. More...
 
void Pitch (const ignition::math::Angle &_angle, ReferenceFrame _relativeTo=RF_LOCAL)
 Rotate the camera around the y-axis. More...
 
std::string ProjectionType () const
 Return the projection type as a string. More...
 
void Render (const bool _force=false)
 Render the camera. More...
 
double RenderRate () const
 Get the render Hz rate. More...
 
Ogre::Texture * RenderTexture () const
 Get the render texture. More...
 
ignition::math::Vector3d Right () const
 Get the viewport right vector. More...
 
void Roll (const math::Angle &_angle, Ogre::Node::TransformSpace _relativeTo=Ogre::Node::TS_LOCAL) GAZEBO_DEPRECATED(7.0)
 Rotate the camera around the x-axis. More...
 
void Roll (const ignition::math::Angle &_angle, ReferenceFrame _relativeTo=RF_LOCAL)
 Rotate the camera around the x-axis. More...
 
bool SaveFrame (const std::string &_filename)
 Save the last frame to disk. More...
 
Ogre::SceneNode * SceneNode () const
 Get the camera's scene node. More...
 
std::string ScopedName () const
 Get the camera's scoped name (scene_name::camera_name) More...
 
std::string ScreenshotPath () const
 Get the path to saved screenshots. More...
 
void SetAspectRatio (float _ratio)
 Set the aspect ratio. More...
 
void SetCaptureData (const bool _value)
 Set whether to capture data. More...
 
void SetCaptureDataOnce ()
 Capture data once and save to disk. More...
 
void SetHFOV (math::Angle _angle) GAZEBO_DEPRECATED(7.0)
 Set the camera FOV (horizontal) More...
 
void SetHFOV (const ignition::math::Angle &_angle)
 Set the camera FOV (horizontal) More...
 
void SetImageHeight (const unsigned int _h)
 Set the image height. More...
 
void SetImageSize (const unsigned int _w, const unsigned int _h)
 Set the image size. More...
 
void SetImageWidth (const unsigned int _w)
 Set the image height. More...
 
void SetName (const std::string &_name)
 Set the camera's name. More...
 
void SetRenderRate (const double _hz)
 Set the render Hz rate. More...
 
void SetSaveFramePathname (const std::string &_pathname)
 Set the save frame pathname. More...
 
void SetScene (ScenePtr _scene)
 Set the scene this camera is viewing. More...
 
void SetSceneNode (Ogre::SceneNode *_node)
 Set the camera's scene node. More...
 
void SetWindowId (unsigned int _windowId)
 
virtual void SetWorldPose (const ignition::math::Pose3d &_pose)
 Set the global pose of the camera. More...
 
void SetWorldPosition (const math::Vector3 &_pos) GAZEBO_DEPRECATED(7.0)
 Set the world position. More...
 
void SetWorldPosition (const ignition::math::Vector3d &_pos)
 Set the world position. More...
 
void SetWorldRotation (const math::Quaternion &_quat) GAZEBO_DEPRECATED(7.0)
 Set the world orientation. More...
 
void SetWorldRotation (const ignition::math::Quaterniond &_quat)
 Set the world orientation. More...
 
void ShowWireframe (const bool _s)
 Set whether to view the world in wireframe. More...
 
unsigned int TextureHeight () const
 Get the height of the off-screen render texture. More...
 
unsigned int TextureWidth () const
 Get the width of the off-screen render texture. More...
 
void ToggleShowWireframe ()
 Toggle whether to view the world in wireframe. More...
 
void TrackVisual (const std::string &_visualName)
 Set the camera to track a scene node. More...
 
void Translate (const math::Vector3 &_direction) GAZEBO_DEPRECATED(7.0)
 Translate the camera. More...
 
void Translate (const ignition::math::Vector3d &_direction)
 Translate the camera. More...
 
virtual unsigned int TriangleCount () const
 Get the triangle count. More...
 
ignition::math::Vector3d Up () const
 Get the viewport up vector. More...
 
ignition::math::Angle VFOV () const
 Get the camera FOV (vertical) More...
 
unsigned int ViewportHeight () const
 Get the viewport height in pixels. More...
 
unsigned int ViewportWidth () const
 Get the viewport width in pixels. More...
 
unsigned int WindowId () const
 Get the ID of the window this camera is rendering into. More...
 
bool WorldPointOnPlane (const int _x, const int _y, const ignition::math::Planed &_plane, ignition::math::Vector3d &_result)
 Get point on a plane. More...
 
ignition::math::Pose3d WorldPose () const
 Get the world pose. More...
 
ignition::math::Vector3d WorldPosition () const
 Get the camera position in the world. More...
 
ignition::math::Quaterniond WorldRotation () const
 Get the camera's orientation in the world. More...
 
void Yaw (const math::Angle &_angle, Ogre::Node::TransformSpace _relativeTo=Ogre::Node::TS_WORLD) GAZEBO_DEPRECATED(7.0)
 Rotate the camera around the z-axis. More...
 
void Yaw (const ignition::math::Angle &_angle, ReferenceFrame _relativeTo=RF_WORLD)
 Rotate the camera around the z-axis. More...
 
double ZValue (const int _x, const int _y)
 Get the Z-buffer value at the given image coordinate. More...
 

Protected Member Functions

virtual void AnimationComplete ()
 Internal function used to indicate that an animation has completed. More...
 
virtual bool AttachToVisualImpl (VisualPtr _visual, bool _inheritOrientation, double _minDist=0, double _maxDist=0)
 Set the camera to be attached to a visual. More...
 
virtual bool TrackVisualImpl (VisualPtr _visual)
 Set the camera to track a scene node. More...
 
virtual void UpdateFOV ()
 Update the camera's field of view. More...
 
- Protected Member Functions inherited from gazebo::rendering::Camera
virtual bool AttachToVisualImpl (const std::string &_name, const bool _inheritOrientation, const double _minDist=0, const double _maxDist=0)
 Attach the camera to a scene node. More...
 
virtual bool AttachToVisualImpl (uint32_t _id, const bool _inheritOrientation, const double _minDist=0, const double _maxDist=0)
 Attach the camera to a scene node. More...
 
std::string FrameFilename ()
 Get the next frame filename based on SDF parameters. More...
 
std::string GetFrameFilename () GAZEBO_DEPRECATED(7.0)
 Get the next frame filename based on SDF parameters. More...
 
void ReadPixelBuffer ()
 Read image data from pixel buffer. More...
 
virtual void RenderImpl ()
 Implementation of the render call. More...
 
bool TrackVisualImpl (const std::string &_visualName)
 Implementation of the Camera::TrackVisual call. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from gazebo::rendering::Camera
static size_t GetImageByteSize (unsigned int _width, unsigned int _height, const std::string &_format) GAZEBO_DEPRECATED(7.0)
 Calculate image byte size base on a few parameters. More...
 
static size_t ImageByteSize (const unsigned int _width, const unsigned int _height, const std::string &_format)
 Calculate image byte size base on a few parameters. More...
 
static bool SaveFrame (const unsigned char *_image, const unsigned int _width, const unsigned int _height, const int _depth, const std::string &_format, const std::string &_filename)
 Save a frame using an image buffer. More...
 
- Protected Attributes inherited from gazebo::rendering::Camera
Ogre::AnimationState * animState
 Animation state, used to animate the camera. More...
 
unsigned char * bayerFrameBuffer
 Buffer for a bayer image frame. More...
 
Ogre::Camera * camera
 The OGRE camera. More...
 
bool captureData
 True to capture frames into an image buffer. More...
 
bool captureDataOnce
 True to capture a frame once and save to disk. More...
 
std::vector< event::ConnectionPtrconnections
 The camera's event connections. More...
 
int imageFormat
 Format for saving images. More...
 
int imageHeight
 Save image height. More...
 
int imageWidth
 Save image width. More...
 
bool initialized
 True if initialized. More...
 
common::Time lastRenderWallTime
 Time the last frame was rendered. More...
 
std::string name
 Name of the camera. More...
 
bool newData
 True if new data is available. More...
 
event::EventT< void(const
unsigned char *, unsigned int,
unsigned int, unsigned int,
const std::string &)> 
newImageFrame
 Event triggered when a new frame is generated. More...
 
std::function< void()> onAnimationComplete
 User callback for when an animation completes. More...
 
common::Time prevAnimTime
 Previous time the camera animation was updated. More...
 
Ogre::RenderTarget * renderTarget
 Target that renders frames. More...
 
Ogre::Texture * renderTexture
 Texture that receives results from rendering. More...
 
std::list< msgs::Request > requests
 List of requests. More...
 
unsigned int saveCount
 Number of saved frames. More...
 
unsigned char * saveFrameBuffer
 Buffer for a single image frame. More...
 
ScenePtr scene
 Pointer to the scene. More...
 
Ogre::SceneNode * sceneNode
 Scene node that controls camera position and orientation. More...
 
std::string scopedName
 Scene scoped name of the camera. More...
 
std::string scopedUniqueName
 Scene scoped name of the camera with a unique ID. More...
 
std::string screenshotPath
 Path to saved screenshots. More...
 
sdf::ElementPtr sdf
 Camera's SDF values. More...
 
unsigned int textureHeight
 Height of the render texture. More...
 
unsigned int textureWidth
 Width of the render texture. More...
 
Ogre::Viewport * viewport
 Viewport the ogre camera uses. More...
 
unsigned int windowId
 ID of the window that the camera is attached to. More...
 

Detailed Description

A camera used for user visualization of a scene.

Constructor & Destructor Documentation

gazebo::rendering::UserCamera::UserCamera ( const std::string &  _name,
ScenePtr  _scene,
bool  _stereoEnabled = false 
)

Constructor.

Parameters
[in]_nameName of the camera.
[in]_sceneScene to put the camera in.
[in]_stereoEnabledTrue to enable stereo rendering. This is here for compatibility with 3D monitors/TVs.
virtual gazebo::rendering::UserCamera::~UserCamera ( )
virtual

Destructor.

Member Function Documentation

virtual void gazebo::rendering::UserCamera::AnimationComplete ( )
protectedvirtual

Internal function used to indicate that an animation has completed.

Reimplemented from gazebo::rendering::Camera.

virtual bool gazebo::rendering::UserCamera::AttachToVisualImpl ( VisualPtr  _visual,
bool  _inheritOrientation,
double  _minDist = 0,
double  _maxDist = 0 
)
protectedvirtual

Set the camera to be attached to a visual.

This causes the camera to move in relation to the specified visual.

Parameters
[in]_visualThe visual to attach to.
[in]_inheritOrientationTrue if the camera should also rotate when the visual rotates.
[in]_minDistMinimum distance the camera can get to the visual.
[in]_maxDistMaximum distance the camera can get from the visual.
Returns
True if successfully attach to the visual.

Reimplemented from gazebo::rendering::Camera.

math::Pose gazebo::rendering::UserCamera::DefaultPose ( ) const

Get the default pose in the world coordinate frame.

Returns
Default pose of the camera.
void gazebo::rendering::UserCamera::EnableStereo ( bool  _enable)

Turn on/off stereo rendering.

Stereo must be initially enable in the ~/.gazebo/gui.ini file using:

[rendering]
stereo=1
Parameters
[in]_enableTrue to turn on stereo, false to turn off.
void gazebo::rendering::UserCamera::EnableViewController ( bool  _value) const

Set whether the view controller is enabled.

The view controller is used to handle user camera movements.

Parameters
[in]_valueTrue to enable viewcontroller, False to disable.
void gazebo::rendering::UserCamera::Fini ( )
virtual

Finialize.

Reimplemented from gazebo::rendering::Camera.

virtual unsigned int gazebo::rendering::UserCamera::GetImageHeight ( ) const
virtual

Get the height of the image.

Returns
Image height
Deprecated:
See ImageHeight()

Reimplemented from gazebo::rendering::Camera.

virtual unsigned int gazebo::rendering::UserCamera::GetImageWidth ( ) const
virtual

Get the width of the image.

Returns
Image width
Deprecated:
See ImageWidth()

Reimplemented from gazebo::rendering::Camera.

std::string gazebo::rendering::UserCamera::GetViewControllerTypeString ( )

Get current view controller type.

Returns
Type of the current view controller: "orbit", "fps"
VisualPtr gazebo::rendering::UserCamera::GetVisual ( const math::Vector2i _mousePos,
std::string &  _mod 
)

Get an entity at a pixel location using a camera.

Used for mouse picking.

Parameters
[in]_mousePosThe position of the mouse in screen coordinates
[out]_modUsed for object manipulation
Returns
The selected entity, or NULL
VisualPtr gazebo::rendering::UserCamera::GetVisual ( const math::Vector2i _mousePos) const

Get a visual at a mouse position.

Parameters
[in]_mousePos2D position of the mouse in pixels.
void gazebo::rendering::UserCamera::HandleKeyPressEvent ( const std::string &  _key)

Handle a key press.

Parameters
[in]_keyThe key pressed.
void gazebo::rendering::UserCamera::HandleKeyReleaseEvent ( const std::string &  _key)

Handle a key release.

Parameters
[in]_keyThe key released.
void gazebo::rendering::UserCamera::HandleMouseEvent ( const common::MouseEvent _evt)

Handle a mouse event.

Parameters
[in]_evtThe mouse event.
void gazebo::rendering::UserCamera::Init ( )
virtual

Initialize.

Reimplemented from gazebo::rendering::Camera.

bool gazebo::rendering::UserCamera::IsCameraSetInWorldFile ( )

brief Show if the user camera pose has changed in the world file.

return true if the camera pose changed in the world file.

void gazebo::rendering::UserCamera::Load ( sdf::ElementPtr  _sdf)
virtual

Load the user camera.

Parameters
[in]_sdfParameters for the camera.

Reimplemented from gazebo::rendering::Camera.

void gazebo::rendering::UserCamera::Load ( )
virtual

Generic load function.

Reimplemented from gazebo::rendering::Camera.

virtual bool gazebo::rendering::UserCamera::MoveToPosition ( const math::Pose _pose,
double  _time 
)
virtual

Move the camera to a position (this is an animated motion).

See Also
Camera::MoveToPositions
Parameters
[in]_poseEnd position of the camera
[in]_timeDuration of the camera's movement
Deprecated:
See function that accepts ignition::math parameters.

Reimplemented from gazebo::rendering::Camera.

void gazebo::rendering::UserCamera::MoveToVisual ( VisualPtr  _visual)

Move the camera to focus on a visual.

Parameters
[in]_visualVisual to move the camera to.
void gazebo::rendering::UserCamera::MoveToVisual ( const std::string &  _visualName)

Move the camera to focus on a visual.

Parameters
[in]_visualNameName of the visual to move the camera to.
virtual void gazebo::rendering::UserCamera::PostRender ( )
virtual

Post render.

Reimplemented from gazebo::rendering::Camera.

void gazebo::rendering::UserCamera::Resize ( unsigned int  _w,
unsigned int  _h 
)

Resize the camera.

Parameters
[in]_wWidth of the camera image.
[in]_hHeight of the camera image.
virtual void gazebo::rendering::UserCamera::SetClipDist ( float  _near,
float  _far 
)
virtual

Set the clip distances.

Parameters
[in]_nearNear clip distance in meters
[in]_farFar clip distance in meters

Reimplemented from gazebo::rendering::Camera.

void gazebo::rendering::UserCamera::SetDefaultPose ( const math::Pose _pose)

Set the default pose in the world coordinate frame and set that as the current camera world pose.

Parameters
[in]_poseNew default pose of the camera.
void gazebo::rendering::UserCamera::SetFocalPoint ( const math::Vector3 _pt)

Set the point the camera should orbit around.

Parameters
[in]_ptThe focal point
void gazebo::rendering::UserCamera::SetJoyPoseControl ( bool  _value)

brief Enable or disable camera control through ~/user_camera/joy_pose gz topic.

Defaults to true.

Parameters
[in]_valueTrue to enable camera pose control by gz topic ~/user_camera/joy_pose.
void gazebo::rendering::UserCamera::SetJoyTwistControl ( bool  _value)

brief Enable or disable camera control through ~/user_camera/joy_twist gz topic.

Defaults to true.

Parameters
[in]_valueTrue to enable camera pose control by gz topic ~/user_camera/joy_twist.
virtual bool gazebo::rendering::UserCamera::SetProjectionType ( const std::string &  _type)
virtual

Set the type of projection used by the camera.

Parameters
[in]_typeThe type of projection: "perspective" or "orthographic".
Returns
True if successful.
See Also
GetProjectionType()

Reimplemented from gazebo::rendering::Camera.

virtual void gazebo::rendering::UserCamera::SetRenderTarget ( Ogre::RenderTarget *  _target)
virtual

Set to true to enable rendering.

Use this only if you really know what you're doing.

Parameters
[in]_targetThe new rendering target.

Reimplemented from gazebo::rendering::Camera.

void gazebo::rendering::UserCamera::SetUseSDFPose ( bool  _value)

brief Set if the user camera pose has changed in the world file.

Parameters
[in]_valueTrue if the camera pose changed in the world file.
void gazebo::rendering::UserCamera::SetViewController ( const std::string &  _type)

Set view controller.

Parameters
[in]_typeThe type of view controller: "orbit", "fps"
void gazebo::rendering::UserCamera::SetViewController ( const std::string &  _type,
const math::Vector3 _pos 
)

Set view controller.

Parameters
[in]_typeThe type of view controller: "orbit", "fps"
[in]_posThe initial pose of the camera.
void gazebo::rendering::UserCamera::SetViewportDimensions ( float  _x,
float  _y,
float  _w,
float  _h 
)

Set the dimensions of the viewport.

Parameters
[in]_xX position of the viewport.
[in]_yY position of the viewport.
[in]_wWidth of the viewport.
[in]_hHeight of the viewport.
virtual void gazebo::rendering::UserCamera::SetWorldPose ( const math::Pose _pose)
virtual

Set the pose in the world coordinate frame.

Parameters
[in]_poseNew pose of the camera.

Reimplemented from gazebo::rendering::Camera.

bool gazebo::rendering::UserCamera::StereoEnabled ( ) const

Get whether stereo is enabled.

Returns
True if stereo is enabled.
virtual bool gazebo::rendering::UserCamera::TrackVisualImpl ( VisualPtr  _visual)
protectedvirtual

Set the camera to track a scene node.

Tracking just causes the camera to rotate to follow the visual.

Parameters
[in]_visualVisual to track.
Returns
True if the camera is now tracking the visual.

Reimplemented from gazebo::rendering::Camera.

virtual void gazebo::rendering::UserCamera::Update ( )
virtual

Render the camera.

Reimplemented from gazebo::rendering::Camera.

virtual void gazebo::rendering::UserCamera::UpdateFOV ( )
protectedvirtual

Update the camera's field of view.

Reimplemented from gazebo::rendering::Camera.


The documentation for this class was generated from the following file: