Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Karlsson
turtlerob1
Commits
60456c31
Commit
60456c31
authored
Sep 24, 2015
by
Fredrik Bagge Carlsson
Browse files
Merge branch 'master' of gitlab.control.lth.se:letter2martin/turtlerob1
parents
8f7e77eb
fce25fa0
Changes
2
Show whitespace changes
Inline
Side-by-side
get_audio.m
0 → 100644
View file @
60456c31
function signal = get_audio()
global bass;
persistent lastLastIndex;
persistent lastIndex;
persistent fs;
persistent p;
if isempty(fs)
p = bass.Audio();
fs = p.Audio.sampleRate;
lastLastIndex = 0;
lastIndex = 0;
end
p = bass.Audio();
pause(0.1)
lastIndex = p.Audio.lastFrameIndex;
diffIndex = lastIndex - lastLastIndex;
tempLeft = cell2mat(p.Audio.left);
tempLeft = tempLeft(max(end-diffIndex+1,1):end);
tempRight = cell2mat(p.Audio.right);
tempRight = tempRight(max(end-diffIndex+1,1):end);
lastLastIndex = lastIndex;
signal = [tempLeft; tempRight];
end
\ No newline at end of file
startup_rob.m
0 → 100644
View file @
60456c31
global client
global bass
addpath(genpath('~/openrobots/lib/matlab/'));
client = genomix.client('turtlebot1-wifi:8080');
bass = client.load('bass');
bass.Acquire('-a',24414,2048,80);
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment