Image upside down when streaming to ROS

Typically: "How do I... ", "How can I... " questions
Post Reply
Rick Shen
Posts: 4
Joined: 15 Oct 2018, 01:30

Image upside down when streaming to ROS

Post 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

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Image upside down when streaming to ROS

Post 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

Post Reply