playerv camera data wrong colors when using gazebo

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

playerv camera data wrong colors when using gazebo

David Michal-3
I am trying to use camera data from gazebo for the first time.  The
image has the correct shapes in playerv but the wrong colors.  Blue and
yellow objects in gazebo show up as red and turquoise.  I am using
Player 3.0.1, Gazebo 0.9.0, and Ogre 1.6.5.  Is there something I have
configured incorrectly or is this a bug?

Here is the definition from my model file.

<model:physical name="webcam_model">
  <xyz>0.22 0.0 0.108</xyz>
  <rpy>0.0 60.0 0.0</rpy>
  <body:empty name="webcam_body">
      <geom:sphere name="webcam_geom">
      <size>0.0254</size>
      <mass>0.25</mass>
      <visual>
        <scale>0.0254 0.0254 0.0254</scale>
        <mesh>unit_sphere</mesh>
        <material>Gazebo/Black</material>
      </visual>
    </geom:sphere>
    <sensor:camera name="webcam_sensor">
      <imageSize>640 480</imageSize>
      <hfov>72</hfov>
      <nearClip>0.02</nearClip>
      <farClip>20</farClip>
      <saveFrames>false</saveFrames>
      <saveFramesPath>frames</saveFramesPath>
      <controller:generic_camera name="webcam_controller">
        <interface:camera name="camera_iface_0"/>
      </controller:generic_camera>
    </sensor:camera>
  </body:empty>
</model:physical>

And here is the entry in the config file.

driver
(
  name "gazebo"
  provides ["camera:0"]
  gz_id "pcbot914_model1::webcam_model::camera_iface_0"
)



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: playerv camera data wrong colors when using gazebo

Nate Koenig
Hello,

Can you try the latest version of Gazebo, or even the SVN version?

-nate

On Sun, Mar 28, 2010 at 9:22 PM, David Michal <[hidden email]> wrote:

> I am trying to use camera data from gazebo for the first time.  The
> image has the correct shapes in playerv but the wrong colors.  Blue and
> yellow objects in gazebo show up as red and turquoise.  I am using
> Player 3.0.1, Gazebo 0.9.0, and Ogre 1.6.5.  Is there something I have
> configured incorrectly or is this a bug?
>
> Here is the definition from my model file.
>
> <model:physical name="webcam_model">
>  <xyz>0.22 0.0 0.108</xyz>
>  <rpy>0.0 60.0 0.0</rpy>
>  <body:empty name="webcam_body">
>      <geom:sphere name="webcam_geom">
>      <size>0.0254</size>
>      <mass>0.25</mass>
>      <visual>
>        <scale>0.0254 0.0254 0.0254</scale>
>        <mesh>unit_sphere</mesh>
>        <material>Gazebo/Black</material>
>      </visual>
>    </geom:sphere>
>    <sensor:camera name="webcam_sensor">
>      <imageSize>640 480</imageSize>
>      <hfov>72</hfov>
>      <nearClip>0.02</nearClip>
>      <farClip>20</farClip>
>      <saveFrames>false</saveFrames>
>      <saveFramesPath>frames</saveFramesPath>
>      <controller:generic_camera name="webcam_controller">
>        <interface:camera name="camera_iface_0"/>
>      </controller:generic_camera>
>    </sensor:camera>
>  </body:empty>
> </model:physical>
>
> And here is the entry in the config file.
>
> driver
> (
>  name "gazebo"
>  provides ["camera:0"]
>  gz_id "pcbot914_model1::webcam_model::camera_iface_0"
> )
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Playerstage-gazebo mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: playerv camera data wrong colors when using gazebo

David Michal-3
I tried Gazebo 0.10.0.  It has the same problem. Unfortunately for me it
seems to have a lot of other problems as well such as position2d not
working (I have seen a patch for this), the texture on my robot doesn't
display, the ir rays don't display, and my client program gets a
segmentation fault when trying to get the ir range information.  This is
why I have stuck with 0.9.0. After some further study I have noticed
that the color problem seems to be a result of the red and blue channels
getting swapped in the playerv camera view.  This is why blue displays
as red and yellow as cyan.  I haven't tried playerv with a real camera
yet.  Its possible that this could be a Player problem instead of a
Gazebo problem.  I'll try it with a real camera this weekend and let you
know. Thanks.

On Thu, 2010-04-01 at 12:51 -0700, Nate Koenig wrote:

