##

WideAngleCamera.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_RENDERING_WIDEANGLECAMERA_HH_
#define GAZEBO_RENDERING_WIDEANGLECAMERA_HH_
#include <string>
#include <utility>
#include <vector>
#include <sdf/sdf.hh>
#include "gazebo/msgs/msgs.hh"
#include "gazebo/transport/Node.hh"
#include "gazebo/transport/Subscriber.hh"
#include "gazebo/rendering/ogre_gazebo.h"
#include "gazebo/msgs/MessageTypes.hh"
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/util/system.hh"
#include "gazebo/rendering/Camera.hh"
namespace gazebo
{
namespace rendering
{
// forward declarations
class WideAngleCamera;
class CameraLensPrivate;
class WideAngleCameraPrivate;
class GAZEBO_VISIBLE CameraLens
{
public: CameraLens();
public: virtual ~CameraLens();
public: void Init(const double _c1, const double _c2,
const std::string &_fun, const double _f,
const double _c3);
public: void Init(const std::string &_name);
public: void Load(sdf::ElementPtr _sdf);
public: void Load();
public: std::string Type() const;
public: bool IsCustom() const;
public: double C1() const;
public: double C2() const;
public: double C3() const;
public: double F() const;
public: std::string Fun() const;
public: double CutOffAngle() const;
public: bool ScaleToHFOV() const;
public: void SetType(const std::string &_type);
public: void SetC1(const double _c);
public: void SetC2(const double _c);
public: void SetC3(const double _c);
public: void SetF(const double _f);
public: void SetFun(const std::string &_fun);
public: void SetCutOffAngle(const double _angle);
public: void SetScaleToHFOV(const bool _scale);
public: void SetUniformVariables(Ogre::Pass *_pass, const float _ratio,
const float _hfov);
private: void ConvertToCustom();
private: std::unique_ptr<CameraLensPrivate> dataPtr;
};
class GAZEBO_VISIBLE WideAngleCamera :
public Camera,
protected Ogre::CompositorInstance::Listener
{
public: WideAngleCamera(const std::string &_namePrefix, ScenePtr _scene,
const bool _autoRender = true,
const int _textureSize = 256);
public: virtual ~WideAngleCamera();
// Documentation inherited
public: void Init() override;
// Documentation inherited
public: void Load() override;
using Camera::Load;
// Documentation inherited
public: virtual void Fini() override;
public: int EnvTextureSize() const;
public: CameraLens *Lens() const;
// Documentation inherited
public: void SetRenderTarget(Ogre::RenderTarget *_target) override;
public: void SetEnvTextureSize(const int _size);
protected: void CreateEnvCameras();
// Documentation inherited
public: void SetClipDist() override;
using Camera::SetClipDist;
// Documentation inherited
public: bool SetBackgroundColor(const ignition::math::Color &_color)
override;
public: ignition::math::Vector3d Project3d(
const ignition::math::Vector3d &_pt) const;
public: std::vector<Ogre::Camera *> OgreEnvCameras() const;
protected: void CreateEnvRenderTexture(const std::string &_textureName);
// Documentation inherited
protected: void RenderImpl() override;
// Documentation inherited
protected: void UpdateFOV() override;
protected: void notifyMaterialRender(Ogre::uint32 _pass_id,
Ogre::MaterialPtr &_material) override;
private: std::unique_ptr<WideAngleCameraPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
system.hh
msgs.hh
Camera.hh
Node.hh
gazebo::rendering::WideAngleCamera
Camera with variable mapping function.
Definition: WideAngleCamera.hh:174
gazebo::rendering::ScenePtr
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
RenderTypes.hh
rendering
rendering
Definition: RenderEngine.hh:31
gazebo::rendering::CameraLens
Describes a lens of a camera as amapping function of type r = c1*f*fun(theta/c2+c3)
Definition: WideAngleCamera.hh:55
ogre_gazebo.h
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::rendering::Camera::SetClipDist
virtual void SetClipDist()
Set the clip distance based on stored SDF values.
gazebo::rendering::Camera::Load
virtual void Load()
Load the camera with default parameters.
gazebo::rendering::Camera
Basic camera sensor.
Definition: Camera.hh:84
Subscriber.hh
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59