30 eyeRenderTexture(nullptr),
74 #define DEBUG_SQUARES 0
77 for (
int i = 0; i < 10; ++i) {
83 if (pix[0] <= 5 && pix[1] >= 250 && pix[2] <= 5) {
89 if (pix[0] >= 250 && pix[1] <= 5 && pix[2] <= 5) {
102 size_t w = img.
width();
115 for (
size_t i = 0; i < h; ++i) {
117 unsigned char* dataStart = data + (i*rs);
118 memcpy(textureStart, dataStart, rs);
126 unsigned char* dataStart = data + (y+i)*rs + x*3;
143 int ret = std::sscanf(b.
toString().c_str(),
"%d %lg %lg %lg %lg\n", &seqNum, &ts, &r, &p, &yy);
145 roll += OVR::DegreeToRad(
static_cast<float>(r));
146 pitch += OVR::DegreeToRad(
static_cast<float>(p));
147 yaw += OVR::DegreeToRad(
static_cast<float>(yy));
150 eyeRenderTexture->
eyePose.Orientation.w = (float)(- cos(roll/2) * cos(pitch/2) * cos(yaw/2) - sin(roll/2) * sin(pitch/2) * sin(yaw/2));
151 eyeRenderTexture->
eyePose.Orientation.x = (float)(- cos(roll/2) * sin(pitch/2) * cos(yaw/2) - sin(roll/2) * cos(pitch/2) * sin(yaw/2));
152 eyeRenderTexture->
eyePose.Orientation.y = (float)(- cos(roll/2) * cos(pitch/2) * sin(yaw/2) + sin(roll/2) * sin(pitch/2) * cos(yaw/2));
153 eyeRenderTexture->
eyePose.Orientation.z = (float)(- sin(roll/2) * cos(pitch/2) * cos(yaw/2) + cos(roll/2) * sin(pitch/2) * sin(yaw/2));
const yarp::os::LogComponent & OVRHEADSET()
A simple collection of objects that can be described and transmitted in a portable way.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
bool getEnvelope(PortReader &envelope) override
Get the envelope information (e.g., a timestamp) from the last message received on the port.
static void delaySystem(double seconds)
unsigned char * getPixelAddress(size_t x, size_t y) const
Get address of a pixel in memory.
size_t width() const
Gets width of image in pixels.
size_t getRowSize() const
Size of the underlying image buffer rows.
unsigned char * getRawImage() const
Access to the internal image buffer.
size_t height() const
Gets height of image in pixels.
#define yCTrace(component,...)
#define yCWarning(component,...)
yarp::sig::Matrix eye(int r, int c)
Build an identity matrix (defined in Math.h).
The main, catch-all namespace for YARP.