bryceikeda / HololensBaseProject

Base project for Unity Robotics Hub Applications along with the IP address menu
16 stars 2 forks source link

Cannot implicitly convert type 'uint' to 'int'. #2

Open cnyeu opened 2 years ago

cnyeu commented 2 years ago

Hi, I followed the tutorial on Youtube and wanted to make a connection between Hololens2 and Ros2. I wanted to use the Menu & Notepad as in the video. When I select Ros2 under Robotics, insert the prefabs and scripts, I get the following output: Assets\Scripts\Clock\TimeStamp.cs(40,34): error CS1503: Argument 1: cannot convert from 'int' to 'uint'. Assets\Scripts\Publishers\ROSClockPublisher.cs(63,19): error CS0266: Cannot implicitly convert type 'uint' to 'int'. An explicit conversion exists (are you missing a cast?).

Is the connection via ros2 possible at all? And if so, what exactly has to be changed in the scripts?

bryceikeda commented 1 year ago

I can look into this. It should work with ROS 2 but I have not tried it. What may work is removing all the type casts for the 'sec' variables. Looking at this documentation , sec should be int and nanosec should be uint for ROS 2.