Ask Your Question

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

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

lucasw gravatar image could set the fontName ( ) to something fixed width. 'Courier' maybe?

edit flag offensive delete link more


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

Your Answer

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

Add Answer

Question Tools



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

Seen: 806 times

Last updated: Apr 19 '16