Skip to content

Latest commit

 

History

History
229 lines (191 loc) · 13.3 KB

tm_foxy_e.md

File metadata and controls

229 lines (191 loc) · 13.3 KB

TM ROS Driver Usage and Installation

The TM ROS Windows 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.

1. Usage and Installation

  • This manual is for ROS2 Foxy vs TMflow2 version.
  • TM ROS driver is embedded in the robot controller via TMflow 2 and is based on ROS2 Foxy.

💡 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).

  • The driver-embedded function related to the robot can be set in ConfigurationROS Settings of the TMflow 2.
  • Just clone the TM ROS App of the git repository into your working directory and then build it.

➤ 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.

2. TMflow Listen node setup

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.

  1. 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.

  1. 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.2

Note: Set the network mask and the communication with the TM Robot must be in the set domain.


  1. The Ethernet Slave and Data Table Setting are no setup required. As the "Configuration ⇒ ROS Setting" is Running, the build-in ROS Data Table Setting will be automatically selected (as shown in the figure below, occupied by ROS).

The user can skip this step as follows: The following is only an introduction to the parameters of the ROS data table.

The build-in ROS Data Table Setting 1 to receive/send specific data is listed below:

  - [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

1 The build-in ROS Data Table Setting is no setup required.

If you need to check more about the maximum, minimum, and average calculation properties of joint torque 2 listed below, these three checked items require TMflow 2.16 or later versions to support.

  - [x] Joint_Torque_Average
  - [x] Joint_Torque_Min
  - [x] Joint_Torque_Max

2 This function requires TMflow 2.16 or later versions to support.

  1. Don't forget to press the Play/Pause Button on the Robot Stick to start running this Listen task project.

§ Remote connection to TM ROBOT

Static IP of remote connection network settings through the wired network.

  1. 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.

  1. 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

  1. Check Internet connection: start a terminal to test the connectivity with the target host TM ROBOT, by typing ping 192.168.10.2

ping_target_host

💡 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.

§ Common usage of TM ROS Windows driver

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 and ROS Settings (ROS Drive status: ⇒ Running) 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 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>
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export ROS_DOMAIN_ID=<ROS_DOMAIN_ID>
source ./install/setup.bash

Note: Domain ID is the key to ROS communication, and please make sure the ROS node works under the ROS environment setup with the same Domain ID as the robot.

1 The user can download the Embedded TM ROS basic App packages from Techman Download Center for the basic TM ROS application or clone the Experimental TM2 Foxy ROS Apps of the GitHub repository for more advanced ROS applications.

3. TMflow Vision node setup and prerequisites for using TM ROS Vision

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)

§ Prerequisites for using TM ROS Vision

Dependencies

  • ROS2 Foxy

  • Python packages:

    1. flask
    2. waitress
    3. opencv-python==3.4.13.47 (Minimum)
    4. numpy
    5. 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

Run TM ROS Vision driver

Make sure that ROS Settings (ROS Drive status: ⇒ Running) is ready. Please refer to the following section: "4.ROS Settings on Configuration".

💡 The user can check whether the connection succeeds or not. When you proceed to the following steps introduced in the following text: step1 ⇒ step4 of § TMflow Vision node setup.

§ TMflow Vision node setup

  1. 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.

  1. 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).

  1. Click FindExternal Detection, which adds an External Detection node to the Vision Job flow.

  1. To set up External Detection, please enter http://127.0.0.1:6189/api in the HTTP Setting blank text and click the Send button. If normal, the text box will receive a message in JSON format as shown below. Then, enter http://127.0.0.1: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.

  1. 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).

§ TMflow Vision node usage

➤ 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 and ROS Settings (ROS Drive status: ⇒ Running) are ready and the Vision task project is running. Do you build TM relative ROS apps 1 on your (remote) computer?

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>
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export ROS_DOMAIN_ID=<ROS_DOMAIN_ID>
source ./install/setup.bash
ros2 run image_sub sub_img

Note: The <ROS_DOMAIN_ID> is the key to ROS communication and must be the same as the value of TM Flow 2 in the ROS Settings.

Then, the viewer will display image data from TMflow.
Note: When you have finished, press CTRL + C in all terminal windows to shut everything down.

4. ROS Settings on Configuration

In the ROS Settings, the user can enter the domain ID and turn on the TM ROS driver using the toggle button. Navigate to Configuration ⇒ ROS Setting and check the ROS Drive Status: When the ROS Drive Status label prompts is Running, it means the TM ROS Driver is ready.

The TM ROS driver requires the TM Ethernet Slave to communicate with the robot information and publish it as a ROS topic; therefore, when the TM ROS Driver is running, the TM Ethernet Slave will be occupied and cannot be closed manually. For the convenience of ROS users, once it is turned on, it will be automatically turned on by default. If the user confirms that they no longer want to use the "embedded TM ROS Driver" function, the user must manually turn it off again to allow the system memory to return to the default off.

➤ Run the embedded ROS driver Mouse-click to enable the Slave Setup setting and wait for the status: ⇒ Running.


➤ Stop running the embedded ROS driver Mouse-click the toggle button again and the status will show NotRun.