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

How to start rviz with a fixed frame

asked 2016-04-24 09:44:59 -0500

user23fj239 gravatar image

updated 2016-05-22 19:16:38 -0500

130s gravatar image

I have come across this question using the static_transform_publisher from the bash, but this is inconvinient. The arguments seem to offer this but cannot find an example what args -f acutally takes

  pc~/catkin_ws$ rviz -h
[ INFO] [1461508601.744858346]: rviz version 1.11.8
[ INFO] [1461508601.744970393]: compiled against OGRE version 1.8.1 (Byatis)
rviz command line options:
  -h [ --help ]               Produce this help message
  -s [ --splash-screen ] arg  A custom splash-screen image to display
  --help-file arg             A custom html file to show as the help screen
  -d [ --display-config ] arg A display config file (.rviz) to load
  -f [ --fixed-frame ] arg    Set the fixed frame

Could someone post an example for example this frame (no trans, no rot)

rosrun tf static_transform_publisher 0 0 0 0 0 0 1 map my_frame 10

EDIT So what I do is using a launch file to pack both commands together:

<launch>
<!-- set up the cosys -->
 <node pkg="tf" type="static_transform_publisher" name="map2frame_0" 
    args="0.0 0.0 0.0 0 0 0 1 map frame_0 100" />
<!-- start rviz -->
  <node pkg="rviz" type="rviz" name="my_rviz" 
    args="-d $(find rviz_markers)/include/rviz_config.rviz"/>
</launch>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-04-24 09:56:47 -0500

spmaniato gravatar image

You would run RViz like this: rosrun rviz rviz -f my_frame

This will set the Fixed Frame to my_frame under Global Options. You can also do that from the GUI btw.

edit flag offensive delete link more

Comments

what a pitty, so i cant get around publishing the my_frame. Do you know how to specify a path when using a launch file for the config, eg: <node pkg="rviz" type="rviz" name="my_rviz" args="-d $(WHAT GOES HERE)/rviz_config.rviz"/>

user23fj239 gravatar image user23fj239  ( 2016-04-24 10:04:27 -0500 )edit

If my_frame already exists, then you don't need the static transform publisher anymore. By setting the fixed frame to my_frame, RViz will visualize everything relative to my_frame instead of map, which is the default fixed frame.

spmaniato gravatar image spmaniato  ( 2016-04-24 10:08:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-04-24 09:44:59 -0500

Seen: 11,349 times

Last updated: Apr 24 '16