udacity / RoboND-QuadRotor-Unity-Simulator

QuadRotor simulator for Controls and Deep Learning projects
59 stars 34 forks source link

How does this compile? #7

Open AWDunstan opened 6 years ago

AWDunstan commented 6 years ago

https://github.com/udacity/RoboND-QuadRotor-Unity-Simulator/blob/1e71321d95e416bafa5296a229f36404bddc0452/Assets/Plugins/ROS/Messages/geometry_msgs/Vector3.cs#L49

source (which is a UnityEngine.Vector3) doesn't have a ToRos() method. The same problem exists in Point.cs.

demi180 commented 6 years ago

It's an Extension Method, see below:

https://github.com/udacity/RoboND-QuadRotor-Unity-Simulator/blob/1e71321d95e416bafa5296a229f36404bddc0452/Assets/Plugins/MatrixExtension.cs#L70

AWDunstan commented 6 years ago

I see - thanks!

I was trying to use the ROS parts as a standalone library in Unity, and had built a DLL with only the files that seemed to have something to do with ROS. Adding MatrixExtensions.cs to the DLL solved it.

Now to figure out how to add my own message types...