Open glennliu opened 4 years ago
Hello
I am doing the same things and I have already successfully received PointCloud2 messages in Unity.
You need to add new messages in the RosSharp.sln project in VisualStodio, then build it and update RosBridgeClient.dll in the Unity Project.
However, it doesn't work if I apply it to Hololens2 and it seems that it just can't receive my custom messages in Hololens2. I am confused, too.
Hi @whirwind
Can I use the generated ros message as the original wiki explained, and add this ros message to RosSharp.sln?
I can receive pointcloud2 message in HoloLens 1/ HoloLens2, with the original siemens/ros-sharp. I'll try your solution later today and share my results.
Hi @glennliu
Sorry I made some mistakes about my previous answer
You said you can receive pointcloud2 message in HoloLens 1/ HoloLens2, is that real? I can do it in Unity, but I am struggling with receiving PointCloud2 message while deploying it to Hololens2. Please share your exprience if don't mind. You can check my issue here: EricVoll/ros-sharp#3
Hi @whirwind
I didn't explain it clearly. When I use Ros# on Unity's Holographic Emulation, I can successfully receive sensor/PointCloud messages on HL1/HL2. It is actually running on Unity, instead of HL1/HL2.
On the other hand, I did more tests today. I build the package of dwhit/ros-sharp on visual studio and run it on HoloLens2 Emulator. Messages _sensormsgs/CompressedImage and _navmsgs/Odometry can be read correctly. I guess it would also be correct if it is finally deployed on HL1/HL2. I didn't meet the crash issue you mentioned.
But I still have a problem with reading _sensormsgs/PointCloud. Because the default message only supports _sensormsgs/PointCloud2, I generate _sesormsgs/PointCloud messages on Visual Studio. When I try to read the generated _sensormsgs/PointCloud messages, the rosbridge_server on ROS shows,
[INFO] [1599289865.975327]: Client connected. 1 clients total.
[ERROR] [1599289866.058728]: [Client 1] [id: /sdf_map/occ_pc:0] subscribe: Expected field type to be one of (<type 'str'>, <type 'unicode'>). Invalid value: None
[INFO] [1599289866.113138]: [Client 1] Subscribed to /vins_estimator/imu_propagate
[INFO] [1599289866.124490]: [Client 1] Subscribed to /camera/color/compressed
It occurs whenever I try to read a generated message. Do you think is it related with RosBridgeClient.ddl? Is there any other actions needed after add the new messages on Visual Studio?
Thanks
Hi @glennliu
I subscribed other messages such as posestamped and CompressedImage. They work perfectly in both Unity and HL2 device. This is why I am confused only PointCloud or PointCloud2 fail.
Here is my script for PointCloud message generation with EricVoll/ros-sharp which is similar to dwhit/ros-sharp, but be careful that some parts of code format is different. Although I can not receive PointCloud or PointCloud2 message in HL2 device, this works well in my Unity and might help.
In VS2019 project, scripts need to be added to both RosBridgeClient and RosBridgeClientUWP(add as link) folder. And be sure to add them to corresponding folders of message type
Hi
I add "sensor_msgs/PointCloud2" message successful in the original ROS#. But the generated message is not compatible with your fork. It shows compile errors. Then, I tried to generate a new message with "rosbridgeclient" in your code.
But it is quite different to the original message generation. Can you please explain the main steps of using it?
Thanks