The TM ROS driver is designed to interface the TM Robot's operating software (TMflow2) with the Robot Operating System (ROS) so that program developers and researchers can build and reuse their own programs to control the TM robot externally.
- This manual is for ROS2 Foxy vs TMflow2 version.
💡 The operation interface of TMflow2: Navigate to ≡ and click to expand the function menu, including the icons Login/Logout, Connect, View, Run Setting, Project, Configuration, and System. Please refer to Software Manual TMflow (SW2.14_Rev1.00).
- Just clone the TM ROS driver of the git repository into your working directory and then build it.
- The user can directly return to "5. TM External GUI Debugging and Demonstration" introduced above: then refer to steps 1 to 4 of this chapter § Use the demo code and drivers on an external Linux PC.
➤ After installing the correct ROS version of the computer, the next step is to ensure that your hardware, control computer, and TM Robot are all properly configured to communicate with each other. See below to make sure the network settings on your computer are correct, the TM Robot's operating software (TMflow 2) network settings are ready and the Listen node is running.
The Listen node: a socket server can be established and be connected with ROS by an external device to communicate according to the defined protocol. The user can make the robot communicate with the user's ROS (remote) computer equipment through a wired network when all the network parameters in the Network setting are set.
- Create a Listen task of flow project of TMflow software, and then drag the Listen node from the Node List menu (⇒ Communication ⇒ Listen) onto the project flow, as shown below.
- Set the
Network
settings: mouse-click to enter the page of System ⇒ Network in order.
➤ Example: Set the Subnet mask: 255.255.255.0 and IP address 192.168.10.2Note: Set the network mask, and the communication with the TM Robot must be in the set domain.
- Set the Ethernet Slave
Data Table Setting
item: mouse-click to enter the page of Setting ⇒ Connection ⇒ Ethernet Slave in order.
➤ We recommend one easy method 1 to set the Ethernet SlaveData Table setting
to directly import the software package.
1 See TM ROS Driver vs TMflow Software Usage: Import Data Table Setting.A previous traditional method as follows: (Note: TMflow software version changes may have slightly different settings.)
The user can manually click theData Table Setting
2 item and check the following boxes as item predefined 3 to receive/send specific data:- [x] Robot_Error - [x] Project_Run - [x] Project_Pause - [x] ESTOP - [x] Camera_Light - [x] Error_Code - [x] Joint_Angle - [x] Coord_Robot_Flange - [x] Coord_Robot_Tool - [x] TCP_Force - [x] TCP_Force3D - [x] TCP_Speed - [x] TCP_Speed3D - [x] Joint_Speed - [x] Joint_Torque - [x] Project_Speed - [x] Robot Light - [x] Ctrl_DO0~DO7 - [x] Ctrl_DI0~DI7 - [x] Ctrl_AO0 - [x] Ctrl_AI0~AI1 - [x] END_DO0~DO2 - [x] END_DI0~DI2 - [x] END_AI0
2 Turn off Ethernet Slave. Let "STATUS: Disable" displayed on the Ethernet Slave setting page, then click
Data Table Setting
to enter the next page for related settings.
3 The checked items listed above must all be selected for TM2 ROS setting.
When you need to check more about the maximum, minimum, and average calculation properties of joint torque 4 listed below, these three checked items can be checked individually or all of them, please leave them unchecked when not in use.
- [x] Joint_Torque_Average - [x] Joint_Torque_Min - [x] Joint_Torque_Max
4 This function requires TMflow 2.16 or later versions to support.
- Enable the Ethernet Slave settings: mouse-click to enable or disable TM Ethernet Slave. Once enabled, the robot establishes a Socket server to send the robot status and data to the connected clients and permissions to access specific robot data.
Mouse-click to enable theEthernet Slave
setting and letSTATUS:
⇒Enable
.
Note: If the user encounters the "Occupied by ROS" lock state as shown in the upper right picture, please go to Configuration ⇒ ROS Setting to unlock it (by turning off
Slave Setup
let the setupROS Driver Status
changed from Running to NotRun).
- Don't forget to press the Play/Pause Button on the Robot Stick to start running this Listen task project.
Static IP of remote connection network settings through the wired network.
- Set the wired network of the user's (remote) Ubuntu computer by mouse-click on the top right of the desktop ⇒ Click on "Wired Settings" ⇒ Click on the gear icon ⇒ In the IPv4 feature options, click on "Manual" in order.
- Set the Static IP settings: where the IP address is fixed for the first three yards same as the previous setting 192.168.10, last yards 3-254 machine numbers are available. (Because TM ROBOT, you have been set to 192.168.10.2)
➤ Example: Set the Netmask: 255.255.255.0 and IP address 192.168.10.30
- Check Internet connection: start a terminal to test the connectivity with the target host TM ROBOT, by typing ping 192.168.10.2
💡 Tip: Remember to reconfigure the network settings due to static IP changes or replacement of the ROS control PC.
As mentioned above, a valuable debugging tool is your operating system's ping command. If nothing appears to happen or an error is thrown, the robot cannot be accessed from your computer. Please go back to the top of this chapter and re-operate in the order of instructions.
If you are an experienced user, you may just need to turn off ⇒ turn on the gear icon of "Wired Settings" on your computer or to turn off ⇒ turn on the "Ethernet Slave Data Table" setting of the robot to reconfigure the hardware settings.
ROS2 driver usage through the Listen Node
💡 Do you prepare the TM Robot ready ? Make sure that TM Robot's operating software (TMflow) network settings are ready and the Listen node is running. Do you build TM relative ROS apps 1 on your (remote) computer?
After the user has set up the ROS2 environment (example : Debian packages for ROS 2 Foxy) and built the TM driver relative ROS apps 1 based on the specific workspace, please enter your workspace<workspace>
by launching the terminal, and remember to make the workspace visible to ROS.source /opt/ros/foxy/setup.bash cd <workspace> source ./install/setup.bashThen, run the driver to maintain the connection with TM Robot by typing
ros2 run tm_driver tm_driver robot_ip:=<robot_ip_address>Example :
ros2 run tm_driver tm_driver robot_ip:=192.168.10.2
, if the <robot_ip_address> is 192.168.10.2Now, the user can use a new terminal to run each ROS node or command, but don't forget to source the correct setup shell files as starting a new terminal.
➢ 1 The user can download the TM driver relative ROS apps Experimental TM2 Foxy ROS Apps of the GitHub repository for ROS applications.
Note: When you have finished, press CTRL + C in all terminal windows to shut everything down.
The Vision node provides the creation of a plane with fixed-point type, servo type, and object type as well as a variety of AOI identification functions. TM ROS Driver can receive the source image from the vision job (with External Detection) and publish it as a ROS topic.
The following describes how the user can acquire image data through TMvision™ of TM Robot. (Built-in Vision System)
Dependencies
ROS2 Foxy
Python packages:
- flask
- waitress
- opencv-python==3.4.13.47 (Minimum)
- numpy
- datetime
For example, install Python3 packages:
- pip3 install flask
- pip3 install waitress
- pip3 install opencv-python
- pip3 install datetime
Techman Robot Vision
- type: sensor_msgs::msg::Image
- message name: techman_image
Build TM ROS Vision driver node on your (remote) computer
Under the environment settings have been finished with your workspace
<workspace>
, then typecd ~/<workspace> && source ./install/setup.bash ros2 run tm_image image_talker💡 The user can check whether the connection succeeds or not. When you proceed to the following steps introduced in the following text: step1 ⇒ step5 of § TMflow Vision node setup.
💡 Before going through the following steps, please build the TM ROS Vision driver node on your (remote) computer and then connect this (remote) computer to the local TM Robot computer.
- Create a Vision task project of TMflow software, drag the Vision node from the Node List menu (⇒ Process ⇒ Vision) onto the project flow and then click the "+" to add your Vision Job, as shown below.
- Select the AOI-only and Click Next while editing the vision job type. Set up the proper initial position and camera parameters.
Note: TMflow software version changes may have slightly different settings(SW2.14_Rev1.00).
- Click Find ⇒ External Detection, which adds an External Detection node to the Vision Job flow.
- To check whether the connection succeeds or not, please enter
<user_pc_ip_address>:6189/api
in the HTTP Setting blank text and click the Send button to get the information of the (remote) computer for ROS.
The<user_pc_ip_address>
means the IP address of the user's (remote) ROS computer, for example, 192.168.10.12
If normal, the text box will receive a message in JSON format as shown below.
If the connection fails, a TIMEOUT error will be displayed in the window. If the IP address of the user's (remote) ROS computer doesn't exist, ERROR_CODE_7 will be displayed in the window.
- Enter
<user_pc_ip_address>:6189/api/DET
in the URL blank text and type arbitrary letters in the Value blank text; the Key will be generated automatically. Assign a name to the model in the Model name blank text and click the Save button.
Don't forget to press the Play/Pause Button on the Robot Stick to start running this Vision task project.
Note: For more about External Detection, please refer to Software Manual TMvision(SW2.14_Rev1.00).
➤ Receive image data on the user's Linux computer from the TMflow Vision node.
💡 Do you prepare the TM Robot ready? Make sure that TM Robot's operating software (TMflow) relative HTTP Parameters Vision settings are ready and the Vision task project is running.Now, in a new terminal of your (remote) ROS2 Linux computer: Source setup.bash in the workspace path and run to get image data from TMvision™ by typing
source /opt/ros/foxy/setup.bash cd <workspace> source ./install/setup.bash ros2 run image_sub sub_imgThen, the viewer will display image data from TMflow.
Note: When you have finished, press CTRL + C in all terminal windows to shut everything down.