Ask Your Question

Rviz is not opening after launching the file.

asked 2020-11-07 23:45:11 -0500

HASSAN ISMAIL gravatar image

I created the workspace for the 5 dof robotic arm and inside the workspace's src folder i create a package (ros_package) and inside it i placed launch files (inside the launch folder) and Urdf file (inside the Urdf Folder) but when i launch it by using a command: roslaunch ros_package simulate.launch

Nothing is happened. There is no error but no rviz file is opening

here it shows like

roslaunch ros_package simulate.launch ... logging to /home/robotics/.ros/log/8e294e00-2182-11eb-a9c8-080027889fb4/roslaunch-robotics-PC-2351.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-11-11 09:14:02 -0500

Hello Hassan,

It might be useful to check if you have a RViz configuration file at the stated path. For an illustration, please check how the tutorial.launch of hector_slam uses RViz node.

<node pkg="rviz" type="rviz" name="rviz" args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>

See at github that under the rviz_cfg folder, there is a configuration file, mapping_demo.rviz.

You can adjust what topics to show, how the RViz should look like and other parameters regarding the visualization, by creating or modifying a configuration file and calling it at rviz node. If you are unsure what topics to show or topics' exact names, simply use rosrun rviz rviz to open an empty RViz and click "add" at the left bottom and choose "by topic". That will show what topics and with which classes you can visualize them. Then you can add them to your config file.

I hope it helps.

edit flag offensive delete link more



Thanks ergineer. Yes it helps and works. Basically i missed the arg and didn't properly define the param thats why it didn't open.

HASSAN ISMAIL gravatar image HASSAN ISMAIL  ( 2020-11-11 13:21:43 -0500 )edit

I am glad it helps and works. Good luck with your project.

ergineer gravatar image ergineer  ( 2020-11-12 09:57:29 -0500 )edit

answered 2020-11-10 09:33:27 -0500

rodrigo55 gravatar image

Hi Hassan,

It's very simple, really. You'll want to add an RViz node tag inside your launch file. For example, in this launch file I created, you can see the tag after what is needed to launch a turtlebot3 simulation:


    <!-- Launch Turtlebot3 World -->
    <include file="$(find turtlebot3_gazebo)/launch/turtlebot3_world.launch"/>
    <!-- Launch Turtlebot3 robot state publisher and joint state publisher -->
    <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch"/>

    <!--Run Rviz-->
    <node name="rviz" pkg="rviz" type="rviz"/>


This will automatically launch RViz as soon as you launch your simulate.launch file.

If you want to, you can go to the link below to check out a video I created explaining this with a specific example:



edit flag offensive delete link more


Thank Rodrigo i just checked your video and thanks for responding. I already add the Rviz node in my launch file but still its not open here is my launch file looks like.


 <arg name="model" default="$(find ros_package)/urdf/robot-arm.urdf"/>    <arg name="gui" default="true" />
     <param name="robot_description" command="cat" />    <param name="use_gui" value="$(arg gui)"/>
   <node name="joint_state_publisher"    pkg="joint_state_publisher"    type="joint_state_publisher" />    <node name="robot_state_publisher"    pkg="robot_state_publisher"    type="state_publisher" />    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg    rvizconfig)" required="true" />

HASSAN ISMAIL gravatar image HASSAN ISMAIL  ( 2020-11-10 10:59:14 -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



Asked: 2020-11-07 23:45:11 -0500

Seen: 3,426 times

Last updated: Nov 10 '20