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/pick_and_place/2_ros_tcp.md
+2-17Lines changed: 2 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,11 +187,10 @@ Most of the ROS setup has been provided via the `niryo_moveit` package. This sec
187
187
sudo -H pip install rospkg jsonpickle
188
188
```
189
189
190
-
> In your ROS workspace, find the directory `src/niryo_moveit/scripts`. Note the file `server_endpoint.py`. This script imports the necessary dependencies from tcp_endpoint, defines the TCP host address and port values, and starts the server. `rospy.spin()` ensures the node does not exit until it is shut down.
190
+
> In your ROS workspace, find the directory `src/niryo_moveit/scripts`. Note the file `server_endpoint.py`. This script imports the necessary dependencies from tcp_endpoint and starts the server. `rospy.spin()` ensures the node does not exit until it is shut down.
@@ -203,32 +202,18 @@ Most of the ROS setup has been provided via the `niryo_moveit` package. This sec
203
202
204
203
1. The ROS parameters will need to be set to your configuration in order to allow the server endpoint to fetch values for the TCP connection. Navigate to `src/niryo_moveit/config/params.yaml` and open the file for editing. You will need to know the IP address of your ROS machine as well as the IP address of the machine running Unity.
205
204
- The ROS machine IP, i.e. `ROS_IP` should be the same value as the one set as `Host Name` on the RosConnect component in Unity.
206
-
- Finding the IP address of your local machine (the one running Unity), i.e. `UNITY_IP` depends on your operating system.
207
-
- On a Mac, open `System Preferences > Network`. Your IP address should be listed on the active connection.
208
-
- 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."
209
-
210
-
- Update the `ROS_IP` and `UNITY_IP` below with the appropriate addresses and copy the contents into the `params.yaml` file.
205
+
- Update the `ROS_IP` below with the appropriate addresses and copy the contents into the `params.yaml` file.
211
206
212
207
```yaml
213
208
ROS_IP: <your ROS IP>
214
-
ROS_TCP_PORT: 10000
215
-
UNITY_IP: <your Unity IP>
216
-
UNITY_SERVER_PORT: 5005
217
-
rosdistro: 'melodic'
218
209
```
219
210
220
211
e.g.
221
212
222
213
```yaml
223
214
ROS_IP: 192.168.50.149
224
-
ROS_TCP_PORT: 10000
225
-
UNITY_IP: 192.168.50.13
226
-
UNITY_SERVER_PORT: 5005
227
-
rosdistro: 'melodic'
228
215
```
229
216
230
-
Ensure that the `ROS_TCP_PORT` is set to 10000, and the `UNITY_SERVER_PORT` is set to 5005.
231
-
232
217
> Note: Learn more about the server endpoint and ROS parameters [here](../ros_unity_integration/server_endpoint.md).
233
218
234
219
> This YAML file is `rosparam set` from the launch files provided for this tutorial, which has been copied below for reference. Additionally, the server_endpoint and trajectory_subscriber nodes are launched from this file.
@@ -103,48 +89,47 @@ A ROS Service requires two components:
103
89
104
90
`RosService('position_service', PositionService)`
105
91
92
+
## Creating the Server
93
+
94
+
Requires:
95
+
96
+
- The ROS node name
97
+
98
+
```python
99
+
tcp_server = TCPServer(ros_node_name)
100
+
```
101
+
106
102
## Source Destination Dictionary
107
103
108
104
Create a dictionary keyed by topic or service with the corresponding ROS communication class as the value. The dictionary is used by the TCP server to direct messages to and from the ROS network.
These values can be hardcoded, but for the sake of portability, we recommend setting the parameters using the `rosparam set` command, or a `rosparam` YAML file.
123
+
The following parameters can be hardcoded, but for the sake of portability, we recommend setting the parameters using the `rosparam set` command, or a `rosparam` YAML file.
Copy file name to clipboardExpand all lines: tutorials/ros_unity_integration/service.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ public class RosServiceExample : MonoBehaviour
98
98
}
99
99
```
100
100
101
-
- Create an empty GameObject, name it `RosConnection`, and attach the `Plugins/TCPConnection/ROSConnection` script to it.
101
+
- Create an empty GameObject, name it `RosConnection`, and attach the `Plugins/TCPConnection/ROSConnection` script to it. (Or, if you're reusing the same scene from the previous tutorials, you can just keep the existing RosConnection object.)
102
102
- In the Inspector window of the Editor change the `Host Name` variable on the `RosConnection` GameObject to the ROS IP.
103
103
- Create another empty GameObject and name it `RosService`.
104
104
- Attach the `RosServiceExample` script to the `RosService` GameObject. Drag the cube GameObject onto its `cube` parameter and the RosConnection GameObject onto its `Ros` parameter.
Copy file name to clipboardExpand all lines: tutorials/ros_unity_integration/setup.md
+2-10Lines changed: 2 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,19 +19,13 @@ Once ROS Core has started, it will print `started core service [/rosout]` to the
19
19
20
20
1. Note that in the `server_endpoint`, the script fetches parameters for the TCP connection. You will need to know the IP address of your ROS machine as well as the IP address of the machine running Unity.
21
21
- The ROS machine IP, i.e. `ROS_IP` should be the same value as the one set as `Host Name` on the RosConnect component in Unity.
22
-
- Finding the IP address of your local machine (the one running Unity), i.e. `UNITY_IP` depends on your operating system.
23
-
- On a Mac, open `System Preferences > Network`. Your IP address should be listed on the active connection.
24
-
- 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."
25
-
26
22
1. The ROS parameter values can be set using a YAML file. Create a `params.yaml` file in your package, e.g. `./config/params.yaml`. Open the file for editing.
27
23
28
-
1. Update the `ROS_IP`and `UNITY_IP`below with the appropriate addresses and copy the contents into the `params.yaml` file.
24
+
1. Update the `ROS_IP` below with the appropriate address and copy the contents into the `params.yaml` file.
29
25
30
26
```yaml
31
27
ROS_IP: <your ROS IP>
32
28
ROS_TCP_PORT: 10000
33
-
UNITY_IP: <your Unity IP>
34
-
UNITY_SERVER_PORT: 5005
35
29
rosdistro: 'melodic'
36
30
```
37
31
@@ -40,12 +34,10 @@ Once ROS Core has started, it will print `started core service [/rosout]` to the
40
34
```yaml
41
35
ROS_IP: 192.168.50.149
42
36
ROS_TCP_PORT: 10000
43
-
UNITY_IP: 192.168.50.13
44
-
UNITY_SERVER_PORT: 5005
45
37
rosdistro: 'melodic'
46
38
```
47
39
48
-
Ensure that the `ROS_TCP_PORT` is set to 10000, and the `UNITY_SERVER_PORT` is set to 5005.
40
+
Ensure that the `ROS_TCP_PORT` is set to 10000.
49
41
50
42
1. Set these newly defined parameters by running `rosparam load`, e.g.:
0 commit comments