Ask Your Question
0

Could I change the path from continue line to scatter?

asked 2020-10-16 02:27:51 -0500

Redhwan gravatar image

When I see line style is only lines or Billboards with kinetic version ROS. I have many states and I would like to present every state by specific color.

The full code:

#!/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 = 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) 

odom_sub = rospy.Subscriber('/odom_ekf', Odometry, odom_cb)
path_pub = rospy.Publisher('/path', Path, queue_size=10)

if __name__ == '__main__':
    rospy.spin()

image description Could I change the path from continue line to scatter? if yes.

Please help me.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-10-16 05:58:08 -0500

mgruhler gravatar image

Let me answer what I think you asked:

"Can I use another style for the Path Display than Lines or Billboard?"

No, only those two are implemented. AFAIR, this is the same for melodic and noetic. So you'd need to implement any other visualization yourself.

edit flag offensive delete link more

Comments

Thanks for your answer, is it available to add more?

Redhwan gravatar image Redhwan  ( 2020-10-16 06:14:54 -0500 )edit

Please clarify?

mgruhler gravatar image mgruhler  ( 2020-10-19 01:10:13 -0500 )edit

Thanks, I understood how to do it but there are some issues because c++, I am not good in c++. So, I skipped it.

Redhwan gravatar image Redhwan  ( 2020-10-20 00:52:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-10-16 02:27:51 -0500

Seen: 21 times

Last updated: Oct 16