您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 ros訂閱話題python(ros下python文件怎么運行)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-06-17 16:57:59【】6人已围观
简介/p> self.cmd_vel=rospy.Publisher('/cmd_vel',Twist,queue_size=5)
self.cmd_vel = rospy.Publisher('/cmd_vel', Twist, queue_size=5)
rate = 20
r = rospy.Rate(rate)
linear_speed = 0.2
goal_distance =1.0
angular_speed = 1.0
goal_angle = pi
angular_tolerance = radians(2.5)
# Initialize tf listener, and give some time to fill its buffer
self.tf_listener = tf.TransformListener()
rospy.sleep(2)
# Set odom_frame and base_frame
self.odom_frame = '/odom'
try:
self.tf_listener.waitForTransform(self.odom_frame,
'/base_footprint',
rospy.Time(),
rospy.Duration(1.0))
self.base_frame = '/base_footprint'
except(tf.Exception, tf.ConnectivityException, tf.LookupException): try:
self.tf_listener.waitForTransform(self.odom_frame,
'/base_link',
rospy.Time(),
rospy.Duration(1.0))
self.base_frame = '/base_link'
except(tf.Exception, tf.ConnectivityException, tf.LookupException):
rospy.loginfo("Cannot find base_frame transformed from /odom")
rospy.signal_shutdown("tf Exception")
position = Point()
for i in range(2):
move_cmd = Twist()
move_cmd.linear.x = linear_speed # Initial pose, obtained from internal odometry
(position, rotation) = self.get_odom()
x_start = position.x
y_start = position.y
distance = 0
# Keep publishing Twist msgs, until the internal odometry reach the goal
while distance < goal_distance and not rospy.is_shutdown():
self.cmd_vel.publish(move_cmd)
r.sleep()
(position, rotation) = self.get_odom()
distance = sqrt( pow( (position.x-x_start), 2 ) + \
pow( (position.y-y_start), 2 ) )
# Stop 1 ms before rotate
move_cmd = Twist()
self.cmd_vel.publish(move_cmd)
rospy.sleep(1)
move_cmd.angular.z = angular_speed # should be the current ration from odom
angle_last = rotation
angle_turn = 0 while abs(angle_turn+angular_tolerance) < abs(goal_angle) \ and not rospy.is_shutdown():
self.cmd_vel.publish(move_cmd)
r.sleep()
(position, rotation) = self.get_odom
delta_angle = normalize_angle(rotation - angle_last)
angle_turn += delta_angle
angle_last = rotation
move_cmd = Twist()
self.cmd_vel.publish(move_cmd)
rospy.sleep(1)
self.cmd_vel.publish(Twist())
def get_dom(self): try:
(trans, rot) = self.tf_listener.lookupTransfrom(self.odom_frame,
&
很赞哦!(52674)
相关文章
- 04 文明國際貿易路線包括自己(為什么是歐洲文明塑造現代世界?)
- 04 搭建jenkins實現自動化部署(自動化部署工具jenkins,從此擺脫重復單調的工作)
- 01 義烏市場采購貿易方式的特點(義烏購的經營模式是什么樣的?)
- 01 義烏貿易有限公司(義烏外貿公司的地址)
- 04 教師讀書分享買粉絲報道稿(中心小學讀書節活動方案)
- 04 敬老院活動買粉絲文章(大學生應怎樣合理安排假期時間?)
- 04 描寫上海外灘的英語作文(介紹上海外灘的英語作文)
- 04 新貿易用英語怎么說(英語中的貨代怎么說)
- 01 義烏市場采購貿易方式視頻(義烏市場采購貿易平臺結匯時間)
- 04 新安捷貿易(上海)有限公司東莞分公司(撐傘架十大品牌排行榜)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片
职业:程序员,设计师
现居:河北省承德双桥区
工作室:小组
Email:[email protected]
热门文章
站长推荐
04 數字貿易對我國農產品出口的影響(精選電子商務論文題目)
01 義烏工商職業技術學院外語外貿學院院長(浙江橫店影視職業學院的表演藝術學院)
04 施倍德貿易(上海)有限公司青島分公司招聘(什么專業適合考公務員)
04 新貿易保護理論思維導圖(第42周 大國政治的悲劇 思維導圖及知識筆記)
01 烏魯木齊九價疫苗預約買粉絲(九價疫苗怎么預約買粉絲買粉絲)
04 教師讀書活動買粉絲文章(2019年12月21日晚八點句讀聯盟七色閱讀作坊第20次分享活動記錄)
04 數字經濟與國際貿易論文有關近三年的文獻(廣西大學2020年中美校際交流項目招生簡章)
04 政論天下買粉絲買粉絲(如何評價沈洋老師用口琴演奏的《不忘初心》?)