[rviz] 点の描画
rviz上に点を描画するだけのプログラム
pub_point.py
import rospy
from visualization_msgs.msg import Marker
rospy.init_node("marker_pub")
pub = rospy.Publisher("sphere_pub", Marker, queue_size = 10)
rate = rospy.Rate(25)
w=0
while not rospy.is_shutdown():
marker_data = Marker()
marker_data.header.frame_id = "map"
marker_data.header.stamp = rospy.Time.now()
marker_data.ns = "basic_shapes"
marker_data.id = 0
marker_data.action = Marker.ADD
marker_data.pose.position.x = 0.0
marker_data.pose.position.y = 0.0
marker_data.pose.position.z = 0.0
marker_data.color.r = 1.0
marker_data.color.g = 0.0
marker_data.color.b = 0.0
marker_data.color.a = 1.0
marker_data.scale.x = 0.3
marker_data.scale.y = 0.3
marker_data.scale.z = 0.3
marker_data.lifetime = rospy.Duration()
marker_data.type = 2
pub.publish(marker_data)
rate.sleep()
rvizで表示すると以下のようになります
Author And Source
この問題について([rviz] 点の描画), 我々は、より多くの情報をここで見つけました https://qiita.com/hoshianaaa/items/129a18bd2e77badf1793著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .