您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 ros訂閱話題python(更改ros python 路徑)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-16 04:07:59【】8人已围观
简介/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,
&
很赞哦!(4726)
相关文章
- 01 天津飛集貿易公司招聘(企業如何選擇招聘方式)
- 01 天津海路豐汽車貿易有限公司(南京市疾控緊急提醒!)
- 01 天津經濟貿易學校2021分數線(天津市經濟貿易學校分數線)
- 01 天津融誠物產國際貿易有限公司怎么樣(天津融誠物產是國企嗎)
- 01 FB海外推廣的競爭對手有哪些(如何做好外貿,怎么快速獲得外貿訂單?)
- 01 天津物產進出口貿易有限公司電話號碼(天津物產進出口貿易有限公司的公司優勢)
- 01 天津網紅花姐有老公了嗎(天津咸陽橋跳舞網紅花姐是誰)
- 01 天津經濟貿易學校官網(天津市經濟貿易學校)
- 01 天津物資貿易學校電話為什么打不通(從天津物資貿易學校怎么去火車站)
- 01 fansone訂閱下載(fansone有app嗎)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片
职业:程序员,设计师
现居:贵州铜仁玉屏侗族自治县
工作室:小组
Email:[email protected]
热门文章
站长推荐
01 天津物資貿易學校宿舍有獨立衛生間嗎(天津醫科大學宿舍條件怎么樣,有獨立衛生間和空調嗎)
01 fob exw和cif這三個貿易術語的區別(EXW,FOB,CIF 貿易術語的區別?)
01 f買粉絲是什么意思國際貿易(外貿合同上的ICPO是什么意思?)
01 天津貿易經濟學校宿舍(天津商業大學經濟學院的宿舍如何)
01 天津腫瘤醫院買粉絲預約更新幾點(杭州市腫瘤醫院買粉絲就診人姓名錯誤怎么更改)
01 天津造宏鋼鐵貿易有限公司(全國有哪些鋼板生產廠家)
01 天津腫瘤醫院買粉絲下載(復旦大學腫瘤醫院買粉絲買粉絲通知結果出來點進去沒結果是什么意思)
01 天津社保買粉絲(津社保買粉絲買粉絲怎么查)