您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 ros訂閱話題python(ros下python文件怎么運行)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-14 03:04:39【】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,
&
很赞哦!(8395)
相关文章
- 01 信用青海買粉絲買粉絲企業版(青海納稅服務買粉絲買粉絲怎么實名認證)
- 01 做tiktok建議用電腦嗎(電腦tiktok怎么下載T?)
- 01 倩女幽魂怎么取消海外入口(倩女幽魂手游海外入口什么意思)
- 11 music 買粉絲 youtube my playlist library(如何在youtubemusic中創建快捷指令)
- 01 修文礦能礦產貿易有限公司(修文縣大營煤礦現狀)
- 11 youtube mp3 downloader apple app 買粉絲(C#的側邊欄技術。答好了加分。)
- 01 做外貿聽不懂客戶說什么怎么辦(做外貿英語不好怎么辦?)
- 01 做tiktok搬運賺錢嗎(海外抖音tiktok怎么賺錢)
- 11 how to download youtube 買粉絲s for 買粉絲(芭比動畫片的片尾曲叫什么名字?)
- 11 買粉絲 youtube to mp3 player播放器插件(C#的側邊欄技術。答好了加分。)
热门文章
站长推荐
10 青島百多匯貿易有限公司(中國有多少家做進出口貿易的企業?)
11 download playlist on youtube(好聽的英文歌)
10 進出口貿易計劃書范文(項目投資計劃書的范文)
11 youtube how to share playlist(幫忙翻譯一段IPHONE廣告)
01 做國際貿易的銀行有哪些(請問可以開立國際貿易信用證的國內銀行有哪些?)
11 how to make art on youtube(利物浦大學2017年文書范文分享 You tube助我打開數學世界大門(內附3篇范文))
11 download youtube mp3 online 買粉絲 play(高分懸賞!求一首英文流行歌曲)
10 青島市場采購貿易聯網平臺(EDI在我國發展的必要性)