> Hello,
>
> Can you try the latest version of Gazebo, or even the SVN version?
>
> -nate
>
> On Sun, Mar 28, 2010 at 9:22 PM, David Michal <[hidden email]> wrote:
> > I am trying to use camera data from gazebo for the first time.  The
> > image has the correct shapes in playerv but the wrong colors.  Blue and
> > yellow objects in gazebo show up as red and turquoise.  I am using
> > Player 3.0.1, Gazebo 0.9.0, and Ogre 1.6.5.  Is there something I have
> > configured incorrectly or is this a bug?
> >
> > Here is the definition from my model file.
> >
> > <model:physical name="webcam_model">
> >  <xyz>0.22 0.0 0.108</xyz>
> >  <rpy>0.0 60.0 0.0</rpy>
> >  <body:empty name="webcam_body">
> >      <geom:sphere name="webcam_geom">
> >      <size>0.0254</size>
> >      <mass>0.25</mass>
> >      <visual>
> >        <scale>0.0254 0.0254 0.0254</scale>
> >        <mesh>unit_sphere</mesh>
> >        <material>Gazebo/Black</material>
> >      </visual>
> >    </geom:sphere>
> >    <sensor:camera name="webcam_sensor">
> >      <imageSize>640 480</imageSize>
> >      <hfov>72</hfov>
> >      <nearClip>0.02</nearClip>
> >      <farClip>20</farClip>
> >      <saveFrames>false</saveFrames>
> >      <saveFramesPath>frames</saveFramesPath>
> >      <controller:generic_camera name="webcam_controller">
> >        <interface:camera name="camera_iface_0"/>
> >      </controller:generic_camera>
> >    </sensor:camera>
> >  </body:empty>
> > </model:physical>
> >
> > And here is the entry in the config file.
> >
> > driver
> > (
> >  name "gazebo"
> >  provides ["camera:0"]
> >  gz_id "pcbot914_model1::webcam_model::camera_iface_0"
> > )
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Download Intel&#174; Parallel Studio Eval
> > Try the new software tools for yourself. Speed compiling, find bugs
> > proactively, and fine-tune applications for parallel performance.
> > See why Intel Parallel Studio got high marks during beta.
> > http://p.sf.net/sfu/intel-sw-dev
> > _______________________________________________
> > Playerstage-gazebo mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
> >
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Playerstage-gazebo mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: playerv camera data wrong colors when using gazebo

David Michal-3
Tried playerv with a real camera and it works fine.  The red/blue swap
must be a problem with Gazebo and/or Ogre.

On Fri, 2010-04-02 at 21:13 -0500, David Michal wrote:

> I tried Gazebo 0.10.0.  It has the same problem. Unfortunately for me it
> seems to have a lot of other problems as well such as position2d not
> working (I have seen a patch for this), the texture on my robot doesn't
> display, the ir rays don't display, and my client program gets a
> segmentation fault when trying to get the ir range information.  This is
> why I have stuck with 0.9.0. After some further study I have noticed
> that the color problem seems to be a result of the red and blue channels
> getting swapped in the playerv camera view.  This is why blue displays
> as red and yellow as cyan.  I haven't tried playerv with a real camera
> yet.  Its possible that this could be a Player problem instead of a
> Gazebo problem.  I'll try it with a real camera this weekend and let you
> know. Thanks.
>
> On Thu, 2010-04-01 at 12:51 -0700, Nate Koenig wrote:
> > Hello,
> >
> > Can you try the latest version of Gazebo, or even the SVN version?
> >
> > -nate
> >
> > On Sun, Mar 28, 2010 at 9:22 PM, David Michal <[hidden email]> wrote:
> > > I am trying to use camera data from gazebo for the first time.  The
> > > image has the correct shapes in playerv but the wrong colors.  Blue and
> > > yellow objects in gazebo show up as red and turquoise.  I am using
> > > Player 3.0.1, Gazebo 0.9.0, and Ogre 1.6.5.  Is there something I have
> > > configured incorrectly or is this a bug?
> > >
> > > Here is the definition from my model file.
> > >
> > > <model:physical name="webcam_model">
> > >  <xyz>0.22 0.0 0.108</xyz>
> > >  <rpy>0.0 60.0 0.0</rpy>
> > >  <body:empty name="webcam_body">
> > >      <geom:sphere name="webcam_geom">
> > >      <size>0.0254</size>
> > >      <mass>0.25</mass>
> > >      <visual>
> > >        <scale>0.0254 0.0254 0.0254</scale>
> > >        <mesh>unit_sphere</mesh>
> > >        <material>Gazebo/Black</material>
> > >      </visual>
> > >    </geom:sphere>
> > >    <sensor:camera name="webcam_sensor">
> > >      <imageSize>640 480</imageSize>
> > >      <hfov>72</hfov>
> > >      <nearClip>0.02</nearClip>
> > >      <farClip>20</farClip>
> > >      <saveFrames>false</saveFrames>
> > >      <saveFramesPath>frames</saveFramesPath>
> > >      <controller:generic_camera name="webcam_controller">
> > >        <interface:camera name="camera_iface_0"/>
> > >      </controller:generic_camera>
> > >    </sensor:camera>
> > >  </body:empty>
> > > </model:physical>
> > >
> > > And here is the entry in the config file.
> > >
> > > driver
> > > (
> > >  name "gazebo"
> > >  provides ["camera:0"]
> > >  gz_id "pcbot914_model1::webcam_model::camera_iface_0"
> > > )
> > >
> > >
> > >
> > > ------------------------------------------------------------------------------
> > > Download Intel&#174; Parallel Studio Eval
> > > Try the new software tools for yourself. Speed compiling, find bugs
> > > proactively, and fine-tune applications for parallel performance.
> > > See why Intel Parallel Studio got high marks during beta.
> > > http://p.sf.net/sfu/intel-sw-dev
> > > _______________________________________________
> > > Playerstage-gazebo mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
> > >
> >
> > ------------------------------------------------------------------------------
> > Download Intel&#174; Parallel Studio Eval
> > Try the new software tools for yourself. Speed compiling, find bugs
> > proactively, and fine-tune applications for parallel performance.
> > See why Intel Parallel Studio got high marks during beta.
> > http://p.sf.net/sfu/intel-sw-dev
> > _______________________________________________
> > Playerstage-gazebo mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
> >
>



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: playerv camera data wrong colors when using gazebo

