mjxu96 / carlaviz

Visualize carla in the web browser
MIT License
259 stars 60 forks source link

Apply static data to Carlaviz #14

Closed GwangRyul closed 3 years ago

GwangRyul commented 3 years ago

HI, I am trying to proceed with the project of sending carlaviz to actual cars in real time. I have a 'rosbag' file with vehicle sensor values, but I would like to know how to use it. This 'rosbag' file contains data for lidar. I wanted to create an object in 'carlaproxy.cpp', but I'm having trouble connecting it with a pointer. When I try to apply such static data to carlaviz, I wonder which "cpp" file I have to touch. And could you tell me about the process?

mjxu96 commented 3 years ago

Hi, if you want to convert any data format to XVIZ format and visualize them in the browser, you might find following links usable.

  1. [Official repo of XVIZ protocol and its js/python implementation] https://github.com/uber/xviz
  2. [My cpp implementation of XVIZ] https://github.com/wx9698/xviz
GwangRyul commented 3 years ago

Thank you for your reply. The ultimate goal is to customize the carlaviz-proxy code to match the sensor data of the vehicle. In the process, I would like to ask a few questions to confirm the compatibility of our data.

  1. I would like to know the code that stores the object of raw data of several types of sensors in the carla-simulator. I would like to modify the format of the sensor data to match the ros message topic.
  2. When exchanging sensor data from carla-simulator(world) through server, I would like to know the code that generates sensor data for objects and structures type, not pointer or reference. "According to our research on ""Radar data"", the following is the result."

backend/src/backend/proxy/carla_proxy.cpp backend/third_party/LibCarla/source/carla/sensor/s11n/RadarDat backend/third_party/LibCarla/source/carla/sensor/s11n/SensorHeaderSerializer

mjxu96 commented 3 years ago

Hi,

It seems that all related codes are in the Carla's cpp library and I just copy their codes to this repo. You might need to ask Carla team about this

GwangRyul commented 3 years ago

Thank you We've looked at 'XVIZ' before. We found it difficult to show data about real-time autonomous driving. So I found 'caraviz' while I was looking for a UI suitable for autonomous'. I wonder if carla-simulator can be replaced by real-time self-driving in caraviz.

mjxu96 commented 3 years ago

Yes, of course. CarlaViz just accepts real time carla data, packages them and sends them to the frontend.

GwangRyul commented 3 years ago

I'm sorry. I think I communicated the meaning wrongly. Is it possible to remove the 'carla-simulator' from the 'carlaviz' and receive the 'ros topic' in real time and send them to the fronted?

mjxu96 commented 3 years ago

Yes, but you need to change a lot of codes in CarlaViz to meet your needs. CarlaViz acts like a "convertor" which converts the data in Carla's format to XVIZ format. If you change the part which accepts Carla data to something accepting ROS data, you can then visualize your ROS data.

You can also use the libraries I mentioned above to convert any types of data to XVIZ data.

The frontend of CarlaViz can accept any data in the XVIZ protocol and visualize them.

GwangRyul commented 3 years ago

Thank you for solving what I want to know!