Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
2
1. Kinematics of UR3 Robot
2. Control UR using Python (Hardware)
3. Control UR using MATLAB (Simulation, Hardware)
4. Control UR using MoveIt in ROS (Simulation, Hardware)
5. HUSKY DUAL UR5 MOBILE MANIPULATION DEMO (Simulation)
3
Kinematics of UR3 Robot
• DH Parameter of UR3 Robot
https://www.universal-robots.com/how-tos-and-faqs/faq/ur-faq/parameters-for-
calculations-of-kinematics-and-dynamics-45257/
θ d (mm) α (rad) l (mm)
Joint 1 θ1 151.9 π/2 0
Joint 2 θ2 0 0 -243.65
Joint 3 θ3 0 0 -213.25
Joint 4 θ4 112.35 π/2 0
Joint 5 θ5 85.35 -π/2 0
Joint 6 θ6 81.9 0 0
Kinematics of UR3 Robot
G. W. Jiang, et.al “A Precise Positioning Method for a Puncture Robot Based on a PSO-Optimized
BP Neural Network Algorithm,” Applied Sciences, doi:10.3390/app7100969
Kinematics of UR3 Robot
• Transformation matrix from the base to the end effector:
• The orientation of the end effector is described according to the RPY
(roll-pitch-yaw) rotation.
• These rotations are the angles around the Z-Y-Z axis
G. W. Jiang, et.al “A Precise Positioning Method for a Puncture Robot Based on a PSO-Optimized
BP Neural Network Algorithm,” Applied Sciences, doi:10.3390/app7100969
Kinematics of UR3 Robot
• The forward kinematics equation of the robot is:
• The inverse kinematics equation is:
G. W. Jiang, et.al “A Precise Positioning Method for a Puncture Robot Based on a PSO-Optimized
BP Neural Network Algorithm,” Applied Sciences, doi:10.3390/app7100969
8
02 Necessary Resources
• Functions
• Parameters in Functions
• Examples
URX Python 라이브러리 소개
• urx is a python library to control the robots from Universal Robots.
• urx is an easy to use module for pick and place operations – based
applications that do not require high control frequency
• urx can use the python-math3d library to receive and send transformation
matrices to the robot.
설치하기
1. PC에 Python 설치하기
2. Python 라이브러리 설치하기
2.1 검색창에 cmd를 입력하여 열고, 다음 명령어 기입하기
pip install numpy
pip install math3d
설치하기
3. URX 라이브러리 설치하기
검색창에서 “cmd”를 입력하여 열고, 다음 명령을 입력합니다.
pip install urx
4. PyCharm 설치하기
연결하기
• Desktop PC • UR onboard PC
실습 1. 시작 포즈 자세를 유지하면서 urx 메서드를 실행하는 예제
1. UR3 온보드 PC와 컴퓨터를 이더넷 케이블로 연결합니다. UR3의 전원을 켜고 로봇
기능(Feature)을 Base로 설정합니다.
실습 1. 시작 포즈 자세를 유지하면서 urx 메서드를 실행하는 예제
2. PyCharm을 열고 새 프로젝트를 만듭니다. 외부 라이브러리 추가: File → Settings.
Settings 팝업 윈도우에서 Project → Project Interpreter → Python 3.6 E: \ Python
\ Python.exe를 선택합니다.
실습 1. 시작 포즈 자세를 유지하면서 urx 메서드를 실행하는 예제
3. Create URAll_Test.py file and Run it.
• rob = urx.Robot("192.168.0.100")
• rob.set_tcp((0, 0, 0, 0, 0, 0))
• rob.set_payload(0.5, (0, 0, 0))
• rob.getj()
• rob.get_pose()
• rob.getl()
• rob.movels([p1, p2], vel=v, acc=a, radius=r, wait=False, threshold=None)
• rob.movej(initj, acc=0.8, vel=0.2, wait=False, relative=False, threshold=None)
• rob.movec(via, to, acc=a, vel=v, wait=False, threshold=None)
• rob.translate((l, 0, 0), acc=a, vel=v, wait=False, command="movel")
• rob.translate_tool((0, 0, l), vel=v, acc=a, wait=False, threshold=None)
• t.orient.rotate_zb(pi / 8)
rob.set_pose(t, vel=v, acc=a, wait=wait(), threshold=None)
False or wait functionblend
이동 명령: Move J
• 관절 이동
• 보간 없음
• 가장 빠른 이동 종류
• 이동이 자유로운 공간에서 유용
Waypoint_2
Waypoint_3
Waypoint_1
Waypoint_4
17
이동 명령: Move L
• 직선 이동
• TCP에 대해 직선 궤적으로 보간
Waypoint_2
Waypoint_3
Waypoint_1
Waypoint_4
18
이동 명령: MoveL with blend
• 혼합 반지름
• 연속 이동
• 웨이포인트에서 정지하지 않음
Waypoint_2
Waypoint_3
Waypoint_1
Waypoint_4
blend radius
19
이동 명령: Move P
shared blend
constant
TCP speed
• 프로세스 이동
• 프로세스 응용
• 직선 이동
• TCP 속도 고정
• 혼합 반지름 공유
Waypoint_2
Waypoint_3
Waypoint_1
Waypoint_4
20
이동 명령: Move C
21
• 원형 이동
• TCP에 대해 원형 궤적
• 웨이포인트 3개 필요
– 시작점
– 경유점
– 종료점
• 반지름 자동 계산Waypoint_1
Waypoint_2
Waypoint_3
Waypoint_5 Waypoint_4
(Start point) (End point)
(Via point)
실습2. OnRobot RG2 그리퍼 제어하기
Step 1): import onrobot_rg2_gripper.py file
실습2. OnRobot RG2 그리퍼 제어하기
2. Run test_rg2_gripper.py
The source code is explained as:Line 1: import on_robot_rg2_gripper file made instep 1)Line 3: import urx libraryLine 10: establish connectionLine 11: initial functionLine 12: open rg2 gripperLine 13: close rg2 gripperLine 15: disconnect robot
실습3. UR3와 OnRobot RG2 그리퍼를 사용한 픽앤플레이스 어플리케이션
1. Create pick_place.py file
25
Universal Robot의 MATLAB Toolbox 소개하기
• This tool box interfaces industrial manipulators form Universal Robots with
MATLAB.
• The toolbox allows users to interface manipulators leveraging the URX
Python library.
• This toolbox also includes:
– visualization tools
– forward and inverse kinematics functions
– Jacobians
– an URScript control approach allowing users to smoothly command UR manipulators
along desired trajectories
Kinematics of UR3 Robot
• DH Parameter of UR3 Robot
MATLAB Toolbox 설치하기
1. Python Installation
1. pip install numpy
2. pip install math3d
3. pip install urx
2. MATLAB Installation
2.1 Download URToolbox (https://github.com/Kutzer/URToolbox)
2.2 Unzip “URToolbox.zip”
2.3 Open MATLAB as an administrator
2.4 Run “installURToolbox”
3. Setup computer’s IP address and UR onboard PC’s IP address
MATLAB Toolbox 설치하기
4. URToolboxScript Installation
4.1 DownDownload WinSCP v.5.7.7 or later version (https://winscp.net/download/winscp577setup.exe)
4.2 Create an FTP connection with the UR system
4.3 Revise “URToolboxScript.script” file, open MATLAB as an administrator and revise some contents in the
URToolboxScript.script file as below. Save the file.
4.4 Upload “URToolboxScript.script” from the unzipped “URToolbox.zip” directory to the “/programs” directory on the UR.
4.5 Load the script using the teach pendant and save the compiled URP file when prompted
Username: root
Password: easybot
Port: 22
실습1. MATLAB UR Toolbox를 이용하여 UR 시뮬레이션
1. 관리자권한으로 MATLAB을실행합니다. SCRIPT_DrawCircle.m 파일을실행하고 UR을선
택합니다.
실습1. MATLAB UR Toolbox를 이용하여 UR 시뮬레이션
2. When I choose UR3 model, and set the Tool as the defined waypoints in the following
source code. The URsim object is used to visualize the robot and calculate inverse
kinematics for the system
실습1. MATLAB UR Toolbox를 이용하여 UR 시뮬레이션
3. Test result:
실습 2. MATLAB UR Toolbox를 이용한 Universal Robot Process
1. 관리자권한으로 MATLAB을실행합니다. SCRIPT_DrawCircle.m 파일을엽니다.
2. 하드웨어연결플래그를 True로설정합니다.
3. UR 온보드컨트롤러에서 URToolbox.urp 파일을엽니다. SCRIPT_DrawCircle.m 파일을실행합니다.
Enter server IP address: 192.168.0.77Enter port: 30003Enter number of connections to be made: 1Server created.Begin UR onboard controller, then press ENTER.Connections established.Would you like to create a URX connection as well? yEnter URX address: 192.168.0.100
실습 2. MATLAB UR Toolbox를 이용한 Universal Robot Process
35
Robot working senario
• Understanding the request
• Understanding the environment
• Planning the task
• Executing the task
Contents
• MoveIt! Introduction
• MoveIt! Quick start
• Control real UR robot with Move Group C++ Interface
What is MoveIt! ?
• An easy-to-use platform for developing advanced robotic
applications, evaluating new robotic designs and building
integrated robotic products
• Features:
– Motion planning
• Navigation
• Manipulation
– Environment integration (3rd party lib)
• 3D perception
• Kinematics
• Control
• Support many robots:
– Mobile platforms
– Manipulators with grippers
– Humanoids
MoveIt! System Framework
Planning Scene:
• Planning Scene: representation of the environment, and save robot’s state.
• State information: joint states
• Sensor information: using the world geometry monitor
• World geometry information: from user input on the planning_scene topic
3D Perception
• 3D Perception: process by occupancy map monitor
– Point clouds: handled by the point cloud occupancy map updater
plugin
– Depth images: handled by the depth image occupancy map updater
plugin
Motion Planning Libraries
• OMPL: (open Motion Planning Library)
– An open source C++ library for motion planning
– It includes a number of advanced algorithms for motion planning.
– The algorithm in this library is based on the sampling planning
algorithm, which can realize the path planning between different target
points.
Kinematics and Collisions
• Kinematics
– Orocos KDL
– Basic FK + Jdacobians
– IKFast link
– Own IK
• Collisions:
– Flexible Collision Library
– Meshes, Primitive Shapes, Octomap
– Allowed Collision Matrix
MoveIt! Quick start
• Assembly: Creating a robot URDF model
• Configuration: Generate a configuration file using the MoveIt!
Setup Assistant tool
• Drive: Add robot controller plugin
• Control: MoveIt! Control robot movement
Install Universal Robot ROS
mkdir –p ~/ur/catkin_ws/src
cd ~/ur/catkin_ws/src && catkin_init_workspace
git clone https://github.com/ros-industrial/universal_robot
git clone https://github.com/ros-industrial/ur_modern_driver
cd ..
catkin_make install
source ~/ur/catkin_ws/devel/setup.bash
Creating robot URDF model
Step 1): Create Robot URDF Model
Creating robot URDF model -- definition
Property definition
Inertial matrix
definition
Creating robot URDF model – link and joint
Link:• Visual• Collision• inertial
Joint:
Creating robot URDF model – link and joint
Transmission interface
Controller plugin
Creating robot URDF model – gazebo property
Transmission interface
Controller plugin
Creating robot URDF model – Visualization
Joint_state tf
view_ur3.launch
Creating robot URDF model – Visualization
roslaunch ur_description view_ur3.launch
Creating robot URDF model
Step 2): Generate a configuration file
using the MoveIt! Setup Assistant tool
MoveIt! Setup Assistant
roslaunch ur3_moveit_config setup_assistant.launch
Load Model
MoveIt! Setup Assistant – Self-Collisions
roslaunch ur3_moveit_config setup_assistant.launch
Set Sample Point
MoveIt! Setup Assistant – Planning Groups
Manipulator Planning Groups
MoveIt! Setup Assistant – Planning Groups
Manipulator and
endeffector planning
groups
MoveIt! Setup Assistant – Robot Poses
Set Robot Pose: home, up
MoveIt! Setup Assistant – End Effectors
Set end effectors
MoveIt! Setup Assistant – Author Information
Fill in author information
MoveIt! Setup Assistant – Configuration Files
Generate
configuration
files
MoveIt! Setup Assistant – Configuration Files
MoveIt! Demo
roslaunch ur3_moveit_config demo.launch
Motion Planning PluginRobot State Display
MoveIt! Demo – Drag Planning
Drag mouse to set
goal point
MoveIt! Demo – Random Goal Planning
Set random goals
MoveIt! Demo – Set start point
Set start point
Add robot controller plugin
Step 3): Add robot controller plugin
Add robot controller plugin
• Name: Controller plugin name
• Action_ns: namespace of the
action message
• Type: type of action
• Joints: The joints included in
the planning group
Add robot controller plugin
fake_moveit_controller_manager.launch
Add robot controller plugin
Step 4): MoveIt! Control robot
movement
MoveIt! Control robot movement
• “move_group” Python Interface • “move_group” C++ Interface
group_name = "panda_arm"
group = moveit_commander.MoveGroupCommander(group_name)
pose_goal = geometry_msgs.msg.Pose()
pose_goal.orientation.w = 1.0
pose_goal.position.x = 0.4
pose_goal.position.y = 0.1
pose_goal.position.z = 0.4
group.set_pose_target(pose_goal)
static const std::string PLANNING_GROUP = "panda_arm";
moveit::planning_interface::MoveGroupInterface move_group(PLANNING_GROUP);
geometry_msgs::Pose target_pose1;
target_pose1.orientation.w = 1.0;
target_pose1.position.x = 0.28;
target_pose1.position.y = -0.2;
target_pose1.position.z = 0.5;
move_group.setPoseTarget(target_pose1);
MoveIt! Control robot movement- Move Up and Down
MoveIt! Control robot movement--Move Up and Down
• Add content in CMakeLists.txt
• Open a terminal, compile workspacecd ur/catkin_ws
catkin_make
• Run commandroslaunch ur_gazebo ur3.launch
roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch sim:=true
roslaunch ur3_moveit_config moveit_rviz.launch config:=true
rosrun ur_modern_driver ur_test02
MoveIt! Control robot movement- Plan to goal point
MoveIt! Control robot movement – Plan to goal point
• Run commandroslaunch ur_gazebo ur3_joint_limited.launch
roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch sim:=true limited:=true
roslaunch ur3_moveit_config moveit_rviz.launch config:=true
rosrun ur_modern_driver ur_test01
MoveIt! Control robot movement – Add an object, plan safe path
MoveIt! Control robot movement – Add an object, plan safe path
• Run commandroslaunch ur_gazebo ur3_joint_limited.launch
roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch sim:=true limited:=true
roslaunch ur3_moveit_config moveit_rviz.launch config:=true
rosrun ur_modern_driver ur_test03
MoveIt! Control robot movement
• Usage with real hardware • Desktop PC • UR onboard PC
MoveIt! Control robot movement
• Usage with real hardware # Bringup the real robot
roslaunch ur_modern_driver ur3_bringup.launch robot_ip:=192.168.0.100
# For settingup the MoveIt! Nodes to allow motion planning run:
roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch
# For starting up Rviz with a configuration including the MoveIt! Motion Planning
plugin run:
roslaunch ur3_moveit_config moveit_rviz.launch config:=true
MoveIt! Control robot movement
81
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Installation all of packages
mkdir -p ~/dual_ws/src
cd ~/dual_ws/src && catkin_init_workspace
git clone https://github.com/DualUR5Husky/husky
git clone https://github.com/DualUR5Husky/ur_modern_driver
git clone https://github.com/ros-industrial/universal_robot
git clone https://github.com/DualUR5Husky/robotiq
git clone https://github.com/DualUR5Husky/husky_simulator
git clone https://github.com/DualUr5Husky/flir_ptu
cd ..
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Install dependencies
– sudo apt-get update
– rosdep install --from-paths src --ignore-src --
rosdistro=kinetic –y
• Build workspace
– catkin_make install
– source ~/dual_ws/devel/setup.bash
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Usage:
– roslaunch husky_gazebo husky_empty_world.launch
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Usage:
• Launch the moveit interface
– roslaunch husky_dual_ur5_moveit_config demo.launch
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Usage:
• Controlling the gripper– rosrun robotiq_s_model_control SModelSimpleController.py _topic:=left_hand/command
– Type “a”, then ”o”, open the gripper
HUSKY DUAL UR5 MOBILE MANIPULATION DEMO
• Usage:• Navigation and Mapping with the Dual UR5 Husky
– # Start the husky gazebo
– roslaunch husky_gazebo husky_playpen.launch
– # Bring up the mapping demo
– roslaunch husky_navigation gmapping_demo.launch
– # Bring up the visualization for it
– roslaunch husky_viz view_robot.launch
88
Thanks for your attention!
89