Robot Operating System: How to Start the Robot Simulation Tool Rviz

Try & Fail Part 1: Just start Rviz

$> roscore... logging to /home/devcon/.ros/log/25db6b78-4ce6-11eb-af10-2bdc7827bddf/roslaunch-ubuntu-16348.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.
started roslaunch server http://ubuntu:36485/
ros_comm version 1.15.9

Try & Fail Part 2: Add a Robot Model to Rviz

PARAMETERS
* /robot_description: <?xml version="1....
* /robot_model: True
* /rosdistro: noetic
* /rosversion: 1.15.9

Essential Step 1: Create a new ROS Workspace & Package

  1. Create a custom workspace and a new ROS package
  2. Change to the workspace root dir, and compile the custom package with catkin_make
  3. Add this workspace to your shell environment
  4. Create a ROS launch file launch/rviz.launch, and add the launch commands
  5. Use roslaunch to start the launch file
$> mkdir -p ~/ROS/src
$> cd ~/ROS
$> catkin_make
Base path: /home/devcon/ROS
Source space: /home/devcon/ROS/src
...
$> cd ~/ROS/src
$> catkin_create_pkg car-robot
Created file car-robot/package.xml
...
$> catkin_make
Base path: /home/devcon/ROS
...
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - car-robot
....
source ~/Ros/devel/setup.bash

Essential Step 2: Create a Launch File

<launch>
<param name="robot_description" textfile="$(find car-robot)/urdf/bot.urdf"/>
<arg name="rvizconfig" default="$(find urdf_tutorial)/rviz/urdf.rviz" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
</launch>
$> roslaunch car-robot rviz.launchroslaunch car-robot rviz.launch
... logging to /home/devcon/.ros/log/f85832ac-524a-11eb-95f4-070c1d9ad706/roslaunch-giga-5809.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.
started roslaunch server http://giga:46009/

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store