nodecopter / dronegames.co

2 stars 4 forks source link

Getting Bottom Camera Feed #4

Closed vshesh closed 11 years ago

vshesh commented 11 years ago

Hi everyone,

We're trying to get the feed from the bottom camera of the drone as opposed to the front camera. It's possible since the sample FreeFlight lets you switch between the two cameras, but we don't see the APIs for that in the node.js program examples. There appears to be only one video port which connects to the front camera.

Currently, we're trying to find the C API call within the FreeFlight App source code that does the switching, but no luck on that either.

UPDATE: we appear to have found a command that according to the API should work. this command is AT*CONFIG=#, "video:video_channel","2", but when we used the UdpControl model (written by FelixGe) to try and send this command, the program didn't change the channel and continued outputting the front camera feed.

UPDATE 2: we've found the solution to the problem, but don't know why it works. The command (as felixge said) is client.config('video:video_channel', '1'), but it doesn't work as a standalone command in a file, eg:

var arDrone = require('ar-drone'); var control = arDrone.createUdpControl();

control.config('video:video_channel', '1'); control.flush();

// rest of the pngstream code.

on the other hand, putting this command in a loop like:

// png stream code up here

setInterval(function() { control.config('video:video_channel', '1');

// other stuff with the drone

control.flush(); }, 30);

works. I don't really know why that is, since all it's doing is setting a flag... we should only need to send it once.

Any ideas? Thanks! Vishesh

csanz commented 11 years ago

@vgupta0 can you try to debug this real quick to make sure that @felixge's library is sending the right data to the drone.

felixge commented 11 years ago

The command is:

client.config('video:video_channel', '1');