## Re: [PlayerStage-Gazebo] Camera rotation problem

 Re: [PlayerStage-Gazebo] Camera rotation problem From: Michael Sheldon - 2007-11-26 12:46:35 ```On Sun, 2007-11-25 at 01:41 +0000, Michael Sheldon wrote: > Hi, > > I'm currently working on creating an omnidirectional camera for use in > Gazebo 0.7; however I'm having a little bit of trouble setting the > camera rotation. The way I'm acquiring an omnidirectional image, is to > make 4 passes with a 90 degree field of view, these will later be cube > mapped on to a sphere to simulate the distortion of a real > omnidirectional camera (one which uses a hyperbolic mirror). Ah don't worry, I've solved it now. I should have been rotating by adding quaternions (using GzCoordRotationAdd), rather than treating it as an orientation about the axis. Cheers, Mike. ```

 [PlayerStage-Gazebo] Camera rotation problem From: Michael Sheldon - 2007-11-25 01:41:31 ```Hi, I'm currently working on creating an omnidirectional camera for use in Gazebo 0.7; however I'm having a little bit of trouble setting the camera rotation. The way I'm acquiring an omnidirectional image, is to make 4 passes with a 90 degree field of view, these will later be cube mapped on to a sphere to simulate the distortion of a real omnidirectional camera (one which uses a hyperbolic mirror). However the camera does not rotate as I would expect, the following code is used for the image acquisition: for(j = 0; j < 4; j++) { dst = data->image + len * j; this->camera->Update(); src = this->camera->GetImageData() + (height - 1) * len; for (i = 0; i < height; i++, src -= len, dst += len) { memcpy(dst, src, len); dst += len * 3; } pose = this->camera->GetPose(); pose.rot.z += M_PI / 2; this->camera->SetPose(pose); } Which produces output like this: http://www.mikeasoft.com/~mike/omnicam.png As you can see I'm attempting to rotate the camera by PI/2 for each section of the image, however the resulting images are clearly not rotated by this amount. When I turn the whole robot about its Z axis the different sections of the image rotate at different speeds, the first (front) image rotates as normal, but all the others are incorrect. Can anyone give me a clue as to what I might be doing wrong? Cheers, Mike. ```
 Re: [PlayerStage-Gazebo] Camera rotation problem From: Michael Sheldon - 2007-11-26 12:46:35 ```On Sun, 2007-11-25 at 01:41 +0000, Michael Sheldon wrote: > Hi, > > I'm currently working on creating an omnidirectional camera for use in > Gazebo 0.7; however I'm having a little bit of trouble setting the > camera rotation. The way I'm acquiring an omnidirectional image, is to > make 4 passes with a 90 degree field of view, these will later be cube > mapped on to a sphere to simulate the distortion of a real > omnidirectional camera (one which uses a hyperbolic mirror). Ah don't worry, I've solved it now. I should have been rotating by adding quaternions (using GzCoordRotationAdd), rather than treating it as an orientation about the axis. Cheers, Mike. ```