您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
03 ros訂閱話題python(更改ros python 路徑)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-13 23:46:19【】7人已围观
简介/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,
&
很赞哦!(49765)
相关文章
- 01 烏克蘭外貿騙局揭秘(烏克蘭客戶拖欠貨款怎么催?烏克蘭外貿欠款催收技巧及成功案例)
- 01 義烏網紅玩具批發市場(網紅玩具批發一手貨源在哪里)
- tiktok網頁版登錄入口官網(《抖音小店》商家登錄入口官網)
- tiktok網頁版登入失敗身份驗證失敗(tiktok網頁版怎么提現)
- tiktok網頁版登錄入口學生賬號注冊(用微信立了兩個身份第二個身份如何更改頭像?)
- tiktok網頁版登錄入口電腦網頁打不(tiktok網頁版怎么提現)
- 01 義烏五金外貿公司大全(義烏最大的外貿公司)
- 01 義烏外貿英語培訓機構(義烏初中英語培訓哪家好?)
- tiktok網頁版登入不能(tiktok賬號退出登入另外一個手機可以嗎)
- tiktok網頁版登錄入口電腦網頁如何(用微信立了兩個身份第二個身份如何更改頭像?)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款的名片
职业:程序员,设计师
现居:河北省廊坊固安县
工作室:小组
Email:[email protected]
热门文章
站长推荐
tiktok網頁版登錄入口網頁官方版(《抖音小店》商家登錄入口官網)
tiktok網頁版登錄入口學生賬號是(身份微信怎么登錄?)
tiktok網頁版登錄入口網址鏈接是(tiktok發視頻違規導致小店被封要多久恢復商城入口)
tiktok網頁版登錄入口網頁官網云南(tiktok網頁版怎么提現)
tiktok網頁版登錄入口網址鏈接入口(《抖音小店》商家登錄入口官網)
tiktok網頁版登錄入口官方版本最新(tiktok發視頻違規導致小店被封要多久恢復商城入口)
01 烏魯木齊亞歐商品貿易博覽會(亞歐博覽會2021時間)
tiktok網頁版登入失敗次數過多(tiktok網頁版可以查看tiktokshop嗎)