ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Check out the wiki. It shows you how to add topics to visualize with rviz.
In short, in rviz:
2 | No.2 Revision |
Check out the wiki. It shows you how to add topics to visualize with rviz.rviz and much more.
In short, in rviz:
3 | No.3 Revision |
Check out the wiki. It shows you how to add topics to visualize with rviz and much more.
In short, in rviz:
Update:
So, if I understand your question correctly you want to display the path that your robot is taking. A way to do this is by subscribing to the robot's odometry topic (/odom
?) and then take the robot's pose and republish them as a path. Here's a simple script that should be a decent starting point for you.
#!/usr/bin/env python
import rospy
from nav_msgs.msg import Path
from nav_msgs.msg import Odometry
from geometry_msgs.msg import PoseStamped
path = Path()
def odom_cb(data):
global path
path.header = data.header
pose = PoseStamped()
pose.header = data.header
pose.pose = data.pose.pose
path.poses.append(pose)
path_pub.publish(path)
odom_sub = rospy.Subscriber('/odom', Odometry, odom_cb)
path_pub = rospy.Publisher('/path', Path, queue_size=10)
if __name__ == '__main__':
rospy.init_node('path_node')
while not rospy.is_shutdown():
rospy.spin()
4 | No.4 Revision |
Check out the wiki. It shows you how to add topics to visualize with rviz and much more.
In short, in rviz:
Update:
So, if I understand your question correctly you want to display the path that your robot is taking. A way to do this is by subscribing to the robot's odometry topic (/odom
?) and then take the robot's pose and republish them as a path. Here's a simple script that should be a decent starting point for you.
#!/usr/bin/env python
import rospy
from nav_msgs.msg import Path
from nav_msgs.msg import Odometry
from geometry_msgs.msg import PoseStamped
path = Path()
def odom_cb(data):
global path
path.header = data.header
pose = PoseStamped()
pose.header = data.header
pose.pose = data.pose.pose
path.poses.append(pose)
path_pub.publish(path)
odom_sub = rospy.Subscriber('/odom', Odometry, odom_cb)
path_pub = rospy.Publisher('/path', Path, queue_size=10)
if __name__ == '__main__':
rospy.init_node('path_node')
while not rospy.is_shutdown():
rospy.spin()
5 | No.5 Revision |
Check out the wiki. It shows you how to add topics to visualize with rviz and much more.
In short, in rviz:
Update:
So, if I understand your question correctly you want to display the path that your robot is taking. A way to do this is by subscribing to the robot's odometry topic (/odom
?) and then take the robot's pose and republish them as a path. Here's a simple script that should be a decent starting point for you.
#!/usr/bin/env python
import rospy
from nav_msgs.msg import Path
from nav_msgs.msg import Odometry
from geometry_msgs.msg import PoseStamped
path = Path()
def odom_cb(data):
global path
path.header = data.header
pose = PoseStamped()
pose.header = data.header
pose.pose = data.pose.pose
path.poses.append(pose)
path_pub.publish(path)
rospy.init_node('path_node')
odom_sub = rospy.Subscriber('/odom', Odometry, odom_cb)
path_pub = rospy.Publisher('/path', Path, queue_size=10)
if __name__ == '__main__':
rospy.init_node('path_node')
rospy.spin()