Page 1 of 1

Image upside down when streaming to ROS

Posted: 19 Oct 2018, 19:09
by Rick Shen
Hi, I am using ROSInterface to streaming VisionSensor data to ROS. However, when I run the demo scene rosInterfaceTopicPublisherAndSubscriber.ttt from VREP official ROS tutorial, the image published to ros is upside down.

I never change any code from the template. The passive vision sensor is having a normal display. But the image_view and Rviz all shows upside down.

Why is this happen? How to solve this problem?

BTW, I saw a previous discussion to add a "flip image vertically" filter. But that will also flip the display in the VREP, which influence the simulation effect.

The problem is similar in this ROS answer but I don't quite understand what they mean.
Image

Re: Image upside down when streaming to ROS

Posted: 23 Oct 2018, 06:42
by coppelia
Hello,

you can flip the retrieved image buffer with following:

Code: Select all

    local data,w,h=sim.getVisionSensorCharImage(activeVisionSensor)
    sim.transformImage(data,{w,h},4)
Cheers