Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Final-Assignment-31388-Advanced-Autonomous-Robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
manli
Final-Assignment-31388-Advanced-Autonomous-Robot
Commits
5c6b7a40
Commit
5c6b7a40
authored
5 years ago
by
manxilin
Browse files
Options
Downloads
Patches
Plain Diff
optimize params
parent
90dd32ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrc_src/main
+28
-13
28 additions, 13 deletions
mrc_src/main
with
28 additions
and
13 deletions
mrc_src/main
+
28
−
13
View file @
5c6b7a40
...
...
@@ -6,14 +6,14 @@ pi = 3.1415926535
% origin
xOrig = 0.25
yOrig = 0.45
% distance from the expected robot position to the guidemark
dist = 0.35
% distance from the nearest node to the guidemark
nodeDist = 0.
2
5
nodeDist = 0.
1
5
% robot length
length = 0.25
length = 0.35
% distance from the expected robot position to the guidemark
dist = 0.5-0.26
% the first guidemark number
gmno = 1
4
gmno = 1
3
% task number
%% - 1: subtask1, follow the guidemarks
%% - 2: subtask2, recognize unknown object
...
...
@@ -170,11 +170,11 @@ rotAng = atan2(yTar-yCurr,xTar-xCurr)-thCurr
rotAng = normalizeanglerad(rotAng)
wait 0.5
eval rotAng
turn rotAng "rad" @v 0.1 :($cmdtime>5)|($irdistfrontmiddle<=
nodeD
ist)| ($irdistfrontleft<=0.05) | ($irdistfrontright<=0.05)
turn rotAng "rad" @v 0.1 :($cmdtime>5)|($irdistfrontmiddle<=
d
ist)| ($irdistfrontleft<=0.05) | ($irdistfrontright<=0.05)
stop
wait 2
ignoreobstacles
drivew xTar yTar thTar "rad" @v 0.3 :($targetdist<0.0
1
)|($cmdtime>10)|($irdistfrontmiddle<=
nodeD
ist)
drivew xTar yTar thTar "rad" @v 0.3 :($targetdist<0.0
5
)|($cmdtime>10)|($irdistfrontmiddle<=
d
ist)
stop
wait 1
call "update"
...
...
@@ -183,8 +183,8 @@ rotAng = thTar-thCurr
rotAng = normalizeanglerad(rotAng)
stop
wait 0.5
turn rotAng "rad" @v 0.1 :($cmdtime>5)|($irdistfrontmiddle<=
nodeD
ist)| ($irdistfrontleft<=0.05) | ($irdistfrontright<=0.05)
wait 1
turn rotAng "rad" @v 0.1 :($cmdtime>5)|($irdistfrontmiddle<=
d
ist)| ($irdistfrontleft<=0.05) | ($irdistfrontright<=0.05)
stop
return
% function: plan
...
...
@@ -203,7 +203,7 @@ wait 0.5
xTar = $l5
yTar = $l6
thTar = $l7
if((xTar==xOrig)&(yTar==yOrig)&(pno>
1
)) "loop"
if((xTar==xOrig)&(yTar==yOrig)&(pno>
0
)) "loop"
call "go"
wait 2
if(pno>0) "loop"
...
...
@@ -212,6 +212,8 @@ xTar = xEnd
yTar = yEnd
thTar = thEnd
call "go"
%wait 1
%fwd -0.2 @v 0.1:($irdistfrontmiddle<=dist)
return
% function: look
...
...
@@ -252,13 +254,26 @@ return
% function: backToOrig
% drive the robot back to the start square
label "backToOrig"
fwd -0.
45
@v 0.1
fwd -0.
32
@v 0.1
wait 1
xEnd =
xOrig
yEnd =
yOrig-
0.
1
xEnd =
2
yEnd = 0.
5
thEnd = 0
call "plan"
wait 1
% to make sure it inside the square
call "update"
rotAng = -thCurr
turn rotAng "rad" @v 0.1:($irdistfrontleft<=0.05) | ($irdistfrontright<=0.05)
stop
wait 0.5
fwd -1.85 @v 0.1
turn -90
ignoreobstacles
fwd 0.05 @v 0.1
turn 90
stop
wait 1
laser "scanset logclose"
laser "odopose log=false"
return
...
...
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