lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.26k stars 778 forks source link

How to fetch and Visualize camera images in autoware.auto RVIZ #1617

Open tecena opened 3 years ago

tecena commented 3 years ago

Hi, @lemketron @EricBoiseLGSVL @hadiTab

I am trying to fetch and visualize main camera images in autoware.auto RVIZ from simulator. The LGSVL-Bridge and simulator are running on two different machines. I did choose Lexus2016RXHybrid vehicle ,it has autoware.auto sensor configuration but does not have a camera on to it, so added a camera by clicking on + icon in configurator and added color camera sensor, and matched the values with sensor configuration mentioned in https://gitlab.com/ApexAI/autowareclass2020/-/blob/bc1206171c96907977b0f5a8f4e3bc039ce61ae6/lectures/11_LGSVL_Simulator/lgsvl-simulation.md

{
  "type": "Color Camera",
  "name": "Main Camera",
  "params": {
    "Width": 1920,
    "Height": 1080,
    "Frequency": 15,
    "JpegQuality": 75,
    "FieldOfView": 50,
    "MinDistance": 0.1,
    "MaxDistance": 1000,
    "Topic": "/simulator/camera_node/image/compressed",
    "Frame": "camera"
  },
  "transform": {
    "x": 0,
    "y": 1.7,
    "z": -0.2,
    "pitch": 0,
    "yaw": 0,
    "roll": 0
  }
},

Configuration. Created a Random Traffic simulation with Autowrae.Auto(ApexAI) autopilot with IP and Port of the machine where LGSVL-Bridge is running. When I run simulation, the LGSVL bridge connected to simulator with IP:Port . The simulation is starting , bridge is connected at the specified IP, data is flowing from simulator to LGSVL_bridge. The Ros topics listed are ROS topics

I am able to add this topic in RVIZ, but no image is displayed. RVIZ

Even when I run- ros2 topic echo /simulator/camera_node/image/compressed. No data is displayed.

I did download the image transport package - sudo apt install ros-foxy-compressed-image-transport and also executed the image decompressor and publisher command - 1.ros2 run image_transport republish compressed in/compressed:=/simulator/camera_node/image/compressed raw out:=/image_raw (command by https://gitlab.com/ApexAI/autowareclass2020/-/blob/bc1206171c96907977b0f5a8f4e3bc039ce61ae6/lectures/11_LGSVL_Simulator/lgsvl-simulation.md also mentioned in autoware lecture 11) 2.ros2 run image_transport republish compressed in:=/simulator/camera_node/image raw out:=/new_topic_name (mentioned in issue #398)

also referred the Autoware video lecture 11 for the same https://www.youtube.com/watch?v=OcB6FUbjZXo by @lemketron, its working correctly in video , but when I follow the same ,its not working out.

Please help me to know, what has to be done to fetch and visualize main camera data into Autoware.Auto RVIZ.

tecena commented 3 years ago

@cyberphysicalrobotics please help to fetch the camera topic images .

mguzzina commented 3 years ago

Could you try running ros2 run image_transport republish compressed /in/compressed:=/simulator/camera_node/image/compressed raw /out:=/image_raw instead?