Visualize data from the physical platform
This tutorial shows how to use rviz to visualize data from the physical CAT Vehicle platform that was recorded as a ROS bagfile. It provides step-by-step instructions for how to visualize the platform, as well as the data from it.
- start up roscore
- (new tab) roslaunch catvehicle robotviz.launch
- (new tab) rosrun rviz rviz
- (new tab) rosbag play bagfile.bag
Download a bagfile
ROS bagfiles are available through the Files panel. Once downloaded, use the name of the file you have (we will just call it "bagfile.bag").
Start up roscore
In many of the other tutorials, you run roslaunch: doing so automatically starts up roscore, if it is not yet running. When playing back a bagfile of recorded data, roslaunch has not already started up roscore so you will need to do so.
roscore
Populate your ROS environment with robot parameters
Using rosparam, ROS permits values to be shared in a runtime environment across many different computers (if so desired). For example, the name of the car, what it looks like, etc., need to be inserted into your parameter set. Every time you restart roscore you will need to do this. Note: this is automatically done for you when you run the catvehicle simulator, when gazebo is started up. Check out launch/catvehicle.launch in the catvehicle package to see how this is done.
In a new tab:
roslaunch catvehicle robotviz.launch
This launchfile exis as soon as the parameters are set in ROS.
Start up rviz
In a new tab:
rosrun rviz rviz
You won't see the car right now: you'll see a white shape of a car, with four white wheels under it. The car doesn't look right until you start the bagfile!
Play the bagfile
YMMV on the file name. Explore different command line parameters like "-l" (lowercase L) which loops the bagfile.
rosbag play bagfile.bag
Now, you should see the car sitting among a bunch of laser data, lidar data, etc. All the sensors should have tf lookups, so you can use the "Reference frame" dropdown to use as your origin a different part of the vehicle.
What's next?
Use playback of the rosbag file to test your task4.launch file.