I am trying to use streamlit with ROS where I get PointCloud2 messages which I can convert to numpy arrays - Nx4
I want to be able to display these in real-time - something like in RVIZ in ROS.
How may I do that?
Basically, I would like to plot the 3D points, be able to zoom, pan, rotate and also update the points every frame.
Steps to reproduce
add code here
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Explain what you expect to happen when you run the code above.
Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.
Streamlit version: (get it with $ streamlit version)
Python version: (get it with $ python --version)
Using Conda? PipEnv? PyEnv? Pex?
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.
Link to your GitHub repo:
Link to your deployed app:
If needed, add any other context about the problem here.
Thank you for the reply.
Getting data from ros is not the main problem, I already have code for that.
Problem is, plotly scatter_3d or matplotlib 3d produce very bad 3D visualizations.
I use mayavi generally or rviz if withing ros.
So, is it somehow possible to use mayavi or PyVista or something that produces nice 3D point cloud visualizations?
It’s a case of automotive dataset - point clouds are generally 120000x4
I am aware of this. I have a somewhat similar way of refreshing. But I am looking for something more robust and proper.
Nevertheless, thanks a lot. I will try out the 3D point cloud plot and update in a day or two.
But - you have created a great framework, I really like it and would love to see it grow and be more stable for multiple use cases.
I am fairly new to streamlit and learning it while working on my case. Some nice things I imagine (may be already present):
Download button that opens up a certain public directory allowing user to select file to download
A modal dialog that allows for user input - usable for password authentication when logging into the app
Upload button that allows user to select where to upload a file to on server - easier workflow with binary and image files etc.
Coordinate based layout system for better usage of screen space - user get’s to select
More stability in multi-page apps - I encountered st.session_state loses parameters when page is changed in multi-page apps unless we do a st.update_session(st.session_state).
To your point 5, you may be interested in the discussion about changing keyed widget behavior. Session state “losing” parameters is tied to the widget cleanup process and I’m guessing that’s what you came across. Namely, when a widget is not rendered on the screen, it’s data gets deleted (including its value in session state). This is entirely expected, and you mentioned a solution that “interrupts” the cleanup process thereby keeping the keys. (My usual preferred solution is to treat all data assigned to widget keys as transient and have separate keys for keeping data between pages. This also keeps the solution on the page with the affected key and doesn’t require a copy-paste script at the top of every page in the app. )