0
$\begingroup$

Rosanswers logo

Hi all,

This will be a simple question I'm sure. Currently using XTIon running a openni2_camera_node. This depth and rgb images are coming through fine, but that flipped about the Y axis. Is there something I need to set to correct this?

I am using the command below, with the resulting output. The last be is my modification to the code as it wasn't detecting the resolution on the pi

pi@toeminator ~ $ rosrun openni2_camera openni2_camera_node
[ INFO] [1419945763.946308307]: creating image_transport... this might take a while...
[ERROR] [1419945766.605981936]: Tried to advertise a service that is already advertised in this node [/openni2_camera/set_camera_info]
[ INFO] [1419945766.627862571]: using default calibration URL
[ INFO] [1419945766.641525343]: camera calibration URL: file:///home/pi/.ros/camera_info/rgb.yaml
[ERROR] [1419945766.655618108]: Unable to open camera calibration file [/home/pi/.ros/camera_info/rgb.yaml]
[ WARN] [1419945766.668209898]: Camera calibration file /home/pi/.ros/camera_info/rgb.yaml not found.
[ WARN] [1419945766.678064734]: Using default parameters for RGB camera calibration.
[ INFO] [1419945766.683336646]: using default calibration URL
[ INFO] [1419945766.693109483]: camera calibration URL: file:///home/pi/.ros/camera_info/depth.yaml
[ERROR] [1419945766.701483343]: Unable to open camera calibration file [/home/pi/.ros/camera_info/depth.yaml]
[ WARN] [1419945766.711815171]: Camera calibration file /home/pi/.ros/camera_info/depth.yaml not found.
[ WARN] [1419945766.724518959]: Using default parameters for IR camera calibration.
Warning: USB events thread - failed to set priority. This might cause loss of data...
Available depth modes
0: 320x240, 30 fps, 100 format
1: 320x240, 30 fps, 101 format
2: 320x240, 60 fps, 100 format
3: 320x240, 60 fps, 101 format
4: 640x480, 30 fps, 100 format
5: 640x480, 30 fps, 101 format
6: 160x120, 30 fps, 100 format
7: 160x120, 30 fps, 101 format
[ INFO] [1419945768.719023684]: Everything set up... lets stream some images

The images below show the image streamed back as viewed in rqt (top) and bottom is how the scene really looks (I've flipped is manually)

image description

Many Thanks

Mark


Originally posted by MarkyMark2012 on ROS Answers with karma: 1834 on 2014-12-28

Post score: 2


Original comments

Comment by tfoote on 2014-12-28:
Please clarify what you mean by flipped and which axis you are referring to.

Comment by MarkyMark2012 on 2014-12-29:
It's flipped about the Y axis as you look at it. i.e. the left is on the right and the right is on the left. The image is the correct re top and bottom

Comment by tfoote on 2014-12-29:
Please explain yoiur full setup so we can reproduce it? What are you running with what parameters? What visualizer are you running with what settings? Commands and console outputs are useful. A screen capture would be helpful as well.

Comment by tfoote on 2014-12-29:
Please see guidelines for asking questions at: http://wiki.ros.org/Support

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Ok finally found the solution to this. For some reason the VideoStream in Openni2 (not sure about 1) has mirroring enabled as default. i.e the image is shown as if seen in a mirror. To correct this the openni2_camera.cpp file needs to be updated with the lines:

   depthStream.setMirroringEnabled(FALSE);
   rgbStream.setMirroringEnabled(FALSE);

This means that this image will go from being this (mirrored)

image description

to non-mirrored

image description

Additional I've built all the underlying drivered et al from source as this runs on a raspberry pi

Hopefully this will be of use some time...

Mark


Originally posted by MarkyMark2012 with karma: 1834 on 2015-05-30

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by miguel on 2015-10-05:
Thanks so much for this, been wondering why my laserscan was upside down for months now and never realized the image was inverted! Solved my issue!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.