You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/ros_unity_integration/subscriber.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Create a simple Unity scene which subscribes to a [ROS topic](http://wiki.ros.or
11
11
- Follow the [ROS–Unity Initial Setup](setup.md) guide.
12
12
13
13
- Open a new terminal window, navigate to your Catkin workspace, and run the following commands:
14
-
14
+
15
15
```bash
16
16
source devel/setup.bash
17
17
rosrun robotics_demo server_endpoint.py
@@ -21,7 +21,7 @@ Once the server_endpoint has started, it will print something similar to `[INFO]
21
21
22
22
- In Unity, we need to generate the C# code for the `UnityColor` message. Open `Robotics` -> `Generate ROS Messages...`.
23
23
- Set the ROS message path to `PATH/TO/Unity-Robotics-Hub/tutorials/ros_packages/robotics_demo/`, expand the robotics_demo subfolder and click `Build 2 msgs`.
24
-
24
+
25
25

26
26
27
27
- The generated files will be saved in the default directory `Assets/RosMessages/RoboticsDemo/msg`.
@@ -34,7 +34,7 @@ Once the server_endpoint has started, it will print something similar to `[INFO]
@@ -56,13 +56,16 @@ public class RosSubscriberExample : MonoBehaviour
56
56
- Attach the `RosSubscriberExample` script to the `RosSubscriber` GameObject and drag the cube GameObject onto the `cube` parameter in the Inspector window.
57
57
58
58
- From the Unity menu bar, open `Robotics/ROS Settings`, and set the `ROS IP Address` variable to your ROS IP.
59
+
- Unlike the previous tutorial, using a subscriber requires an incoming connection from ROS to Unity. You may need to adjust your firewall settings for this to work.
60
+
- The IP for Unity to listen on should be determined automatically, but if you're having trouble, you can set it manually in the `Override Unity IP` field. Finding the IP address of your local machine (the one running Unity) depends on your operating system.
61
+
- On a Mac, open `System Preferences > Network`. Your IP address should be listed on the active connection.
62
+
- On Windows, click the Wi-Fi icon on the taskbar, and open `Properties`. Your IP address should be listed near the bottom, next to "IPv4 address."
63
+
59
64
- Press play in the editor
60
65
61
66
### In ROS Terminal Window
62
67
- After the scene has entered Play mode, run the following command: `rosrun robotics_demo color_publisher.py` to change the color of the cube GameObject in Unity to a random color
63
68
64
-
> Please reference [networking troubleshooting](network.md) doc if any errors are thrown.
65
-
66
69

67
70
68
71
Continue to the [ROS–Unity Integration Service](service.md).
0 commit comments