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

adding new point just befor the final point produce jerkey motion #635

Merged
merged 1 commit into from Jul 19, 2016

Conversation

Projects
None yet
1 participant
@k-okada
Copy link
Member

commented Jul 11, 2016

This will generate smoother motion, expecting not to produce jerkey motion specially the end of the trajectory
this code is introduced in #289, and @wkentaro said I think this works. why don't you merge this? so may be no longer need this code at some point...

Only tested on the gazebo, need to test on the real robot

@k-okada

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2016

before

screenshot from 2016-07-11 19 45 11

after

screenshot from 2016-07-11 19 46 33

I tested with following code

(defun straight-motion ()
  (let (av0 av1)
    (setq av0 (send *baxter* :rarm :inverse-kinematics (make-coords :pos #f(900 -500 350) :rpy (float-vector 0 0 0)))
          av1 (send *baxter* :rarm :inverse-kinematics (make-coords :pos #f(900 0 350) :rpy (float-vector 0 0 0)))
          )
    (warning-message 2 "move 1 points (tm = 3000)~%")
    (send *ri* :angle-vector (send *baxter* :reset-pose) 3000)
    (send *ri* :wait-interpolation)
    (unix::sleep 1)
    ;;
    (warning-message 2 "move 1 points (tm = nil)~%")
    (send *ri* :angle-vector av1 3000)
    (send *ri* :wait-interpolation)
    (unix::sleep 1)

    (warning-message 2 "move 2 points (tm = 3000)~%")
    (send *ri* :angle-vector-sequence (list av0 av1) 3000)
    (send *ri* :wait-interpolation)
    (unix::sleep 1)

    (warning-message 2 "move 2 points (tm = nil)~%")
    (send *ri* :angle-vector-sequence (list av0 av1))
    (send *ri* :wait-interpolation)
    (unix::sleep 1)

    (warning-message 2 "move 3 points (tm = 3000)~%")
    (send *ri* :angle-vector-sequence (list av0 (midpoint 0.5 av0 av1) av1) 3000)
    (send *ri* :wait-interpolation)
    (unix::sleep 1)

    (warning-message 2 "move 3 points (tm = nil)~%")
    (send *ri* :angle-vector-sequence (list av0 (midpoint 0.5 av0 av1) av1))
    (send *ri* :wait-interpolation)
    (unix::sleep 1)

    ))

  )

But I think fundamental problem is that they use Bezier function at
https://github.com/RethinkRobotics/baxter_interface/blob/master/src/joint_trajectory_action/joint_trajectory_action.py#L293-L312

@k-okada k-okada force-pushed the k-okada:remove_jerkey branch from 5979a9e to ab9defc Jul 16, 2016

fix for baxter_interface v1.1.1, which removes limitation on number o…
…f points to sent

from v1.1.1 if num_points is 1, it will use current position to the first element of trajectory point RethinkRobotics/baxter_interface@b38ec25

@k-okada k-okada force-pushed the k-okada:remove_jerkey branch from ab9defc to e7247ba Jul 16, 2016

@k-okada

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2016

RethinkRobotics/baxter_interface@b38ec25 has been merged since v1.1.1 and we nolongr need to add current position if length of trajectory.points is 1

@k-okada

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2016

if RethinkRobotics/baxter_interface#73 is merged, we can remove

 ;; from v1.1.1 if num_points is 1, it will use current position to the first element of trajectory point https://github.com/RethinkRobotics/baxter_interface/commit/b38ec257fece0711adb260ed6bc161096aa3ecae                                        
     (when (>= (length avs) 2)
       (push (send self :state :potentio-vector :wait-until-update t) avs)
       (push 50 tms))

@k-okada k-okada merged commit 5618b10 into jsk-ros-pkg:master Jul 19, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@k-okada k-okada deleted the k-okada:remove_jerkey branch Jul 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.