Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pr2eus] Allow initial av in angle-vector-sequence #270

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pr2eus/robot-interface.l
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
cacts (send self ctype)))
av)
(:angle-vector-sequence
(avs &optional (tms (list 3000)) (ctype controller-type) (start-time 0.1) &key (scale 1) (min-time 0.0))
(avs &optional (tms (list 3000)) (ctype controller-type) (start-time 0.1) &key (scale 1) (min-time 0.0) (allow-initial-av nil))
"Send joind angle to robot, this method retuns immediately, so use :wait-interpolation to block until the motion stops."
(setq ctype (or ctype controller-type)) ;; use default controller-type if ctype is nil
(unless (gethash ctype controller-table)
Expand All @@ -421,6 +421,11 @@
(setq av (pop avs))
(setq fastest-tm (* 1000 (send self :angle-vector-duration av-prev av scale min-time ctype)))
(setq tm (pop tms))
(when allow-initial-av ;; let first tm be zero
(when (and (numberp tm) (= tm 0))
(warning-message 3 "[robot-interface.l] (angle-vector-sequence) let first tm be zero~%")
(setq fastest-tm 0))
(setq allow-initial-av nil))
(cond
((equal tm :fast)
(setq tm fastest-tm))
Expand Down