当前位置: 首页 > news >正文

企业网站建设与推广公司网站制作要多少钱

企业网站建设与推广,公司网站制作要多少钱,四川成都最新疫情最新消息,做外贸网站 自杀以下代码实现了:Interactive Marker通过topic一直发送其状态,而不只是交互时才发送。 几个要点: 通过定时器rospy.Timer实现PublishInteractiveMarkerServer feedback.pose的类型是geometry_msgs/Pose,而不是geometry_msgs/PoseS…

以下代码实现了:Interactive Marker通过topic一直发送其状态,而不只是交互时才发送。
几个要点:

  • 通过定时器rospy.Timer实现Publish
  • InteractiveMarkerServer feedback.pose的类型是geometry_msgs/Pose,而不是geometry_msgs/PoseStamped
#!/usr/bin/env pythonimport rospy
import copyfrom interactive_markers.interactive_marker_server import *
from visualization_msgs.msg import *
from geometry_msgs.msg import Point
from geometry_msgs.msg import Poseclass ObstaclePublisher:def __init__(self, obs_init_position: list):# self.server = Noneself.server = InteractiveMarkerServer("obstacle_controls")position = Point(obs_init_position[0], obs_init_position[1], obs_init_position[2])# include orientation# self.make6DofMarker(False, InteractiveMarkerControl.MOVE_ROTATE_3D, position, True)# without orientationself.make6DofMarker(False, InteractiveMarkerControl.MOVE_3D, position, False)self.ps = Pose()self.ps.position = position# a topic to publish obstacle's pose all the timeself.pub = rospy.Publisher('/obstacle_pose', Pose, queue_size=1)rospy.Timer(rospy.Duration(0.02), self.publish_obs_pose)rospy.loginfo("Publishing pose of the obstacle at topic: " + str(self.pub.name))self.server.applyChanges()def processFeedback(self, feedback):rospy.loginfo("You are operating the obstacle.")self.ps = feedback.poseself.server.applyChanges()def makeBox(self, msg):marker = Marker()marker.type = Marker.SPHEREmarker.scale.x = msg.scale * 0.2marker.scale.y = msg.scale * 0.2marker.scale.z = msg.scale * 0.2marker.color.r = 0.8marker.color.g = 0.1marker.color.b = 0.1marker.color.a = 1.0return markerdef makeBoxControl(self, msg):control = InteractiveMarkerControl()control.always_visible = Truecontrol.markers.append(self.makeBox(msg))msg.controls.append(control)return control###################################################################### Marker Creationdef normalizeQuaternion(self, quaternion_msg):norm = quaternion_msg.x**2 + quaternion_msg.y**2 + quaternion_msg.z**2 + quaternion_msg.w**2s = norm ** (-0.5)quaternion_msg.x *= squaternion_msg.y *= squaternion_msg.z *= squaternion_msg.w *= sdef make6DofMarker(self, fixed, interaction_mode, position, show_6dof=False):int_marker = InteractiveMarker()int_marker.header.frame_id = "world"int_marker.pose.position = positionint_marker.scale = 1int_marker.name = "Obstacle"int_marker.description = "Obstacle"# insert a obstacleself.makeBoxControl(int_marker)int_marker.controls[0].interaction_mode = interaction_modeif show_6dof:control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 1control.orientation.y = 0control.orientation.z = 0self.normalizeQuaternion(control.orientation)control.name = "rotate_x"control.interaction_mode = InteractiveMarkerControl.ROTATE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 1control.orientation.y = 0control.orientation.z = 0self.normalizeQuaternion(control.orientation)control.name = "move_x"control.interaction_mode = InteractiveMarkerControl.MOVE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 0control.orientation.y = 1control.orientation.z = 0self.normalizeQuaternion(control.orientation)control.name = "rotate_z"control.interaction_mode = InteractiveMarkerControl.ROTATE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 0control.orientation.y = 1control.orientation.z = 0self.normalizeQuaternion(control.orientation)control.name = "move_z"control.interaction_mode = InteractiveMarkerControl.MOVE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 0control.orientation.y = 0control.orientation.z = 1self.normalizeQuaternion(control.orientation)control.name = "rotate_y"control.interaction_mode = InteractiveMarkerControl.ROTATE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)control = InteractiveMarkerControl()control.orientation.w = 1control.orientation.x = 0control.orientation.y = 0control.orientation.z = 1self.normalizeQuaternion(control.orientation)control.name = "move_y"control.interaction_mode = InteractiveMarkerControl.MOVE_AXISif fixed:control.orientation_mode = InteractiveMarkerControl.FIXEDint_marker.controls.append(control)self.server.insert(int_marker, self.processFeedback)def publish_obs_pose(self, *args):self.pub.publish(self.ps)if __name__ == "__main__":rospy.init_node("obstacle_controls")op = ObstaclePublisher([0.6, 0.6, 0.6])rospy.spin()
http://www.hotlads.com/news/3539.html

相关文章:

  • 电商网站怎么做搜索seo与sem的区别和联系
  • 网站上设置返回首页的超链接咋做的黑科技推广软件
  • 广州专业做网站多少钱seo数据分析哪些方面
  • 网站建设技术问题店铺推广渠道有哪些
  • 主做收影视出版的小说网站品牌营销策划方案案例
  • nginx网站开发怎么制作网站详细流程
  • 网站建设需求调查表新闻热点事件2021(最新)
  • 网站开发和报价方案无货源网店怎么开
  • python+网站开发+prf汉中网络推广
  • 网站icp备案流程站长seo工具
  • 建筑施工模板沧州搜索引擎优化
  • 做网站收录的网站有哪些万网域名注册官网查询
  • 生成前端页面的网站口碑营销的案例及分析
  • 响应式网站开发价格seo sem
  • 郑州网站设计价格互联网营销专业
  • 有做网站动态效果软件天津seo培训
  • 动态网站和静态网站有什么区别百度seo快速排名优化
  • 电商网站建设新闻深圳网站优化软件
  • 网站上面的头像怎么做的网站模板平台
  • 深圳红酒网站建设免费线上培训平台
  • 框架布局技术制作一个网站定制网站建设推广服务
  • 网站开发者morz百度seo搜索引擎优化
  • 网站模板html谷歌账号
  • 关岭做网站贵港网站seo
  • 网站建设 招标书免费网站seo诊断
  • 惠州网站建设制作公司什么是推广
  • 哪些是用vue做的网站南宁seo服务公司
  • 湖北省级建设主管部门网站关键词排名点击软件首页
  • 广州专业网站建设哪家好本地建站软件有哪些
  • 自己做家具展示网站企业文化案例