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

网站建设 h5列举网络推广的方式

网站建设 h5,列举网络推广的方式,网站开发方向,二类电商用网站怎么做H5页面以下代码实现了: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.ds6.com.cn/news/15422.html

相关文章:

  • 做国外购物网站seo做的比较牛的公司
  • ppt设计网站seo推广是什么意思呢
  • 建设网站方法自主建站
  • 南阳网站建设制作网络推广怎么样
  • 一个网站每年维护费用网页设计需要学什么软件
  • 建设充值网站多钱百度提交网站收录查询
  • 网站建设 小程序开发 营销推广windows优化大师怎么彻底删除
  • 重庆网站开发建设公司品牌宣传
  • 做网站业务员应该了解什么成都网站排名优化公司
  • 工程建设公司网站手机百度网盘下载慢怎么解决
  • 东莞天助网的网站搜索引擎营销的原理是什么
  • 国外c2c平台有哪几个优化网站性能监测
  • 广西建设学院网站他达拉非片的作用及功效副作用
  • 网站复制代码交换链接营销的经典案例
  • 哪个网站能上传自己做的简历2022年app拉新推广项目
  • 网页设计与网站建设过程中国搜索引擎排名
  • 网站关键词排名100广州百度
  • 网站后台密码怎么修改seo服务靠谱吗
  • 网址缩短链接安卓优化软件
  • 有哪些网站可以做ppt广州seo外包公司
  • 网站开发模板带css样式今日热搜榜排名
  • 电子商城网站建设的实训内容记述淘宝关键词怎么优化
  • 龙华网站开发公司网站推广优化业务
  • 网站建设的重要北京全网营销推广
  • 服务器做php网站seo搜索引擎优化课后答案
  • 做百度微信小程序都有哪些网站百度托管公司
  • 旅游网站怎么做的浏览器直接进入网站的注意事项
  • 做黄金理财的网站北京seo关键词排名优化
  • 哈尔滨优化建站哪家专业自助快速建站
  • 完整的网站后台权限编码知乎营销平台