New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to visualize data from rviz to Unity? #79
Comments
Hi @lee4138 : When you go through the example applications provided in the Wiki, you will get familiar with ROS# and will be able to easily adjust this communication framework to your individual application. @faizan-m is also currently working on LaserScan message import to Unity (see issue #78 ). Maybe you two want to exchange about it here. |
Hi @lee4138! I am actually in the process of creating an Augmented Reality Framework in Unity for ROS that would ideally be implementable on any devices supported by Unity, including Hololens. Unfortunately, it is still under development at the moment and not public. I did not find any easy shortcuts to recreate rviz in Unity so I am taking the slow and steady approach of visualizing them myself. |
Hi @MartinBischoff and @faizan-m, many thanks for your reply! So with slow and steady way you mean to convert the raw data into something that will fit into unity? If you have already implemented some converter code would you mind to share please? I watched this video 'HoloLens + ROS + AR' (https://www.youtube.com/watch?v=TkorsuwkU1g), which shows a laserscan visualization similar to rviz into the hololens. Unfortunately the author didnt reply to my request yet. Do you have any idea which approach he might have used? And do you have achieved something similar? |
Yeah I am just creating graphics based off the values through ROS#. I don't really have any "converter code" in between, everything is wired up very directly the way I am doing it so there are no discrete pieces that might be useful to you at the moment. I am not sure about the approach in the video but it has a lot of latency that I have not experienced. |
okay, thanks for your answer! I will try that too and report. |
Hi all, i have now build up the connection and can receive PointCloud2 messages which I converted from the Laser Scan data. For that I have build a SensorReceiver.cs file and attached it to the Subscriber Component of the RosConnector, like done in the tutorials with the JoyReceiver. I extracted x y z values I would like to ask what you would suggest for the next steps to visualize the data correctly in Unity. My idea is to use these xyz points to project circles into the Unity scene at that points but I am not sure about few things. I am not sure what the xyz values represent exactly, they have values ranging from (-5 to 2.5) someone have experince in working with PointClouds in Unity? I think that I also need to do some kind of a coodrinate transformation from the RVIZ map to the Unity map in order to project the circles at the right spot. How can I do that? And where do I have to attach the scripts ? (sorry if the questions might seem basic , I am a complete beginner) . |
Hi @lee4138 !
Though 3D point cloud illustrations are really fun, please understand that I can't take the time to give further application-specific coding support. For new technical problems please open a new issue in the future. |
Dear @MartinBischoff, |
@lee4138 Great initiative :D Sincerely |
Hi @kosenhitatchi, |
Hi @kosenhitatchi, |
@lee4138 , what a wonderful new. I'll try your code right away and give you some feedback as soon as I can. |
Hi @kosenhitatchi, Therefore the SensorReceiver.cs class, which is working like the Subscriber classes in the ROS# Examples, will receive the PCL2 Data from ROS. You have to drag a subscriber to your unity scene in the ROS Connector and as Message Receiver put in SensorReceiver.cs (SensorReceiver has to be a seperate empty Gameobject where you drag the sensorreceive.cs script into) , the topic to subscribe is the topic which produces the PointCLoud2 Data (in your case the kinect) and drag a sphere gameobject to the field 'point' of Sensorreceive and in the field youbot drag a reference gameobject from which the PCL Data will be displayed .(See ROS# Examples on how to subscribe to ROS topics). DataPoint.cs is the class for the DataPoints which are created within SP2.cs. I know this is a inefficient way of solving the problem and better solutions would be to use object pooling where you dont delete the points but make them invisible and reuse the gameobjects rather than delete them. Also the ideas of Martin Bischoff are more effective. But since I have to implement some other stuff I didnt tried that out yet. If you implement a more effective solution please let me know! Ps.: I will have a full documentation about my project soon which also includes some flow charts, and diagramms on how the PCL Handling classes work. I can provide that to you as well. |
Hey @kosenhitatchi @lee4138 were you all able to visualise a pointcloud using ros sharp ? I have used two subscribers that subscribe to the RGB and depth images from a realsense d435 and use the constructor in pointcloud.cs to create an object with the pointcloud data, but I'm receiving 'NullReferenceException: Object reference not set to an instance of an object'. If you ll can share the work youll have done with the pointcloud visualision in unity and or any help would be appreciated. |
Good evening @akashcastelino, |
Hi buddy, |
Hi @lee4138, @akashcastelino |
Hi all,
For visualization you need additional scripts that work with the incomming ROS data.
I managed to visualize the pointclouds within the Unity Application and Hololens using different scripts and classes. Please refer to my code that I uploaded (as zip file) and posted in an answer above. There is also an explanation to that in the answers. I will try to make a git for the project of mine but dont know when exactly :/
Hope this helps and if there are specific questions to the code please dont hesitate to ask, when I have time I will answer!
Best regards
On 12/02/2019 06:57:21, stevensu1838 <notifications@github.com> wrote:
Hi @AlbertoGhiotto [https://github.com/AlbertoGhiotto],
I am afraid you won't get any feedback on this topic from these experts here. I totally understand your problems and I tried it before. But it seems you have to be an expert of Unity to get the job done and no instructions online at all. Please just google and take a look at this thesis.
Visualization of Robotic Sensor Data with Augmented Reality
Hopefully, you can make it.
Also, I sincerely hope the experts here can give some guidance on this topic. Coz it is really hard for our non-experts to really do something with ROS#.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [#79 (comment)], or mute the thread [https://github.com/notifications/unsubscribe-auth/ATYn-b1eZ2U7a6vrVcccnX5Hbyn5AUXlks5vMlfAgaJpZM4U5dWT].
|
@linhdoan8 Hello, I am doing the same job as you recently, but I have no idea, based on your work, to visualize the point cloud in unity, can provide me with the code for reference, I would be very grateful |
where is your code ? |
Issue Template © Siemens AG, 2017-2018
Author: Dr. Martin Bischoff (martin.bischoff@siemens.com)
-->
I have a question!
Here is my question:
Hi all,
I am completely new to Ros and Unity and was searching for a way to visualize rviz sensor data like laser scan or mapping data in Unity to deploy to the Hololens. Fortunately I found ROS# which makes that possible. I would like to ask which are the approaches to visualize data from rviz especially the laser scan data. I would subscribe to the topic /base_scan but obviously I have to find a way to convert the data from that topic to a format to appropriately visualize in Unity (so that the Unity scene looks like Rviz). I saw the video 'ROS#: Robot Teleoperation via Unity ' - (https://www.youtube.com/watch?v=OytzagQirrk) from you and would like to achieve something similar. Is there any code available because in the wiki there is no part explaining that demo. I hope for your reply and many thanks in advance!
Best regards
The text was updated successfully, but these errors were encountered: