Cameras - ISU-MAVRIC/Old-MAVRIC-Systems GitHub Wiki
Overview
MAVRIC rovers use a variety of cameras to ensure operators will always be able to see the state of the rover. Each rover has a primary camera mounted on a tall mast, and several fixed hazard cameras that can be used to supplement the main mast camera. The main camera can be moved (pan-tilt-zoom) to look at objects of interest, and generally provides the best picture of the rover's state.
Mast Camera
The Scarab main mast camera is a PTZ dome camera that hangs underneath the mast crossbeam. It has both hardware and software zoom, and has IR lights and an optical filter for operating in night vision mode. The camera streams video using the Real-Time Streaming Protocol (RTSP), and can be accessed from the browser, using the iSpy program on Windows, or using VNC Media player on Windows (may not be reliable). This camera is also used for the arUco tag detection portion of the autonomous system.
The RTSP raw stream source can be accessed using either of two addresses:
rtsp://admin:[email protected]:554/Streaming/Channels/1
rtsp://admin:[email protected]:554/out.h264
Intel RealSense Depth Camera
- Has 3 cameras (2 IR) and can do depth perception from 0.2 to 10m.
- Has pre-made ROS library.
Links
- https://github.com/intel-ros/realsense/releases
- https://github.com/IntelRealSense/librealsense/releases/tag/v2.17.0
- https://github.com/intel-ros/realsense
- RPi INSTALL: https://github.com/IntelRealSense/librealsense/blob/development/doc/installation.md
Hazard Cameras
Linux Video Pipeline
The above stream addresses should be sufficient to view the camera from iSpy, but they are not directly compatible with the Jetson's machine vision libraries on Linux. We can use gstreamer or ffmpeg on Linux commands to create a video pipeline that pulls the camera source and outputs it to /dev/video1
in a format that the Jetson libraries can use. Eventually, these commands should be added to rc.local
or some other startup script so the pipeline can be brought up automatically. Generally, you only need to modprobe
a module once for it to become active, so you should only need to run sudo modprobe v4l2loopback
once, not every time you run a video pipeline command.
FFmpeg
sudo modprobe v4l2loopback
ffmpeg -i rtsp://admin:[email protected]:554/out.h264 -vf fps=25 -f v4l2 -pix_fmt yuyv422 /dev/video1
gstreamer - Main Mast Camera
sudo modprobe v4l2loopback
gst-launch-1.0 rtspsrc location=rtsp://admin:[email protected]:554/out.h264 latency=50 ! application/x-rtp, media=video ! decodebin ! video/x-raw, format=NV12 ! videoconvert ! video/x-raw, width=1280, height=720, format=YUY2 ! videoconvert ! v4l2sink device=/dev/video1
gstreamer - View Hazard Cameras
sudo modprobe v4l2loopback
gst-launch-1.0 rtspsrc location=rtsp://admin:[email protected]:8554/out.h264 latency=50 ! application/x-rtp, media=video ! decodebin ! videoconvert ! xvimagesink
gstreamer - View Pipeline Output
gst-launch-1.0 v4l2src device=/dev/video1 ! xvimagesink
Should it be necessary to configure the camera, you can log in to the camera at 192.168.1.64 using username "admin" and password "mavric-camera". This information is also written on the camera box.