您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 ros訂閱話題python(更改ros python 路徑)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-11 12:19:53【】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,
&
很赞哦!(492)
相关文章
- 04 art youtube 買粉絲 ideas(美國留學 如何圓夢紐約大學電影學院)
- 02 歷年外貿數據(進出口總額的歷年數據)
- 04 7月份外貿數據統計(上半年外貿數據亮眼的原因是什么?)
- 02 廈門南普陀寺買粉絲預約(2022廈門南普陀寺網上預約指南附開放時間)
- 04 8.屬于商業信用的國際貿易結算方式是 ()(國際結算分析題)
- 04 2023年中墨貿易總額(陜西省渭南市合陽縣人口多嗎)
- 02 廈門盒其有幸貿易有限公司(廈門有哪些風景名勝區)
- 04 2023年全球商品貿易量增長多少(東盟博覽會東盟博覽會2023)
- 04 beauty products to diy(“I make it, I know who I am” —“女神 (Goddess)”by Joyce Cheng)
- 02 廈門幫粉絲買奔馳(廈門人偏愛奔馳?廈門五月份上牌量-豪華車篇)
热门文章
站长推荐
04 broad institute工作(倫敦大學學院基本概況)
02 印度進出口貿易總額增長率(與上年相比,2007年我國對主要國家和地區貨物進出口總額增長率最高的國家(地區)的進口額為:)
04 2023年國際貿易形勢分析當代(現在做什么行業前景比較好呢)
02 廈門網紅健康步道(廈門山海健康步道國慶花海打卡攻略廈門網紅打卡旅游景點山海健康步道)
04 application youtube music windows(所有手機的設置程序的包名和類名是一樣的嗎)
02 即墨外貿尾貨服裝市場有幾塊錢的(青島外貿尾貨一條街在哪里)
04 2022年對外貿易地理方向,貨物結構(2022上半年我國服務貿易增長較快 彰顯高水平開放活力)
04 2023年4月日本貿易數據(我國2023年人均gdp能達到多少美元?)