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

Updates to :stop-motion #402

Merged
merged 4 commits into from Dec 17, 2019
Merged

Conversation

Affonso-Gui
Copy link
Member

The :stop-motion stops the current angle vector by sending the actual angle vector as a new command (and therefore overwriting the old command).

The problem is that is also does that when there is no ongoing action, and since it also have an :wait-interpolation it takes a few seconds to return from the call.

In this PR we:

  1. Only overwrite commands when there are ongoing actions
  2. Add a wait key argument to the :stop-motion, so the user can opt not to wait-interpolation.

@pazeshun

@k-okada
Copy link
Member

k-okada commented Oct 8, 2019

Do you need this because I did not merged start-jsk/rtmros_common#765 (comment) ?

@Affonso-Gui
Copy link
Member Author

@k-okada This is not directly related to start-jsk/rtmros_common#765 (comment).

I noticed this problem when adding a call of :stop-motion to the default sigint behaviour, which led me to waiting a couple seconds every time C-c is pressed, even though there was no ongoing motion.

@YoheiKakiuchi
Copy link
Member

Why this it also have an :wait-interpolation it takes a few seconds to return from the call. happens.

I saw the code, by this (send self :angle-vector av stop-time),
the duration of this command was limited by min-time (= 1.0 second).
https://github.com/jsk-ros-pkg/jsk_pr2eus/blob/master/pr2eus/robot-interface.l#L374

@k-okada
Copy link
Member

k-okada commented Oct 8, 2019 via email

@Affonso-Gui
Copy link
Member Author

@YoheiKakiuchi Sorry, saying that it takes a few seconds was a bit exaggerated. It seems to take exactly 1 second

$ (bench (send *ri* :stop-motion))
[ INFO] [1570526342.652453956]: wait-interpolation debug: start
[ INFO] [1570526343.678601001]: wait-interpolation debug: end
;; time -> 1.08321[s]
(nil nil nil nil)

@k-okada :cancel-angle-vector leads to an abrupt stop, while :stop-motion makes the robot stops smoothly. I thought that it would be best fitted for a demo to use the :stop-motion in planned interruptions.

@k-okada
Copy link
Member

k-okada commented Oct 10, 2019 via email

@Affonso-Gui
Copy link
Member Author

@k-okada Can I ask for a review?

(send self :angle-vector av stop-time)
(send self :wait-interpolation)))
(:stop-motion (&key (stop-time 0) (wait t))
"Smoothly stops the motion being executed by sending the current joint state to the joint trajectory action goal"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Affonso-Gui how about adding “, uses are expected to use :cancel-angle-vector, for most cases” or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are uses expected to use :cancel-angle-vector for most cases?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is supported, what is the reason to use :stop-motion ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both :cancel-angle-vector and :stop-motion are (should be) supported on all robots that use follow-joint-trajectory controllers.

:cancel-angle-vector leads to an abrupt stop, while :stop-motion makes the robot stops smoothly.

Although there are robots in which :cancel-angle-vector is smooth enough, prioritizing speed or smoothness is task/motion dependent, so I don't believe we can generalize into using one over the other.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, then how about adding "note that :cancel-angle-vector leads to an abrupt stop, while :stop-motion makes the robot stops smoothly.", ":stop-time is transition time for stopping motion, but the actual interpolation duration is limited by :min-time of :angle-vector, which is set to 1.0 [sec] by default" etc, to avoid confusion like my case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-okada Added more information to the docstring. Please check to see if it's clear enough.

@k-okada k-okada merged commit 32f729d into jsk-ros-pkg:master Dec 17, 2019
@Affonso-Gui Affonso-Gui deleted the stop-motion branch December 17, 2019 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants