How to get sensor's raw data?

Hi there, i have one problem to get the raw data of a sensor, ler’s take a carla.sensor.rgb actor as example, once this type of actor is generated in carla world, how can we get the raw data of this actor, the only way for now i can know is through sensor.listen() function, which has a lambda function as parameter, and according to the tutorial, the lambada function also has a parameter carla.SensorData, which i guess is also some magic ways when world on_tick this carla.SensorData will be fed automatically. Are there any other methods that i can retrieve the sensor data directly other than using listen method?
By the way, when calling listen method, we get a carla.Image, but when i try to get raw_data attribute, i thought i would get a bytes type as in the tutorial page “https://carla.readthedocs.io/en/latest/python_api/#carla.Image” tells us, but i just got a class called memoryview, amazing.

i guess is also some magic ways when world on_tick this carla.SensorData will be fed automatically.

that is how callback functions work.

By the way, when calling listen method, we get a carla.Image, but when i try to get raw_data attribute, i thought i would get a bytes type as in the tutorial page “https://carla.readthedocs.io/en/latest/python_api/#carla.Image” tells us, but i just got a class called memoryview, amazing.

I personally use the C++ API so I’m not sure about the python bindings but a memory view seems like a reasonable thing to do for that amount of data as opposed to just copying every frame. you should be able to treat it like you would an array of bytes.

I personally also want to use C++ API, for me, i use carla on windows and use the official compiled version, could you give me some hints how to start it with C++ API, my very first question is, when I use C++ API, do I just need to start a project(like in VS a vs project) then include all the cpp relative files into this project?

That might work but you’ll be basically making the client library. I haven’t tried it on windows but the instructions seem pretty similar. I make the C++ example in root/Examples/CppClient, then link against the libraries that are created in the libcarla_install/lib folder.

The CppClient code is good enough to get you started but there are no docs for the C++ API since it was not even intended to be “public”, so you’ll have to find out how to do other things by just going through the headers. The Python API is the advised way to go.

True, do you have any infos on some open sources that we could build up our own map other than RoadRunner?