Setup and launch the camera
Beginner Tutorial | Expected duration is 20 minutes
By: Akkshaj Singh, Ramon Qu, Rosario Scalise
This tutorial will get your car's camera operational and teach you to modify your camera data.
To get you viewing your car's live camera feed.
- Complete the hardware setup with your car
- Complete the quickstart tutorial. (Required for rviz)
- Complete the first_steps tutorial.
- A desktop/laptop computer that can ssh into the car.
- An SSH-capable text editor, like Vim or Visual Studio Code (requires the SSH plugin)
SSH into the Car
$ ssh <user>@<car ip>
Power on the Jetson, and SSH into the car, like in the first_steps tutorial. Do this in three separate terminal windows. If you're familiar with tools like tmux or GNU Screen, feel free to use those, but they are outside the scope of the tutorial.
Now that you're connected to the car, let's launch ROS.
Normally, we would launch tele-op here in order to be able to drive the car around, but let's try launching just the camera.
Launching the Intel RealSense Camera
First, navigate to the directory containing the
realsense2 package for ROS.
$ cd ~/catkin_ws/src/realsense2/realsense2_camera/launch/
Here, you can now launch the camera by running the launchfile. Ensure your RealSense camera is connected to the Jetson's USB port. You can verify this with the
$ roslaunch rs_camera.launch
If you get an error along the lines of
failed to find nodelet to unload try reconnecting the camera to the Jetson and running the command again.
$ rostopic list
Run the above command, and you should be able to see the topics for the camera, like this:
Launching RViz on your computer
Note: the following commands in this section should be run in a terminal window connected to your local device, NOT the SSH window to the car.
$ export ROS_IP=YOUR-IP
ROS_MASTER_URI to the IP of the car. (You used this to SSH into it earlier.)
$ export ROS_MASTER_URI=http://CAR_IP_GOES_HERE:11311
Now, launch RViz.
If you get errors make sure the following are correct:
- Teleop is running
- Your laptop is connnected properly
This should output a bunch of camera-related topics. If not, check your
$ rostopic list
ROS_IPto ensure they are correct.
Viewing Camera Output in RViz
In your RViz window, you can add topics to view various camera feeds from the RealSense. It is able to publish RGB, Depth, and Infrared camera data. Clicking add will allow you to view those feeds, like so: After selecting the topic, you should be able to see the camera feed in RViz.
Changing Camera Settings
It is also possible to change camera settings and parameters, like resolution, framerate, image compression, etc. You can do this by editing the launchfile we used previously to launch the camera in the
~/catkin_ws/src/realsense2/realsense2_camera/launch/ directory. Make sure that it is not running when you do this. Open it with your text editor of choice and edit the parameters in the .launch file.