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
@@ -10,38 +10,36 @@ This driver is for ROS2 Foxy version.
10
10
11
11
If you want to use Dashing version, please go to our [Dashing version driver](https://github.com/TechmanRobotInc/tmr_ros2/tree/dashing-devel).
12
12
13
-
If you want to know how to use this driver, please go to our [TM ROS1 driver](https://github.com/TechmanRobotInc/tmr_ros1)
13
+
If you want to know how to use this driver, please go to [TM ROS1 driver](https://github.com/TechmanRobotInc/tmr_ros1).
14
14
15
15
### __ROS2 Driver__
16
16
17
17
The driver for ROS2 publishes identical topics and provides identical services as ROS1 version, but for now there is no interface integration with MoveIt.
18
-
This driver uses _ros2 composition_, there are two nodes in the identical process:
18
+
This driver uses _ROS2 composition_, there are two nodes in the identical process:
19
19
one node publishes topics while the other node sets up service servers.
20
20
21
-
> __Usage__
21
+
> __ROS2 driver usage__
22
+
23
+
> If you have set up the ROS2 environment and TM driver build based on a specific workspace, then type in your workspace`<workspace>` by starting a terminal, and remember to make the workspace visible to ROS.
24
+
>
25
+
> ```bash
26
+
>source /opt/ros/foxy/setup.bash
27
+
>cd<workspace>
28
+
>source ./install/setup.bash
29
+
>```
22
30
23
31
24
-
>For example, execute the launch script to enable the driver to connect to tm5-900 robot
32
+
>Then, run the driver to connect to TM robot by type
> The parameter `<robot_ip>` means the IP address of the robot control pc.
131
+
154
132
155
133
## __4. Vision__
156
134
@@ -168,20 +146,14 @@ Click on the __Data Table Setting__ button and check the following boxes:
168
146
> 4. waitress
169
147
> 5. datetime
170
148
>
171
-
> __Installation__
172
-
>
173
-
> Create a dictionary and downlaod the repository.
174
-
>
175
-
>```bash
176
-
> mkdir ~/techman_ros2
177
-
>cd~/techman_ros2
178
-
> colon build
179
-
>```
180
149
>
150
+
181
151
> __The Techman Robot ROS2 node which publishes image data__
152
+
153
+
> Under all environment settings have been finished with your workspace`<workspace>`, thentype
182
154
>
183
155
>```bash
184
-
>cd~/techman_ros2&&source install/setup.bash
156
+
>cd~/workspace&&source install/setup.bash
185
157
> ros2 run tm_get_status image_talker
186
158
>```
187
159
>
@@ -193,8 +165,8 @@ Click on the __Data Table Setting__ button and check the following boxes:
193
165
>
194
166
> The viewer will display image data from _TMFlow_.
195
167
196
-
## __3. Demo code__
197
-
There are some demo codes to show how to use this driver.
168
+
## __5. Code of Demo__
169
+
There are some demo codes showing how to use this driver.
198
170
199
171
> 1. demo_send_script:<br/>
200
172
In this demo code, it shows how to send a listen node script to control the robot. <br/>
@@ -203,78 +175,90 @@ You can use service named "send_script" to send script.<br/>
203
175
"script"-> the script which you want to send.<br/>
204
176
"ok" -> Correctness of the script.
205
177
> 2. demo_ask_item:<br/>
206
-
In this demo code, you can send TMSCT cmd by using this service. More details please refer to the Expression Editor and Listen Node.pdf(Chapter TMSCT<br/>
178
+
In this demo code, you can use this service to send TMSCT cmd. More details please refer to the Expression Editor and Listen Node.pdf(Chapter7.4 TMSCT)<br/>
207
179
> 3. demo_ask_sta:<br/>
208
-
In this demo code, you can send TMSTA cmd by using this service. More details please refer to the Expression Editor and Listen Node.pdf(Chapter TMSTA<br/>
180
+
In this demo code, you can use this service to send TMSTA cmd. More details please refer to the Expression Editor and Listen Node.pdf(Chapter7.5 TMSTA)<br/>
209
181
> 4. demo_connect_tm:<br/>
210
-
In this demo code, you can set connection. <br/>
182
+
In this demo code, you can setthe connection type. <br/>
211
183
If you set to reconnect as true, every time when driver disconnects from listen node, it will try to re-connect it.<br/>
212
-
There are two topics you can use, one is "connect_tmsvr"which is setting ethercad server connection, and the other is "connect_tmsct"which is setting TM-Flow connection.<br/>
184
+
There are two kind connection settings you can select, one is "connect_tmsvr"for EtherCAT server connection, and the other is "connect_tmsct"for setting TM-Flow connection.<br/>
213
185
> 5. demo_set_event:<br/>
214
-
In this demo code, there are six types of events you can use.<br/>
215
-
func: You can use TAG, WAIT_TAG, STOP, PAUSE, RESUME and EXIT<br/>
216
-
arg0: iffun is TAG or WAIT_TAG, arg0 is timeout in ms<br/>
217
-
arg1: iffun is TAG or WAIT_TAG, arg1 is id<br/>
186
+
In this demo code, six event types can be selected.<br/>
187
+
func: TAG, WAIT_TAG, STOP, PAUSE, RESUME and EXIT<br/>
188
+
arg0: iffunc is TAG or WAIT_TAG, arg0 is timeout in ms<br/>
189
+
arg1: iffunc is TAG or WAIT_TAG, arg1 is id<br/>
218
190
> 6. demo_set_io:<br/>
219
-
In this demo code, you should set module, type, pin and state.More details please refer to the Expression Editor and Listen Node.pdf(Chapter IO<br/>
191
+
In this demo code, you should set module, type, pin and state.More details please refer to the Expression Editor and Listen Node.pdf(Chapter6.5 IO)<br/>
220
192
module : MODULE_CONTROLBOX or MODULE_ENDEFFECTOR<br/>
state: STATE_OFF or STATE_ON or other value(if digitial IO)<br/>
224
196
> 7. demo_set_positions:<br/>
225
-
In this demo, you should be careful all units are not degree, they are rad.<br/>
226
-
motion_type : PTP_J , PTP_T , LINE_J , LINE_T , CIRC_J ,CIRC_T , PLINE_J ,PLINE_T. More details please refer to the Expression Editor and Listen Node.pdf(Chapter PTP, Line, Circle, Pline, Move_PTP, Move_Line, Move_PLine) <br/>
197
+
In this demo, you should be careful with parameter units to operation.<br/>
198
+
motion_type : PTP_J , PTP_T , LINE_J , LINE_T , CIRC_J ,CIRC_T , PLINE_J ,PLINE_T. More details please refer to the Expression Editor and Listen Node.pdf(Chapter8 PTP, Line, Circle, Pline, Move_PTP, Move_Line, Move_PLine) <br/>
227
199
positions : target position or target joint(rad)<br/>
228
200
velocity : joint velocity-> max value is Pi -> 3.14 rad/s , line velocity ->m/s <br/>
229
201
acc_time : to max speed timein millisecond<br/>
230
202
blend_percentage : 0 has no blending
231
-
fine_goal :intrue case, controller will check the error of the final position and you should wait few ms<br/>
203
+
fine_goal :In a real situation, the controller will check the erro of the final position and should waita few milliseconds.<br/>
232
204
> 8. demo_write_item: <br/>
233
-
In this demo code, you can send TMSVR cmd by using this service. More details please refer to the Expression Editor and Listen Node.pdf(Chapter svr_write
205
+
In this demo code, you can use this service to send TMSVR cmd. More details please refer to the Expression Editor and Listen Node.pdf(Chapter9.3svr_write())
234
206
> 9. demo_leave_listen_node:<br/>
235
207
In this demo code, you can use send_script service sending a script to leave the listen node.
236
208
237
-
## How to use demo code & driver
238
-
1. Create a folder ``~/tm_driver`` by type<br/>
239
-
``mkdir ~/tm_driver``<br/>
240
-
``cd ~/tm_driver``
241
-
2. Download this package by using git and change into dashing branch<br/>
209
+
## Usage with demo code & driver
210
+
> Note: If you have even successfully built a specific code(tmr_ros2), you only need to change to the TM driver workspace path ``cd ~/tmdriver_ws`` , and then directly refer to steps 5~6 below. <br/>
211
+
> 1. Type to create a root workspace directory by starting a terminal: For example, ``tmdriver_ws`` or ``catkin_ws``, thentype to change current directory into the workspace directory path.<br/>
212
+
``mkdir ~/tmdriver_ws``<br/>
213
+
``cd ~/tmdriver_ws``<br/>
214
+
> 2. Clone the the TM driver of git repository into the current directory by typing<br/>
> 3. After the download done, rename the download folder ``tmr_ros2``(or ``tmr_ros2-master``) to ``src`` by typing<br/>
217
+
``mv tmr_ros2 src``<br/> (or right-click on the download folder, select"Rename...")<br/>
218
+
> 4. At the workspace directory to build the download packages and source'setup.bash'in this workspace to make the worksapce visible to ROS.<br/>
219
+
Note: Do you set``source /opt/ros/foxy/setup.bash`` ready? If check ok, thentype below.<br/>
245
220
``colcon build``<br/>
246
221
``source ./install/setup.bash``<br/>
247
-
4. Open a terminal and type<br/>
222
+
> 5. In a new terminal: Source setup.bash in the workspace path and run the driver to connect to TM robot by typing<br/>
223
+
``source ./install/setup.bash``<br/>
248
224
``ros2 run tm_driver tm_driver <robot_ip>``<br/>
249
-
<robot_ip> is tm robot ip address, you can get it by TM Flow, for example 192.168.10.2
250
-
5. Open another terminaland typewhich demo you want to try.
251
-
For example you want to try demo_set_io, you can type<br/>
225
+
The <robot_ip> is the IP address of the TM robot, you can get it through TM Flow, for example 192.168.10.2<br/>
226
+
> 6. In another new terminal: Source setup.bash in the workspace path and typespecific demo node functionwhichyou want to study for applications. For example: you selectto run demo_set_io, you can type<br/>
227
+
``source ./install/setup.bash``<br/>
252
228
``ros2 run demo demo_set_io``<br/>
253
-
:warning: Some demos will let the robot move, please be careful.
229
+
>[CAUTION]:warning: Some demos will let the robot move, please be careful.<br/>
254
230
255
-
## GUI debug and demo
256
-
This GUI shows up tm_driver connection status, sct sta svr messages and robot status. You can use this GUI to check driver and robot connect status and send re-connect command and base on this GUI to modify.
257
231
258
-
### How to use it
259
-
1. Create a folder ``~/tm_driver`` by type<br/>
260
-
``mkdir ~/tm_driver``<br/>
261
-
``cd ~/tm_driver``
262
-
2. Download this package by using git<br/>
232
+
## TM GUI debugging and demonstration
233
+
The GUI displays tm_driver connection status, sct, sta, svr messages and robot status. Easily judge the message between the driver and the robot through the GUI display. If the connection fails, you can also try to send a reconnect command on this GUI for debugging.
234
+
235
+
### Usage with TM GUI debugging
236
+
> Note: If you have even successfully built a specific code(tmr_ros2), you only need to change to the TM driver workspace path ``cd ~/tmdriver_ws`` , and then directly refer to steps 5~6 below. <br/>
237
+
> 1. Type to create a root workspace directory by starting a terminal: For example, ``tmdriver_ws`` or ``catkin_ws``, thentype to change current directory into the workspace directory path.<br/>
238
+
``mkdir ~/tmdriver_ws``<br/>
239
+
``cd ~/tmdriver_ws``
240
+
> 2. Clone the the TM driver of git repository into the current directory by typing<br/>
> 3. After the download done, rename the download folder ``tmr_ros2``(or ``tmr_ros2-master``) to ``src`` by typing<br/>
243
+
``mv tmr_ros2 src``<br/> (or right-click on the download folder, select"Rename...")<br/>
244
+
> 4. At the workspace directory to build the download packages and source'setup.bash'in this workspace to make the worksapce visible to ROS.<br/>
245
+
Note: Do you set``source /opt/ros/foxy/setup.bash`` ready? If cehck ok, thentype below.<br/>
265
246
``colcon build``<br/>
266
247
``source ./install/setup.bash``<br/>
267
-
4. Open a terminal and type<br/>
248
+
> 5. In a new terminal: Source setup.bash in the workspace path and run the driver to connect to TM robot by typing<br/>
249
+
``source ./install/setup.bash``<br/>
268
250
``ros2 run tm_driver tm_driver <robot_ip>``<br/>
269
-
<robot_ip> is tm robot ip address, you can get it by TM Flow, for example 192.168.10.2
270
-
5. Open another terminal and type<br/>
251
+
The <robot_ip> is the IP address of the TM robot, you can get it through TM Flow, for example 192.168.10.2
252
+
> 6. In another new terminal: Source setup.bash in the workspace path and start GUI debug by typing<br/>
253
+
``source ./install/setup.bash``<br/>
271
254
``ros2 run ui_for_debug_and_demo robot_ui``<br/>
272
255
273
-
### UI description
274
-
1. When ``is_srv_connect`` and ``is_sct_connect`` are true, it means the all connection is success.
275
-
2. If ``is_srv_connect`` is false, you should check the data table is correct or not.
276
-
3. If ``is_sct_connect`` is false, you should check whether you run the project or not.
277
-
4. If ``is_srv_connect`` and ``is_sct_connect`` are true, but ``robot link`` is false. It means you connect the TM project, but you are not in listen node, so you when you send the move command, it doesn't work.
278
-
5. When you send a command or click ``"change control box IO"``, you can see ``"Robot Response"`` add a response item, the item details you can reference ``SctResponse.msg``, ``StaResponse.msg`` and ``SvrResponse.msg``.
279
-
6. You can click ``"clear"`` to clear the old response items.
280
-
7. If you didn't open the ``tm_ros_driver``, you will see all items show ``"Not ini"``.
256
+
257
+
### Debugging description
258
+
>* If ``is_srv_connect`` and ``is_sct_connect`` are true, it means that all connection is success.<br/>
259
+
>* If ``is_srv_connect`` is false, you should check whether the data table is correct.<br/>
260
+
>* If ``is_sct_connect`` is false, you should check whether the project is running.<br/>
261
+
>* If ``is_srv_connect`` and ``is_sct_connect`` are true, and the ``robot link`` is false, it means that the driver has connected to the TM project, but the TMFlow listen node is set to abnormal. Therefore, when you send the move command, it does not work.<br/>
262
+
>* When you send a command or click ``"change control box IO"``, you will see a response item embedded in the ``Robot Response``. For details of this item, please refer to ``SctResponse.msg``, ``StaResponse.msg`` and ``SvrResponse.msg``.<br/>
263
+
>* You can click ``"clear"`` to clear the old response items.<br/>
264
+
>* If you forget to run the ``tm_ros_driver``, you will see all items displayed as ``"Not ini"``.<br/>
0 commit comments