Ask Your Question
0

Can't vizualise Pose in Rviz

asked 2019-12-07 23:59:39 -0600

TenderTadpole7 gravatar image

I'm trying to implement a path planning algorithm on a static image. I have obtained an occupancy grid and have also published a point via geometry_msgs/PoseStamped, but i cannot visualize this on Rviz .

This is the publisher that Ive written

pub = rospy.Publisher('move_base_simple/goal',PoseStamped,queue_size=1)
rospy.init_node('pose_publisher',anonymous = True)
rate = rospy.Rate(1)
while not rospy.is_shutdown():
    p = PoseStamped()
    p.header.seq = 1
    p.header.stamp = rospy.Time.now()
    p.header.frame_id = 'map'
    p.pose.position.x = 100
    p.pose.position.y = 100
    p.pose.position.z = 0
    p.pose.orientation.x = 0
    p.pose.orientation.x = 0
    p.pose.orientation.x = 0
    p.pose.orientation.w = 1
    pub.publish(p)
    rate.sleep()

What am i doing wrong

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-08 00:03:48 -0600

TenderTadpole7 gravatar image

After increasing the scale of the pose arrow i was able to vizualise it

edit flag offensive delete link more

Comments

Seems you've already figured it out, but just the draw some attention to it:

p.pose.position.x = 100
p.pose.position.y = 100

This places the PoseStamped at 100 metres in the X direction and 100 metres in the Y direction.

While of course perfectly valid, it is quite a distance.

gvdhoorn gravatar imagegvdhoorn ( 2019-12-08 02:25:15 -0600 )edit

Thanks for bringing this to my attention, I hadn't noticed that this was in meters

TenderTadpole7 gravatar imageTenderTadpole7 ( 2019-12-08 11:21:11 -0600 )edit

As everything in ROS, PoseStamped uses SI units. See also REP-103: Standard Units of Measure and Coordinate Conventions.

gvdhoorn gravatar imagegvdhoorn ( 2019-12-08 11:57:13 -0600 )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

1 follower

Stats

Asked: 2019-12-07 23:56:07 -0600

Seen: 19 times

Last updated: Dec 07 '19