AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxSensor/Camera.h
Go to the documentation of this file.
1/*
2Copyright 2007-2026. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
22
23#include <agx/Frame.h>
24
25#include <agxSDK/Simulation.h>
26
27namespace agxSensor
28{
31
37 {
38 public:
45 static Camera* find(const agxSDK::Simulation* simulation, const agx::Name& name);
46
53 static Camera* find(const Environment* environment, const agx::Name& name);
54
61 static CameraPtrVector findAll(const agxSDK::Simulation* simulation, const agx::Name& name);
62
69 static CameraPtrVector findAll(const Environment* environment, const agx::Name& name);
70
76 static CameraPtrVector findAll(const agxSDK::Simulation* simulation);
77
83 static CameraPtrVector findAll(const Environment* environment);
84
89 static void setDefaultCameraBackend(const CameraBackend& backend);
90
91 public:
100 Camera(agx::Frame* frame, CameraModel* model, const CameraBackend& backend = defaultBackend());
101
107 virtual void setFrame(agx::Frame* frame) override;
108
112 virtual agx::Frame* getFrame() const override;
113
118
123
128
133
137 void capture();
138
140
141 public:
142 virtual void synchronize(const CallbackData& data) override;
143 virtual void execute(const CallbackData& data) override;
144 virtual void complete() override;
145 virtual void result(const CallbackData& data) override;
146 virtual void synchronizeGraphics(const agxRender::RenderManager& renderManager) override;
147 virtual void cleanup() override;
148
150
151 protected:
152 Camera();
153
155
156 private:
157 static CameraBackend& defaultBackend();
158
159 private:
160 agx::FrameRef m_frame;
161 CameraModelRef m_model;
162 CameraBackend m_backend;
163 bool m_useDefaultBackend;
164 };
165}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXSENSOR_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:131
Base camera model describing the fundamental components, such as the lens and the sensor of the camer...
Definition: CameraModel.h:35
Handler responsible for how the camera readings are assembled and provided to the user.
Camera instance class defined by a frame/transform and a model.
virtual agx::Frame * getFrame() const override
virtual ISensorOutputHandler * getOutputHandlerBase() const override
static CameraPtrVector findAll(const Environment *environment)
Find all cameras.
CameraModel * getModel() const
static Camera * find(const Environment *environment, const agx::Name &name)
Find camera given name.
static CameraPtrVector findAll(const agxSDK::Simulation *simulation, const agx::Name &name)
Find all cameras, given name.
void capture()
Tell the camera to capture a frame for all outputs.
CameraOutputHandler * getOutputHandler() const
virtual void setFrame(agx::Frame *frame) override
Assign a new parent frame to attach this camera to.
const CameraBackend & getCameraBackend() const
static Camera * find(const agxSDK::Simulation *simulation, const agx::Name &name)
Find camera given name.
static CameraPtrVector findAll(const Environment *environment, const agx::Name &name)
Find all cameras, given name.
static void setDefaultCameraBackend(const CameraBackend &backend)
Set the render backend connection to use as default for all cameras, if no explicit one is assigned.
static CameraPtrVector findAll(const agxSDK::Simulation *simulation)
Find all cameras.
Camera(agx::Frame *frame, CameraModel *model, const CameraBackend &backend=defaultBackend())
Construct this camera attached to the given frame and configured by the model.
Sensor environment implementation where different sensors collects data given a set of added objects,...
Common base type for all sensors attached to a frame of reference, such as that of a rigid body.
Common interface for sensor output handlers.
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
Representation of a name string.
Definition: Name.h:33
Vector containing 'raw' data.
Definition: agx/Vector.h:246
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
Namespace containing classes for handling debug rendering of collision geometries,...
Definition: Constraint.h:36
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.