robotology-legacy / kinect-wrapper

A C++ library that wraps around Kinect SDK or OpenNI drivers
GNU General Public License v2.0
2 stars 4 forks source link

Allow setting RGB image size for OpenNI driver + Fix kinectClientExample #4

Closed Tobias-Fischer closed 9 years ago

Tobias-Fischer commented 9 years ago

Hi, this little pull request slightly extends two features of the kinect-wrapper.

  1. It allows specifying carrier and remote in the kinectClientExample. So far, these options were existing but not used. Also, the documentation was misleading as changing "local" was documented to change the port name, but "name" is the actual option.
  2. For the OpenNI driver, it was not possible so far to change the RGB image size. Therefore, RGB images were always at 320x240 resolution. The little fix introduces the capability to change image width and height.

Both fixes were tested and should work just fine. @pattacini It would be great if you could merge this :).

Thanks and have a nice week, Tobias

pattacini commented 9 years ago

Hi @Tobias-Fischer, could you address the small comment I've pointed out?

Tobias-Fischer commented 9 years ago

Hi @pattacini, I fixed the small issue. Could you please provide a brief explanation why using c_str() is of advantage?

Thanks, Tobias

pattacini commented 9 years ago

I was not aware of the new Property::put(const ConstString&, const ConstString&) method. I thought we were still sticking to Property::put(const char*, const char*). By the way, the cast from std::string to yarp::os::ConstString was used to cause trouble before, until they practically enabled typedef std::string yarp::os::ConstString by default. Nonetheless, if I'm not mistaken, it is still possible to have a standalone implementation of ConstString, thus it's safer to call c_str().