Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bigprint
twins-controller
Commits
e915a960
Commit
e915a960
authored
Jan 18, 2021
by
Jayant Khatkar
Browse files
print which trajectory fails for manual resume, interface for resuming from nth traj(
#17
)
parent
157c4e9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.py
View file @
e915a960
...
...
@@ -18,20 +18,21 @@ from Controller import Controller
import
gcode2contour
as
gc
def
execute_plan
(
plan
,
controller
,
contours
=
None
,
confirm
=
False
):
def
execute_plan
(
plan
,
controller
,
contours
=
None
,
confirm
=
False
,
skip_first
=
1
):
"""
Executes a plan on MoveIt
Single arm only
skips the first n trajectories in the plan
"""
# plan to the start position of the plan
controller
.
group
.
go
(
plan
.
trajs
[
0
][
0
].
positions
[
0
])
controller
.
group
.
go
(
plan
.
trajs
[
0
][
skip_first
].
positions
[
0
])
# execute trajectories in plan
for
i
,
t
in
enumerate
(
plan
.
trajs
[
0
]):
if
i
==
0
:
print
(
"skipping
first traj"
)
if
i
<
skip_first
:
print
(
"skipping
traj {}"
.
format
(
i
)
)
continue
if
confirm
:
...
...
@@ -40,8 +41,10 @@ def execute_plan(plan, controller, contours=None, confirm=False):
break
if
t
.
contour
is
not
None
:
print
(
"Printing {}th trajectory in the plan, which is contour {}"
.
format
(
i
,
t
.
contour
))
controller
.
exec_ctraj
(
speed_multiplier
(
t
,
5
),
contour
=
contours
[
t
.
contour
])
else
:
print
(
"Moving arm, no extrusion"
)
controller
.
exec_ctraj
(
t
)
return
...
...
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