equals
Posts: 11
Joined: Thu Oct 27, 2016 7:48 pm

Robot camera, view on command line?

Sat Oct 29, 2016 3:07 pm

I am building a robot as a side project with my son. We want to use a camera, either the on board camera or USB web cam (not sure which one would be better) as a first person view of the robot. That way we can drive the robot remotely. So far we have a working C program using ncurses to view our sensor data. But before we continue with this program I would like to know what is the best way to add on the camera so we can view a live video feed on the command line?

Summary-
Want live feed of camera on robot.
Currently connect to pi remotely via SSH
Robot program in C using ncurses.
How to get live video feed of robot on command line?

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Robot camera, view on command line?

Sun Oct 30, 2016 12:14 pm

You cannot view "real" video over SSH terminals - i'm not considering practical jokes like libcaca or the "aa" output device of mplayer here.

Rewrite your app as GTK+ app and you could at least use X forwarding over SSH. Or do the proper thing and use RDP/VNC/TeamViewer instead of SSH in the first place.
Or rewrite everything in HTML5 and use a browser to control your robot.

But full-motion , full-color video inside SSH terminal sessions simply doesn't work.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

jerryneedell
Posts: 1
Joined: Fri Nov 04, 2016 11:47 am

Re: Robot camera, view on command line?

Fri Nov 04, 2016 11:53 am

Just one example: I have been using the following approach with the Raspberry Pi Camera- still a work in progress but functional:
Install
http://elinux.org/RPi-Cam-Web-Interface

this provides a browser interface to view the video stream.

Run the rest of the robot sensors and controls from an ssh command line session. They can also eventually be incorporated into a browser based control if desired.

RpiName
Posts: 714
Joined: Sat Jul 06, 2013 3:14 am

Re: Robot camera, view on command line?

Fri Nov 04, 2016 1:51 pm

equals wrote:I am building a robot as a side project with my son. We want to use a camera, either the on board camera or USB web cam (not sure which one would be better) as a first person view of the robot. That way we can drive the robot remotely. So far we have a working C program using ncurses to view our sensor data. But before we continue with this program I would like to know what is the best way to add on the camera so we can view a live video feed on the command line?
See the infinite number of possibilities that UV4L offers:
http://linux-projects.org

It provides a simple framework based on REST API which allows you to drive you robot in your native client: audio/video/data in a modern way - and very likely unique way in the world.

Here are a few demos:
http://www.linux-projects.org/demos/

Especially if you need to stream HDMI out to your PC, smartphone or another Rpi display or native WebRTC client (written with the framework), see this demo to have an idea and read through the manuals for more details:

https://www.youtube.com/watch?v=wthS8TP ... e=youtu.be

User avatar
dexterindustries
Posts: 47
Joined: Thu Mar 07, 2013 3:51 am
Location: Somewhere
Contact: Website

Re: Robot camera, view on command line?

Fri Nov 04, 2016 4:48 pm

There is an example of a Raspberry Pi Robot controlled by a mobile phone, with code, for the GoPiGo. It uses the Raspberry Pi camera and the Raspberry Pi, and can be viewed first person through a browser (including a computer or a mobile phone) re. http://www.dexterindustries.com/GoPiGo/ ... ing-robot/

This is an advanced project with the GoPiGo to create a Browser streaming robot which can stream live video to a browser and can be controlled from the browser too. There is a youtube video of it working here. https://www.youtube.com/watch?v=Y0UNPUXHu50
John Cole
Dexter Industries

Code: Select all

http://www.dexterindustries.com

Return to “Automation, sensing and robotics”