#!/usr/bin/env python
import rospy
import math
from tf import transformations
from geometry_msgs.msg import PoseWithCovarianceStamped
class PoseSetter(rospy.SubscribeListener):
def __init__(self, pose):
self.pose = pose
def peer_subscribe(self, topic_name, topic_publish, peer_publish):
p = PoseWithCovarianceStamped()
p.header.frame_id = "map"
p.pose.pose.position.x = self.pose[]
p.pose.pose.position.y = self.pose[]
(p.pose.pose.orientation.x,
p.pose.pose.orientation.y,
p.pose.pose.orientation.z,
p.pose.pose.orientation.w) = transformations.quaternion_from_euler(, , self.pose[])
p.pose.covariance[*+] = 0.5 * 0.5
p.pose.covariance[*+] = 0.5 * 0.5
p.pose.covariance[*+] = math.pi/12.0 * math.pi/12.0
peer_publish(p)
x=True
pose = [-9.983256,-2.641909,-1.201580]#x,y,a
rospy.init_node(‘pose_setter‘, anonymous=True)
pub=rospy.Publisher("initialpose", PoseWithCovarianceStamped, queue_size=)
pub.publish(PoseSetter(pose))

最新文章

  1. PHP获取指定月份的第一天开始和最后一天结束的时间戳函数
  2. [ubuntu]用ubuntu开发的日子----win7 ubuntu双系统
  3. 明白python文件如何组织,理解建立源文件
  4. 对sizeof的思考
  5. 多线程程序设计学习(4)guarded suspension模式
  6. (十二)学习CSS之display属性
  7. 网站WAF的检测
  8. careercup-C和C++ 13.4
  9. Twitter 工程师谈 JVM 调优
  10. [PWA] 13. New db and object store
  11. Javascript DOM编程艺术JS代码
  12. Linux简介与厂商版本下
  13. JavaSE教程-04Java中循环语句for,while,do···while
  14. 中国移动飞信WAP登陆分析及脚本
  15. nyoj 仿射密码
  16. linux安装postgresql简洁版
  17. 修改xampp-apache访问目录
  18. linux开通端口允许其他机器访问
  19. Angular2+URL中的 # 引发的思考
  20. 【JAVA】使用IntelliJ IDEA创建Java控制台工程

热门文章

  1. 方法引用(method reference)
  2. C# 注册windows 服务
  3. (四)Maven中的仓库
  4. Java InterpolationSearch
  5. Android监听EditText输入字符串,删除指定的字符
  6. 笔记: ASP.NET Core视图组件
  7. Vue中遍历数组的新方法
  8. perl语言的线程使用
  9. 1.Java集合-HashMap实现原理及源码分析
  10. Rocketmq 集群部署