Multiple camera interface on the same model

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

Multiple camera interface on the same model

Francesco Grandis
Hello, i wrote a plugin model to simulate an omnidirectional camera (i.e. a
simple camera that looks at an hyperbolical mirror: it receives distorted
circular images on a 360deg HFOV and some nonlinear VFOV). It works fine, so i'd
like to contibute to the project, if you're interested of course.

Anyway i have a problem with an extension of the plugin i have still to write.
Before reading the following, please note that i'm using gazebo 0.5.3 and player
1.6.4 (due to many compiling/running problem that i solved only downgrading)

So: i have to manipulate the mirror images to create panoramic images, more
"readable" to the user. I thought to give the model two camera interfaces, each
one with its image size, data and so on, so the user could decide to see only
the mirror image, or the panoramic or both by the simulation control. I cannot
use a single interface like StereoHead for example, because the two images are
different in sizes, and i don't want to create an interface ad hoc (i'd rather
stick to an existing standard, than create new one).

Also, to minimize trouble probability, i made a great copy&paste-work from
existing code :) but the problem is that gazebo seems to consider only the
second iface created (code below). Looking at other models that use two ifaces,
i noticed that they use 2 DIFFERENT ifaces (SickLMS200 uses laser and fiducial,
SonyVID30 uses camera and ptz), so i wonder, is there any problem or
consideration to be aware of using two ifaces of the same type?

Of course, if you have any other or better idea to resolve the problem, you're
very welcome. Thanks for any help or suggestion.

Francesco

code:

int OmniCam01::Init( WorldFile *file, WorldFileNode *node )
{
...

  // OmniCamera mirror interface
  assert(this->mirrorIface);
  if (gz_camera_create(this->mirrorIface, this->world->gz_server, this->GetId(),
          "OmniCam01-mirror", (int) this, (int) this->parent) !=0)
    return -1;

  // OmniCamera panoramic interface
  assert(this->panIface);
  if (gz_camera_create(this->panIface, this->world->gz_server, this->GetId(),
          "OmniCam01-panoramic", (int) this, (int) this->parent) !=0)
    return -1;

...

}

It does not give any error compiling or running, just ignores mirrorIface



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

Re: Multiple camera interface on the same model

Francesco Grandis
Francesco Grandis <wil@...> writes:

> So: i have to manipulate the mirror images to create panoramic images, more
> "readable" to the user. I thought to give the model two camera interfaces,
> each one with its image size, data and so on, so the user could decide to see
> only the mirror image, or the panoramic or both by the simulation control.
 
> Also, to minimize trouble probability, i made a great copy&paste-work from
> existing code :) but the problem is that gazebo seems to consider only the
> second iface created (code below). Looking at other models that use two
> ifaces, i noticed that they use 2 DIFFERENT ifaces (SickLMS200 uses laser and
> fiducial, SonyVID30 uses camera and ptz), so i wonder, is there any problem or
> consideration to be aware of using two ifaces of the same type?
 

>   // OmniCamera mirror interface
>   assert(this->mirrorIface);
>   if (gz_camera_create(this->mirrorIface, this->world->gz_server,
>     this->GetId(), "OmniCam01-mirror", (int) this, (int) this->parent) !=0)
>     return -1;
>
>   // OmniCamera panoramic interface
>   assert(this->panIface);
>   if (gz_camera_create(this->panIface, this->world->gz_server, this->GetId(),
>           "OmniCam01-panoramic", (int) this, (int) this->parent) !=0)
>     return -1;


Solved. The problem was the equal identifier of the interface, i suppose. Using
this code:

  assert(this->mirrorIface);
  if (gz_camera_create(this->mirrorIface, this->world->gz_server,
      "mirror", "OmniCam01", (int) this, (int) this->parent) !=0)
    return -1;

  assert(this->panIface);
  if (gz_camera_create(this->panIface, this->world->gz_server,
      "panoramic","OmniCam01", (int) this, (int) this->parent) !=0)
    return -1;

it works fine, don't know if it can generate problems elsewhere.

I'm still willing to contribute the plugin, if anyone's interested.

Bye

Francesco
 





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

Re: Multiple camera interface on the same model

Ankit
how do you integrate this model in a robot urdf model and simulate the same
in gazebo.
I mean which .so files are linked as shared objects at time of compiling.

and how a normal mono camera can be made to function as an omnivision camera?


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-gazebo mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo