高斯六軸機械臂畫圓

#!/usr/bin/env python
# Copyright (c) 2018 Pilz GmbH & Co. KG
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from geometry_msgs.msg import Point
from pilz_robot_programming.robot import *
from pilz_robot_programming.commands import *
import math
import rospy
from time import sleep
import yaml

__REQUIRED_API_VERSION__ = "1"

def start_program():
    print("Executing " + __file__)

    r = Robot(__REQUIRED_API_VERSION__)

    r.move(Ptp(goal=Pose(position=Point(0.35, 0.0, 0.08), orientation=from_euler(0, 0, 0)), 
        vel_scale=0.5, acc_scale=0.4))
    r.move(Lin(goal=Pose(position=Point(0.35, 0.0, 0.06), orientation=from_euler(0, 0, 0)), 
        vel_scale=0.3, acc_scale=0.3))
    print "do circle"
    r.move(Circ(goal=Pose(position=Point(0.30, 0.05, 0.06)), center=Point(0.30, 0, 0.06), acc_scale=0.3, vel_scale=0.3)) 
    #sleep(1)
    r.move(Circ(goal=Pose(position=Point(0.25, 0.0, 0.06)), center=Point(0.30, 0, 0.06), acc_scale=0.3, vel_scale=0.3)) 
    #sleep(1)
    r.move(Circ(goal=Pose(position=Point(0.30, -0.05, 0.06)), center=Point(0.30, 0, 0.06), acc_scale=0.3, vel_scale=0.3)) 
    #sleep(1)
    r.move(Circ(goal=Pose(position=Point(0.35, 0.0, 0.06)), center=Point(0.30, 0, 0.06), acc_scale=0.3, vel_scale=0.3)) 
    #sleep(1)

    r.move(Ptp(goal=[0, 0, 0, 0, 0, 0], vel_scale=0.5, acc_scale=0.5))
    
if __name__ == "__main__":
    # Init a ros node
    rospy.init_node('robot_program_node', log_level=rospy.INFO)

    start_program()


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章