Rviz Tools for python

  • rviz marker 기능을 쉽게 사용
  • 설치 : ./include/rviz_tools_py/폳더내에 rviz_tools.py & init.py 복사
#------------marker-----------------

import roslib
from geometry_msgs.msg import Pose, Point, Quaternion, Vector3, Polygon
from tf import transformations # rotation_matrix(), concatenate_matrices()
import rviz_tools_py as rviz_tools

#------------------------------------
#------------marker---------------------
markers = rviz_tools.RvizMarkers('/velodyne', 'visualization_marker')

# Text:

# Publish some text using a ROS Pose Msg
P = Pose(Point(3,-1,0),Quaternion(0,0,0,1))
scale = Vector3(0.2,0.2,0.2)
markers.publishText(P, 'This is some text_korean', 'white', scale, 5.0) # pose, text, color, scale, lifetime


# Cube / Cuboid:

# Publish a cuboid using a numpy transform matrix
T = transformations.translation_matrix((0.6,2.2,0))
scale = Vector3(1.5,5.2,0.2)
markers.publishCube(T, 'red', scale, 5.0) # pose, color, scale, lifetime

#-------------------------------

Visualising the real time trajectory path using markers

https://answers.ros.org/question/279558/visualising-the-real-time-trajectory-path-using-markers/

https://youtu.be/0BlFQ8F5vhc

results matching ""

    No results matching ""