Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
turtlerob1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Karlsson
turtlerob1
Commits
e01ab7e6
Commit
e01ab7e6
authored
9 years ago
by
Fredrik Bagge Carlson
Browse files
Options
Downloads
Patches
Plain Diff
update PF and add navigation
parent
ae8c62a7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
g_density.m
+1
-1
1 addition, 1 deletion
g_density.m
navigation.m
+18
-0
18 additions, 0 deletions
navigation.m
state_machine.m
+10
-6
10 additions, 6 deletions
state_machine.m
track_audio_pf.m
+3
-3
3 additions, 3 deletions
track_audio_pf.m
with
32 additions
and
10 deletions
g_density.m
+
1
−
1
View file @
e01ab7e6
function r = g_density(y,xp,xr)
sigma_v =
1
;
sigma_v =
20
;
N = length(xp);
v = xp - repmat(xr,1,N);
az = atan2d(v(2,:),v(1,:));
...
...
This diff is collapsed.
Click to expand it.
navigation.m
0 → 100644
+
18
−
0
View file @
e01ab7e6
% Assuming that you already have a 'client' handle, and that the 'binauloc'
% component is running on the turtlebot, load this component.
sendPosition
=
client
.
load
(
'sendPosition'
)
%if you want to move the robot in an absolute position (world frame, check the red arrow on the floor)
absoluteX
=
1
;
absoluteY
=
1
;
absoluteOrientation
=
90
;
%Angles are in degrees.
sendPosition
.
moveAbsolutePosition
(
'map'
,
absoluteX
,
absoluteY
,
absoluteOrientation
);
%if you want to move the robot in a relative position, from its current position.
moveFront
=
0.5
;
moveLeft
=
0.5
;
rotateClockwise
=
45
;
sendPosition
.
moveRelativePosition
(
'map'
,
moveFront
,
moveLeft
,
rotateClockwise
);
%To get the current position:
position
=
sendPosition
.
NavigationState
()
.
NavigationState
.
position
;
This diff is collapsed.
Click to expand it.
state_machine.m
+
10
−
6
View file @
e01ab7e6
% States
d2r
=
180
/
pi
;
th_az
=
5
;
% Degrees
step_distance
=
0.1
;
% meters
while
(
true
)
audio
=
get_audio
();
az
=
get_azimuth
();
% To source
pause
(
0.01
)
audio
=
get_audio
();
set_ref_az
(
-
az
);
% Relative, otherwise get current az and calc rel. value
az
=
binauloc
.
Azimuths
()
*
d2r
;
if
~
abs
(
az
)
<
th_az
turn
(
az
);
% Relative, otherwise get current az and calc rel. value
continue
end
% The angle to the source is small enough, take a step forward
step_forward
(
distance
);
if
~
there
()
step_forward
(
step_distance
);
continue
end
...
...
@@ -25,6 +28,7 @@ while(true)
source_label
=
analyze_source
(
audio
);
display
(
'Source label determined'
)
disp
(
source_label
)
key
=
input
(
'Press any key to continue, press c to exit: '
,
's'
);
if
key
==
'c'
break
...
...
This diff is collapsed.
Click to expand it.
track_audio_pf.m
+
3
−
3
View file @
e01ab7e6
...
...
@@ -43,9 +43,9 @@ par_sub = genParStruct('cc_bBroadband',0,'cc_wSizeSec',winSec,...
mObj
=
manager
(
dObj
,
'localization'
,
par_sub
);
%% Particle filter parameters
sigma_w
=
1
;
% State noise std
sigma_v
=
1
;
% Measurement noise std
sigma_w0
=
10
;
sigma_w
=
0.3
;
% State noise std
sigma_v
=
20
;
% Measurement noise std
sigma_w0
=
5
;
fs
=
24414
;
chunks
=
2048
;
dt
=
chunks
/
fs
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment