Package org.robwork.sdurw_simulation
Class GLFrameGrabber25D
- java.lang.Object
-
- org.robwork.sdurw_simulation.FrameGrabber25D
-
- org.robwork.sdurw_simulation.GLFrameGrabber25D
-
public class GLFrameGrabber25D extends FrameGrabber25D
An implementation of the FrameGrabber interface. The GLFrameGrabber25D
grabs images from a OpenGL scene using a simple pinhole camera model.
a framethe opengl rendering to
take pictures of the scene.
The most basic parameter of a camera is its Field of view. This
can be used as an initial camera model. Field of view can be
calculated from the focal length and the size of the CCD
typically (1/2, 1/3, 1/4) inch.
If a more realistic camera model is
required the perspective transform of a specific camera can be added
-
-
Constructor Summary
Constructors Constructor Description GLFrameGrabber25D(int width, int height, double fov)constructorGLFrameGrabber25D(int width, int height, double fov, double mindepth)constructorGLFrameGrabber25D(int width, int height, double fov, double mindepth, double maxdepth)constructorGLFrameGrabber25D(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()static longgetCPtr(GLFrameGrabber25D obj)doublegetFieldOfViewY()Returns the field of view measured around the y-axis.doublegetMaxDepth()maximum depth that this framegrabber can handledoublegetMinDepth()minimum depth that this framegrabber can handlevoidgrab(FramePtr frame, State state)this function grabs a image from the specialized source and
copies it to the FrameGrabber25D image.booleaninit(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t drawer)initialize the grabber with a scene viewer.voidsetMaxDepth(double depth)set the maximum depth that is percieved by this frame grabber.
If min and max depth are too far apart the resolution of the depth
perception will become bad.voidsetMinDepth(double depth)set the minimum depth that is percieved by this frame grabber.
If min and max depth are too far apart the resolution of the depth
perception will become bad.
-
-
-
Constructor Detail
-
GLFrameGrabber25D
public GLFrameGrabber25D(long cPtr, boolean cMemoryOwn)
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov, double mindepth, double maxdepth)constructor- Parameters:
width- [in] width of imageheight- [in] height of imagefov- [in] the vertical field of view angle in degreemindepth- [in] the minimum depth of camera.maxdepth- [in] the maximum depth of camera.
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov, double mindepth)constructor- Parameters:
width- [in] width of imageheight- [in] height of imagefov- [in] the vertical field of view angle in degreemindepth- [in] the minimum depth of camera.
-
GLFrameGrabber25D
public GLFrameGrabber25D(int width, int height, double fov)constructor- Parameters:
width- [in] width of imageheight- [in] height of imagefov- [in] the vertical field of view angle in degree
-
-
Method Detail
-
getCPtr
public static long getCPtr(GLFrameGrabber25D obj)
-
delete
public void delete()
- Overrides:
deletein classFrameGrabber25D
-
init
public boolean init(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer_t drawer)
initialize the grabber with a scene viewer. This registers the grabber
as a camera in the scene and enables rendering.- Parameters:
drawer- [in] the scene viewer- Returns:
- true if initialization succeeded, false otherwise (depends on the capabilities of
the SceneViewer).
-
setMaxDepth
public void setMaxDepth(double depth)
set the maximum depth that is percieved by this frame grabber.
If min and max depth are too far apart the resolution of the depth
perception will become bad. Hence keep the range realistic.- Parameters:
depth- [in] max depth
-
setMinDepth
public void setMinDepth(double depth)
set the minimum depth that is percieved by this frame grabber.
If min and max depth are too far apart the resolution of the depth
perception will become bad. Hence keep the range realistic.- Parameters:
depth- [in] min depth
-
grab
public void grab(FramePtr frame, State state)
Description copied from class:FrameGrabber25Dthis function grabs a image from the specialized source and
copies it to the FrameGrabber25D image.- Overrides:
grabin classFrameGrabber25D
-
getMaxDepth
public double getMaxDepth()
Description copied from class:FrameGrabber25Dmaximum depth that this framegrabber can handle- Overrides:
getMaxDepthin classFrameGrabber25D- Returns:
- maximum depth in meter
-
getMinDepth
public double getMinDepth()
Description copied from class:FrameGrabber25Dminimum depth that this framegrabber can handle- Overrides:
getMinDepthin classFrameGrabber25D- Returns:
- minimum depth in meter
-
getFieldOfViewY
public double getFieldOfViewY()
Description copied from class:FrameGrabber25DReturns the field of view measured around the y-axis.- Overrides:
getFieldOfViewYin classFrameGrabber25D- Returns:
- Field of view measured around y-axis in radians
-
-