资源简介
《Mastering ROS for Robotics Programming》一书的代码。
代码片段和文件信息
#!/usr/bin/python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014 PAL Robotics SL
# All rights reserved.
#
# Redistribution and use in source and binary forms with or without
# modification are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of the PAL Robotics nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# “AS IS“ AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT
# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT
# INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING
# BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT
# LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# author: Bence Magyar
import rospy
from actionlib import SimpleActionClient
from geometry_msgs.msg import PoseArray Pose Point
from std_msgs.msg import Header
from moveit_simple_grasps.msg import GenerateGraspsAction GenerateGraspsGoal
from moveit_msgs.msg import Grasp
import geometry_msgs
grasp_publisher = None
grasps_ac = None
def generate_grasps(pose width):
#send request to block grasp generator service
grasps_ac.wait_for_server()
rospy.loginfo(“Successfully connected.“)
goal = GenerateGraspsGoal()
goal.pose = pose.pose
goal.width = width
grasps_ac.send_goal(goal)
rospy.loginfo(“Sent goal waiting:\n“ + str(goal))
t_start = rospy.Time.now()
grasps_ac.wait_for_result()
t_end = rospy.Time.now()
t_total = t_end - t_start
rospy.loginfo(“Result received in “ + str(t_total.to_sec()))
grasp_list = grasps_ac.get_result().grasps
return grasp_list
def publish_grasps_as_poses(grasps):
rospy.loginfo(“Publishing PoseArray on /grasp_pose_from_block_bla for grasp_pose“)
graspmsg = Grasp()
grasp_PA = PoseArray()
header = Header()
header.frame_id = “base_link“
header.stamp = rospy.Time.now()
grasp_PA.header = header
for graspmsg in grasps:
p = Pose(graspmsg.grasp_pose.pose.position graspmsg.grasp_pose.pose.orientation)
grasp_PA.poses.append(p)
grasp_publisher.publish(grasp_PA)
rospy.loginfo(‘Published ‘ + str(len(grasp_PA.poses)) + ‘ p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-11-02 20:11 chapter_10_codes\
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_desc
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_desc
文件 610 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 672 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 181 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_desc
文件 79284 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 98584 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 67484 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 21484 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 235984 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 28984 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 209384 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 12784 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 209384 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 216584 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 98584 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 67484 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 133784 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 98584 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
文件 67484 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_desc
文件 21509 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
目录 0 2015-10-20 18:27 chapter_10_codes\cool_arm\cool5000_desc
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_moveit_config\
文件 230 2015-10-21 15:09 chapter_10_codes\cool_arm\cool5000_moveit_config\.setup_assistant
文件 268 2015-10-21 15:09 chapter_10_codes\cool_arm\cool5000_moveit_config\CMakeLists.txt
目录 0 2015-11-02 20:11 chapter_10_codes\cool_arm\cool5000_moveit_config\config\
文件 11118 2015-10-21 15:09 chapter_10_codes\cool_arm\cool5000_moveit_config\config\cool5000_desc
............此处省略2043个文件信息
- 上一篇:EDA程序设计
- 下一篇:cmake-3.11.1
相关资源
- wifi电路调试经验之谈
- Oxford Industries 采用 Microsoft.NET 平台实
- IBM CAW for Microsoft Cluster Server 简介
- IBM.Rational.Rose.Enterprise的license.upd
- Symantec AntiVirus for Microsoft SharePoint产品
- Microservice patterns
- Microsoft Visio 2013 Professional 64位简体中
- Microsoft Project 2016
- 含Microsoft.Office.Interop.Owc11
- The Existence and Stability of Nontrivial St
- DS4000存储系统上Microsoft Exchange 2003的存
- Microsoft Visual Studio 2017 Installer Project
- 通过 Microsoft Services for UNIX 将 UNIX 应用
- Microsoft Windows Services for UNIX 3.5 版中的
- Ross-Konno手术后左心室流出道梗阻
- Genome doubling and chromosome elimination wit
- Improvement of the coercivity and corrosion re
- Effects of cerium on the microstructure and me
- crossfilter tutorial
- RoboWare Studio中文版(2018).pdf
- 倍加福二维码识别模块使用手册
- Bioinformatics analysis of tyrosinase-related
- Effect of isovalent substitution on martensiti
- Facile hydrothermal synthesis of Tb2(MoO4)
- Spectroscopic Study on Cu2+-induced Abnormally
- ROS 6.40.3最新破解版 Mikrotik RouterOS L6全
- 论文研究-基于AMBA AXI总线的Crossbar互联
- router os 6.0支持IDE破解版
- ROST内容挖掘软件
- Aerosim Blockset
评论
共有 条评论