valentino
Hi
I'm using the last svn of Gazebo with Player 3.0.1, Ogre 1.7.0 on ubuntu 9.10
(I tried it on both versions 32 and 64 bit). All run well until, using playerv,
I subscribe the camera interface (sonyvid30) causing a segfault in gazebo. This
is the output of gazebo debug "gdb gazebo" after subscribing of the camera
interface in Playerv:

 Gazebo successfully initialized
 [New Thread 0x7fffe51b7910 (LWP 11321)]

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 0x7fffe51b7910 (LWP 11321)]
 0x00007ffff49fedf8 in gazebo::OgreCamera::GetVFOV() const () from
 /usr/local/lib/libgazebo_rendering.so
 (gdb)


The problem seems caused by GetVFOV() function in Generic_Camera.cc
line 131, but I am not able to solve it.
Doing some testing, I have noticed that while the definition of SONYVID30
is not incorporated in the model of PIONEER2DX in the Gazebo world
file, subscribe the cam works well in PlayerV (although the colors are
wrong). Of course I need that the Cam is included into definition of the robot.
The problem to subscribe a simulated camera interface, appears only
with the svn versions of gazebo (I have tried 8611, and the last
8614). If I Use gazebo 0.10, I can subscribe the camera interface with
playerv without errors and colors are rights, but with svn versions of Gazebo, I
get a segfault. So I'd like to use gazebo 0.10 but Icannot because with this
version,the robot doesn't respond to any movement commands.
Someone can help me ?
Thanks



------------------------------------------------------------------------------
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
Reply | Threaded
Open this post in threaded view
|

Re: playerv camera data wrong colors when using gazebo

Bushra Sabir
In reply to this post by Nate Koenig
Dear

         The swaping of color is due to the fact that the image obtained from playerv camera is RGB while you have to convert it into BGR.

Regards

Bushra Sabir
Nate Koenig wrote
Hello,

Can you try the latest version of Gazebo, or even the SVN version?

-nate

On Sun, Mar 28, 2010 at 9:22 PM, David Michal <michalrobots@knology.net> wrote:
> I am trying to use camera data from gazebo for the first time.  The
> image has the correct shapes in playerv but the wrong colors.  Blue and
> yellow objects in gazebo show up as red and turquoise.  I am using
> Player 3.0.1, Gazebo 0.9.0, and Ogre 1.6.5.  Is there something I have
> configured incorrectly or is this a bug?
>
> Here is the definition from my model file.
>
> <model:physical name="webcam_model">
>  <xyz>0.22 0.0 0.108</xyz>
>  <rpy>0.0 60.0 0.0</rpy>
>  <body:empty name="webcam_body">
>      <geom:sphere name="webcam_geom">
>      <size>0.0254</size>
>      <mass>0.25</mass>
>      <visual>
>        <scale>0.0254 0.0254 0.0254</scale>
>        <mesh>unit_sphere</mesh>
>        <material>Gazebo/Black</material>
>      </visual>
>    </geom:sphere>
>    <sensor:camera name="webcam_sensor">
>      <imageSize>640 480</imageSize>
>      <hfov>72</hfov>
>      <nearClip>0.02</nearClip>
>      <farClip>20</farClip>
>      <saveFrames>false</saveFrames>
>      <saveFramesPath>frames</saveFramesPath>
>      <controller:generic_camera name="webcam_controller">
>        <interface:camera name="camera_iface_0"/>
>      </controller:generic_camera>
>    </sensor:camera>
>  </body:empty>
> </model:physical>
>
> And here is the entry in the config file.
>
> driver
> (
>  name "gazebo"
>  provides ["camera:0"]
>  gz_id "pcbot914_model1::webcam_model::camera_iface_0"
> )
>
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Playerstage-gazebo mailing list
> Playerstage-gazebo@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Playerstage-gazebo mailing list
Playerstage-gazebo@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo