Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
bigprint
twins-planner
Commits
ca5d090d
Commit
ca5d090d
authored
Feb 22, 2021
by
Jayant Khatkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix logic errors in Combined Scheduler
parent
33ce6391
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/decmcts.py
src/decmcts.py
+6
-5
No files found.
src/decmcts.py
View file @
ca5d090d
...
...
@@ -143,20 +143,20 @@ class CombinedSchedule:
ao
=
copy
.
deepcopy
(
self
.
col_table
[
ct
,
ct_r
])
# apply t_diff and add allowed offset for when other robot is done
allowed_offsets
.
append
([(
-
1e6
,
t_0
-
self
.
end_times
[
r
][
-
1
]
-
self
.
safe_time
)]
+
\
allowed_offsets
.
append
([(
-
1e6
,
t_0
-
self
.
end_times
[
r
][
-
1
]
-
10
)]
+
\
[(
a
+
t_diff
,
b
+
t_diff
)
for
a
,
b
in
ao
if
a
+
t_diff
<=
0
])
# easy for n = 2
if
self
.
n
==
2
:
# if collision forces this contour to start after other arm is finished their last contour, reject
if
t_0
+
allowed_offsets
[
0
][
-
1
][
1
]
>
self
.
end_times
[
1
-
robot
][
-
1
]
\
if
t_0
-
allowed_offsets
[
0
][
-
1
][
1
]
>
self
.
end_times
[
1
-
robot
][
-
1
]
\
and
not
(
self
.
end_times
[
robot
][
-
1
]
==
0
and
self
.
end_times
[
1
-
robot
][
-
1
]
==
0
)
\
and
not
force
:
# reject contour if it cannot be parallelised with current plan
self
.
start_next_contour
[
robot
]
=
self
.
end_times
[
1
-
robot
][
-
1
]
+
self
.
safe_time
return
False
t_wait
=
max
(
trav_time
,
-
min
(
0
,
allowed_offsets
[
0
][
-
1
][
1
])
)
t_wait
=
-
min
(
0
,
allowed_offsets
[
0
][
-
1
][
1
])
self
.
trajs
[
robot
].
append
(
ct
)
self
.
start_times
[
robot
].
append
(
t_0
+
t_wait
)
self
.
end_times
[
robot
].
append
(
self
.
start_times
[
robot
][
-
1
]
+
ct
.
time
[
-
1
])
...
...
@@ -250,6 +250,7 @@ def createCombinedSchedule(data, states):
for
r
in
rs
:
if
len
(
cts_left
[
r
])
!=
0
:
robot
=
r
break
# if rejected, switch robots (if possible) and force next contour
else
:
...
...
@@ -575,7 +576,7 @@ def decmcts(
if
__name__
==
"__main__"
:
# Read gcode file
model
=
"
Top
-ascii"
model
=
"
prop_v2
-ascii"
tracker
=
tu
.
get_tracker
(
model
)
# 3arms simulation
...
...
@@ -590,4 +591,4 @@ if __name__ == "__main__":
sim_env
=
tu
.
SimEnv
(
env_desc
=
env_desc2
,
gui
=
True
,
home
=
home
)
# decmcts plan first n contours
plan
=
decmcts
(
model
,
sim_env
,
tracker
,
nth_layer
=
50
,
interactive
=
False
,
nodes_per_layer
=
1
000
)
plan
=
decmcts
(
model
,
sim_env
,
tracker
,
nth_layer
=
50
,
interactive
=
False
,
nodes_per_layer
=
3
000
)
Write
Preview
Markdown
is supported
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