ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Align rviz marker text

asked 2015-09-16 19:31:28 -0600

dinosaur gravatar image

I'm making rviz markers by following the ROS wiki docs for rviz markers. I'm working with the TEXT_VIEW_FACING type of marker. By default, the text is centered on marker.pose.position, but I'd really like to left-align the text.

I'd do this by adding half its width to the y-position, but I don't know the marker's width. I could compute it from number of characters and average character width, but rviz uses a variable-width font, so that's only an approximation.

Is there a good way to cleanly align rviz marker text?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-19 12:03:00 -0600

lucasw gravatar image

https://github.com/ros-visualization/... could set the fontName ( https://github.com/ros-visualization/... ) to something fixed width. 'Courier' maybe?

edit flag offensive delete link more

Comments

I'm struggling with the alignment of the TEXT_VIEW_FACING marker. Does someone have an example of how to left-align the text?

roscb gravatar image roscb  ( 2019-11-06 10:10:40 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2015-09-16 19:31:28 -0600

Seen: 1,533 times

Last updated: Apr 19 '16