Visualizing with RViz
NOTE: ROS 2 tutorials are still under active development.
You can utilize RViz to visualize Stretch's sensor information. To begin, run the stretch driver launch file.
ros2 launch stretch_core stretch_driver.launch.py
Then run the following command to bring up a simple RViz configuration of the Stretch robot.
ros2 run rviz2 rviz2 -d `ros2 pkg prefix stretch_calibration`/rviz/stretch_simple_test.rviz
If you want to visualize Stretch's tf transform tree, you need to add the display type to the RViz window. First, click on the Add button and include the TF type to the display. You will then see all of the transform frames of the Stretch robot and the visualization can be toggled off and on by clicking the checkbox next to the tree. Below is a gif for reference.
There are further tutorials for RViz that can be found here.
Running RViz and Gazebo (Simulation)
Let's bringup stretch in the willowgarage world from the gazebo basics tutorial and RViz by using the following command.
roslaunch stretch_gazebo gazebo.launch world:=worlds/willowgarage.world rviz:=true
rvizflag will open an RViz window to visualize a variety of ROS topics.
Bringup the keyboard teleop to drive Stretch and observe its sensor input.