Camera#
- class blueprints.Camera[source]#
Bases:
CameraType,CyclicalThing,MoveableThingThis class is available through the shortcut
blueprints.Camera.Most attribute descriptions are partially taken from Mujoco.
- fieldofview#
The angle of field of view in radians.
- Type:
int | float, optional
- ipd#
Inter-pupilary distance. This attribute only has an effect during stereoscopic rendering. It specifies the distance between the left and right viewpoints. Each viewpoint is shifted by +/- half of the distance specified here, along the X axis of the camera frame.
- Type:
float
- target#
The target attribute specifies a Body that is tracked by the camera. Compatible
modevalues are (‘targetbody’, ‘targetbodycom’).- Type:
blue.Body | None
- mode#
- The possible values are:
'fixed': Position and orientation will change w.r.t. the parents frame of reference.'track': Position is at a constant offset from the parent in world coordinates, while the camera orientation is constant in world coordinates.'trackcom': is similar to'track'but the constant spatial offset is defined relative to the center of mass of the kinematic subtree starting at the parent Body. This can be used to keep an entire mechanism in view. Note that the subtree center of mass for the World is the center of mass of the entire model.'targetbody': the Camera position is fixed in the parent Body, while the Camera orientation is adjusted so that it always points towards the targeted Body (which is specified with the target attribute)'targetbodycom': is the same as'targetbody'but the Camera is oriented towards the center of mass of the subtree starting at the target Cody.
- Type:
str
Attributes Summary
Vertical field-of-view of the camera.
Vertical field-of-view of the camera.
Frames per second
The delay between each rendering in seconds
This attribute only has an effect during stereoscopic rendering.
The Camera observation is retrieved as the image rendered by the mujoco Renderer using OpenGL.
The resolution is used for
observationrendering andrecording.The target attribute specifies a Body that is tracked by the camera.
Attributes Documentation
- fieldofview#
Vertical field-of-view of the camera.
- Returns:
Field of view
- Return type:
float
- fovy#
Vertical field-of-view of the camera.
- Returns:
field of view in degrees
- Return type:
float
- fps#
Frames per second
- Return type:
float
- frameinterval#
The delay between each rendering in seconds
- Return type:
float
- ipd#
This attribute only has an effect during stereoscopic rendering. It specifies the distance between the left and right viewpoints. Each viewpoint is shifted by \(\pm\) half of the distance specified here, along the \(X\) axis of the camera frame.
- Returns:
Inter-pupilary distance
- Return type:
float
- observation#
The Camera observation is retrieved as the image rendered by the mujoco Renderer using OpenGL.
- Returns:
RGB image using the specified camera settings.
- Return type:
np.ndarray
- resolution#
The resolution is used for
observationrendering andrecording. Rendering inWorld.viewuses OpenGL defaults.- Returns:
The resolution of the camera.
- Return type:
np.ndarray
- target#
The target attribute specifies a Body that is tracked by the camera. Compatible
modevalues are (‘targetbody’, ‘targetbodycom’).- Return type:
blue.BodyType | None
- __init__(pos=[0.0, 0.0, 0.0], alpha=1.5707963267948966, beta=0.0, gamma=0.0, mode='fixed', resolution=[480, 480], fieldofview=0.7853981633974483, ipd=0.068, fps=30, name=None, x=None, y=None, z=None, quat=None, **kwargs)[source]#
- Parameters:
pos (
np.ndarray | list[int | float], optional) – Represents the position of the object. Changing this attribute also changes the propertiesx,yandz.alpha (
int | float, optional) – (Improper) euler angle of rotation around the x-axis in radian. Changing this value also changes theeulerproperty.beta (
int | float, optional) – (Improper) euler angle of rotation around the y-axis in radian. Changing this value also changes theeulerproperty.gamma (
int | float, optional) – (Improper) euler angle of rotation around the z-axis in radian. Changing this value also changes theeulerproperty.mode (
str, optional) – The mode defines who the position and orientation is changed over time. Seemodefor a detailed description.fieldofview (
int | float, optional) – The angle of field of view in radians.ipd (
int | float, optional) – Inter-pupilary distance. This attribute only has an effect during stereoscopic rendering. It specifies the distance between the left and right viewpoints. Each viewpoint is shifted by +/- half of the distance specified here, along the X axis of the camera frame.name (
str | None, optional) – The user specified name of the Camera. It might change in the case of a naming conflict.x (
int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the X position coordinate.y (
int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the Y position coordinate.z (
int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the Z position coordinate.quat (
list [ int | float ] | np.ndarray | None, optional) – If set, the quaternion orientation overwrites the euler anglesalpha,betaandgamma.**kwargs – Keyword arguments are passed to
super().__init__.resolution (ndarray | list[int])
fps (int | float | None)
- Return type:
None
- classmethod __new__(*args, **kwargs)#